@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
@@ -0,0 +1,204 @@
1
+ import { type Priority } from "./plot";
2
+ import { type ITool } from "./tool";
3
+ import type { Callback } from "./tools/callbacks";
4
+ import type { InferTools, ToolBuilder, ToolShed } from "./utils/types";
5
+ /**
6
+ * Base class for all twists.
7
+ *
8
+ * Twists are activated in a Plot priority and have access to that priority and all
9
+ * its descendants.
10
+ *
11
+ * Override build() to declare tool dependencies and lifecycle methods to handle events.
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * class FlatteringTwist extends Twist<FlatteringTwist> {
16
+ * build(build: ToolBuilder) {
17
+ * return {
18
+ * plot: build(Plot),
19
+ * };
20
+ * }
21
+ *
22
+ * async activate(priority: Pick<Priority, "id">) {
23
+ * // Initialize twist for the given priority
24
+ * await this.tools.plot.createActivity({
25
+ * type: ActivityType.Note,
26
+ * note: "Hello, good looking!",
27
+ * });
28
+ * }
29
+ * }
30
+ * ```
31
+ */
32
+ export declare abstract class Twist<TSelf> {
33
+ protected id: string;
34
+ private toolShed;
35
+ constructor(id: string, toolShed: ToolShed);
36
+ /**
37
+ * Gets the initialized tools for this twist.
38
+ * @throws Error if called before initialization is complete
39
+ */
40
+ protected get tools(): InferTools<TSelf>;
41
+ /**
42
+ * Declares tool dependencies for this twist.
43
+ * Return an object mapping tool names to build() promises.
44
+ *
45
+ * @param build - The build function to use for declaring dependencies
46
+ * @returns Object mapping tool names to tool promises
47
+ *
48
+ * @example
49
+ * ```typescript
50
+ * build(build: ToolBuilder) {
51
+ * return {
52
+ * plot: build(Plot),
53
+ * calendar: build(GoogleCalendar, { apiKey: "..." }),
54
+ * };
55
+ * }
56
+ * ```
57
+ */
58
+ abstract build(build: ToolBuilder): Record<string, Promise<ITool>>;
59
+ /**
60
+ * Creates a persistent callback to a method on this twist.
61
+ *
62
+ * ExtraArgs are strongly typed to match the method's signature after the first argument.
63
+ *
64
+ * @param fn - The method to callback
65
+ * @param extraArgs - Additional arguments to pass (type-checked, must be serializable)
66
+ * @returns Promise resolving to a persistent callback token
67
+ *
68
+ * @example
69
+ * ```typescript
70
+ * const callback = await this.callback(this.onWebhook, "calendar", 123);
71
+ * ```
72
+ */
73
+ protected callback(fn: Function, ...extraArgs: any[]): Promise<Callback>;
74
+ /**
75
+ * Deletes a specific callback by its token.
76
+ *
77
+ * @param token - The callback token to delete
78
+ * @returns Promise that resolves when the callback is deleted
79
+ */
80
+ protected deleteCallback(token: Callback): Promise<void>;
81
+ /**
82
+ * Deletes all callbacks for this twist.
83
+ *
84
+ * @returns Promise that resolves when all callbacks are deleted
85
+ */
86
+ protected deleteAllCallbacks(): Promise<void>;
87
+ /**
88
+ * Executes a callback by its token.
89
+ *
90
+ * @param token - The callback token to execute
91
+ * @param args - Optional arguments to pass to the callback
92
+ * @returns Promise resolving to the callback result
93
+ */
94
+ protected run(token: Callback, ...args: []): Promise<any>;
95
+ /**
96
+ * Retrieves a value from persistent storage by key.
97
+ *
98
+ * @template T - The expected type of the stored value
99
+ * @param key - The storage key to retrieve
100
+ * @returns Promise resolving to the stored value or null
101
+ */
102
+ protected get<T>(key: string): Promise<T | null>;
103
+ /**
104
+ * Stores a value in persistent storage.
105
+ *
106
+ * **Important**: Values must be JSON-serializable. Functions, Symbols, and undefined values
107
+ * cannot be stored directly.
108
+ *
109
+ * **For function references**: Use callbacks instead of storing functions directly.
110
+ *
111
+ * @example
112
+ * ```typescript
113
+ * // ❌ WRONG: Cannot store functions directly
114
+ * await this.set("handler", this.myHandler);
115
+ *
116
+ * // ✅ CORRECT: Create a callback token first
117
+ * const token = await this.callback(this.myHandler, "arg1", "arg2");
118
+ * await this.set("handler_token", token);
119
+ *
120
+ * // Later, execute the callback
121
+ * const token = await this.get<string>("handler_token");
122
+ * await this.run(token, args);
123
+ * ```
124
+ *
125
+ * @template T - The type of value being stored
126
+ * @param key - The storage key to use
127
+ * @param value - The value to store (must be JSON-serializable)
128
+ * @returns Promise that resolves when the value is stored
129
+ */
130
+ protected set<T>(key: string, value: T): Promise<void>;
131
+ /**
132
+ * Removes a specific key from persistent storage.
133
+ *
134
+ * @param key - The storage key to remove
135
+ * @returns Promise that resolves when the key is removed
136
+ */
137
+ protected clear(key: string): Promise<void>;
138
+ /**
139
+ * Removes all keys from this twist's storage.
140
+ *
141
+ * @returns Promise that resolves when all keys are removed
142
+ */
143
+ protected clearAll(): Promise<void>;
144
+ /**
145
+ * Queues a callback to execute in a separate worker context.
146
+ *
147
+ * @param callback - The callback token created with `this.callback()`
148
+ * @param options - Optional configuration for the execution
149
+ * @param options.runAt - If provided, schedules execution at this time; otherwise runs immediately
150
+ * @returns Promise resolving to a cancellation token (only for scheduled executions)
151
+ */
152
+ protected runTask(callback: Callback, options?: {
153
+ runAt?: Date;
154
+ }): Promise<string | void>;
155
+ /**
156
+ * Cancels a previously scheduled execution.
157
+ *
158
+ * @param token - The cancellation token returned by runTask() with runAt option
159
+ * @returns Promise that resolves when the cancellation is processed
160
+ */
161
+ protected cancelTask(token: string): Promise<void>;
162
+ /**
163
+ * Cancels all scheduled executions for this twist.
164
+ *
165
+ * @returns Promise that resolves when all cancellations are processed
166
+ */
167
+ protected cancelAllTasks(): Promise<void>;
168
+ /**
169
+ * Called when the twist is activated for a specific priority.
170
+ *
171
+ * This method should contain initialization logic such as setting up
172
+ * initial activities, configuring webhooks, or establishing external connections.
173
+ *
174
+ * @param priority - The priority context containing the priority ID
175
+ * @returns Promise that resolves when activation is complete
176
+ */
177
+ activate(priority: Pick<Priority, "id">): Promise<void>;
178
+ /**
179
+ * Called when a new version of the twist is deployed to an existing priority.
180
+ *
181
+ * This method should contain migration logic for updating old data structures
182
+ * or setting up new resources that weren't needed by the previous version.
183
+ * It is called with the new version for each active priorityTwist.
184
+ *
185
+ * @returns Promise that resolves when upgrade is complete
186
+ */
187
+ upgrade(): Promise<void>;
188
+ /**
189
+ * Called when the twist is removed from a priority.
190
+ *
191
+ * This method should contain cleanup logic such as removing webhooks,
192
+ * cleaning up external resources, or performing final data operations.
193
+ *
194
+ * @returns Promise that resolves when deactivation is complete
195
+ */
196
+ deactivate(): Promise<void>;
197
+ /**
198
+ * Waits for tool initialization to complete.
199
+ * Called automatically by the entrypoint before lifecycle methods.
200
+ * @internal
201
+ */
202
+ waitForReady(): Promise<void>;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GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAItD;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;cACa,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAI5D;;;;;OAKG;cACa,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjD;;;;OAIG;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;;;;;;;;OAQG;IAEH,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvD;;;;;;;;OAQG;IACH,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAIxB;;;;;;;OAOG;IACH,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B;;;;OAIG;IACG,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;CAGpC"}
package/dist/twist.js ADDED
@@ -0,0 +1,216 @@
1
+ /**
2
+ * Base class for all twists.
3
+ *
4
+ * Twists are activated in a Plot priority and have access to that priority and all
5
+ * its descendants.
6
+ *
7
+ * Override build() to declare tool dependencies and lifecycle methods to handle events.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * class FlatteringTwist extends Twist<FlatteringTwist> {
12
+ * build(build: ToolBuilder) {
13
+ * return {
14
+ * plot: build(Plot),
15
+ * };
16
+ * }
17
+ *
18
+ * async activate(priority: Pick<Priority, "id">) {
19
+ * // Initialize twist for the given priority
20
+ * await this.tools.plot.createActivity({
21
+ * type: ActivityType.Note,
22
+ * note: "Hello, good looking!",
23
+ * });
24
+ * }
25
+ * }
26
+ * ```
27
+ */
28
+ export class Twist {
29
+ id;
30
+ toolShed;
31
+ constructor(id, toolShed) {
32
+ this.id = id;
33
+ this.toolShed = toolShed;
34
+ }
35
+ /**
36
+ * Gets the initialized tools for this twist.
37
+ * @throws Error if called before initialization is complete
38
+ */
39
+ get tools() {
40
+ return this.toolShed.getTools();
41
+ }
42
+ /**
43
+ * Creates a persistent callback to a method on this twist.
44
+ *
45
+ * ExtraArgs are strongly typed to match the method's signature after the first argument.
46
+ *
47
+ * @param fn - The method to callback
48
+ * @param extraArgs - Additional arguments to pass (type-checked, must be serializable)
49
+ * @returns Promise resolving to a persistent callback token
50
+ *
51
+ * @example
52
+ * ```typescript
53
+ * const callback = await this.callback(this.onWebhook, "calendar", 123);
54
+ * ```
55
+ */
56
+ async callback(fn, ...extraArgs) {
57
+ return this.tools.callbacks.create(fn, ...extraArgs);
58
+ }
59
+ /**
60
+ * Deletes a specific callback by its token.
61
+ *
62
+ * @param token - The callback token to delete
63
+ * @returns Promise that resolves when the callback is deleted
64
+ */
65
+ async deleteCallback(token) {
66
+ return this.tools.callbacks.delete(token);
67
+ }
68
+ /**
69
+ * Deletes all callbacks for this twist.
70
+ *
71
+ * @returns Promise that resolves when all callbacks are deleted
72
+ */
73
+ async deleteAllCallbacks() {
74
+ return this.tools.callbacks.deleteAll();
75
+ }
76
+ /**
77
+ * Executes a callback by its token.
78
+ *
79
+ * @param token - The callback token to execute
80
+ * @param args - Optional arguments to pass to the callback
81
+ * @returns Promise resolving to the callback result
82
+ */
83
+ async run(token, ...args) {
84
+ return this.tools.callbacks.run(token, ...args);
85
+ }
86
+ /**
87
+ * Retrieves a value from persistent storage by key.
88
+ *
89
+ * @template T - The expected type of the stored value
90
+ * @param key - The storage key to retrieve
91
+ * @returns Promise resolving to the stored value or null
92
+ */
93
+ async get(key) {
94
+ return this.tools.store.get(key);
95
+ }
96
+ /**
97
+ * Stores a value in persistent storage.
98
+ *
99
+ * **Important**: Values must be JSON-serializable. Functions, Symbols, and undefined values
100
+ * cannot be stored directly.
101
+ *
102
+ * **For function references**: Use callbacks instead of storing functions directly.
103
+ *
104
+ * @example
105
+ * ```typescript
106
+ * // ❌ WRONG: Cannot store functions directly
107
+ * await this.set("handler", this.myHandler);
108
+ *
109
+ * // ✅ CORRECT: Create a callback token first
110
+ * const token = await this.callback(this.myHandler, "arg1", "arg2");
111
+ * await this.set("handler_token", token);
112
+ *
113
+ * // Later, execute the callback
114
+ * const token = await this.get<string>("handler_token");
115
+ * await this.run(token, args);
116
+ * ```
117
+ *
118
+ * @template T - The type of value being stored
119
+ * @param key - The storage key to use
120
+ * @param value - The value to store (must be JSON-serializable)
121
+ * @returns Promise that resolves when the value is stored
122
+ */
123
+ async set(key, value) {
124
+ return this.tools.store.set(key, value);
125
+ }
126
+ /**
127
+ * Removes a specific key from persistent storage.
128
+ *
129
+ * @param key - The storage key to remove
130
+ * @returns Promise that resolves when the key is removed
131
+ */
132
+ async clear(key) {
133
+ return this.tools.store.clear(key);
134
+ }
135
+ /**
136
+ * Removes all keys from this twist's storage.
137
+ *
138
+ * @returns Promise that resolves when all keys are removed
139
+ */
140
+ async clearAll() {
141
+ return this.tools.store.clearAll();
142
+ }
143
+ /**
144
+ * Queues a callback to execute in a separate worker context.
145
+ *
146
+ * @param callback - The callback token created with `this.callback()`
147
+ * @param options - Optional configuration for the execution
148
+ * @param options.runAt - If provided, schedules execution at this time; otherwise runs immediately
149
+ * @returns Promise resolving to a cancellation token (only for scheduled executions)
150
+ */
151
+ async runTask(callback, options) {
152
+ return this.tools.tasks.runTask(callback, options);
153
+ }
154
+ /**
155
+ * Cancels a previously scheduled execution.
156
+ *
157
+ * @param token - The cancellation token returned by runTask() with runAt option
158
+ * @returns Promise that resolves when the cancellation is processed
159
+ */
160
+ async cancelTask(token) {
161
+ return this.tools.tasks.cancelTask(token);
162
+ }
163
+ /**
164
+ * Cancels all scheduled executions for this twist.
165
+ *
166
+ * @returns Promise that resolves when all cancellations are processed
167
+ */
168
+ async cancelAllTasks() {
169
+ return this.tools.tasks.cancelAllTasks();
170
+ }
171
+ /**
172
+ * Called when the twist is activated for a specific priority.
173
+ *
174
+ * This method should contain initialization logic such as setting up
175
+ * initial activities, configuring webhooks, or establishing external connections.
176
+ *
177
+ * @param priority - The priority context containing the priority ID
178
+ * @returns Promise that resolves when activation is complete
179
+ */
180
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
181
+ activate(priority) {
182
+ return Promise.resolve();
183
+ }
184
+ /**
185
+ * Called when a new version of the twist is deployed to an existing priority.
186
+ *
187
+ * This method should contain migration logic for updating old data structures
188
+ * or setting up new resources that weren't needed by the previous version.
189
+ * It is called with the new version for each active priorityTwist.
190
+ *
191
+ * @returns Promise that resolves when upgrade is complete
192
+ */
193
+ upgrade() {
194
+ return Promise.resolve();
195
+ }
196
+ /**
197
+ * Called when the twist is removed from a priority.
198
+ *
199
+ * This method should contain cleanup logic such as removing webhooks,
200
+ * cleaning up external resources, or performing final data operations.
201
+ *
202
+ * @returns Promise that resolves when deactivation is complete
203
+ */
204
+ deactivate() {
205
+ return Promise.resolve();
206
+ }
207
+ /**
208
+ * Waits for tool initialization to complete.
209
+ * Called automatically by the entrypoint before lifecycle methods.
210
+ * @internal
211
+ */
212
+ async waitForReady() {
213
+ await this.toolShed.waitForReady();
214
+ }
215
+ }
216
+ //# sourceMappingURL=twist.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"twist.js","sourceRoot":"","sources":["../src/twist.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,OAAgB,KAAK;IACH;IAAoB;IAA1C,YAAsB,EAAU,EAAU,QAAkB;QAAtC,OAAE,GAAF,EAAE,CAAQ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,GAAG,CAAC,CAAC;IACrC,CAAC;IAED;;;;OAIG;IACO,KAAK,CAAC,QAAQ;QACtB,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;IACrC,CAAC;IAED;;;;;;;OAOG;IACO,KAAK,CAAC,OAAO,CACrB,QAAkB,EAClB,OAA0B;QAE1B,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;;;;;;;;OAQG;IACH,6DAA6D;IAC7D,QAAQ,CAAC,QAA8B;QACrC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED;;;;;;;;OAQG;IACH,OAAO;QACL,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED;;;;;;;OAOG;IACH,UAAU;QACR,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"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Internal type utilities for SDK implementation.
3
+ *
4
+ * This file contains advanced TypeScript type utilities used internally
5
+ * by the SDK to provide type-safe APIs. Most developers don't need to
6
+ * reference these types directly - they work behind the scenes to power
7
+ * the Twist and Tool APIs.
8
+ *
9
+ * @internal
10
+ */
11
+ import type { Callbacks } from "../tools/callbacks";
12
+ import type { Store } from "../tools/store";
13
+ import type { Tasks } from "../tools/tasks";
14
+ /**
15
+ * Unwraps Promise types to their resolved values.
16
+ * Converts { foo: Promise<string> } to { foo: string }
17
+ */
18
+ export type PromiseValues<T> = {
19
+ [K in keyof T]: T[K] extends Promise<infer U> ? U : T[K];
20
+ };
21
+ /**
22
+ * Extracts the return type from an instance build method.
23
+ */
24
+ export type ExtractBuildReturn<T> = T extends {
25
+ build: (...args: any[]) => infer R;
26
+ } ? R : {};
27
+ /**
28
+ * Built-in tools available to all twists and tools.
29
+ */
30
+ export type BuiltInTools = {
31
+ callbacks: Callbacks;
32
+ store: Store;
33
+ tasks: Tasks;
34
+ };
35
+ /**
36
+ * Infers the complete set of tools available to an twist or tool,
37
+ * combining tools declared in build with built-in tools.
38
+ */
39
+ export type InferTools<T> = PromiseValues<ExtractBuildReturn<T>> & BuiltInTools;
40
+ /**
41
+ * Infers the options type from a constructor's second parameter.
42
+ */
43
+ export type InferOptions<T> = T extends {
44
+ Options: infer O;
45
+ } ? O : unknown;
46
+ /**
47
+ * Function type for building tool dependencies.
48
+ * Used in build methods to request tool instances.
49
+ */
50
+ export type ToolBuilder = <TC extends abstract new (...args: any) => any>(ToolClass: TC, options?: InferOptions<TC>) => Promise<InstanceType<TC>>;
51
+ /**
52
+ * Interface for managing tool initialization and lifecycle.
53
+ * Implemented by the twist runtime to provide tools to twists and tools.
54
+ */
55
+ export interface ToolShed {
56
+ /**
57
+ * Build function for requesting tool dependencies
58
+ */
59
+ build: ToolBuilder;
60
+ /**
61
+ * Whether tools are ready (all promises resolved)
62
+ */
63
+ readonly ready: boolean;
64
+ /**
65
+ * Wait for all tool promises to resolve
66
+ */
67
+ waitForReady(): Promise<void>;
68
+ /**
69
+ * Get resolved tools (throws if not ready)
70
+ */
71
+ getTools<T>(): T;
72
+ }
73
+ /**
74
+ * Represents any non-function type.
75
+ */
76
+ export type NonFunction = Exclude<unknown, (...args: any[]) => any>;
77
+ /**
78
+ * Filters out function properties from a type, keeping only data properties.
79
+ * For arrays, keeps the array structure while filtering functions from elements.
80
+ */
81
+ export type NoFunctions<T> = T extends (...args: any[]) => any ? never : T extends object ? {
82
+ [K in keyof T]: T[K] extends (...args: any[]) => any ? never : T[K];
83
+ } : T;
84
+ /**
85
+ * Extracts method names from a type that are functions.
86
+ * Used to type-check callback method references.
87
+ */
88
+ export type CallbackMethods<T> = {
89
+ [K in keyof T]: T[K] extends (...args: any[]) => any ? K : never;
90
+ }[keyof T];
91
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAM5C;;;GAGG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI;KAC5B,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACzD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAAI,CAAC,SAAS;IAC5C,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,MAAM,CAAC,CAAC;CACpC,GACG,CAAC,GACD,EAAE,CAAC;AAEP;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,aAAa,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC;A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