@plotday/twister 0.20.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 (298) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +261 -0
  3. package/bin/commands/build.js +108 -0
  4. package/bin/commands/build.js.map +1 -0
  5. package/bin/commands/create.js +230 -0
  6. package/bin/commands/create.js.map +1 -0
  7. package/bin/commands/deploy.js +292 -0
  8. package/bin/commands/deploy.js.map +1 -0
  9. package/bin/commands/generate.js +301 -0
  10. package/bin/commands/generate.js.map +1 -0
  11. package/bin/commands/lint.js +69 -0
  12. package/bin/commands/lint.js.map +1 -0
  13. package/bin/commands/login.js +140 -0
  14. package/bin/commands/login.js.map +1 -0
  15. package/bin/commands/priority-create.js +102 -0
  16. package/bin/commands/priority-create.js.map +1 -0
  17. package/bin/commands/priority-list.js +47 -0
  18. package/bin/commands/priority-list.js.map +1 -0
  19. package/bin/commands/twist-logs.js +187 -0
  20. package/bin/commands/twist-logs.js.map +1 -0
  21. package/bin/index.js +129 -0
  22. package/bin/index.js.map +1 -0
  23. package/bin/package.json +3 -0
  24. package/bin/plot.cjs +3 -0
  25. package/bin/templates/AGENTS.template.md +403 -0
  26. package/bin/templates/CLAUDE.template.md +1 -0
  27. package/bin/templates/README.template.md +189 -0
  28. package/bin/utils/bundle.js +106 -0
  29. package/bin/utils/bundle.js.map +1 -0
  30. package/bin/utils/output.js +133 -0
  31. package/bin/utils/output.js.map +1 -0
  32. package/bin/utils/packageManager.js +65 -0
  33. package/bin/utils/packageManager.js.map +1 -0
  34. package/bin/utils/sse.js +100 -0
  35. package/bin/utils/sse.js.map +1 -0
  36. package/bin/utils/token.js +75 -0
  37. package/bin/utils/token.js.map +1 -0
  38. package/cli/templates/AGENTS.template.md +403 -0
  39. package/cli/templates/CLAUDE.template.md +1 -0
  40. package/cli/templates/README.template.md +189 -0
  41. package/dist/common/calendar.d.ts +144 -0
  42. package/dist/common/calendar.d.ts.map +1 -0
  43. package/dist/common/calendar.js +2 -0
  44. package/dist/common/calendar.js.map +1 -0
  45. package/dist/common/messaging.d.ts +84 -0
  46. package/dist/common/messaging.d.ts.map +1 -0
  47. package/dist/common/messaging.js +2 -0
  48. package/dist/common/messaging.js.map +1 -0
  49. package/dist/creator-docs.d.ts +11 -0
  50. package/dist/creator-docs.d.ts.map +1 -0
  51. package/dist/creator-docs.js +27 -0
  52. package/dist/creator-docs.js.map +1 -0
  53. package/dist/docs/.nojekyll +1 -0
  54. package/dist/docs/assets/favicon.svg +8 -0
  55. package/dist/docs/assets/hierarchy.js +1 -0
  56. package/dist/docs/assets/highlight.css +134 -0
  57. package/dist/docs/assets/icons.js +18 -0
  58. package/dist/docs/assets/icons.svg +1 -0
  59. package/dist/docs/assets/main.js +60 -0
  60. package/dist/docs/assets/navigation.js +1 -0
  61. package/dist/docs/assets/search.js +1 -0
  62. package/dist/docs/assets/style.css +1633 -0
  63. package/dist/docs/classes/tool.ITool.html +4 -0
  64. package/dist/docs/classes/tool.Tool.html +116 -0
  65. package/dist/docs/classes/tools_ai.AI.html +27 -0
  66. package/dist/docs/classes/tools_callbacks.Callbacks.html +45 -0
  67. package/dist/docs/classes/tools_integrations.Integrations.html +26 -0
  68. package/dist/docs/classes/tools_network.Network.html +68 -0
  69. package/dist/docs/classes/tools_plot.Plot.html +82 -0
  70. package/dist/docs/classes/tools_store.Store.html +53 -0
  71. package/dist/docs/classes/tools_tasks.Tasks.html +39 -0
  72. package/dist/docs/classes/tools_twists.Twists.html +59 -0
  73. package/dist/docs/classes/twist.Twist.html +96 -0
  74. package/dist/docs/documents/Advanced.html +91 -0
  75. package/dist/docs/documents/Building_Custom_Tools.html +200 -0
  76. package/dist/docs/documents/Built-in_Tools.html +170 -0
  77. package/dist/docs/documents/CLI_Reference.html +193 -0
  78. package/dist/docs/documents/Core_Concepts.html +163 -0
  79. package/dist/docs/documents/Getting_Started.html +94 -0
  80. package/dist/docs/documents/Runtime_Environment.html +128 -0
  81. package/dist/docs/enums/plot.ActivityLinkType.html +12 -0
  82. package/dist/docs/enums/plot.ActivityType.html +10 -0
  83. package/dist/docs/enums/plot.ActorType.html +10 -0
  84. package/dist/docs/enums/plot.ConferencingProvider.html +14 -0
  85. package/dist/docs/enums/tag.Tag.html +45 -0
  86. package/dist/docs/enums/tools_ai.AIModel.html +31 -0
  87. package/dist/docs/enums/tools_integrations.AuthLevel.html +7 -0
  88. package/dist/docs/enums/tools_integrations.AuthProvider.html +24 -0
  89. package/dist/docs/enums/tools_plot.ActivityAccess.html +8 -0
  90. package/dist/docs/enums/tools_plot.ContactAccess.html +5 -0
  91. package/dist/docs/enums/tools_plot.PriorityAccess.html +8 -0
  92. package/dist/docs/hierarchy.html +1 -0
  93. package/dist/docs/index.html +100 -0
  94. package/dist/docs/interfaces/common_calendar.Calendar.html +13 -0
  95. package/dist/docs/interfaces/common_calendar.CalendarTool.html +49 -0
  96. package/dist/docs/interfaces/common_calendar.SyncOptions.html +8 -0
  97. package/dist/docs/interfaces/tools_ai.AIRequest.html +46 -0
  98. package/dist/docs/interfaces/tools_ai.AIResponse.html +19 -0
  99. package/dist/docs/interfaces/tools_ai.FilePart.html +14 -0
  100. package/dist/docs/interfaces/tools_ai.ImagePart.html +11 -0
  101. package/dist/docs/interfaces/tools_ai.ReasoningPart.html +7 -0
  102. package/dist/docs/interfaces/tools_ai.RedactedReasoningPart.html +5 -0
  103. package/dist/docs/interfaces/tools_ai.TextPart.html +5 -0
  104. package/dist/docs/interfaces/tools_ai.ToolCallPart.html +9 -0
  105. package/dist/docs/interfaces/tools_ai.ToolExecutionOptions.html +9 -0
  106. package/dist/docs/interfaces/tools_ai.ToolResultPart.html +9 -0
  107. package/dist/docs/interfaces/tools_twists.TwistSource.html +13 -0
  108. package/dist/docs/interfaces/utils_types.ToolShed.html +11 -0
  109. package/dist/docs/modules/common_calendar.html +1 -0
  110. package/dist/docs/modules/index.html +1 -0
  111. package/dist/docs/modules/plot.html +1 -0
  112. package/dist/docs/modules/tag.html +1 -0
  113. package/dist/docs/modules/tool.html +1 -0
  114. package/dist/docs/modules/tools_ai.html +1 -0
  115. package/dist/docs/modules/tools_callbacks.html +1 -0
  116. package/dist/docs/modules/tools_integrations.html +1 -0
  117. package/dist/docs/modules/tools_network.html +1 -0
  118. package/dist/docs/modules/tools_plot.html +1 -0
  119. package/dist/docs/modules/tools_store.html +1 -0
  120. package/dist/docs/modules/tools_tasks.html +1 -0
  121. package/dist/docs/modules/tools_twists.html +1 -0
  122. package/dist/docs/modules/twist.html +1 -0
  123. package/dist/docs/modules/utils_types.html +1 -0
  124. package/dist/docs/modules.html +1 -0
  125. package/dist/docs/types/common_calendar.CalendarAuth.html +7 -0
  126. package/dist/docs/types/plot.Activity.html +64 -0
  127. package/dist/docs/types/plot.ActivityLink.html +22 -0
  128. package/dist/docs/types/plot.ActivityMeta.html +11 -0
  129. package/dist/docs/types/plot.ActivityUpdate.html +13 -0
  130. package/dist/docs/types/plot.Actor.html +15 -0
  131. package/dist/docs/types/plot.ActorId.html +4 -0
  132. package/dist/docs/types/plot.NewActivity.html +16 -0
  133. package/dist/docs/types/plot.NewContact.html +13 -0
  134. package/dist/docs/types/plot.NewPriority.html +5 -0
  135. package/dist/docs/types/plot.NoteType.html +1 -0
  136. package/dist/docs/types/plot.PickPriorityConfig.html +22 -0
  137. package/dist/docs/types/plot.Priority.html +8 -0
  138. package/dist/docs/types/tools_ai.AIAssistantMessage.html +4 -0
  139. package/dist/docs/types/tools_ai.AIMessage.html +3 -0
  140. package/dist/docs/types/tools_ai.AISource.html +11 -0
  141. package/dist/docs/types/tools_ai.AISystemMessage.html +7 -0
  142. package/dist/docs/types/tools_ai.AITool.html +19 -0
  143. package/dist/docs/types/tools_ai.AIToolMessage.html +4 -0
  144. package/dist/docs/types/tools_ai.AIToolSet.html +1 -0
  145. package/dist/docs/types/tools_ai.AIUsage.html +10 -0
  146. package/dist/docs/types/tools_ai.AIUserMessage.html +4 -0
  147. package/dist/docs/types/tools_ai.DataContent.html +2 -0
  148. package/dist/docs/types/tools_ai.ModelPreferences.html +24 -0
  149. package/dist/docs/types/tools_callbacks.Callback.html +8 -0
  150. package/dist/docs/types/tools_integrations.AuthToken.html +16 -0
  151. package/dist/docs/types/tools_integrations.Authorization.html +10 -0
  152. package/dist/docs/types/tools_network.WebhookRequest.html +15 -0
  153. package/dist/docs/types/tools_plot.ActivityIntentHandler.html +9 -0
  154. package/dist/docs/types/tools_twists.Log.html +6 -0
  155. package/dist/docs/types/tools_twists.TwistPermissions.html +12 -0
  156. package/dist/docs/types/utils_types.BuiltInTools.html +5 -0
  157. package/dist/docs/types/utils_types.CallbackMethods.html +3 -0
  158. package/dist/docs/types/utils_types.ExtractBuildReturn.html +2 -0
  159. package/dist/docs/types/utils_types.InferOptions.html +2 -0
  160. package/dist/docs/types/utils_types.InferTools.html +3 -0
  161. package/dist/docs/types/utils_types.NoFunctions.html +3 -0
  162. package/dist/docs/types/utils_types.NonFunction.html +2 -0
  163. package/dist/docs/types/utils_types.PromiseValues.html +3 -0
  164. package/dist/docs/types/utils_types.ToolBuilder.html +3 -0
  165. package/dist/index.d.ts +7 -0
  166. package/dist/index.d.ts.map +1 -0
  167. package/dist/index.js +7 -0
  168. package/dist/index.js.map +1 -0
  169. package/dist/llm-docs/common/calendar.d.ts +9 -0
  170. package/dist/llm-docs/common/calendar.d.ts.map +1 -0
  171. package/dist/llm-docs/common/calendar.js +8 -0
  172. package/dist/llm-docs/common/calendar.js.map +1 -0
  173. package/dist/llm-docs/common/messaging.d.ts +9 -0
  174. package/dist/llm-docs/common/messaging.d.ts.map +1 -0
  175. package/dist/llm-docs/common/messaging.js +8 -0
  176. package/dist/llm-docs/common/messaging.js.map +1 -0
  177. package/dist/llm-docs/creator-docs.d.ts +9 -0
  178. package/dist/llm-docs/creator-docs.d.ts.map +1 -0
  179. package/dist/llm-docs/creator-docs.js +8 -0
  180. package/dist/llm-docs/creator-docs.js.map +1 -0
  181. package/dist/llm-docs/index.d.ts +11 -0
  182. package/dist/llm-docs/index.d.ts.map +1 -0
  183. package/dist/llm-docs/index.js +42 -0
  184. package/dist/llm-docs/index.js.map +1 -0
  185. package/dist/llm-docs/plot.d.ts +9 -0
  186. package/dist/llm-docs/plot.d.ts.map +1 -0
  187. package/dist/llm-docs/plot.js +8 -0
  188. package/dist/llm-docs/plot.js.map +1 -0
  189. package/dist/llm-docs/tag.d.ts +9 -0
  190. package/dist/llm-docs/tag.d.ts.map +1 -0
  191. package/dist/llm-docs/tag.js +8 -0
  192. package/dist/llm-docs/tag.js.map +1 -0
  193. package/dist/llm-docs/tool.d.ts +9 -0
  194. package/dist/llm-docs/tool.d.ts.map +1 -0
  195. package/dist/llm-docs/tool.js +8 -0
  196. package/dist/llm-docs/tool.js.map +1 -0
  197. package/dist/llm-docs/tools/ai.d.ts +9 -0
  198. package/dist/llm-docs/tools/ai.d.ts.map +1 -0
  199. package/dist/llm-docs/tools/ai.js +8 -0
  200. package/dist/llm-docs/tools/ai.js.map +1 -0
  201. package/dist/llm-docs/tools/callbacks.d.ts +9 -0
  202. package/dist/llm-docs/tools/callbacks.d.ts.map +1 -0
  203. package/dist/llm-docs/tools/callbacks.js +8 -0
  204. package/dist/llm-docs/tools/callbacks.js.map +1 -0
  205. package/dist/llm-docs/tools/integrations.d.ts +9 -0
  206. package/dist/llm-docs/tools/integrations.d.ts.map +1 -0
  207. package/dist/llm-docs/tools/integrations.js +8 -0
  208. package/dist/llm-docs/tools/integrations.js.map +1 -0
  209. package/dist/llm-docs/tools/network.d.ts +9 -0
  210. package/dist/llm-docs/tools/network.d.ts.map +1 -0
  211. package/dist/llm-docs/tools/network.js +8 -0
  212. package/dist/llm-docs/tools/network.js.map +1 -0
  213. package/dist/llm-docs/tools/plot.d.ts +9 -0
  214. package/dist/llm-docs/tools/plot.d.ts.map +1 -0
  215. package/dist/llm-docs/tools/plot.js +8 -0
  216. package/dist/llm-docs/tools/plot.js.map +1 -0
  217. package/dist/llm-docs/tools/store.d.ts +9 -0
  218. package/dist/llm-docs/tools/store.d.ts.map +1 -0
  219. package/dist/llm-docs/tools/store.js +8 -0
  220. package/dist/llm-docs/tools/store.js.map +1 -0
  221. package/dist/llm-docs/tools/tasks.d.ts +9 -0
  222. package/dist/llm-docs/tools/tasks.d.ts.map +1 -0
  223. package/dist/llm-docs/tools/tasks.js +8 -0
  224. package/dist/llm-docs/tools/tasks.js.map +1 -0
  225. package/dist/llm-docs/tools/twists.d.ts +9 -0
  226. package/dist/llm-docs/tools/twists.d.ts.map +1 -0
  227. package/dist/llm-docs/tools/twists.js +8 -0
  228. package/dist/llm-docs/tools/twists.js.map +1 -0
  229. package/dist/llm-docs/twist-guide-template.d.ts +9 -0
  230. package/dist/llm-docs/twist-guide-template.d.ts.map +1 -0
  231. package/dist/llm-docs/twist-guide-template.js +8 -0
  232. package/dist/llm-docs/twist-guide-template.js.map +1 -0
  233. package/dist/llm-docs/twist.d.ts +9 -0
  234. package/dist/llm-docs/twist.d.ts.map +1 -0
  235. package/dist/llm-docs/twist.js +8 -0
  236. package/dist/llm-docs/twist.js.map +1 -0
  237. package/dist/plot.d.ts +463 -0
  238. package/dist/plot.d.ts.map +1 -0
  239. package/dist/plot.js +68 -0
  240. package/dist/plot.js.map +1 -0
  241. package/dist/tag.d.ts +47 -0
  242. package/dist/tag.d.ts.map +1 -0
  243. package/dist/tag.js +51 -0
  244. package/dist/tag.js.map +1 -0
  245. package/dist/tool.d.ts +242 -0
  246. package/dist/tool.d.ts.map +1 -0
  247. package/dist/tool.js +283 -0
  248. package/dist/tool.js.map +1 -0
  249. package/dist/tools/ai.d.ts +697 -0
  250. package/dist/tools/ai.d.ts.map +1 -0
  251. package/dist/tools/ai.js +104 -0
  252. package/dist/tools/ai.js.map +1 -0
  253. package/dist/tools/callbacks.d.ts +96 -0
  254. package/dist/tools/callbacks.d.ts.map +1 -0
  255. package/dist/tools/callbacks.js +40 -0
  256. package/dist/tools/callbacks.js.map +1 -0
  257. package/dist/tools/index.d.ts +9 -0
  258. package/dist/tools/index.d.ts.map +1 -0
  259. package/dist/tools/index.js +9 -0
  260. package/dist/tools/index.js.map +1 -0
  261. package/dist/tools/integrations.d.ts +142 -0
  262. package/dist/tools/integrations.d.ts.map +1 -0
  263. package/dist/tools/integrations.js +79 -0
  264. package/dist/tools/integrations.js.map +1 -0
  265. package/dist/tools/network.d.ts +188 -0
  266. package/dist/tools/network.d.ts.map +1 -0
  267. package/dist/tools/network.js +87 -0
  268. package/dist/tools/network.js.map +1 -0
  269. package/dist/tools/plot.d.ts +252 -0
  270. package/dist/tools/plot.d.ts.map +1 -0
  271. package/dist/tools/plot.js +72 -0
  272. package/dist/tools/plot.js.map +1 -0
  273. package/dist/tools/store.d.ts +90 -0
  274. package/dist/tools/store.d.ts.map +1 -0
  275. package/dist/tools/store.js +48 -0
  276. package/dist/tools/store.js.map +1 -0
  277. package/dist/tools/tasks.d.ts +93 -0
  278. package/dist/tools/tasks.d.ts.map +1 -0
  279. package/dist/tools/tasks.js +58 -0
  280. package/dist/tools/tasks.js.map +1 -0
  281. package/dist/tools/twists.d.ts +213 -0
  282. package/dist/tools/twists.d.ts.map +1 -0
  283. package/dist/tools/twists.js +26 -0
  284. package/dist/tools/twists.js.map +1 -0
  285. package/dist/twist-guide.d.ts +2 -0
  286. package/dist/twist-guide.d.ts.map +1 -0
  287. package/dist/twist-guide.js +9 -0
  288. package/dist/twist-guide.js.map +1 -0
  289. package/dist/twist.d.ts +204 -0
  290. package/dist/twist.d.ts.map +1 -0
  291. package/dist/twist.js +216 -0
  292. package/dist/twist.js.map +1 -0
  293. package/dist/utils/types.d.ts +91 -0
  294. package/dist/utils/types.d.ts.map +1 -0
  295. package/dist/utils/types.js +2 -0
  296. package/dist/utils/types.js.map +1 -0
  297. package/package.json +206 -0
  298. package/tsconfig.base.json +28 -0
package/dist/tool.d.ts ADDED
@@ -0,0 +1,242 @@
1
+ import { type Priority } from "./plot";
2
+ import type { Callback } from "./tools/callbacks";
3
+ import type { InferOptions, InferTools, ToolBuilder, ToolShed } from "./utils/types";
4
+ export type { ToolBuilder };
5
+ /**
6
+ * Abstrtact parent for both built-in tools and regular Tools.
7
+ * Regular tools extend Tool.
8
+ */
9
+ export declare abstract class ITool {
10
+ }
11
+ /**
12
+ * Base class for regular tools.
13
+ *
14
+ * Regular tools run in isolation and can only access other tools declared
15
+ * in their build method. They are ideal for external API integrations
16
+ * and reusable functionality that doesn't require Plot's internal infrastructure.
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * class GoogleCalendarTool extends Tool<GoogleCalendarTool> {
21
+ * constructor(id: string, options: { clientId: string }) {
22
+ * super(id, options);
23
+ * }
24
+ *
25
+ * build(tools: ToolBuilder) {
26
+ * return {
27
+ * auth: tools.build(Integrations),
28
+ * network: tools.build(Network),
29
+ * };
30
+ * }
31
+ *
32
+ * async getCalendars() {
33
+ * const token = await this.tools.auth.get(...);
34
+ * // Implementation
35
+ * }
36
+ * }
37
+ * ```
38
+ */
39
+ export declare abstract class Tool<TSelf> implements ITool {
40
+ protected id: string;
41
+ protected options: InferOptions<TSelf>;
42
+ private toolShed;
43
+ constructor(id: string, options: InferOptions<TSelf>, toolShed: ToolShed);
44
+ /**
45
+ * Gets the initialized tools for this tool.
46
+ * @throws Error if called before initialization is complete
47
+ */
48
+ protected get tools(): InferTools<TSelf>;
49
+ /**
50
+ * Declares tool dependencies for this tool.
51
+ * Return an object mapping tool names to build() promises.
52
+ * Default implementation returns empty object (no custom tools).
53
+ *
54
+ * @param build - The build function to use for declaring dependencies
55
+ * @returns Object mapping tool names to tool promises
56
+ *
57
+ * @example
58
+ * ```typescript
59
+ * build(build: ToolBuilder) {
60
+ * return {
61
+ * network: build(Network, { urls: ["https://api.example.com/*"] }),
62
+ * };
63
+ * }
64
+ * ```
65
+ */
66
+ build(build: ToolBuilder): Record<string, Promise<ITool>>;
67
+ /**
68
+ * Creates a persistent callback to a method on this tool.
69
+ *
70
+ * ExtraArgs are strongly typed to match the method's signature after the first argument.
71
+ *
72
+ * @param fn - The method to callback
73
+ * @param extraArgs - Additional arguments to pass (type-checked, must be serializable)
74
+ * @returns Promise resolving to a persistent callback token
75
+ *
76
+ * @example
77
+ * ```typescript
78
+ * const callback = await this.callback(this.onWebhook, "calendar", 123);
79
+ * ```
80
+ */
81
+ protected callback(fn: Function, ...extraArgs: any[]): Promise<Callback>;
82
+ /**
83
+ * Deletes a specific callback by its token.
84
+ *
85
+ * @param token - The callback token to delete
86
+ * @returns Promise that resolves when the callback is deleted
87
+ */
88
+ protected deleteCallback(token: Callback): Promise<void>;
89
+ /**
90
+ * Deletes all callbacks for this tool.
91
+ *
92
+ * @returns Promise that resolves when all callbacks are deleted
93
+ */
94
+ protected deleteAllCallbacks(): Promise<void>;
95
+ /**
96
+ * Executes a callback by its token.
97
+ *
98
+ * @param token - The callback token to execute
99
+ * @param args - Optional arguments to pass to the callback
100
+ * @returns Promise resolving to the callback result
101
+ */
102
+ protected run(token: Callback, args?: any): Promise<any>;
103
+ /**
104
+ * Retrieves a value from persistent storage by key.
105
+ *
106
+ * @template T - The expected type of the stored value
107
+ * @param key - The storage key to retrieve
108
+ * @returns Promise resolving to the stored value or null
109
+ */
110
+ protected get<T>(key: string): Promise<T | null>;
111
+ /**
112
+ * Stores a value in persistent storage.
113
+ *
114
+ * **Important**: Values must be JSON-serializable. Functions, Symbols, and undefined values
115
+ * cannot be stored directly.
116
+ *
117
+ * **For function references**: Use callbacks instead of storing functions directly.
118
+ *
119
+ * @example
120
+ * ```typescript
121
+ * // ❌ WRONG: Cannot store functions directly
122
+ * await this.set("handler", this.myHandler);
123
+ *
124
+ * // ✅ CORRECT: Create a callback token first
125
+ * const token = await this.callback(this.myHandler, "arg1", "arg2");
126
+ * await this.set("handler_token", token);
127
+ *
128
+ * // Later, execute the callback
129
+ * const token = await this.get<string>("handler_token");
130
+ * await this.run(token, args);
131
+ * ```
132
+ *
133
+ * @template T - The type of value being stored
134
+ * @param key - The storage key to use
135
+ * @param value - The value to store (must be JSON-serializable)
136
+ * @returns Promise that resolves when the value is stored
137
+ */
138
+ protected set<T>(key: string, value: T): Promise<void>;
139
+ /**
140
+ * Removes a specific key from persistent storage.
141
+ *
142
+ * @param key - The storage key to remove
143
+ * @returns Promise that resolves when the key is removed
144
+ */
145
+ protected clear(key: string): Promise<void>;
146
+ /**
147
+ * Removes all keys from this tool's storage.
148
+ *
149
+ * @returns Promise that resolves when all keys are removed
150
+ */
151
+ protected clearAll(): Promise<void>;
152
+ /**
153
+ * Queues a callback to execute in a separate worker context.
154
+ *
155
+ * @param callback - The callback token created with `this.callback()`
156
+ * @param options - Optional configuration for the execution
157
+ * @param options.runAt - If provided, schedules execution at this time; otherwise runs immediately
158
+ * @returns Promise resolving to a cancellation token (only for scheduled executions)
159
+ */
160
+ protected runTask(callback: Callback, options?: {
161
+ runAt?: Date;
162
+ }): Promise<string | void>;
163
+ /**
164
+ * Cancels a previously scheduled execution.
165
+ *
166
+ * @param token - The cancellation token returned by runTask() with runAt option
167
+ * @returns Promise that resolves when the cancellation is processed
168
+ */
169
+ protected cancelTask(token: string): Promise<void>;
170
+ /**
171
+ * Cancels all scheduled executions for this tool.
172
+ *
173
+ * @returns Promise that resolves when all cancellations are processed
174
+ */
175
+ protected cancelAllTasks(): Promise<void>;
176
+ /**
177
+ * Called before the twist's activate method, starting from the deepest tool dependencies.
178
+ *
179
+ * This method is called in a depth-first manner, with the deepest dependencies
180
+ * being called first, bubbling up to the top-level tools before the twist's
181
+ * activate method is called.
182
+ *
183
+ * @param priority - The priority context containing the priority ID
184
+ * @returns Promise that resolves when pre-activation is complete
185
+ */
186
+ preActivate(priority: Priority): Promise<void>;
187
+ /**
188
+ * Called after the twist's activate method, starting from the top-level tools.
189
+ *
190
+ * This method is called in reverse order, with top-level tools being called
191
+ * first, then cascading down to the deepest dependencies.
192
+ *
193
+ * @param priority - The priority context containing the priority ID
194
+ * @returns Promise that resolves when post-activation is complete
195
+ */
196
+ postActivate(priority: Priority): Promise<void>;
197
+ /**
198
+ * Called before the twist's upgrade method, starting from the deepest tool dependencies.
199
+ *
200
+ * This method is called in a depth-first manner, with the deepest dependencies
201
+ * being called first, bubbling up to the top-level tools before the twist's
202
+ * upgrade method is called.
203
+ *
204
+ * @returns Promise that resolves when pre-upgrade is complete
205
+ */
206
+ preUpgrade(): Promise<void>;
207
+ /**
208
+ * Called after the twist's upgrade method, starting from the top-level tools.
209
+ *
210
+ * This method is called in reverse order, with top-level tools being called
211
+ * first, then cascading down to the deepest dependencies.
212
+ *
213
+ * @returns Promise that resolves when post-upgrade is complete
214
+ */
215
+ postUpgrade(): Promise<void>;
216
+ /**
217
+ * Called before the twist's deactivate method, starting from the deepest tool dependencies.
218
+ *
219
+ * This method is called in a depth-first manner, with the deepest dependencies
220
+ * being called first, bubbling up to the top-level tools before the twist's
221
+ * deactivate method is called.
222
+ *
223
+ * @returns Promise that resolves when pre-deactivation is complete
224
+ */
225
+ preDeactivate(): Promise<void>;
226
+ /**
227
+ * Called after the twist's deactivate method, starting from the top-level tools.
228
+ *
229
+ * This method is called in reverse order, with top-level tools being called
230
+ * first, then cascading down to the deepest dependencies.
231
+ *
232
+ * @returns Promise that resolves when post-deactivation is complete
233
+ */
234
+ postDeactivate(): Promise<void>;
235
+ /**
236
+ * Waits for tool initialization to complete.
237
+ * Called automatically by the entrypoint before lifecycle methods.
238
+ * @internal
239
+ */
240
+ waitForReady(): Promise<void>;
241
+ }
242
+ //# sourceMappingURL=tool.d.ts.map
@@ -0,0 +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,K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cACa,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAIzC;;;;;;;OAOG;cACa,OAAO,CACrB,QAAQ,EAAE,QAAQ,EAClB,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,IAAI,CAAA;KAAE,GACzB,OAAO,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 ADDED
@@ -0,0 +1,283 @@
1
+ /**
2
+ * Abstrtact parent for both built-in tools and regular Tools.
3
+ * Regular tools extend Tool.
4
+ */
5
+ export class ITool {
6
+ }
7
+ /**
8
+ * Base class for regular tools.
9
+ *
10
+ * Regular tools run in isolation and can only access other tools declared
11
+ * in their build method. They are ideal for external API integrations
12
+ * and reusable functionality that doesn't require Plot's internal infrastructure.
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * class GoogleCalendarTool extends Tool<GoogleCalendarTool> {
17
+ * constructor(id: string, options: { clientId: string }) {
18
+ * super(id, options);
19
+ * }
20
+ *
21
+ * build(tools: ToolBuilder) {
22
+ * return {
23
+ * auth: tools.build(Integrations),
24
+ * network: tools.build(Network),
25
+ * };
26
+ * }
27
+ *
28
+ * async getCalendars() {
29
+ * const token = await this.tools.auth.get(...);
30
+ * // Implementation
31
+ * }
32
+ * }
33
+ * ```
34
+ */
35
+ export class Tool {
36
+ id;
37
+ options;
38
+ toolShed;
39
+ constructor(id, options, toolShed) {
40
+ this.id = id;
41
+ this.options = options;
42
+ this.toolShed = toolShed;
43
+ }
44
+ /**
45
+ * Gets the initialized tools for this tool.
46
+ * @throws Error if called before initialization is complete
47
+ */
48
+ get tools() {
49
+ return this.toolShed.getTools();
50
+ }
51
+ /**
52
+ * Declares tool dependencies for this tool.
53
+ * Return an object mapping tool names to build() promises.
54
+ * Default implementation returns empty object (no custom tools).
55
+ *
56
+ * @param build - The build function to use for declaring dependencies
57
+ * @returns Object mapping tool names to tool promises
58
+ *
59
+ * @example
60
+ * ```typescript
61
+ * build(build: ToolBuilder) {
62
+ * return {
63
+ * network: build(Network, { urls: ["https://api.example.com/*"] }),
64
+ * };
65
+ * }
66
+ * ```
67
+ */
68
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
69
+ build(build) {
70
+ return {};
71
+ }
72
+ /**
73
+ * Creates a persistent callback to a method on this tool.
74
+ *
75
+ * ExtraArgs are strongly typed to match the method's signature after the first argument.
76
+ *
77
+ * @param fn - The method to callback
78
+ * @param extraArgs - Additional arguments to pass (type-checked, must be serializable)
79
+ * @returns Promise resolving to a persistent callback token
80
+ *
81
+ * @example
82
+ * ```typescript
83
+ * const callback = await this.callback(this.onWebhook, "calendar", 123);
84
+ * ```
85
+ */
86
+ async callback(fn, ...extraArgs) {
87
+ return this.tools.callbacks.create(fn, ...extraArgs);
88
+ }
89
+ /**
90
+ * Deletes a specific callback by its token.
91
+ *
92
+ * @param token - The callback token to delete
93
+ * @returns Promise that resolves when the callback is deleted
94
+ */
95
+ async deleteCallback(token) {
96
+ return this.tools.callbacks.delete(token);
97
+ }
98
+ /**
99
+ * Deletes all callbacks for this tool.
100
+ *
101
+ * @returns Promise that resolves when all callbacks are deleted
102
+ */
103
+ async deleteAllCallbacks() {
104
+ return this.tools.callbacks.deleteAll();
105
+ }
106
+ /**
107
+ * Executes a callback by its token.
108
+ *
109
+ * @param token - The callback token to execute
110
+ * @param args - Optional arguments to pass to the callback
111
+ * @returns Promise resolving to the callback result
112
+ */
113
+ async run(token, args) {
114
+ return this.tools.callbacks.run(token, args);
115
+ }
116
+ /**
117
+ * Retrieves a value from persistent storage by key.
118
+ *
119
+ * @template T - The expected type of the stored value
120
+ * @param key - The storage key to retrieve
121
+ * @returns Promise resolving to the stored value or null
122
+ */
123
+ async get(key) {
124
+ return this.tools.store.get(key);
125
+ }
126
+ /**
127
+ * Stores a value in persistent storage.
128
+ *
129
+ * **Important**: Values must be JSON-serializable. Functions, Symbols, and undefined values
130
+ * cannot be stored directly.
131
+ *
132
+ * **For function references**: Use callbacks instead of storing functions directly.
133
+ *
134
+ * @example
135
+ * ```typescript
136
+ * // ❌ WRONG: Cannot store functions directly
137
+ * await this.set("handler", this.myHandler);
138
+ *
139
+ * // ✅ CORRECT: Create a callback token first
140
+ * const token = await this.callback(this.myHandler, "arg1", "arg2");
141
+ * await this.set("handler_token", token);
142
+ *
143
+ * // Later, execute the callback
144
+ * const token = await this.get<string>("handler_token");
145
+ * await this.run(token, args);
146
+ * ```
147
+ *
148
+ * @template T - The type of value being stored
149
+ * @param key - The storage key to use
150
+ * @param value - The value to store (must be JSON-serializable)
151
+ * @returns Promise that resolves when the value is stored
152
+ */
153
+ async set(key, value) {
154
+ return this.tools.store.set(key, value);
155
+ }
156
+ /**
157
+ * Removes a specific key from persistent storage.
158
+ *
159
+ * @param key - The storage key to remove
160
+ * @returns Promise that resolves when the key is removed
161
+ */
162
+ async clear(key) {
163
+ return this.tools.store.clear(key);
164
+ }
165
+ /**
166
+ * Removes all keys from this tool's storage.
167
+ *
168
+ * @returns Promise that resolves when all keys are removed
169
+ */
170
+ async clearAll() {
171
+ return this.tools.store.clearAll();
172
+ }
173
+ /**
174
+ * Queues a callback to execute in a separate worker context.
175
+ *
176
+ * @param callback - The callback token created with `this.callback()`
177
+ * @param options - Optional configuration for the execution
178
+ * @param options.runAt - If provided, schedules execution at this time; otherwise runs immediately
179
+ * @returns Promise resolving to a cancellation token (only for scheduled executions)
180
+ */
181
+ async runTask(callback, options) {
182
+ return this.tools.tasks.runTask(callback, options);
183
+ }
184
+ /**
185
+ * Cancels a previously scheduled execution.
186
+ *
187
+ * @param token - The cancellation token returned by runTask() with runAt option
188
+ * @returns Promise that resolves when the cancellation is processed
189
+ */
190
+ async cancelTask(token) {
191
+ return this.tools.tasks.cancelTask(token);
192
+ }
193
+ /**
194
+ * Cancels all scheduled executions for this tool.
195
+ *
196
+ * @returns Promise that resolves when all cancellations are processed
197
+ */
198
+ async cancelAllTasks() {
199
+ return this.tools.tasks.cancelAllTasks();
200
+ }
201
+ /**
202
+ * Called before the twist's activate method, starting from the deepest tool dependencies.
203
+ *
204
+ * This method is called in a depth-first manner, with the deepest dependencies
205
+ * being called first, bubbling up to the top-level tools before the twist's
206
+ * activate method is called.
207
+ *
208
+ * @param priority - The priority context containing the priority ID
209
+ * @returns Promise that resolves when pre-activation is complete
210
+ */
211
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
212
+ preActivate(priority) {
213
+ return Promise.resolve();
214
+ }
215
+ /**
216
+ * Called after the twist's activate method, starting from the top-level tools.
217
+ *
218
+ * This method is called in reverse order, with top-level tools being called
219
+ * first, then cascading down to the deepest dependencies.
220
+ *
221
+ * @param priority - The priority context containing the priority ID
222
+ * @returns Promise that resolves when post-activation is complete
223
+ */
224
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
225
+ postActivate(priority) {
226
+ return Promise.resolve();
227
+ }
228
+ /**
229
+ * Called before the twist's upgrade method, starting from the deepest tool dependencies.
230
+ *
231
+ * This method is called in a depth-first manner, with the deepest dependencies
232
+ * being called first, bubbling up to the top-level tools before the twist's
233
+ * upgrade method is called.
234
+ *
235
+ * @returns Promise that resolves when pre-upgrade is complete
236
+ */
237
+ preUpgrade() {
238
+ return Promise.resolve();
239
+ }
240
+ /**
241
+ * Called after the twist's upgrade method, starting from the top-level tools.
242
+ *
243
+ * This method is called in reverse order, with top-level tools being called
244
+ * first, then cascading down to the deepest dependencies.
245
+ *
246
+ * @returns Promise that resolves when post-upgrade is complete
247
+ */
248
+ postUpgrade() {
249
+ return Promise.resolve();
250
+ }
251
+ /**
252
+ * Called before the twist's deactivate method, starting from the deepest tool dependencies.
253
+ *
254
+ * This method is called in a depth-first manner, with the deepest dependencies
255
+ * being called first, bubbling up to the top-level tools before the twist's
256
+ * deactivate method is called.
257
+ *
258
+ * @returns Promise that resolves when pre-deactivation is complete
259
+ */
260
+ preDeactivate() {
261
+ return Promise.resolve();
262
+ }
263
+ /**
264
+ * Called after the twist's deactivate method, starting from the top-level tools.
265
+ *
266
+ * This method is called in reverse order, with top-level tools being called
267
+ * first, then cascading down to the deepest dependencies.
268
+ *
269
+ * @returns Promise that resolves when post-deactivation is complete
270
+ */
271
+ postDeactivate() {
272
+ return Promise.resolve();
273
+ }
274
+ /**
275
+ * Waits for tool initialization to complete.
276
+ * Called automatically by the entrypoint before lifecycle methods.
277
+ * @internal
278
+ */
279
+ async waitForReady() {
280
+ await this.toolShed.waitForReady();
281
+ }
282
+ }
283
+ //# sourceMappingURL=tool.js.map
@@ -0,0 +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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