@plotday/twister 0.21.0 → 0.22.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 (82) hide show
  1. package/dist/common/calendar.d.ts +3 -3
  2. package/dist/common/calendar.d.ts.map +1 -1
  3. package/dist/common/messaging.d.ts +8 -7
  4. package/dist/common/messaging.d.ts.map +1 -1
  5. package/dist/docs/assets/hierarchy.js +1 -1
  6. package/dist/docs/assets/highlight.css +8 -8
  7. package/dist/docs/assets/navigation.js +1 -1
  8. package/dist/docs/assets/search.js +1 -1
  9. package/dist/docs/classes/tool.ITool.html +1 -1
  10. package/dist/docs/classes/tool.Tool.html +1 -1
  11. package/dist/docs/classes/tools_ai.AI.html +3 -3
  12. package/dist/docs/classes/tools_callbacks.Callbacks.html +1 -1
  13. package/dist/docs/classes/tools_integrations.Integrations.html +1 -1
  14. package/dist/docs/classes/tools_network.Network.html +1 -1
  15. package/dist/docs/classes/tools_plot.Plot.html +52 -31
  16. package/dist/docs/classes/tools_store.Store.html +1 -1
  17. package/dist/docs/classes/tools_tasks.Tasks.html +2 -2
  18. package/dist/docs/classes/tools_twists.Twists.html +6 -6
  19. package/dist/docs/classes/twist.Twist.html +1 -1
  20. package/dist/docs/documents/Building_Custom_Tools.html +8 -9
  21. package/dist/docs/documents/Built-in_Tools.html +26 -14
  22. package/dist/docs/documents/Core_Concepts.html +25 -7
  23. package/dist/docs/documents/Getting_Started.html +12 -3
  24. package/dist/docs/documents/Runtime_Environment.html +6 -7
  25. package/dist/docs/enums/plot.ActorType.html +4 -4
  26. package/dist/docs/enums/tools_plot.ActivityAccess.html +6 -6
  27. package/dist/docs/enums/tools_plot.ContactAccess.html +3 -3
  28. package/dist/docs/enums/tools_plot.PriorityAccess.html +3 -3
  29. package/dist/docs/functions/utils_hash.quickHash.html +1 -0
  30. package/dist/docs/hierarchy.html +1 -1
  31. package/dist/docs/index.html +2 -11
  32. package/dist/docs/interfaces/common_calendar.CalendarTool.html +5 -5
  33. package/dist/docs/interfaces/tools_ai.AIRequest.html +4 -4
  34. package/dist/docs/modules/index.html +1 -1
  35. package/dist/docs/modules/plot.html +1 -1
  36. package/dist/docs/modules/tools_plot.html +1 -1
  37. package/dist/docs/modules/utils_hash.html +1 -0
  38. package/dist/docs/modules.html +1 -1
  39. package/dist/docs/types/plot.Activity.html +16 -52
  40. package/dist/docs/types/plot.ActivityCommon.html +20 -0
  41. package/dist/docs/types/plot.ActivityUpdate.html +2 -8
  42. package/dist/docs/types/plot.ActivityWithNotes.html +1 -0
  43. package/dist/docs/types/plot.Actor.html +5 -5
  44. package/dist/docs/types/plot.NewActivity.html +3 -3
  45. package/dist/docs/types/plot.NewActivityWithNotes.html +1 -0
  46. package/dist/docs/types/plot.NewContact.html +4 -4
  47. package/dist/docs/types/plot.NewNote.html +10 -0
  48. package/dist/docs/types/plot.Note.html +7 -0
  49. package/dist/docs/types/plot.NoteType.html +1 -1
  50. package/dist/docs/types/plot.NoteUpdate.html +14 -0
  51. package/dist/docs/types/plot.PickPriorityConfig.html +3 -3
  52. package/dist/docs/types/tools_network.WebhookRequest.html +1 -1
  53. package/dist/docs/types/{tools_plot.ActivityIntentHandler.html → tools_plot.NoteIntentHandler.html} +5 -5
  54. package/dist/llm-docs/common/calendar.d.ts +1 -1
  55. package/dist/llm-docs/common/calendar.d.ts.map +1 -1
  56. package/dist/llm-docs/common/calendar.js +1 -1
  57. package/dist/llm-docs/common/calendar.js.map +1 -1
  58. package/dist/llm-docs/common/messaging.d.ts +1 -1
  59. package/dist/llm-docs/common/messaging.d.ts.map +1 -1
  60. package/dist/llm-docs/common/messaging.js +1 -1
  61. package/dist/llm-docs/common/messaging.js.map +1 -1
  62. package/dist/llm-docs/plot.d.ts +1 -1
  63. package/dist/llm-docs/plot.d.ts.map +1 -1
  64. package/dist/llm-docs/plot.js +1 -1
  65. package/dist/llm-docs/plot.js.map +1 -1
  66. package/dist/llm-docs/tools/plot.d.ts +1 -1
  67. package/dist/llm-docs/tools/plot.d.ts.map +1 -1
  68. package/dist/llm-docs/tools/plot.js +1 -1
  69. package/dist/llm-docs/tools/plot.js.map +1 -1
  70. package/dist/plot.d.ts +75 -33
  71. package/dist/plot.d.ts.map +1 -1
  72. package/dist/plot.js.map +1 -1
  73. package/dist/tools/plot.d.ts +118 -29
  74. package/dist/tools/plot.d.ts.map +1 -1
  75. package/dist/tools/plot.js +4 -4
  76. package/dist/tools/plot.js.map +1 -1
  77. package/dist/utils/hash.d.ts +2 -0
  78. package/dist/utils/hash.d.ts.map +1 -0
  79. package/dist/utils/hash.js +9 -0
  80. package/dist/utils/hash.js.map +1 -0
  81. package/package.json +5 -1
  82. package/dist/docs/documents/Advanced.html +0 -91
@@ -1,7 +1,7 @@
1
1
  <!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>WebhookRequest | Creating Plot Twists</title><link rel="icon" href="../assets/favicon.svg" type="image/svg+xml"/><meta name="description" content="Documentation for Creating Plot Twists"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="/" class="title">Creating Plot Twists</a><div id="tsd-toolbar-links"><a href="https://plot.day">Plot</a><a href="https://github.com/plotday/plot">GitHub</a><a href="https://www.npmjs.com/package/@plotday/twister">NPM</a></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="../modules/tools_network.html">tools/network</a></li><li><a href="" aria-current="page">WebhookRequest</a></li></ul><h1>Type Alias WebhookRequest</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Represents an incoming webhook request.</p>
2
2
  <p>This object is passed to webhook callback functions and contains all
3
3
  the information about the HTTP request that triggered the webhook.</p>
4
- </div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example">Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-2">async</span><span class="hl-1"> </span><span class="hl-6">onWebhookReceived</span><span class="hl-1">(</span><span class="hl-2">request</span><span class="hl-1">: </span><span class="hl-2">WebhookRequest</span><span class="hl-1">, </span><span class="hl-2">context</span><span class="hl-1">: </span><span class="hl-2">any</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-2">console</span><span class="hl-1">.</span><span class="hl-6">log</span><span class="hl-1">(</span><span class="hl-3">`</span><span class="hl-4">${</span><span class="hl-2">request</span><span class="hl-13">.</span><span class="hl-2">method</span><span class="hl-4">}</span><span class="hl-3"> request received`</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-2">console</span><span class="hl-1">.</span><span class="hl-6">log</span><span class="hl-1">(</span><span class="hl-3">&quot;Headers:&quot;</span><span class="hl-1">, </span><span class="hl-2">request</span><span class="hl-1">.</span><span class="hl-2">headers</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-2">console</span><span class="hl-1">.</span><span class="hl-6">log</span><span class="hl-1">(</span><span class="hl-3">&quot;Query params:&quot;</span><span class="hl-1">, </span><span class="hl-2">request</span><span class="hl-1">.</span><span class="hl-2">params</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-2">console</span><span class="hl-1">.</span><span class="hl-6">log</span><span class="hl-1">(</span><span class="hl-3">&quot;Body:&quot;</span><span class="hl-1">, </span><span class="hl-2">request</span><span class="hl-1">.</span><span class="hl-2">body</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-2">console</span><span class="hl-1">.</span><span class="hl-6">log</span><span class="hl-1">(</span><span class="hl-3">&quot;Context:&quot;</span><span class="hl-1">, </span><span class="hl-2">context</span><span class="hl-1">);</span><br/><span class="hl-1">}</span>
4
+ </div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example">Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-2">async</span><span class="hl-1"> </span><span class="hl-6">onWebhookReceived</span><span class="hl-1">(</span><span class="hl-2">request</span><span class="hl-1">: </span><span class="hl-2">WebhookRequest</span><span class="hl-1">, </span><span class="hl-2">context</span><span class="hl-1">: </span><span class="hl-2">any</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-2">console</span><span class="hl-1">.</span><span class="hl-6">log</span><span class="hl-1">(</span><span class="hl-3">`</span><span class="hl-4">${</span><span class="hl-2">request</span><span class="hl-14">.</span><span class="hl-2">method</span><span class="hl-4">}</span><span class="hl-3"> request received`</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-2">console</span><span class="hl-1">.</span><span class="hl-6">log</span><span class="hl-1">(</span><span class="hl-3">&quot;Headers:&quot;</span><span class="hl-1">, </span><span class="hl-2">request</span><span class="hl-1">.</span><span class="hl-2">headers</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-2">console</span><span class="hl-1">.</span><span class="hl-6">log</span><span class="hl-1">(</span><span class="hl-3">&quot;Query params:&quot;</span><span class="hl-1">, </span><span class="hl-2">request</span><span class="hl-1">.</span><span class="hl-2">params</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-2">console</span><span class="hl-1">.</span><span class="hl-6">log</span><span class="hl-1">(</span><span class="hl-3">&quot;Body:&quot;</span><span class="hl-1">, </span><span class="hl-2">request</span><span class="hl-1">.</span><span class="hl-2">body</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-2">console</span><span class="hl-1">.</span><span class="hl-6">log</span><span class="hl-1">(</span><span class="hl-3">&quot;Context:&quot;</span><span class="hl-1">, </span><span class="hl-2">context</span><span class="hl-1">);</span><br/><span class="hl-1">}</span>
5
5
  </code><button type="button">Copy</button></pre>
6
6
 
7
7
  </div></div></section><div class="tsd-signature"><span class="tsd-signature-keyword">type</span> <span class="tsd-kind-type-alias">WebhookRequest</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-symbol">{</span><br/>    <a class="tsd-kind-property" href="#method">method</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>    <a class="tsd-kind-property" href="#headers">headers</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">;</span><br/>    <a class="tsd-kind-property" href="#params">params</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">;</span><br/>    <a class="tsd-kind-property" href="#body">body</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/plotday/plot/blob/main/twist/twister/src/tools/network.ts#L21">tools/network.ts:21</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h5 class="tsd-index-heading uppercase">Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="#method" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>method</span></a>
@@ -1,9 +1,9 @@
1
- <!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>ActivityIntentHandler | Creating Plot Twists</title><link rel="icon" href="../assets/favicon.svg" type="image/svg+xml"/><meta name="description" content="Documentation for Creating Plot Twists"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="/" class="title">Creating Plot Twists</a><div id="tsd-toolbar-links"><a href="https://plot.day">Plot</a><a href="https://github.com/plotday/plot">GitHub</a><a href="https://www.npmjs.com/package/@plotday/twister">NPM</a></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="../modules/tools_plot.html">tools/plot</a></li><li><a href="" aria-current="page">ActivityIntentHandler</a></li></ul><h1>Type Alias ActivityIntentHandler</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Intent handler for activity mentions.
1
+ <!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>NoteIntentHandler | Creating Plot Twists</title><link rel="icon" href="../assets/favicon.svg" type="image/svg+xml"/><meta name="description" content="Documentation for Creating Plot Twists"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="/" class="title">Creating Plot Twists</a><div id="tsd-toolbar-links"><a href="https://plot.day">Plot</a><a href="https://github.com/plotday/plot">GitHub</a><a href="https://www.npmjs.com/package/@plotday/twister">NPM</a></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="../modules/tools_plot.html">tools/plot</a></li><li><a href="" aria-current="page">NoteIntentHandler</a></li></ul><h1>Type Alias NoteIntentHandler</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Intent handler for activity mentions.
2
2
  Defines how the twist should respond when mentioned in an activity.</p>
3
- </div></section><div class="tsd-signature"><span class="tsd-signature-keyword">type</span> <span class="tsd-kind-type-alias">ActivityIntentHandler</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-symbol">{</span><br/>    <a class="tsd-kind-property" href="#description">description</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>    <a class="tsd-kind-property" href="#examples">examples</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">;</span><br/>    <a class="tsd-kind-property" href="#handler">handler</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">activity</span><span class="tsd-signature-symbol">:</span> <a href="plot.Activity.html" class="tsd-signature-type tsd-kind-type-alias">Activity</a><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=&gt;</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/plotday/plot/blob/main/twist/twister/src/tools/plot.ts#L54">tools/plot.ts:54</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h5 class="tsd-index-heading uppercase">Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="#description" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>description</span></a>
3
+ </div></section><div class="tsd-signature"><span class="tsd-signature-keyword">type</span> <span class="tsd-kind-type-alias">NoteIntentHandler</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-symbol">{</span><br/>    <a class="tsd-kind-property" href="#description">description</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>    <a class="tsd-kind-property" href="#examples">examples</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">;</span><br/>    <a class="tsd-kind-property" href="#handler">handler</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">note</span><span class="tsd-signature-symbol">:</span> <a href="plot.Note.html" class="tsd-signature-type tsd-kind-type-alias">Note</a><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=&gt;</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/plotday/plot/blob/main/twist/twister/src/tools/plot.ts#L57">tools/plot.ts:57</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h5 class="tsd-index-heading uppercase">Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="#description" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>description</span></a>
4
4
  <a href="#examples" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>examples</span></a>
5
5
  <a href="#handler" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>handler</span></a>
6
6
  </div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Properties</h2></summary><section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="description"><span>description</span><a href="#description" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">description</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Human-readable description of what this intent handles</p>
7
- </div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/plotday/plot/blob/main/twist/twister/src/tools/plot.ts#L56">tools/plot.ts:56</a></li></ul></aside></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="examples"><span>examples</span><a href="#examples" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">examples</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></div><div class="tsd-comment tsd-typography"><p>Example phrases or activity content that would match this intent</p>
8
- </div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/plotday/plot/blob/main/twist/twister/src/tools/plot.ts#L58">tools/plot.ts:58</a></li></ul></aside></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="handler"><span>handler</span><a href="#handler" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">handler</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">activity</span><span class="tsd-signature-symbol">:</span> <a href="plot.Activity.html" class="tsd-signature-type tsd-kind-type-alias">Activity</a><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=&gt;</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></div><div class="tsd-comment tsd-typography"><p>The function to call when this intent is matched</p>
9
- </div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/plotday/plot/blob/main/twist/twister/src/tools/plot.ts#L60">tools/plot.ts:60</a></li></ul></aside></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#description"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>description</span></a><a href="#examples"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>examples</span></a><a href="#handler"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>handler</span></a></div></details></div></details></div><div class="site-menu"><nav id="tsd-sidebar-links" class="tsd-navigation"><a href="https://plot.day" class="tsd-nav-link">Plot</a><a href="https://github.com/plotday/plot" class="tsd-nav-link">GitHub</a><a href="https://www.npmjs.com/package/@plotday/twister" class="tsd-nav-link">NPM</a></nav><nav class="tsd-navigation"><a href="../modules.html">Creating Plot Twists</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
7
+ </div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/plotday/plot/blob/main/twist/twister/src/tools/plot.ts#L59">tools/plot.ts:59</a></li></ul></aside></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="examples"><span>examples</span><a href="#examples" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">examples</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></div><div class="tsd-comment tsd-typography"><p>Example phrases or activity content that would match this intent</p>
8
+ </div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/plotday/plot/blob/main/twist/twister/src/tools/plot.ts#L61">tools/plot.ts:61</a></li></ul></aside></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="handler"><span>handler</span><a href="#handler" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">handler</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">note</span><span class="tsd-signature-symbol">:</span> <a href="plot.Note.html" class="tsd-signature-type tsd-kind-type-alias">Note</a><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=&gt;</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></div><div class="tsd-comment tsd-typography"><p>The function to call when this intent is matched</p>
9
+ </div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/plotday/plot/blob/main/twist/twister/src/tools/plot.ts#L63">tools/plot.ts:63</a></li></ul></aside></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#description"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>description</span></a><a href="#examples"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>examples</span></a><a href="#handler"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>handler</span></a></div></details></div></details></div><div class="site-menu"><nav id="tsd-sidebar-links" class="tsd-navigation"><a href="https://plot.day" class="tsd-nav-link">Plot</a><a href="https://github.com/plotday/plot" class="tsd-nav-link">GitHub</a><a href="https://www.npmjs.com/package/@plotday/twister" class="tsd-nav-link">NPM</a></nav><nav class="tsd-navigation"><a href="../modules.html">Creating Plot Twists</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
@@ -4,6 +4,6 @@
4
4
  * This file is auto-generated during build. Do not edit manually.
5
5
  * Generated from: prebuild.ts
6
6
  */
7
- declare const _default: "import type { Activity, ActivityLink } from \"../index\";\n\n/**\n * Represents successful calendar authorization.\n *\n * Returned by calendar tools when authorization completes successfully.\n * The auth token is an opaque identifier that can be used for subsequent\n * calendar operations.\n */\nexport type CalendarAuth = {\n /** Opaque token for calendar operations */\n authToken: string;\n};\n\n/**\n * Represents a calendar from an external calendar service.\n *\n * Contains metadata about a specific calendar that can be synced\n * with Plot. Different calendar providers may have additional\n * provider-specific properties.\n */\nexport interface Calendar {\n /** Unique identifier for the calendar within the provider */\n id: string;\n /** Human-readable name of the calendar */\n name: string;\n /** Optional description or additional details about the calendar */\n description: string | null;\n /** Whether this is the user's primary/default calendar */\n primary: boolean;\n}\n\n/**\n * Configuration options for calendar synchronization.\n *\n * Controls the time range and other parameters for calendar sync operations.\n * Used to limit sync scope and optimize performance.\n */\nexport interface SyncOptions {\n /** Earliest date to sync events from (inclusive) */\n timeMin?: Date;\n /** Latest date to sync events to (exclusive) */\n timeMax?: Date;\n}\n\n/**\n * Base interface for calendar integration tools.\n *\n * Defines the standard operations that all calendar tools must implement\n * to integrate with external calendar services like Google Calendar,\n * Outlook Calendar, etc.\n *\n * **Implementation Pattern:**\n * 1. Request an ActivityLink for authorization\n * 2. Create an Activity with the ActivityLink to prompt user\n * 3. Receive a CalendarAuth in the specified callback\n * 4. Fetch list of available calendars\n * 5. Start sync for selected calendars\n * 6. Process incoming events via callbacks\n *\n * @example\n * ```typescript\n * // Typical calendar integration flow\n * class MyCalendarTwist extends Twist {\n * private googleCalendar: GoogleCalendar;\n *\n * async activate() {\n * // Step 1: Request authorization\n * const authLink = await this.googleCalendar.requestAuth(\"onAuthComplete\");\n * await this.plot.createActivity({\n * type: ActivityType.Action,\n * title: \"Connect Google Calendar\",\n * links: [authLink],\n * });\n * }\n *\n * async onAuthComplete(auth: CalendarAuth) {\n * // Step 2: Get available calendars\n * const calendars = await this.googleCalendar.getCalendars(auth.authToken);\n *\n * // Step 3: Start sync for primary calendar\n * const primaryCalendar = calendars.find(c => c.primary);\n * if (primaryCalendar) {\n * await this.googleCalendar.startSync(\n * auth.authToken,\n * primaryCalendar.id,\n * \"onCalendarEvent\"\n * );\n * }\n * }\n *\n * async onCalendarEvent(activity: Activity) {\n * // Step 4: Process synced events\n * await this.plot.createActivity(activity);\n * }\n * }\n * ```\n */\nexport interface CalendarTool {\n /**\n * Initiates the authorization flow for the calendar service.\n *\n * @param callback - Function receiving (auth, ...extraArgs) when auth completes\n * @param extraArgs - Additional arguments to pass to the callback (type-checked)\n * @returns Promise resolving to an ActivityLink to initiate the auth flow\n */\n requestAuth<TCallback extends (auth: CalendarAuth, ...args: any[]) => any>(\n callback: TCallback,\n ...extraArgs: TCallback extends (auth: any, ...rest: infer R) => any\n ? R\n : []\n ): Promise<ActivityLink>;\n\n /**\n * Retrieves the list of calendars accessible to the authenticated user.\n *\n * Returns metadata for all calendars the user has access to, including\n * their primary calendar and any shared calendars. This list can be\n * presented to users for calendar selection.\n *\n * @param authToken - Authorization token from successful auth flow\n * @returns Promise resolving to array of available calendars\n * @throws When the auth token is invalid or expired\n */\n getCalendars(authToken: string): Promise<Calendar[]>;\n\n /**\n * Begins synchronizing events from a specific calendar.\n *\n * Sets up real-time sync for the specified calendar, including initial\n * event import and ongoing change notifications. The callback function\n * will be invoked for each synced event.\n *\n * @param authToken - Authorization token for calendar access\n * @param calendarId - ID of the calendar to sync\n * @param callback - Function receiving (activity, ...extraArgs) for each synced event\n * @param extraArgs - Additional arguments to pass to the callback (type-checked)\n * @returns Promise that resolves when sync setup is complete\n * @throws When auth token is invalid or calendar doesn't exist\n */\n startSync<TCallback extends (activity: Activity, ...args: any[]) => any>(\n authToken: string,\n calendarId: string,\n callback: TCallback,\n ...extraArgs: TCallback extends (activity: any, ...rest: infer R) => any\n ? R\n : []\n ): Promise<void>;\n\n /**\n * Stops synchronizing events from a specific calendar.\n *\n * Disables real-time sync and cleans up any webhooks or polling\n * mechanisms for the specified calendar. No further events will\n * be synced after this call.\n *\n * @param authToken - Authorization token for calendar access\n * @param calendarId - ID of the calendar to stop syncing\n * @returns Promise that resolves when sync is stopped\n */\n stopSync(authToken: string, calendarId: string): Promise<void>;\n}\n";
7
+ declare const _default: "import type { ActivityLink, NewActivityWithNotes } from \"../index\";\n\n/**\n * Represents successful calendar authorization.\n *\n * Returned by calendar tools when authorization completes successfully.\n * The auth token is an opaque identifier that can be used for subsequent\n * calendar operations.\n */\nexport type CalendarAuth = {\n /** Opaque token for calendar operations */\n authToken: string;\n};\n\n/**\n * Represents a calendar from an external calendar service.\n *\n * Contains metadata about a specific calendar that can be synced\n * with Plot. Different calendar providers may have additional\n * provider-specific properties.\n */\nexport interface Calendar {\n /** Unique identifier for the calendar within the provider */\n id: string;\n /** Human-readable name of the calendar */\n name: string;\n /** Optional description or additional details about the calendar */\n description: string | null;\n /** Whether this is the user's primary/default calendar */\n primary: boolean;\n}\n\n/**\n * Configuration options for calendar synchronization.\n *\n * Controls the time range and other parameters for calendar sync operations.\n * Used to limit sync scope and optimize performance.\n */\nexport interface SyncOptions {\n /** Earliest date to sync events from (inclusive) */\n timeMin?: Date;\n /** Latest date to sync events to (exclusive) */\n timeMax?: Date;\n}\n\n/**\n * Base interface for calendar integration tools.\n *\n * Defines the standard operations that all calendar tools must implement\n * to integrate with external calendar services like Google Calendar,\n * Outlook Calendar, etc.\n *\n * **Implementation Pattern:**\n * 1. Request an ActivityLink for authorization\n * 2. Create an Activity with the ActivityLink to prompt user\n * 3. Receive a CalendarAuth in the specified callback\n * 4. Fetch list of available calendars\n * 5. Start sync for selected calendars\n * 6. Process incoming events via callbacks\n *\n * @example\n * ```typescript\n * // Typical calendar integration flow\n * class MyCalendarTwist extends Twist {\n * private googleCalendar: GoogleCalendar;\n *\n * async activate() {\n * // Step 1: Request authorization\n * const authLink = await this.googleCalendar.requestAuth(\"onAuthComplete\");\n * await this.plot.createActivity({\n * type: ActivityType.Action,\n * title: \"Connect Google Calendar\",\n * links: [authLink],\n * });\n * }\n *\n * async onAuthComplete(auth: CalendarAuth) {\n * // Step 2: Get available calendars\n * const calendars = await this.googleCalendar.getCalendars(auth.authToken);\n *\n * // Step 3: Start sync for primary calendar\n * const primaryCalendar = calendars.find(c => c.primary);\n * if (primaryCalendar) {\n * await this.googleCalendar.startSync(\n * auth.authToken,\n * primaryCalendar.id,\n * \"onCalendarEvent\"\n * );\n * }\n * }\n *\n * async onCalendarEvent(activity: NewActivityWithNotes) {\n * // Step 4: Process synced events\n * await this.plot.createActivity(activity);\n * }\n * }\n * ```\n */\nexport interface CalendarTool {\n /**\n * Initiates the authorization flow for the calendar service.\n *\n * @param callback - Function receiving (auth, ...extraArgs) when auth completes\n * @param extraArgs - Additional arguments to pass to the callback (type-checked)\n * @returns Promise resolving to an ActivityLink to initiate the auth flow\n */\n requestAuth<TCallback extends (auth: CalendarAuth, ...args: any[]) => any>(\n callback: TCallback,\n ...extraArgs: TCallback extends (auth: any, ...rest: infer R) => any\n ? R\n : []\n ): Promise<ActivityLink>;\n\n /**\n * Retrieves the list of calendars accessible to the authenticated user.\n *\n * Returns metadata for all calendars the user has access to, including\n * their primary calendar and any shared calendars. This list can be\n * presented to users for calendar selection.\n *\n * @param authToken - Authorization token from successful auth flow\n * @returns Promise resolving to array of available calendars\n * @throws When the auth token is invalid or expired\n */\n getCalendars(authToken: string): Promise<Calendar[]>;\n\n /**\n * Begins synchronizing events from a specific calendar.\n *\n * Sets up real-time sync for the specified calendar, including initial\n * event import and ongoing change notifications. The callback function\n * will be invoked for each synced event.\n *\n * @param authToken - Authorization token for calendar access\n * @param calendarId - ID of the calendar to sync\n * @param callback - Function receiving (activity, ...extraArgs) for each synced event\n * @param extraArgs - Additional arguments to pass to the callback (type-checked)\n * @returns Promise that resolves when sync setup is complete\n * @throws When auth token is invalid or calendar doesn't exist\n */\n startSync<\n TCallback extends (activity: NewActivityWithNotes, ...args: any[]) => any\n >(\n authToken: string,\n calendarId: string,\n callback: TCallback,\n ...extraArgs: TCallback extends (activity: any, ...rest: infer R) => any\n ? R\n : []\n ): Promise<void>;\n\n /**\n * Stops synchronizing events from a specific calendar.\n *\n * Disables real-time sync and cleans up any webhooks or polling\n * mechanisms for the specified calendar. No further events will\n * be synced after this call.\n *\n * @param authToken - Authorization token for calendar access\n * @param calendarId - ID of the calendar to stop syncing\n * @returns Promise that resolves when sync is stopped\n */\n stopSync(authToken: string, calendarId: string): Promise<void>;\n}\n";
8
8
  export default _default;
9
9
  //# sourceMappingURL=calendar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../src/llm-docs/common/calendar.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;wBAEY,8nLAA8nL;AAA7oL,wBAA8oL"}
1
+ {"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../src/llm-docs/common/calendar.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;wBAEY,4qLAA4qL;AAA3rL,wBAA4rL"}
@@ -4,5 +4,5 @@
4
4
  * This file is auto-generated during build. Do not edit manually.
5
5
  * Generated from: prebuild.ts
6
6
  */
7
- export default "import type { Activity, ActivityLink } from \"../index\";\n\n/**\n * Represents successful calendar authorization.\n *\n * Returned by calendar tools when authorization completes successfully.\n * The auth token is an opaque identifier that can be used for subsequent\n * calendar operations.\n */\nexport type CalendarAuth = {\n /** Opaque token for calendar operations */\n authToken: string;\n};\n\n/**\n * Represents a calendar from an external calendar service.\n *\n * Contains metadata about a specific calendar that can be synced\n * with Plot. Different calendar providers may have additional\n * provider-specific properties.\n */\nexport interface Calendar {\n /** Unique identifier for the calendar within the provider */\n id: string;\n /** Human-readable name of the calendar */\n name: string;\n /** Optional description or additional details about the calendar */\n description: string | null;\n /** Whether this is the user's primary/default calendar */\n primary: boolean;\n}\n\n/**\n * Configuration options for calendar synchronization.\n *\n * Controls the time range and other parameters for calendar sync operations.\n * Used to limit sync scope and optimize performance.\n */\nexport interface SyncOptions {\n /** Earliest date to sync events from (inclusive) */\n timeMin?: Date;\n /** Latest date to sync events to (exclusive) */\n timeMax?: Date;\n}\n\n/**\n * Base interface for calendar integration tools.\n *\n * Defines the standard operations that all calendar tools must implement\n * to integrate with external calendar services like Google Calendar,\n * Outlook Calendar, etc.\n *\n * **Implementation Pattern:**\n * 1. Request an ActivityLink for authorization\n * 2. Create an Activity with the ActivityLink to prompt user\n * 3. Receive a CalendarAuth in the specified callback\n * 4. Fetch list of available calendars\n * 5. Start sync for selected calendars\n * 6. Process incoming events via callbacks\n *\n * @example\n * ```typescript\n * // Typical calendar integration flow\n * class MyCalendarTwist extends Twist {\n * private googleCalendar: GoogleCalendar;\n *\n * async activate() {\n * // Step 1: Request authorization\n * const authLink = await this.googleCalendar.requestAuth(\"onAuthComplete\");\n * await this.plot.createActivity({\n * type: ActivityType.Action,\n * title: \"Connect Google Calendar\",\n * links: [authLink],\n * });\n * }\n *\n * async onAuthComplete(auth: CalendarAuth) {\n * // Step 2: Get available calendars\n * const calendars = await this.googleCalendar.getCalendars(auth.authToken);\n *\n * // Step 3: Start sync for primary calendar\n * const primaryCalendar = calendars.find(c => c.primary);\n * if (primaryCalendar) {\n * await this.googleCalendar.startSync(\n * auth.authToken,\n * primaryCalendar.id,\n * \"onCalendarEvent\"\n * );\n * }\n * }\n *\n * async onCalendarEvent(activity: Activity) {\n * // Step 4: Process synced events\n * await this.plot.createActivity(activity);\n * }\n * }\n * ```\n */\nexport interface CalendarTool {\n /**\n * Initiates the authorization flow for the calendar service.\n *\n * @param callback - Function receiving (auth, ...extraArgs) when auth completes\n * @param extraArgs - Additional arguments to pass to the callback (type-checked)\n * @returns Promise resolving to an ActivityLink to initiate the auth flow\n */\n requestAuth<TCallback extends (auth: CalendarAuth, ...args: any[]) => any>(\n callback: TCallback,\n ...extraArgs: TCallback extends (auth: any, ...rest: infer R) => any\n ? R\n : []\n ): Promise<ActivityLink>;\n\n /**\n * Retrieves the list of calendars accessible to the authenticated user.\n *\n * Returns metadata for all calendars the user has access to, including\n * their primary calendar and any shared calendars. This list can be\n * presented to users for calendar selection.\n *\n * @param authToken - Authorization token from successful auth flow\n * @returns Promise resolving to array of available calendars\n * @throws When the auth token is invalid or expired\n */\n getCalendars(authToken: string): Promise<Calendar[]>;\n\n /**\n * Begins synchronizing events from a specific calendar.\n *\n * Sets up real-time sync for the specified calendar, including initial\n * event import and ongoing change notifications. The callback function\n * will be invoked for each synced event.\n *\n * @param authToken - Authorization token for calendar access\n * @param calendarId - ID of the calendar to sync\n * @param callback - Function receiving (activity, ...extraArgs) for each synced event\n * @param extraArgs - Additional arguments to pass to the callback (type-checked)\n * @returns Promise that resolves when sync setup is complete\n * @throws When auth token is invalid or calendar doesn't exist\n */\n startSync<TCallback extends (activity: Activity, ...args: any[]) => any>(\n authToken: string,\n calendarId: string,\n callback: TCallback,\n ...extraArgs: TCallback extends (activity: any, ...rest: infer R) => any\n ? R\n : []\n ): Promise<void>;\n\n /**\n * Stops synchronizing events from a specific calendar.\n *\n * Disables real-time sync and cleans up any webhooks or polling\n * mechanisms for the specified calendar. No further events will\n * be synced after this call.\n *\n * @param authToken - Authorization token for calendar access\n * @param calendarId - ID of the calendar to stop syncing\n * @returns Promise that resolves when sync is stopped\n */\n stopSync(authToken: string, calendarId: string): Promise<void>;\n}\n";
7
+ export default "import type { ActivityLink, NewActivityWithNotes } from \"../index\";\n\n/**\n * Represents successful calendar authorization.\n *\n * Returned by calendar tools when authorization completes successfully.\n * The auth token is an opaque identifier that can be used for subsequent\n * calendar operations.\n */\nexport type CalendarAuth = {\n /** Opaque token for calendar operations */\n authToken: string;\n};\n\n/**\n * Represents a calendar from an external calendar service.\n *\n * Contains metadata about a specific calendar that can be synced\n * with Plot. Different calendar providers may have additional\n * provider-specific properties.\n */\nexport interface Calendar {\n /** Unique identifier for the calendar within the provider */\n id: string;\n /** Human-readable name of the calendar */\n name: string;\n /** Optional description or additional details about the calendar */\n description: string | null;\n /** Whether this is the user's primary/default calendar */\n primary: boolean;\n}\n\n/**\n * Configuration options for calendar synchronization.\n *\n * Controls the time range and other parameters for calendar sync operations.\n * Used to limit sync scope and optimize performance.\n */\nexport interface SyncOptions {\n /** Earliest date to sync events from (inclusive) */\n timeMin?: Date;\n /** Latest date to sync events to (exclusive) */\n timeMax?: Date;\n}\n\n/**\n * Base interface for calendar integration tools.\n *\n * Defines the standard operations that all calendar tools must implement\n * to integrate with external calendar services like Google Calendar,\n * Outlook Calendar, etc.\n *\n * **Implementation Pattern:**\n * 1. Request an ActivityLink for authorization\n * 2. Create an Activity with the ActivityLink to prompt user\n * 3. Receive a CalendarAuth in the specified callback\n * 4. Fetch list of available calendars\n * 5. Start sync for selected calendars\n * 6. Process incoming events via callbacks\n *\n * @example\n * ```typescript\n * // Typical calendar integration flow\n * class MyCalendarTwist extends Twist {\n * private googleCalendar: GoogleCalendar;\n *\n * async activate() {\n * // Step 1: Request authorization\n * const authLink = await this.googleCalendar.requestAuth(\"onAuthComplete\");\n * await this.plot.createActivity({\n * type: ActivityType.Action,\n * title: \"Connect Google Calendar\",\n * links: [authLink],\n * });\n * }\n *\n * async onAuthComplete(auth: CalendarAuth) {\n * // Step 2: Get available calendars\n * const calendars = await this.googleCalendar.getCalendars(auth.authToken);\n *\n * // Step 3: Start sync for primary calendar\n * const primaryCalendar = calendars.find(c => c.primary);\n * if (primaryCalendar) {\n * await this.googleCalendar.startSync(\n * auth.authToken,\n * primaryCalendar.id,\n * \"onCalendarEvent\"\n * );\n * }\n * }\n *\n * async onCalendarEvent(activity: NewActivityWithNotes) {\n * // Step 4: Process synced events\n * await this.plot.createActivity(activity);\n * }\n * }\n * ```\n */\nexport interface CalendarTool {\n /**\n * Initiates the authorization flow for the calendar service.\n *\n * @param callback - Function receiving (auth, ...extraArgs) when auth completes\n * @param extraArgs - Additional arguments to pass to the callback (type-checked)\n * @returns Promise resolving to an ActivityLink to initiate the auth flow\n */\n requestAuth<TCallback extends (auth: CalendarAuth, ...args: any[]) => any>(\n callback: TCallback,\n ...extraArgs: TCallback extends (auth: any, ...rest: infer R) => any\n ? R\n : []\n ): Promise<ActivityLink>;\n\n /**\n * Retrieves the list of calendars accessible to the authenticated user.\n *\n * Returns metadata for all calendars the user has access to, including\n * their primary calendar and any shared calendars. This list can be\n * presented to users for calendar selection.\n *\n * @param authToken - Authorization token from successful auth flow\n * @returns Promise resolving to array of available calendars\n * @throws When the auth token is invalid or expired\n */\n getCalendars(authToken: string): Promise<Calendar[]>;\n\n /**\n * Begins synchronizing events from a specific calendar.\n *\n * Sets up real-time sync for the specified calendar, including initial\n * event import and ongoing change notifications. The callback function\n * will be invoked for each synced event.\n *\n * @param authToken - Authorization token for calendar access\n * @param calendarId - ID of the calendar to sync\n * @param callback - Function receiving (activity, ...extraArgs) for each synced event\n * @param extraArgs - Additional arguments to pass to the callback (type-checked)\n * @returns Promise that resolves when sync setup is complete\n * @throws When auth token is invalid or calendar doesn't exist\n */\n startSync<\n TCallback extends (activity: NewActivityWithNotes, ...args: any[]) => any\n >(\n authToken: string,\n calendarId: string,\n callback: TCallback,\n ...extraArgs: TCallback extends (activity: any, ...rest: infer R) => any\n ? R\n : []\n ): Promise<void>;\n\n /**\n * Stops synchronizing events from a specific calendar.\n *\n * Disables real-time sync and cleans up any webhooks or polling\n * mechanisms for the specified calendar. No further events will\n * be synced after this call.\n *\n * @param authToken - Authorization token for calendar access\n * @param calendarId - ID of the calendar to stop syncing\n * @returns Promise that resolves when sync is stopped\n */\n stopSync(authToken: string, calendarId: string): Promise<void>;\n}\n";
8
8
  //# sourceMappingURL=calendar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../../src/llm-docs/common/calendar.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAe,8nLAA8nL,CAAC"}
1
+ {"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../../src/llm-docs/common/calendar.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAe,4qLAA4qL,CAAC"}
@@ -4,6 +4,6 @@
4
4
  * This file is auto-generated during build. Do not edit manually.
5
5
  * Generated from: prebuild.ts
6
6
  */
7
- declare const _default: "import type { Activity, ActivityLink } from \"../index\";\n\n/**\n * Represents a successful messaging service authorization.\n *\n * Returned by messaging tools when authorization completes successfully.\n * The auth token is an opaque identifier that can be used for subsequent\n * messaging operations.\n */\nexport type MessagingAuth = {\n /** Opaque token for messaging operations */\n authToken: string;\n};\n\n/**\n * Represents a channel from an external messaging service.\n *\n * Contains metadata about a specific channel that can be synced\n * with Plot.\n */\nexport interface MessageChannel {\n /** Unique identifier for the channel within the provider */\n id: string;\n /** Human-readable name of the channel (e.g., \"Inbox\", \"#general\", \"My Team Thread\") */\n name: string;\n /** Optional description or additional details about the channel */\n description: string | null;\n /** Whether this is the user's primary/default channel (e.g. email inbox) */\n primary: boolean;\n}\n\n/**\n * Configuration options for messaging synchronization.\n *\n * Controls the time range and other parameters for messaging sync operations.\n * Used to limit sync scope and optimize performance.\n */\nexport interface MessageSyncOptions {\n /** Earliest date to sync events from (inclusive) */\n timeMin?: Date;\n}\n\n/**\n * Base interface for email and chat integration tools.\n *\n * All synced messages/emails are converted to Activity.\n */\nexport interface MessagingTool {\n /**\n * Initiates the authorization flow for the service.\n *\n * @param callback - Function receiving (auth, ...extraArgs) when auth completes\n * @param extraArgs - Additional arguments to pass to the callback (type-checked)\n * @returns Promise resolving to an ActivityLink to initiate the auth flow\n */\n requestAuth<TCallback extends (auth: MessagingAuth, ...args: any[]) => any>(\n callback: TCallback,\n ...extraArgs: TCallback extends (auth: any, ...rest: infer R) => any\n ? R\n : []\n ): Promise<ActivityLink>;\n\n /**\n * Retrieves the list of conversation channels (inboxes, channels) accessible to the user.\n *\n * @param authToken - Authorization token from successful auth flow\n * @returns Promise resolving to array of available conversation channels\n */\n getChannels(authToken: string): Promise<MessageChannel[]>;\n\n /**\n * Begins synchronizing messages from a specific channel.\n *\n * Messages are converted to an array of Activity represent the email/chat thread.\n * The meta.source is unique and stable per message. The meta.source of the first\n * Activity in the thread can be used as a thread identifier.\n *\n * @param authToken - Authorization token for access\n * @param channelId - ID of the channel (e.g., channel, inbox) to sync\n * @param callback - Function receiving (activity, ...extraArgs) for each synced message/thread\n * @param options - Optional configuration for limiting the sync scope (e.g., time range)\n * @param extraArgs - Additional arguments to pass to the callback (type-checked)\n * @returns Promise that resolves when sync setup is complete\n */\n startSync<TCallback extends (thread: Activity[], ...args: any[]) => any>(\n authToken: string,\n channelId: string,\n callback: TCallback,\n options?: MessageSyncOptions,\n ...extraArgs: TCallback extends (thread: any, ...rest: infer R) => any\n ? R\n : []\n ): Promise<void>;\n\n /**\n * Stops synchronizing messages from a specific channel.\n *\n * @param authToken - Authorization token for access\n * @param channelId - ID of the channel to stop syncing\n * @returns Promise that resolves when sync is stopped\n */\n stopSync(authToken: string, channelId: string): Promise<void>;\n}\n";
7
+ declare const _default: "import type { ActivityLink, NewActivityWithNotes } from \"../index\";\n\n/**\n * Represents a successful messaging service authorization.\n *\n * Returned by messaging tools when authorization completes successfully.\n * The auth token is an opaque identifier that can be used for subsequent\n * messaging operations.\n */\nexport type MessagingAuth = {\n /** Opaque token for messaging operations */\n authToken: string;\n};\n\n/**\n * Represents a channel from an external messaging service.\n *\n * Contains metadata about a specific channel that can be synced\n * with Plot.\n */\nexport interface MessageChannel {\n /** Unique identifier for the channel within the provider */\n id: string;\n /** Human-readable name of the channel (e.g., \"Inbox\", \"#general\", \"My Team Thread\") */\n name: string;\n /** Optional description or additional details about the channel */\n description: string | null;\n /** Whether this is the user's primary/default channel (e.g. email inbox) */\n primary: boolean;\n}\n\n/**\n * Configuration options for messaging synchronization.\n *\n * Controls the time range and other parameters for messaging sync operations.\n * Used to limit sync scope and optimize performance.\n */\nexport interface MessageSyncOptions {\n /** Earliest date to sync events from (inclusive) */\n timeMin?: Date;\n}\n\n/**\n * Base interface for email and chat integration tools.\n *\n * All synced messages/emails are converted to ActivityWithNotes objects.\n * Each email thread or chat conversation becomes an Activity with Notes for each message.\n */\nexport interface MessagingTool {\n /**\n * Initiates the authorization flow for the service.\n *\n * @param callback - Function receiving (auth, ...extraArgs) when auth completes\n * @param extraArgs - Additional arguments to pass to the callback (type-checked)\n * @returns Promise resolving to an ActivityLink to initiate the auth flow\n */\n requestAuth<TCallback extends (auth: MessagingAuth, ...args: any[]) => any>(\n callback: TCallback,\n ...extraArgs: TCallback extends (auth: any, ...rest: infer R) => any\n ? R\n : []\n ): Promise<ActivityLink>;\n\n /**\n * Retrieves the list of conversation channels (inboxes, channels) accessible to the user.\n *\n * @param authToken - Authorization token from successful auth flow\n * @returns Promise resolving to array of available conversation channels\n */\n getChannels(authToken: string): Promise<MessageChannel[]>;\n\n /**\n * Begins synchronizing messages from a specific channel.\n *\n * Email threads and chat conversations are converted to ActivityWithNotes objects.\n * Each object contains an Activity (with subject/title) and Notes array (one per message).\n * The Activity.id can be used as a stable conversation identifier.\n *\n * @param authToken - Authorization token for access\n * @param channelId - ID of the channel (e.g., channel, inbox) to sync\n * @param callback - Function receiving (thread, ...extraArgs) for each synced conversation\n * @param options - Optional configuration for limiting the sync scope (e.g., time range)\n * @param extraArgs - Additional arguments to pass to the callback (type-checked)\n * @returns Promise that resolves when sync setup is complete\n */\n startSync<\n TCallback extends (thread: NewActivityWithNotes, ...args: any[]) => any\n >(\n authToken: string,\n channelId: string,\n callback: TCallback,\n options?: MessageSyncOptions,\n ...extraArgs: TCallback extends (thread: any, ...rest: infer R) => any\n ? R\n : []\n ): Promise<void>;\n\n /**\n * Stops synchronizing messages from a specific channel.\n *\n * @param authToken - Authorization token for access\n * @param channelId - ID of the channel to stop syncing\n * @returns Promise that resolves when sync is stopped\n */\n stopSync(authToken: string, channelId: string): Promise<void>;\n}\n";
8
8
  export default _default;
9
9
  //# sourceMappingURL=messaging.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"messaging.d.ts","sourceRoot":"","sources":["../../../src/llm-docs/common/messaging.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;wBAEY,iuHAAiuH;AAAhvH,wBAAivH"}
1
+ {"version":3,"file":"messaging.d.ts","sourceRoot":"","sources":["../../../src/llm-docs/common/messaging.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;wBAEY,23HAA23H;AAA14H,wBAA24H"}
@@ -4,5 +4,5 @@
4
4
  * This file is auto-generated during build. Do not edit manually.
5
5
  * Generated from: prebuild.ts
6
6
  */
7
- export default "import type { Activity, ActivityLink } from \"../index\";\n\n/**\n * Represents a successful messaging service authorization.\n *\n * Returned by messaging tools when authorization completes successfully.\n * The auth token is an opaque identifier that can be used for subsequent\n * messaging operations.\n */\nexport type MessagingAuth = {\n /** Opaque token for messaging operations */\n authToken: string;\n};\n\n/**\n * Represents a channel from an external messaging service.\n *\n * Contains metadata about a specific channel that can be synced\n * with Plot.\n */\nexport interface MessageChannel {\n /** Unique identifier for the channel within the provider */\n id: string;\n /** Human-readable name of the channel (e.g., \"Inbox\", \"#general\", \"My Team Thread\") */\n name: string;\n /** Optional description or additional details about the channel */\n description: string | null;\n /** Whether this is the user's primary/default channel (e.g. email inbox) */\n primary: boolean;\n}\n\n/**\n * Configuration options for messaging synchronization.\n *\n * Controls the time range and other parameters for messaging sync operations.\n * Used to limit sync scope and optimize performance.\n */\nexport interface MessageSyncOptions {\n /** Earliest date to sync events from (inclusive) */\n timeMin?: Date;\n}\n\n/**\n * Base interface for email and chat integration tools.\n *\n * All synced messages/emails are converted to Activity.\n */\nexport interface MessagingTool {\n /**\n * Initiates the authorization flow for the service.\n *\n * @param callback - Function receiving (auth, ...extraArgs) when auth completes\n * @param extraArgs - Additional arguments to pass to the callback (type-checked)\n * @returns Promise resolving to an ActivityLink to initiate the auth flow\n */\n requestAuth<TCallback extends (auth: MessagingAuth, ...args: any[]) => any>(\n callback: TCallback,\n ...extraArgs: TCallback extends (auth: any, ...rest: infer R) => any\n ? R\n : []\n ): Promise<ActivityLink>;\n\n /**\n * Retrieves the list of conversation channels (inboxes, channels) accessible to the user.\n *\n * @param authToken - Authorization token from successful auth flow\n * @returns Promise resolving to array of available conversation channels\n */\n getChannels(authToken: string): Promise<MessageChannel[]>;\n\n /**\n * Begins synchronizing messages from a specific channel.\n *\n * Messages are converted to an array of Activity represent the email/chat thread.\n * The meta.source is unique and stable per message. The meta.source of the first\n * Activity in the thread can be used as a thread identifier.\n *\n * @param authToken - Authorization token for access\n * @param channelId - ID of the channel (e.g., channel, inbox) to sync\n * @param callback - Function receiving (activity, ...extraArgs) for each synced message/thread\n * @param options - Optional configuration for limiting the sync scope (e.g., time range)\n * @param extraArgs - Additional arguments to pass to the callback (type-checked)\n * @returns Promise that resolves when sync setup is complete\n */\n startSync<TCallback extends (thread: Activity[], ...args: any[]) => any>(\n authToken: string,\n channelId: string,\n callback: TCallback,\n options?: MessageSyncOptions,\n ...extraArgs: TCallback extends (thread: any, ...rest: infer R) => any\n ? R\n : []\n ): Promise<void>;\n\n /**\n * Stops synchronizing messages from a specific channel.\n *\n * @param authToken - Authorization token for access\n * @param channelId - ID of the channel to stop syncing\n * @returns Promise that resolves when sync is stopped\n */\n stopSync(authToken: string, channelId: string): Promise<void>;\n}\n";
7
+ export default "import type { ActivityLink, NewActivityWithNotes } from \"../index\";\n\n/**\n * Represents a successful messaging service authorization.\n *\n * Returned by messaging tools when authorization completes successfully.\n * The auth token is an opaque identifier that can be used for subsequent\n * messaging operations.\n */\nexport type MessagingAuth = {\n /** Opaque token for messaging operations */\n authToken: string;\n};\n\n/**\n * Represents a channel from an external messaging service.\n *\n * Contains metadata about a specific channel that can be synced\n * with Plot.\n */\nexport interface MessageChannel {\n /** Unique identifier for the channel within the provider */\n id: string;\n /** Human-readable name of the channel (e.g., \"Inbox\", \"#general\", \"My Team Thread\") */\n name: string;\n /** Optional description or additional details about the channel */\n description: string | null;\n /** Whether this is the user's primary/default channel (e.g. email inbox) */\n primary: boolean;\n}\n\n/**\n * Configuration options for messaging synchronization.\n *\n * Controls the time range and other parameters for messaging sync operations.\n * Used to limit sync scope and optimize performance.\n */\nexport interface MessageSyncOptions {\n /** Earliest date to sync events from (inclusive) */\n timeMin?: Date;\n}\n\n/**\n * Base interface for email and chat integration tools.\n *\n * All synced messages/emails are converted to ActivityWithNotes objects.\n * Each email thread or chat conversation becomes an Activity with Notes for each message.\n */\nexport interface MessagingTool {\n /**\n * Initiates the authorization flow for the service.\n *\n * @param callback - Function receiving (auth, ...extraArgs) when auth completes\n * @param extraArgs - Additional arguments to pass to the callback (type-checked)\n * @returns Promise resolving to an ActivityLink to initiate the auth flow\n */\n requestAuth<TCallback extends (auth: MessagingAuth, ...args: any[]) => any>(\n callback: TCallback,\n ...extraArgs: TCallback extends (auth: any, ...rest: infer R) => any\n ? R\n : []\n ): Promise<ActivityLink>;\n\n /**\n * Retrieves the list of conversation channels (inboxes, channels) accessible to the user.\n *\n * @param authToken - Authorization token from successful auth flow\n * @returns Promise resolving to array of available conversation channels\n */\n getChannels(authToken: string): Promise<MessageChannel[]>;\n\n /**\n * Begins synchronizing messages from a specific channel.\n *\n * Email threads and chat conversations are converted to ActivityWithNotes objects.\n * Each object contains an Activity (with subject/title) and Notes array (one per message).\n * The Activity.id can be used as a stable conversation identifier.\n *\n * @param authToken - Authorization token for access\n * @param channelId - ID of the channel (e.g., channel, inbox) to sync\n * @param callback - Function receiving (thread, ...extraArgs) for each synced conversation\n * @param options - Optional configuration for limiting the sync scope (e.g., time range)\n * @param extraArgs - Additional arguments to pass to the callback (type-checked)\n * @returns Promise that resolves when sync setup is complete\n */\n startSync<\n TCallback extends (thread: NewActivityWithNotes, ...args: any[]) => any\n >(\n authToken: string,\n channelId: string,\n callback: TCallback,\n options?: MessageSyncOptions,\n ...extraArgs: TCallback extends (thread: any, ...rest: infer R) => any\n ? R\n : []\n ): Promise<void>;\n\n /**\n * Stops synchronizing messages from a specific channel.\n *\n * @param authToken - Authorization token for access\n * @param channelId - ID of the channel to stop syncing\n * @returns Promise that resolves when sync is stopped\n */\n stopSync(authToken: string, channelId: string): Promise<void>;\n}\n";
8
8
  //# sourceMappingURL=messaging.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"messaging.js","sourceRoot":"","sources":["../../../src/llm-docs/common/messaging.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAe,iuHAAiuH,CAAC"}
1
+ {"version":3,"file":"messaging.js","sourceRoot":"","sources":["../../../src/llm-docs/common/messaging.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAe,23HAA23H,CAAC"}
@@ -4,6 +4,6 @@
4
4
  * This file is auto-generated during build. Do not edit manually.
5
5
  * Generated from: prebuild.ts
6
6
  */
7
- declare const _default: "import { type Tag } from \"./tag\";\nimport { type Callback } from \"./tools/callbacks\";\n\nexport { Tag } from \"./tag\";\n\n/**\n * Represents a unique user, contact, or twist in Plot.\n *\n * Note contacts (i.e. people not using Plot) are also represented by ActorIds. They may be\n * people interacting with other connected services (e.g. an email sender or event attendee).\n */\nexport type ActorId = string & { readonly __brand: \"ActorId\" };\n\n/**\n * Represents a priority context within Plot.\n *\n * Priorities are similar to projects in other apps. All Activity is in a Priority.\n * Priorities can be nested.\n */\nexport type Priority = {\n /** Unique identifier for the priority */\n id: string;\n /** Human-readable title for the priority */\n title: string;\n};\n\n/**\n * Type for creating new priorities.\n *\n * Excludes the auto-generated ID field and adds an optional parentId\n * for creating hierarchical priority structures.\n */\nexport type NewPriority = Omit<Priority, \"id\"> & {\n /** Optional ID of the parent priority for creating hierarchies */\n parentId?: string;\n};\n\n/**\n * Enumeration of supported activity types in Plot.\n *\n * Each activity type has different behaviors and rendering characteristics\n * within the Plot application.\n */\nexport enum ActivityType {\n /** A note or piece of information without actionable requirements */\n Note,\n /** An actionable item that can be completed */\n Action,\n /** A scheduled occurrence with start and optional end time */\n Event,\n}\n\n/**\n * Enumeration of supported activity link types.\n *\n * Different link types have different behaviors when clicked by users\n * and may require different rendering approaches.\n */\nexport enum ActivityLinkType {\n /** External web links that open in browser */\n external = \"external\",\n /** Authentication flows for connecting services */\n auth = \"auth\",\n /** Callback links that trigger twist methods when clicked */\n callback = \"callback\",\n /** Video conferencing links with provider-specific handling */\n conferencing = \"conferencing\",\n}\n\n/**\n * Video conferencing providers for conferencing links.\n *\n * Used to identify the conferencing platform and provide\n * provider-specific UI elements (titles, icons, etc.).\n */\nexport enum ConferencingProvider {\n /** Google Meet */\n googleMeet = \"googleMeet\",\n /** Zoom */\n zoom = \"zoom\",\n /** Microsoft Teams */\n microsoftTeams = \"microsoftTeams\",\n /** Cisco Webex */\n webex = \"webex\",\n /** Other or unknown conferencing provider */\n other = \"other\",\n}\n\n/**\n * Represents a clickable link attached to an activity.\n *\n * Activity links are rendered as buttons that enable user interaction with activities.\n * Different link types have specific behaviors and required fields for proper functionality.\n *\n * @example\n * ```typescript\n * // External link - opens URL in browser\n * const externalLink: ActivityLink = {\n * type: ActivityLinkType.external,\n * title: \"Open in Google Calendar\",\n * url: \"https://calendar.google.com/event/123\",\n * };\n *\n * // Conferencing link - opens video conference with provider info\n * const conferencingLink: ActivityLink = {\n * type: ActivityLinkType.conferencing,\n * url: \"https://meet.google.com/abc-defg-hij\",\n * provider: ConferencingProvider.googleMeet,\n * };\n *\n * // Integrations link - initiates OAuth flow\n * const authLink: ActivityLink = {\n * type: ActivityLinkType.auth,\n * title: \"Continue with Google\",\n * provider: AuthProvider.Google,\n * level: AuthLevel.User,\n * scopes: [\"https://www.googleapis.com/auth/calendar.readonly\"],\n * callback: \"callback-token-for-auth-completion\"\n * };\n *\n * // Callback link - triggers a twist method\n * const callbackLink: ActivityLink = {\n * type: ActivityLinkType.callback,\n * title: \"\uD83D\uDCC5 Primary Calendar\",\n * token: \"callback-token-here\"\n * };\n * ```\n */\nexport type ActivityLink =\n | {\n /** External web link that opens in browser */\n type: ActivityLinkType.external;\n /** Display text for the link button */\n title: string;\n /** URL to open when clicked */\n url: string;\n }\n | {\n /** Video conferencing link with provider-specific handling */\n type: ActivityLinkType.conferencing;\n /** URL to join the conference */\n url: string;\n /** Conferencing provider for UI customization */\n provider: ConferencingProvider;\n }\n | {\n /** Authentication link that initiates an OAuth flow */\n type: ActivityLinkType.auth;\n /** Display text for the auth button */\n title: string;\n /** OAuth provider (e.g., \"google\", \"microsoft\") */\n provider: string;\n /** Authorization level (\"user\" or \"priority\") */\n level: string;\n /** Array of OAuth scopes to request */\n scopes: string[];\n /** Callback token for auth completion notification */\n callback: Callback;\n }\n | {\n /** Callback link that triggers a twist method when clicked */\n type: ActivityLinkType.callback;\n /** Display text for the callback button */\n title: string;\n /** Token identifying the callback to execute */\n callback: Callback;\n };\n\n/**\n * Represents metadata about an activity, typically from an external system.\n *\n * Activity metadata enables tracking where activities originated from,\n * which is useful for synchronization, deduplication, and linking\n * back to external systems.\n *\n * @example\n * ```typescript\n * const googleCalendarMeta: ActivityMeta = {\n * type: \"google-calendar-event\",\n * id: \"event-123\",\n * calendarId: \"primary\",\n * htmlLink: \"https://calendar.google.com/event/123\"\n * };\n * ```\n */\nexport type ActivityMeta = {\n /** The type identifier for the source system */\n source: string;\n /** Additional source-specific properties */\n [key: string]: any;\n};\n\n/**\n * Represents a complete activity within the Plot system.\n *\n * Activities are the core entities in Plot, representing anything from simple notes\n * to complex recurring events. They support rich metadata including scheduling,\n * recurrence patterns, links, and external source tracking.\n *\n * @example\n * ```typescript\n * // Simple note\n * const task: Activity = {\n * type: ActivityType.Note,\n * title: \"New campaign brainstorming ideas\",\n * note: \"We could rent a bouncy castle...\",\n * author: { id: \"user-1\", name: \"John Doe\", type: ActorType.User },\n * priority: { id: \"work\", title: \"Work\" },\n * // ... other fields\n * };\n *\n * // Simple action\n * const action: Activity = {\n * type: ActivityType.Action,\n * title: \"Review budget proposal\",\n * author: { id: \"user-1\", name: \"John Doe\", type: ActorType.User },\n * end: null,\n * priority: { id: \"work\", title: \"Work\" },\n * // ... other fields\n * };\n *\n * // Recurring event\n * const meeting: Activity = {\n * type: ActivityType.Event,\n * title: \"Weekly standup\",\n * recurrenceRule: \"FREQ=WEEKLY;BYDAY=MO\",\n * recurrenceCount: 12,\n * // ... other fields\n * };\n * ```\n */\nexport type Activity = {\n /** Unique identifier for the activity */\n id: string;\n /** The type of activity (Note, Task, or Event) */\n type: ActivityType;\n /** Information about who created the activity */\n author: Actor;\n /** The display title/summary of the activity */\n title: string | null;\n /** Primary content for the activity */\n note: string | null;\n /**\n * Start time of a scheduled activity. Notes are not typically scheduled unless they're about specific times.\n * For recurring events, this represents the start of the first occurrence.\n * Can be a Date object for timed events or a date string in \"YYYY-MM-DD\" format for all-day events.\n * Null for activities without scheduled start times.\n */\n start: Date | string | null;\n /**\n * End time of a scheduled activity. Notes are not typically scheduled unless they're about specific times.\n * For recurring events, this represents the end of the first occurrence.\n * Can be a Date object for timed events or a date string in \"YYYY-MM-DD\" format for all-day events.\n * Null for tasks or activities without defined end times.\n */\n end: Date | string | null;\n /**\n * For recurring activities, the last occurrence date (inclusive).\n * Can be a Date object, date string in \"YYYY-MM-DD\" format, or null if recurring indefinitely.\n * When both recurrenceCount and recurrenceUntil are provided, recurrenceCount takes precedence.\n */\n recurrenceUntil: Date | string | null;\n /**\n * For recurring activities, the number of occurrences to generate.\n * Takes precedence over recurrenceUntil if both are provided.\n * Null for non-recurring activities or indefinite recurrence.\n */\n recurrenceCount: number | null;\n /** Timestamp when the activity was marked as complete. Null if not completed. */\n doneAt: Date | null;\n /** Reference to a parent activity for creating hierarchical relationships */\n parent: Activity | null;\n /** For nested activities in a thread, references the top-level activity of that thread */\n threadRoot?: Activity;\n /** Array of interactive links attached to the activity */\n links: Array<ActivityLink> | null;\n /** The priority context this activity belongs to */\n priority: Priority;\n /** Recurrence rule in RFC 5545 RRULE format (e.g., \"FREQ=WEEKLY;BYDAY=MO,WE,FR\") */\n recurrenceRule: string | null;\n /** Array of dates to exclude from the recurrence pattern */\n recurrenceExdates: Date[] | null;\n /** Array of additional occurrence dates to include in the recurrence pattern */\n recurrenceDates: Date[] | null;\n /**\n * For recurring event exceptions, points to the root recurring activity.\n * Used when an individual occurrence of a recurring event is modified.\n */\n recurrence: Activity | null;\n /**\n * For recurring event exceptions, the original occurrence date being overridden.\n * Used to identify which occurrence of a recurring event this exception replaces.\n */\n occurrence: Date | null;\n /** Metadata about the activity, typically from an external system that created it */\n meta: ActivityMeta | null;\n /** Tags attached to this activity. Maps tag ID to array of actor IDs who added that tag. */\n tags: Partial<Record<Tag, ActorId[]>> | null;\n /** Array of actor IDs (users, contacts, or twists) mentioned in this activity via @-mentions */\n mentions: ActorId[] | null;\n};\n\n/**\n * Configuration for automatic priority selection based on activity similarity.\n *\n * Maps activity fields to scoring weights or required exact matches:\n * - Number value: Maximum score for similarity matching on this field\n * - `true` value: Required exact match - activities must match exactly or be excluded\n *\n * Scoring rules:\n * - content: Uses vector similarity on activity embedding (cosine similarity)\n * - type: Exact match on ActivityType\n * - mentions: Percentage of existing activity's mentions that appear in new activity\n * - meta.field: Exact match on top-level meta fields (e.g., \"meta.sourceId\")\n *\n * When content is `true`, applies a strong similarity threshold to ensure only close matches.\n * Default (when neither priority nor pickPriority specified): `{content: true}`\n *\n * @example\n * ```typescript\n * // Require exact content match with strong similarity\n * pickPriority: { content: true }\n *\n * // Score based on content (max 100 points) and require exact type match\n * pickPriority: { content: 100, type: true }\n *\n * // Match on meta source and score content\n * pickPriority: { \"meta.source\": true, content: 50 }\n * ```\n */\nexport type PickPriorityConfig = {\n content?: number | true;\n type?: number | true;\n mentions?: number | true;\n [key: `meta.${string}`]: number | true;\n};\n\n/**\n * Type for creating new activities.\n *\n * Requires only the activity type, with all other fields optional.\n * The ID and author will be automatically assigned by the Plot system\n * based on the current execution context.\n *\n * Priority can be specified in three ways:\n * 1. Explicit priority: `priority: { id: \"...\" }` - Use specific priority (disables pickPriority)\n * 2. Pick priority config: `pickPriority: { ... }` - Auto-select based on similarity\n * 3. Neither: Defaults to `pickPriority: { content: true }` for automatic matching\n *\n * @example\n * ```typescript\n * // Explicit priority (disables automatic matching)\n * const newTask: NewActivity = {\n * type: ActivityType.Action,\n * title: \"Review pull request\",\n * priority: { id: \"work-project-123\" }\n * };\n *\n * // Automatic priority matching (default behavior)\n * const newNote: NewActivity = {\n * type: ActivityType.Note,\n * title: \"Meeting notes\",\n * note: \"Discussed Q4 roadmap...\"\n * // Defaults to pickPriority: { content: true }\n * };\n *\n * // Custom priority matching\n * const newEvent: NewActivity = {\n * type: ActivityType.Event,\n * title: \"Team standup\",\n * pickPriority: { type: true, content: 50 }\n * };\n * ```\n */\nexport type NewActivity = Pick<Activity, \"type\"> &\n Partial<\n Omit<\n Activity,\n \"id\" | \"author\" | \"type\" | \"parent\" | \"priority\" | \"threadRoot\"\n > & {\n parent?: Pick<Activity, \"id\"> | null;\n\n /**\n * Format of the note content. Determines how the note is processed:\n * - 'text': Plain text that will be converted to markdown (auto-links URLs, preserves line breaks)\n * - 'markdown': Already in markdown format (default, no conversion)\n * - 'html': HTML content that will be converted to markdown\n */\n noteType?: NoteType;\n }\n > &\n (\n | {\n /** Explicit priority (required when specified) - disables automatic priority matching */\n priority: Pick<Priority, \"id\">;\n }\n | {\n /** Configuration for automatic priority selection based on similarity */\n pickPriority?: PickPriorityConfig;\n }\n | {}\n );\n\nexport type ActivityUpdate = Pick<Activity, \"id\"> &\n Partial<\n Pick<\n Activity,\n | \"type\"\n | \"start\"\n | \"end\"\n | \"doneAt\"\n | \"note\"\n | \"title\"\n | \"meta\"\n | \"links\"\n | \"recurrenceRule\"\n | \"recurrenceDates\"\n | \"recurrenceExdates\"\n | \"recurrenceUntil\"\n | \"recurrenceCount\"\n | \"occurrence\"\n | \"mentions\"\n >\n > & {\n parent?: Pick<Activity, \"id\"> | null;\n\n /**\n * Format of the note content. Determines how the note is processed:\n * - 'text': Plain text that will be converted to markdown (auto-links URLs, preserves line breaks)\n * - 'markdown': Already in markdown format (default, no conversion)\n * - 'html': HTML content that will be converted to markdown\n */\n noteType?: NoteType;\n\n /**\n * Full tags object from Activity. Maps tag ID to array of actor IDs who added that tag.\n * Only allowed for activities created by the twist.\n * Use twistTags instead for adding/removing the twist's tags on other activities.\n */\n tags?: Partial<Record<Tag, ActorId[]>>;\n\n /**\n * Add or remove the twist's tags.\n * Maps tag ID to boolean: true = add tag, false = remove tag.\n * This is allowed on all activities the twist has access to.\n */\n twistTags?: Partial<Record<Tag, boolean>>;\n };\n\n/**\n * Represents an actor in Plot - a user, contact, or twist.\n *\n * Actors can be associated with activities as authors, assignees, or mentions.\n * The email field is only included when ContactAccess.Read permission is granted.\n *\n * @example\n * ```typescript\n * const actor: Actor = {\n * id: \"f0ffd5f8-1635-4b13-9532-35f97446db90\" as ActorId,\n * type: ActorType.Contact,\n * email: \"john.doe@example.com\", // Only if ContactAccess.Read\n * name: \"John Doe\"\n * };\n * ```\n */\nexport type Actor = {\n /** Unique identifier for the actor */\n id: ActorId;\n /** Type of actor (User, Contact, or Twist) */\n type: ActorType;\n /** Email address (only included with ContactAccess.Read permission) */\n email?: string;\n /** Display name (undefined if not included due to permissions, null if not set) */\n name?: string | null;\n};\n\n/**\n * Enumeration of author types that can create activities.\n *\n * The author type affects how activities are displayed and processed\n * within the Plot system.\n */\nexport enum ActorType {\n /** Activities created by human users */\n User,\n /** Activities created by external contacts */\n Contact,\n /** Activities created by automated twists */\n Twist,\n}\n\n/**\n * Represents contact information for creating a new contact.\n *\n * Contacts are used throughout Plot for representing people associated\n * with activities, such as event attendees or task assignees.\n *\n * @example\n * ```typescript\n * const newContact: NewContact = {\n * email: \"john.doe@example.com\",\n * name: \"John Doe\",\n * avatar: \"https://avatar.example.com/john.jpg\"\n * };\n * ```\n */\nexport type NewContact = {\n /** Email address of the contact (required) */\n email: string;\n /** Optional display name for the contact */\n name?: string;\n /** Optional avatar image URL for the contact */\n avatar?: string;\n};\n\nexport type NoteType = \"text\" | \"markdown\" | \"html\";\n";
7
+ declare const _default: "import { type Tag } from \"./tag\";\nimport { type Callback } from \"./tools/callbacks\";\n\nexport { Tag } from \"./tag\";\n\n/**\n * Represents a unique user, contact, or twist in Plot.\n *\n * Note contacts (i.e. people not using Plot) are also represented by ActorIds. They may be\n * people interacting with other connected services (e.g. an email sender or event attendee).\n */\nexport type ActorId = string & { readonly __brand: \"ActorId\" };\n\n/**\n * Represents a priority context within Plot.\n *\n * Priorities are similar to projects in other apps. All Activity is in a Priority.\n * Priorities can be nested.\n */\nexport type Priority = {\n /** Unique identifier for the priority */\n id: string;\n /** Human-readable title for the priority */\n title: string;\n};\n\n/**\n * Type for creating new priorities.\n *\n * Excludes the auto-generated ID field and adds an optional parentId\n * for creating hierarchical priority structures.\n */\nexport type NewPriority = Omit<Priority, \"id\"> & {\n /** Optional ID of the parent priority for creating hierarchies */\n parentId?: string;\n};\n\n/**\n * Enumeration of supported activity types in Plot.\n *\n * Each activity type has different behaviors and rendering characteristics\n * within the Plot application.\n */\nexport enum ActivityType {\n /** A note or piece of information without actionable requirements */\n Note,\n /** An actionable item that can be completed */\n Action,\n /** A scheduled occurrence with start and optional end time */\n Event,\n}\n\n/**\n * Enumeration of supported activity link types.\n *\n * Different link types have different behaviors when clicked by users\n * and may require different rendering approaches.\n */\nexport enum ActivityLinkType {\n /** External web links that open in browser */\n external = \"external\",\n /** Authentication flows for connecting services */\n auth = \"auth\",\n /** Callback links that trigger twist methods when clicked */\n callback = \"callback\",\n /** Video conferencing links with provider-specific handling */\n conferencing = \"conferencing\",\n}\n\n/**\n * Video conferencing providers for conferencing links.\n *\n * Used to identify the conferencing platform and provide\n * provider-specific UI elements (titles, icons, etc.).\n */\nexport enum ConferencingProvider {\n /** Google Meet */\n googleMeet = \"googleMeet\",\n /** Zoom */\n zoom = \"zoom\",\n /** Microsoft Teams */\n microsoftTeams = \"microsoftTeams\",\n /** Cisco Webex */\n webex = \"webex\",\n /** Other or unknown conferencing provider */\n other = \"other\",\n}\n\n/**\n * Represents a clickable link attached to an activity.\n *\n * Activity links are rendered as buttons that enable user interaction with activities.\n * Different link types have specific behaviors and required fields for proper functionality.\n *\n * @example\n * ```typescript\n * // External link - opens URL in browser\n * const externalLink: ActivityLink = {\n * type: ActivityLinkType.external,\n * title: \"Open in Google Calendar\",\n * url: \"https://calendar.google.com/event/123\",\n * };\n *\n * // Conferencing link - opens video conference with provider info\n * const conferencingLink: ActivityLink = {\n * type: ActivityLinkType.conferencing,\n * url: \"https://meet.google.com/abc-defg-hij\",\n * provider: ConferencingProvider.googleMeet,\n * };\n *\n * // Integrations link - initiates OAuth flow\n * const authLink: ActivityLink = {\n * type: ActivityLinkType.auth,\n * title: \"Continue with Google\",\n * provider: AuthProvider.Google,\n * level: AuthLevel.User,\n * scopes: [\"https://www.googleapis.com/auth/calendar.readonly\"],\n * callback: \"callback-token-for-auth-completion\"\n * };\n *\n * // Callback link - triggers a twist method\n * const callbackLink: ActivityLink = {\n * type: ActivityLinkType.callback,\n * title: \"\uD83D\uDCC5 Primary Calendar\",\n * token: \"callback-token-here\"\n * };\n * ```\n */\nexport type ActivityLink =\n | {\n /** External web link that opens in browser */\n type: ActivityLinkType.external;\n /** Display text for the link button */\n title: string;\n /** URL to open when clicked */\n url: string;\n }\n | {\n /** Video conferencing link with provider-specific handling */\n type: ActivityLinkType.conferencing;\n /** URL to join the conference */\n url: string;\n /** Conferencing provider for UI customization */\n provider: ConferencingProvider;\n }\n | {\n /** Authentication link that initiates an OAuth flow */\n type: ActivityLinkType.auth;\n /** Display text for the auth button */\n title: string;\n /** OAuth provider (e.g., \"google\", \"microsoft\") */\n provider: string;\n /** Authorization level (\"user\" or \"priority\") */\n level: string;\n /** Array of OAuth scopes to request */\n scopes: string[];\n /** Callback token for auth completion notification */\n callback: Callback;\n }\n | {\n /** Callback link that triggers a twist method when clicked */\n type: ActivityLinkType.callback;\n /** Display text for the callback button */\n title: string;\n /** Token identifying the callback to execute */\n callback: Callback;\n };\n\n/**\n * Represents metadata about an activity, typically from an external system.\n *\n * Activity metadata enables tracking where activities originated from,\n * which is useful for synchronization, deduplication, and linking\n * back to external systems.\n *\n * @example\n * ```typescript\n * const googleCalendarMeta: ActivityMeta = {\n * type: \"google-calendar-event\",\n * id: \"event-123\",\n * calendarId: \"primary\",\n * htmlLink: \"https://calendar.google.com/event/123\"\n * };\n * ```\n */\nexport type ActivityMeta = {\n /** The type identifier for the source system */\n source: string;\n /** Additional source-specific properties */\n [key: string]: any;\n};\n\n/**\n * Represents a complete activity within the Plot system.\n *\n * Activities are the core entities in Plot, representing anything from simple notes\n * to complex recurring events. They support rich metadata including scheduling,\n * recurrence patterns, links, and external source tracking.\n *\n * @example\n * ```typescript\n * // Simple note\n * const task: Activity = {\n * type: ActivityType.Note,\n * title: \"New campaign brainstorming ideas\",\n * note: \"We could rent a bouncy castle...\",\n * author: { id: \"user-1\", name: \"John Doe\", type: ActorType.User },\n * priority: { id: \"work\", title: \"Work\" },\n * // ... other fields\n * };\n *\n * // Simple action\n * const action: Activity = {\n * type: ActivityType.Action,\n * title: \"Review budget proposal\",\n * author: { id: \"user-1\", name: \"John Doe\", type: ActorType.User },\n * priority: { id: \"work\", title: \"Work\" },\n * // ... other fields\n * };\n *\n * // Recurring event\n * const meeting: Activity = {\n * type: ActivityType.Event,\n * title: \"Weekly standup\",\n * recurrenceRule: \"FREQ=WEEKLY;BYDAY=MO\",\n * recurrenceCount: 12,\n * // ... other fields\n * };\n * ```\n */\nexport type ActivityCommon = {\n /** Unique identifier for the activity */\n id: string;\n /** Information about who created the activity */\n author: Actor;\n /** Whether this activity is in draft state (not shown in do now view) */\n draft: boolean;\n /** Whether this activity is private (only visible to author) */\n private: boolean;\n /** Tags attached to this activity. Maps tag ID to array of actor IDs who added that tag. */\n tags: Partial<Record<Tag, ActorId[]>> | null;\n /** Array of actor IDs (users, contacts, or twists) mentioned in this activity via @-mentions */\n mentions: ActorId[] | null;\n};\n\nexport type Activity = ActivityCommon & {\n /** The display title/summary of the activity */\n title: string | null;\n /** The type of activity (Note, Task, or Event) */\n type: ActivityType;\n /** Who this activity note is assigned to */\n assignee: Actor | null;\n /** Timestamp when the activity was marked as complete. Null if not completed. */\n doneAt: Date | null;\n /**\n * Start time of a scheduled activity. Notes are not typically scheduled unless they're about specific times.\n * For recurring events, this represents the start of the first occurrence.\n * Can be a Date object for timed events or a date string in \"YYYY-MM-DD\" format for all-day events.\n * Null for activities without scheduled start times.\n */\n start: Date | string | null;\n /**\n * End time of a scheduled activity. Notes are not typically scheduled unless they're about specific times.\n * For recurring events, this represents the end of the first occurrence.\n * Can be a Date object for timed events or a date string in \"YYYY-MM-DD\" format for all-day events.\n * Null for tasks or activities without defined end times.\n */\n end: Date | string | null;\n /**\n * For recurring activities, the last occurrence date (inclusive).\n * Can be a Date object, date string in \"YYYY-MM-DD\" format, or null if recurring indefinitely.\n * When both recurrenceCount and recurrenceUntil are provided, recurrenceCount takes precedence.\n */\n recurrenceUntil: Date | string | null;\n /**\n * For recurring activities, the number of occurrences to generate.\n * Takes precedence over recurrenceUntil if both are provided.\n * Null for non-recurring activities or indefinite recurrence.\n */\n recurrenceCount: number | null;\n /** The priority context this activity belongs to */\n priority: Priority;\n /** Recurrence rule in RFC 5545 RRULE format (e.g., \"FREQ=WEEKLY;BYDAY=MO,WE,FR\") */\n recurrenceRule: string | null;\n /** Array of dates to exclude from the recurrence pattern */\n recurrenceExdates: Date[] | null;\n /** Array of additional occurrence dates to include in the recurrence pattern */\n recurrenceDates: Date[] | null;\n /**\n * For recurring event exceptions, points to the root recurring activity.\n * Used when an individual occurrence of a recurring event is modified.\n */\n recurrence: Activity | null;\n /**\n * For recurring event exceptions, the original occurrence date being overridden.\n * Used to identify which occurrence of a recurring event this exception replaces.\n */\n occurrence: Date | null;\n /** Metadata about the activity, typically from an external system that created it */\n meta: ActivityMeta | null;\n};\n\nexport type ActivityWithNotes = Activity & {\n notes: Note[];\n};\n\nexport type NewActivityWithNotes = NewActivity & {\n notes: Omit<NewNote, \"activity\">[];\n};\n\n/**\n * Configuration for automatic priority selection based on activity similarity.\n *\n * Maps activity fields to scoring weights or required exact matches:\n * - Number value: Maximum score for similarity matching on this field\n * - `true` value: Required exact match - activities must match exactly or be excluded\n *\n * Scoring rules:\n * - content: Uses vector similarity on activity embedding (cosine similarity)\n * - type: Exact match on ActivityType\n * - mentions: Percentage of existing activity's mentions that appear in new activity\n * - meta.field: Exact match on top-level meta fields (e.g., \"meta.sourceId\")\n *\n * When content is `true`, applies a strong similarity threshold to ensure only close matches.\n * Default (when neither priority nor pickPriority specified): `{content: true}`\n *\n * @example\n * ```typescript\n * // Require exact content match with strong similarity\n * pickPriority: { content: true }\n *\n * // Score based on content (max 100 points) and require exact type match\n * pickPriority: { content: 100, type: true }\n *\n * // Match on meta source and score content\n * pickPriority: { \"meta.source\": true, content: 50 }\n * ```\n */\nexport type PickPriorityConfig = {\n content?: number | true;\n type?: number | true;\n mentions?: number | true;\n [key: `meta.${string}`]: number | true;\n};\n\n/**\n * Type for creating new activities.\n *\n * Requires only the activity type, with all other fields optional.\n * The ID and author will be automatically assigned by the Plot system\n * based on the current execution context.\n *\n * Priority can be specified in three ways:\n * 1. Explicit priority: `priority: { id: \"...\" }` - Use specific priority (disables pickPriority)\n * 2. Pick priority config: `pickPriority: { ... }` - Auto-select based on similarity\n * 3. Neither: Defaults to `pickPriority: { content: true }` for automatic matching\n *\n * @example\n * ```typescript\n * // Explicit priority (disables automatic matching)\n * const newTask: NewActivity = {\n * type: ActivityType.Action,\n * title: \"Review pull request\",\n * priority: { id: \"work-project-123\" }\n * };\n *\n * // Automatic priority matching (default behavior)\n * const newNote: NewActivity = {\n * type: ActivityType.Note,\n * title: \"Meeting notes\",\n * note: \"Discussed Q4 roadmap...\"\n * // Defaults to pickPriority: { content: true }\n * };\n *\n * // Custom priority matching\n * const newEvent: NewActivity = {\n * type: ActivityType.Event,\n * title: \"Team standup\",\n * pickPriority: { type: true, content: 50 }\n * };\n * ```\n */\nexport type NewActivity = Pick<Activity, \"type\"> &\n Partial<Omit<Activity, \"id\" | \"author\" | \"type\" | \"priority\" | \"mentions\">> &\n (\n | {\n /** Explicit priority (required when specified) - disables automatic priority matching */\n priority: Pick<Priority, \"id\">;\n }\n | {\n /** Configuration for automatic priority selection based on similarity */\n pickPriority?: PickPriorityConfig;\n }\n | {}\n );\n\nexport type ActivityUpdate = Pick<Activity, \"id\"> &\n Partial<\n Pick<\n Activity,\n | \"type\"\n | \"start\"\n | \"end\"\n | \"doneAt\"\n | \"title\"\n | \"draft\"\n | \"private\"\n | \"meta\"\n | \"recurrenceRule\"\n | \"recurrenceDates\"\n | \"recurrenceExdates\"\n | \"recurrenceUntil\"\n | \"recurrenceCount\"\n | \"occurrence\"\n >\n > & {\n /**\n * Full tags object from Activity. Maps tag ID to array of actor IDs who added that tag.\n * Only allowed for activities created by the twist.\n * Use twistTags instead for adding/removing the twist's tags on other activities.\n */\n tags?: Partial<Record<Tag, ActorId[]>>;\n\n /**\n * Add or remove the twist's tags.\n * Maps tag ID to boolean: true = add tag, false = remove tag.\n * This is allowed on all activities the twist has access to.\n */\n twistTags?: Partial<Record<Tag, boolean>>;\n };\n\n/**\n * Represents a note within an activity.\n *\n * Notes contain the detailed content (note text, links) associated with an activity.\n * They are always ordered by creation time within their parent activity.\n */\nexport type Note = Omit<ActivityCommon, \"type\"> & {\n /** The parent activity this note belongs to */\n activity: Activity;\n /** Primary content for the note (markdown) */\n note: string | null;\n /** Array of interactive links attached to the note */\n links: Array<ActivityLink> | null;\n};\n\n/**\n * Type for creating new notes.\n *\n * Requires the activity reference, with all other fields optional.\n */\nexport type NewNote = Partial<Omit<Note, \"id\" | \"author\" | \"activity\">> & {\n /** Reference to the parent activity (required) */\n activity: Pick<Activity, \"id\">;\n\n /**\n * Format of the note content. Determines how the note is processed:\n * - 'text': Plain text that will be converted to markdown (auto-links URLs, preserves line breaks)\n * - 'markdown': Already in markdown format (default, no conversion)\n * - 'html': HTML content that will be converted to markdown\n */\n noteType?: NoteType;\n};\n\n/**\n * Type for updating existing notes.\n */\nexport type NoteUpdate = Pick<Note, \"id\"> &\n Partial<Pick<Note, \"draft\" | \"private\" | \"note\" | \"links\" | \"mentions\">> & {\n /**\n * Format of the note content. Determines how the note is processed:\n * - 'text': Plain text that will be converted to markdown (auto-links URLs, preserves line breaks)\n * - 'markdown': Already in markdown format (default, no conversion)\n * - 'html': HTML content that will be converted to markdown\n */\n noteType?: NoteType;\n\n /**\n * Full tags object from Note. Maps tag ID to array of actor IDs who added that tag.\n * Only allowed for notes created by the twist.\n * Use twistTags instead for adding/removing the twist's tags on other notes.\n */\n tags?: Partial<Record<Tag, ActorId[]>>;\n\n /**\n * Add or remove the twist's tags.\n * Maps tag ID to boolean: true = add tag, false = remove tag.\n * This is allowed on all notes the twist has access to.\n */\n twistTags?: Partial<Record<Tag, boolean>>;\n };\n\n/**\n * Represents an actor in Plot - a user, contact, or twist.\n *\n * Actors can be associated with activities as authors, assignees, or mentions.\n * The email field is only included when ContactAccess.Read permission is granted.\n *\n * @example\n * ```typescript\n * const actor: Actor = {\n * id: \"f0ffd5f8-1635-4b13-9532-35f97446db90\" as ActorId,\n * type: ActorType.Contact,\n * email: \"john.doe@example.com\", // Only if ContactAccess.Read\n * name: \"John Doe\"\n * };\n * ```\n */\nexport type Actor = {\n /** Unique identifier for the actor */\n id: ActorId;\n /** Type of actor (User, Contact, or Twist) */\n type: ActorType;\n /** Email address (only included with ContactAccess.Read permission) */\n email?: string;\n /** Display name (undefined if not included due to permissions, null if not set) */\n name?: string | null;\n};\n\n/**\n * Enumeration of author types that can create activities.\n *\n * The author type affects how activities are displayed and processed\n * within the Plot system.\n */\nexport enum ActorType {\n /** Activities created by human users */\n User,\n /** Activities created by external contacts */\n Contact,\n /** Activities created by automated twists */\n Twist,\n}\n\n/**\n * Represents contact information for creating a new contact.\n *\n * Contacts are used throughout Plot for representing people associated\n * with activities, such as event attendees or task assignees.\n *\n * @example\n * ```typescript\n * const newContact: NewContact = {\n * email: \"john.doe@example.com\",\n * name: \"John Doe\",\n * avatar: \"https://avatar.example.com/john.jpg\"\n * };\n * ```\n */\nexport type NewContact = {\n /** Email address of the contact (required) */\n email: string;\n /** Optional display name for the contact */\n name?: string;\n /** Optional avatar image URL for the contact */\n avatar?: string;\n};\n\nexport type NoteType = \"text\" | \"markdown\" | \"html\";\n";
8
8
  export default _default;
9
9
  //# sourceMappingURL=plot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plot.d.ts","sourceRoot":"","sources":["../../src/llm-docs/plot.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;wBAEY,kviBAAwuiB;AAAvviB,wBAAwviB"}
1
+ {"version":3,"file":"plot.d.ts","sourceRoot":"","sources":["../../src/llm-docs/plot.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;wBAEY,snlBAA4mlB;AAA3nlB,wBAA4nlB"}
@@ -4,5 +4,5 @@
4
4
  * This file is auto-generated during build. Do not edit manually.
5
5
  * Generated from: prebuild.ts
6
6
  */
7
- export default "import { type Tag } from \"./tag\";\nimport { type Callback } from \"./tools/callbacks\";\n\nexport { Tag } from \"./tag\";\n\n/**\n * Represents a unique user, contact, or twist in Plot.\n *\n * Note contacts (i.e. people not using Plot) are also represented by ActorIds. They may be\n * people interacting with other connected services (e.g. an email sender or event attendee).\n */\nexport type ActorId = string & { readonly __brand: \"ActorId\" };\n\n/**\n * Represents a priority context within Plot.\n *\n * Priorities are similar to projects in other apps. All Activity is in a Priority.\n * Priorities can be nested.\n */\nexport type Priority = {\n /** Unique identifier for the priority */\n id: string;\n /** Human-readable title for the priority */\n title: string;\n};\n\n/**\n * Type for creating new priorities.\n *\n * Excludes the auto-generated ID field and adds an optional parentId\n * for creating hierarchical priority structures.\n */\nexport type NewPriority = Omit<Priority, \"id\"> & {\n /** Optional ID of the parent priority for creating hierarchies */\n parentId?: string;\n};\n\n/**\n * Enumeration of supported activity types in Plot.\n *\n * Each activity type has different behaviors and rendering characteristics\n * within the Plot application.\n */\nexport enum ActivityType {\n /** A note or piece of information without actionable requirements */\n Note,\n /** An actionable item that can be completed */\n Action,\n /** A scheduled occurrence with start and optional end time */\n Event,\n}\n\n/**\n * Enumeration of supported activity link types.\n *\n * Different link types have different behaviors when clicked by users\n * and may require different rendering approaches.\n */\nexport enum ActivityLinkType {\n /** External web links that open in browser */\n external = \"external\",\n /** Authentication flows for connecting services */\n auth = \"auth\",\n /** Callback links that trigger twist methods when clicked */\n callback = \"callback\",\n /** Video conferencing links with provider-specific handling */\n conferencing = \"conferencing\",\n}\n\n/**\n * Video conferencing providers for conferencing links.\n *\n * Used to identify the conferencing platform and provide\n * provider-specific UI elements (titles, icons, etc.).\n */\nexport enum ConferencingProvider {\n /** Google Meet */\n googleMeet = \"googleMeet\",\n /** Zoom */\n zoom = \"zoom\",\n /** Microsoft Teams */\n microsoftTeams = \"microsoftTeams\",\n /** Cisco Webex */\n webex = \"webex\",\n /** Other or unknown conferencing provider */\n other = \"other\",\n}\n\n/**\n * Represents a clickable link attached to an activity.\n *\n * Activity links are rendered as buttons that enable user interaction with activities.\n * Different link types have specific behaviors and required fields for proper functionality.\n *\n * @example\n * ```typescript\n * // External link - opens URL in browser\n * const externalLink: ActivityLink = {\n * type: ActivityLinkType.external,\n * title: \"Open in Google Calendar\",\n * url: \"https://calendar.google.com/event/123\",\n * };\n *\n * // Conferencing link - opens video conference with provider info\n * const conferencingLink: ActivityLink = {\n * type: ActivityLinkType.conferencing,\n * url: \"https://meet.google.com/abc-defg-hij\",\n * provider: ConferencingProvider.googleMeet,\n * };\n *\n * // Integrations link - initiates OAuth flow\n * const authLink: ActivityLink = {\n * type: ActivityLinkType.auth,\n * title: \"Continue with Google\",\n * provider: AuthProvider.Google,\n * level: AuthLevel.User,\n * scopes: [\"https://www.googleapis.com/auth/calendar.readonly\"],\n * callback: \"callback-token-for-auth-completion\"\n * };\n *\n * // Callback link - triggers a twist method\n * const callbackLink: ActivityLink = {\n * type: ActivityLinkType.callback,\n * title: \"📅 Primary Calendar\",\n * token: \"callback-token-here\"\n * };\n * ```\n */\nexport type ActivityLink =\n | {\n /** External web link that opens in browser */\n type: ActivityLinkType.external;\n /** Display text for the link button */\n title: string;\n /** URL to open when clicked */\n url: string;\n }\n | {\n /** Video conferencing link with provider-specific handling */\n type: ActivityLinkType.conferencing;\n /** URL to join the conference */\n url: string;\n /** Conferencing provider for UI customization */\n provider: ConferencingProvider;\n }\n | {\n /** Authentication link that initiates an OAuth flow */\n type: ActivityLinkType.auth;\n /** Display text for the auth button */\n title: string;\n /** OAuth provider (e.g., \"google\", \"microsoft\") */\n provider: string;\n /** Authorization level (\"user\" or \"priority\") */\n level: string;\n /** Array of OAuth scopes to request */\n scopes: string[];\n /** Callback token for auth completion notification */\n callback: Callback;\n }\n | {\n /** Callback link that triggers a twist method when clicked */\n type: ActivityLinkType.callback;\n /** Display text for the callback button */\n title: string;\n /** Token identifying the callback to execute */\n callback: Callback;\n };\n\n/**\n * Represents metadata about an activity, typically from an external system.\n *\n * Activity metadata enables tracking where activities originated from,\n * which is useful for synchronization, deduplication, and linking\n * back to external systems.\n *\n * @example\n * ```typescript\n * const googleCalendarMeta: ActivityMeta = {\n * type: \"google-calendar-event\",\n * id: \"event-123\",\n * calendarId: \"primary\",\n * htmlLink: \"https://calendar.google.com/event/123\"\n * };\n * ```\n */\nexport type ActivityMeta = {\n /** The type identifier for the source system */\n source: string;\n /** Additional source-specific properties */\n [key: string]: any;\n};\n\n/**\n * Represents a complete activity within the Plot system.\n *\n * Activities are the core entities in Plot, representing anything from simple notes\n * to complex recurring events. They support rich metadata including scheduling,\n * recurrence patterns, links, and external source tracking.\n *\n * @example\n * ```typescript\n * // Simple note\n * const task: Activity = {\n * type: ActivityType.Note,\n * title: \"New campaign brainstorming ideas\",\n * note: \"We could rent a bouncy castle...\",\n * author: { id: \"user-1\", name: \"John Doe\", type: ActorType.User },\n * priority: { id: \"work\", title: \"Work\" },\n * // ... other fields\n * };\n *\n * // Simple action\n * const action: Activity = {\n * type: ActivityType.Action,\n * title: \"Review budget proposal\",\n * author: { id: \"user-1\", name: \"John Doe\", type: ActorType.User },\n * end: null,\n * priority: { id: \"work\", title: \"Work\" },\n * // ... other fields\n * };\n *\n * // Recurring event\n * const meeting: Activity = {\n * type: ActivityType.Event,\n * title: \"Weekly standup\",\n * recurrenceRule: \"FREQ=WEEKLY;BYDAY=MO\",\n * recurrenceCount: 12,\n * // ... other fields\n * };\n * ```\n */\nexport type Activity = {\n /** Unique identifier for the activity */\n id: string;\n /** The type of activity (Note, Task, or Event) */\n type: ActivityType;\n /** Information about who created the activity */\n author: Actor;\n /** The display title/summary of the activity */\n title: string | null;\n /** Primary content for the activity */\n note: string | null;\n /**\n * Start time of a scheduled activity. Notes are not typically scheduled unless they're about specific times.\n * For recurring events, this represents the start of the first occurrence.\n * Can be a Date object for timed events or a date string in \"YYYY-MM-DD\" format for all-day events.\n * Null for activities without scheduled start times.\n */\n start: Date | string | null;\n /**\n * End time of a scheduled activity. Notes are not typically scheduled unless they're about specific times.\n * For recurring events, this represents the end of the first occurrence.\n * Can be a Date object for timed events or a date string in \"YYYY-MM-DD\" format for all-day events.\n * Null for tasks or activities without defined end times.\n */\n end: Date | string | null;\n /**\n * For recurring activities, the last occurrence date (inclusive).\n * Can be a Date object, date string in \"YYYY-MM-DD\" format, or null if recurring indefinitely.\n * When both recurrenceCount and recurrenceUntil are provided, recurrenceCount takes precedence.\n */\n recurrenceUntil: Date | string | null;\n /**\n * For recurring activities, the number of occurrences to generate.\n * Takes precedence over recurrenceUntil if both are provided.\n * Null for non-recurring activities or indefinite recurrence.\n */\n recurrenceCount: number | null;\n /** Timestamp when the activity was marked as complete. Null if not completed. */\n doneAt: Date | null;\n /** Reference to a parent activity for creating hierarchical relationships */\n parent: Activity | null;\n /** For nested activities in a thread, references the top-level activity of that thread */\n threadRoot?: Activity;\n /** Array of interactive links attached to the activity */\n links: Array<ActivityLink> | null;\n /** The priority context this activity belongs to */\n priority: Priority;\n /** Recurrence rule in RFC 5545 RRULE format (e.g., \"FREQ=WEEKLY;BYDAY=MO,WE,FR\") */\n recurrenceRule: string | null;\n /** Array of dates to exclude from the recurrence pattern */\n recurrenceExdates: Date[] | null;\n /** Array of additional occurrence dates to include in the recurrence pattern */\n recurrenceDates: Date[] | null;\n /**\n * For recurring event exceptions, points to the root recurring activity.\n * Used when an individual occurrence of a recurring event is modified.\n */\n recurrence: Activity | null;\n /**\n * For recurring event exceptions, the original occurrence date being overridden.\n * Used to identify which occurrence of a recurring event this exception replaces.\n */\n occurrence: Date | null;\n /** Metadata about the activity, typically from an external system that created it */\n meta: ActivityMeta | null;\n /** Tags attached to this activity. Maps tag ID to array of actor IDs who added that tag. */\n tags: Partial<Record<Tag, ActorId[]>> | null;\n /** Array of actor IDs (users, contacts, or twists) mentioned in this activity via @-mentions */\n mentions: ActorId[] | null;\n};\n\n/**\n * Configuration for automatic priority selection based on activity similarity.\n *\n * Maps activity fields to scoring weights or required exact matches:\n * - Number value: Maximum score for similarity matching on this field\n * - `true` value: Required exact match - activities must match exactly or be excluded\n *\n * Scoring rules:\n * - content: Uses vector similarity on activity embedding (cosine similarity)\n * - type: Exact match on ActivityType\n * - mentions: Percentage of existing activity's mentions that appear in new activity\n * - meta.field: Exact match on top-level meta fields (e.g., \"meta.sourceId\")\n *\n * When content is `true`, applies a strong similarity threshold to ensure only close matches.\n * Default (when neither priority nor pickPriority specified): `{content: true}`\n *\n * @example\n * ```typescript\n * // Require exact content match with strong similarity\n * pickPriority: { content: true }\n *\n * // Score based on content (max 100 points) and require exact type match\n * pickPriority: { content: 100, type: true }\n *\n * // Match on meta source and score content\n * pickPriority: { \"meta.source\": true, content: 50 }\n * ```\n */\nexport type PickPriorityConfig = {\n content?: number | true;\n type?: number | true;\n mentions?: number | true;\n [key: `meta.${string}`]: number | true;\n};\n\n/**\n * Type for creating new activities.\n *\n * Requires only the activity type, with all other fields optional.\n * The ID and author will be automatically assigned by the Plot system\n * based on the current execution context.\n *\n * Priority can be specified in three ways:\n * 1. Explicit priority: `priority: { id: \"...\" }` - Use specific priority (disables pickPriority)\n * 2. Pick priority config: `pickPriority: { ... }` - Auto-select based on similarity\n * 3. Neither: Defaults to `pickPriority: { content: true }` for automatic matching\n *\n * @example\n * ```typescript\n * // Explicit priority (disables automatic matching)\n * const newTask: NewActivity = {\n * type: ActivityType.Action,\n * title: \"Review pull request\",\n * priority: { id: \"work-project-123\" }\n * };\n *\n * // Automatic priority matching (default behavior)\n * const newNote: NewActivity = {\n * type: ActivityType.Note,\n * title: \"Meeting notes\",\n * note: \"Discussed Q4 roadmap...\"\n * // Defaults to pickPriority: { content: true }\n * };\n *\n * // Custom priority matching\n * const newEvent: NewActivity = {\n * type: ActivityType.Event,\n * title: \"Team standup\",\n * pickPriority: { type: true, content: 50 }\n * };\n * ```\n */\nexport type NewActivity = Pick<Activity, \"type\"> &\n Partial<\n Omit<\n Activity,\n \"id\" | \"author\" | \"type\" | \"parent\" | \"priority\" | \"threadRoot\"\n > & {\n parent?: Pick<Activity, \"id\"> | null;\n\n /**\n * Format of the note content. Determines how the note is processed:\n * - 'text': Plain text that will be converted to markdown (auto-links URLs, preserves line breaks)\n * - 'markdown': Already in markdown format (default, no conversion)\n * - 'html': HTML content that will be converted to markdown\n */\n noteType?: NoteType;\n }\n > &\n (\n | {\n /** Explicit priority (required when specified) - disables automatic priority matching */\n priority: Pick<Priority, \"id\">;\n }\n | {\n /** Configuration for automatic priority selection based on similarity */\n pickPriority?: PickPriorityConfig;\n }\n | {}\n );\n\nexport type ActivityUpdate = Pick<Activity, \"id\"> &\n Partial<\n Pick<\n Activity,\n | \"type\"\n | \"start\"\n | \"end\"\n | \"doneAt\"\n | \"note\"\n | \"title\"\n | \"meta\"\n | \"links\"\n | \"recurrenceRule\"\n | \"recurrenceDates\"\n | \"recurrenceExdates\"\n | \"recurrenceUntil\"\n | \"recurrenceCount\"\n | \"occurrence\"\n | \"mentions\"\n >\n > & {\n parent?: Pick<Activity, \"id\"> | null;\n\n /**\n * Format of the note content. Determines how the note is processed:\n * - 'text': Plain text that will be converted to markdown (auto-links URLs, preserves line breaks)\n * - 'markdown': Already in markdown format (default, no conversion)\n * - 'html': HTML content that will be converted to markdown\n */\n noteType?: NoteType;\n\n /**\n * Full tags object from Activity. Maps tag ID to array of actor IDs who added that tag.\n * Only allowed for activities created by the twist.\n * Use twistTags instead for adding/removing the twist's tags on other activities.\n */\n tags?: Partial<Record<Tag, ActorId[]>>;\n\n /**\n * Add or remove the twist's tags.\n * Maps tag ID to boolean: true = add tag, false = remove tag.\n * This is allowed on all activities the twist has access to.\n */\n twistTags?: Partial<Record<Tag, boolean>>;\n };\n\n/**\n * Represents an actor in Plot - a user, contact, or twist.\n *\n * Actors can be associated with activities as authors, assignees, or mentions.\n * The email field is only included when ContactAccess.Read permission is granted.\n *\n * @example\n * ```typescript\n * const actor: Actor = {\n * id: \"f0ffd5f8-1635-4b13-9532-35f97446db90\" as ActorId,\n * type: ActorType.Contact,\n * email: \"john.doe@example.com\", // Only if ContactAccess.Read\n * name: \"John Doe\"\n * };\n * ```\n */\nexport type Actor = {\n /** Unique identifier for the actor */\n id: ActorId;\n /** Type of actor (User, Contact, or Twist) */\n type: ActorType;\n /** Email address (only included with ContactAccess.Read permission) */\n email?: string;\n /** Display name (undefined if not included due to permissions, null if not set) */\n name?: string | null;\n};\n\n/**\n * Enumeration of author types that can create activities.\n *\n * The author type affects how activities are displayed and processed\n * within the Plot system.\n */\nexport enum ActorType {\n /** Activities created by human users */\n User,\n /** Activities created by external contacts */\n Contact,\n /** Activities created by automated twists */\n Twist,\n}\n\n/**\n * Represents contact information for creating a new contact.\n *\n * Contacts are used throughout Plot for representing people associated\n * with activities, such as event attendees or task assignees.\n *\n * @example\n * ```typescript\n * const newContact: NewContact = {\n * email: \"john.doe@example.com\",\n * name: \"John Doe\",\n * avatar: \"https://avatar.example.com/john.jpg\"\n * };\n * ```\n */\nexport type NewContact = {\n /** Email address of the contact (required) */\n email: string;\n /** Optional display name for the contact */\n name?: string;\n /** Optional avatar image URL for the contact */\n avatar?: string;\n};\n\nexport type NoteType = \"text\" | \"markdown\" | \"html\";\n";
7
+ export default "import { type Tag } from \"./tag\";\nimport { type Callback } from \"./tools/callbacks\";\n\nexport { Tag } from \"./tag\";\n\n/**\n * Represents a unique user, contact, or twist in Plot.\n *\n * Note contacts (i.e. people not using Plot) are also represented by ActorIds. They may be\n * people interacting with other connected services (e.g. an email sender or event attendee).\n */\nexport type ActorId = string & { readonly __brand: \"ActorId\" };\n\n/**\n * Represents a priority context within Plot.\n *\n * Priorities are similar to projects in other apps. All Activity is in a Priority.\n * Priorities can be nested.\n */\nexport type Priority = {\n /** Unique identifier for the priority */\n id: string;\n /** Human-readable title for the priority */\n title: string;\n};\n\n/**\n * Type for creating new priorities.\n *\n * Excludes the auto-generated ID field and adds an optional parentId\n * for creating hierarchical priority structures.\n */\nexport type NewPriority = Omit<Priority, \"id\"> & {\n /** Optional ID of the parent priority for creating hierarchies */\n parentId?: string;\n};\n\n/**\n * Enumeration of supported activity types in Plot.\n *\n * Each activity type has different behaviors and rendering characteristics\n * within the Plot application.\n */\nexport enum ActivityType {\n /** A note or piece of information without actionable requirements */\n Note,\n /** An actionable item that can be completed */\n Action,\n /** A scheduled occurrence with start and optional end time */\n Event,\n}\n\n/**\n * Enumeration of supported activity link types.\n *\n * Different link types have different behaviors when clicked by users\n * and may require different rendering approaches.\n */\nexport enum ActivityLinkType {\n /** External web links that open in browser */\n external = \"external\",\n /** Authentication flows for connecting services */\n auth = \"auth\",\n /** Callback links that trigger twist methods when clicked */\n callback = \"callback\",\n /** Video conferencing links with provider-specific handling */\n conferencing = \"conferencing\",\n}\n\n/**\n * Video conferencing providers for conferencing links.\n *\n * Used to identify the conferencing platform and provide\n * provider-specific UI elements (titles, icons, etc.).\n */\nexport enum ConferencingProvider {\n /** Google Meet */\n googleMeet = \"googleMeet\",\n /** Zoom */\n zoom = \"zoom\",\n /** Microsoft Teams */\n microsoftTeams = \"microsoftTeams\",\n /** Cisco Webex */\n webex = \"webex\",\n /** Other or unknown conferencing provider */\n other = \"other\",\n}\n\n/**\n * Represents a clickable link attached to an activity.\n *\n * Activity links are rendered as buttons that enable user interaction with activities.\n * Different link types have specific behaviors and required fields for proper functionality.\n *\n * @example\n * ```typescript\n * // External link - opens URL in browser\n * const externalLink: ActivityLink = {\n * type: ActivityLinkType.external,\n * title: \"Open in Google Calendar\",\n * url: \"https://calendar.google.com/event/123\",\n * };\n *\n * // Conferencing link - opens video conference with provider info\n * const conferencingLink: ActivityLink = {\n * type: ActivityLinkType.conferencing,\n * url: \"https://meet.google.com/abc-defg-hij\",\n * provider: ConferencingProvider.googleMeet,\n * };\n *\n * // Integrations link - initiates OAuth flow\n * const authLink: ActivityLink = {\n * type: ActivityLinkType.auth,\n * title: \"Continue with Google\",\n * provider: AuthProvider.Google,\n * level: AuthLevel.User,\n * scopes: [\"https://www.googleapis.com/auth/calendar.readonly\"],\n * callback: \"callback-token-for-auth-completion\"\n * };\n *\n * // Callback link - triggers a twist method\n * const callbackLink: ActivityLink = {\n * type: ActivityLinkType.callback,\n * title: \"📅 Primary Calendar\",\n * token: \"callback-token-here\"\n * };\n * ```\n */\nexport type ActivityLink =\n | {\n /** External web link that opens in browser */\n type: ActivityLinkType.external;\n /** Display text for the link button */\n title: string;\n /** URL to open when clicked */\n url: string;\n }\n | {\n /** Video conferencing link with provider-specific handling */\n type: ActivityLinkType.conferencing;\n /** URL to join the conference */\n url: string;\n /** Conferencing provider for UI customization */\n provider: ConferencingProvider;\n }\n | {\n /** Authentication link that initiates an OAuth flow */\n type: ActivityLinkType.auth;\n /** Display text for the auth button */\n title: string;\n /** OAuth provider (e.g., \"google\", \"microsoft\") */\n provider: string;\n /** Authorization level (\"user\" or \"priority\") */\n level: string;\n /** Array of OAuth scopes to request */\n scopes: string[];\n /** Callback token for auth completion notification */\n callback: Callback;\n }\n | {\n /** Callback link that triggers a twist method when clicked */\n type: ActivityLinkType.callback;\n /** Display text for the callback button */\n title: string;\n /** Token identifying the callback to execute */\n callback: Callback;\n };\n\n/**\n * Represents metadata about an activity, typically from an external system.\n *\n * Activity metadata enables tracking where activities originated from,\n * which is useful for synchronization, deduplication, and linking\n * back to external systems.\n *\n * @example\n * ```typescript\n * const googleCalendarMeta: ActivityMeta = {\n * type: \"google-calendar-event\",\n * id: \"event-123\",\n * calendarId: \"primary\",\n * htmlLink: \"https://calendar.google.com/event/123\"\n * };\n * ```\n */\nexport type ActivityMeta = {\n /** The type identifier for the source system */\n source: string;\n /** Additional source-specific properties */\n [key: string]: any;\n};\n\n/**\n * Represents a complete activity within the Plot system.\n *\n * Activities are the core entities in Plot, representing anything from simple notes\n * to complex recurring events. They support rich metadata including scheduling,\n * recurrence patterns, links, and external source tracking.\n *\n * @example\n * ```typescript\n * // Simple note\n * const task: Activity = {\n * type: ActivityType.Note,\n * title: \"New campaign brainstorming ideas\",\n * note: \"We could rent a bouncy castle...\",\n * author: { id: \"user-1\", name: \"John Doe\", type: ActorType.User },\n * priority: { id: \"work\", title: \"Work\" },\n * // ... other fields\n * };\n *\n * // Simple action\n * const action: Activity = {\n * type: ActivityType.Action,\n * title: \"Review budget proposal\",\n * author: { id: \"user-1\", name: \"John Doe\", type: ActorType.User },\n * priority: { id: \"work\", title: \"Work\" },\n * // ... other fields\n * };\n *\n * // Recurring event\n * const meeting: Activity = {\n * type: ActivityType.Event,\n * title: \"Weekly standup\",\n * recurrenceRule: \"FREQ=WEEKLY;BYDAY=MO\",\n * recurrenceCount: 12,\n * // ... other fields\n * };\n * ```\n */\nexport type ActivityCommon = {\n /** Unique identifier for the activity */\n id: string;\n /** Information about who created the activity */\n author: Actor;\n /** Whether this activity is in draft state (not shown in do now view) */\n draft: boolean;\n /** Whether this activity is private (only visible to author) */\n private: boolean;\n /** Tags attached to this activity. Maps tag ID to array of actor IDs who added that tag. */\n tags: Partial<Record<Tag, ActorId[]>> | null;\n /** Array of actor IDs (users, contacts, or twists) mentioned in this activity via @-mentions */\n mentions: ActorId[] | null;\n};\n\nexport type Activity = ActivityCommon & {\n /** The display title/summary of the activity */\n title: string | null;\n /** The type of activity (Note, Task, or Event) */\n type: ActivityType;\n /** Who this activity note is assigned to */\n assignee: Actor | null;\n /** Timestamp when the activity was marked as complete. Null if not completed. */\n doneAt: Date | null;\n /**\n * Start time of a scheduled activity. Notes are not typically scheduled unless they're about specific times.\n * For recurring events, this represents the start of the first occurrence.\n * Can be a Date object for timed events or a date string in \"YYYY-MM-DD\" format for all-day events.\n * Null for activities without scheduled start times.\n */\n start: Date | string | null;\n /**\n * End time of a scheduled activity. Notes are not typically scheduled unless they're about specific times.\n * For recurring events, this represents the end of the first occurrence.\n * Can be a Date object for timed events or a date string in \"YYYY-MM-DD\" format for all-day events.\n * Null for tasks or activities without defined end times.\n */\n end: Date | string | null;\n /**\n * For recurring activities, the last occurrence date (inclusive).\n * Can be a Date object, date string in \"YYYY-MM-DD\" format, or null if recurring indefinitely.\n * When both recurrenceCount and recurrenceUntil are provided, recurrenceCount takes precedence.\n */\n recurrenceUntil: Date | string | null;\n /**\n * For recurring activities, the number of occurrences to generate.\n * Takes precedence over recurrenceUntil if both are provided.\n * Null for non-recurring activities or indefinite recurrence.\n */\n recurrenceCount: number | null;\n /** The priority context this activity belongs to */\n priority: Priority;\n /** Recurrence rule in RFC 5545 RRULE format (e.g., \"FREQ=WEEKLY;BYDAY=MO,WE,FR\") */\n recurrenceRule: string | null;\n /** Array of dates to exclude from the recurrence pattern */\n recurrenceExdates: Date[] | null;\n /** Array of additional occurrence dates to include in the recurrence pattern */\n recurrenceDates: Date[] | null;\n /**\n * For recurring event exceptions, points to the root recurring activity.\n * Used when an individual occurrence of a recurring event is modified.\n */\n recurrence: Activity | null;\n /**\n * For recurring event exceptions, the original occurrence date being overridden.\n * Used to identify which occurrence of a recurring event this exception replaces.\n */\n occurrence: Date | null;\n /** Metadata about the activity, typically from an external system that created it */\n meta: ActivityMeta | null;\n};\n\nexport type ActivityWithNotes = Activity & {\n notes: Note[];\n};\n\nexport type NewActivityWithNotes = NewActivity & {\n notes: Omit<NewNote, \"activity\">[];\n};\n\n/**\n * Configuration for automatic priority selection based on activity similarity.\n *\n * Maps activity fields to scoring weights or required exact matches:\n * - Number value: Maximum score for similarity matching on this field\n * - `true` value: Required exact match - activities must match exactly or be excluded\n *\n * Scoring rules:\n * - content: Uses vector similarity on activity embedding (cosine similarity)\n * - type: Exact match on ActivityType\n * - mentions: Percentage of existing activity's mentions that appear in new activity\n * - meta.field: Exact match on top-level meta fields (e.g., \"meta.sourceId\")\n *\n * When content is `true`, applies a strong similarity threshold to ensure only close matches.\n * Default (when neither priority nor pickPriority specified): `{content: true}`\n *\n * @example\n * ```typescript\n * // Require exact content match with strong similarity\n * pickPriority: { content: true }\n *\n * // Score based on content (max 100 points) and require exact type match\n * pickPriority: { content: 100, type: true }\n *\n * // Match on meta source and score content\n * pickPriority: { \"meta.source\": true, content: 50 }\n * ```\n */\nexport type PickPriorityConfig = {\n content?: number | true;\n type?: number | true;\n mentions?: number | true;\n [key: `meta.${string}`]: number | true;\n};\n\n/**\n * Type for creating new activities.\n *\n * Requires only the activity type, with all other fields optional.\n * The ID and author will be automatically assigned by the Plot system\n * based on the current execution context.\n *\n * Priority can be specified in three ways:\n * 1. Explicit priority: `priority: { id: \"...\" }` - Use specific priority (disables pickPriority)\n * 2. Pick priority config: `pickPriority: { ... }` - Auto-select based on similarity\n * 3. Neither: Defaults to `pickPriority: { content: true }` for automatic matching\n *\n * @example\n * ```typescript\n * // Explicit priority (disables automatic matching)\n * const newTask: NewActivity = {\n * type: ActivityType.Action,\n * title: \"Review pull request\",\n * priority: { id: \"work-project-123\" }\n * };\n *\n * // Automatic priority matching (default behavior)\n * const newNote: NewActivity = {\n * type: ActivityType.Note,\n * title: \"Meeting notes\",\n * note: \"Discussed Q4 roadmap...\"\n * // Defaults to pickPriority: { content: true }\n * };\n *\n * // Custom priority matching\n * const newEvent: NewActivity = {\n * type: ActivityType.Event,\n * title: \"Team standup\",\n * pickPriority: { type: true, content: 50 }\n * };\n * ```\n */\nexport type NewActivity = Pick<Activity, \"type\"> &\n Partial<Omit<Activity, \"id\" | \"author\" | \"type\" | \"priority\" | \"mentions\">> &\n (\n | {\n /** Explicit priority (required when specified) - disables automatic priority matching */\n priority: Pick<Priority, \"id\">;\n }\n | {\n /** Configuration for automatic priority selection based on similarity */\n pickPriority?: PickPriorityConfig;\n }\n | {}\n );\n\nexport type ActivityUpdate = Pick<Activity, \"id\"> &\n Partial<\n Pick<\n Activity,\n | \"type\"\n | \"start\"\n | \"end\"\n | \"doneAt\"\n | \"title\"\n | \"draft\"\n | \"private\"\n | \"meta\"\n | \"recurrenceRule\"\n | \"recurrenceDates\"\n | \"recurrenceExdates\"\n | \"recurrenceUntil\"\n | \"recurrenceCount\"\n | \"occurrence\"\n >\n > & {\n /**\n * Full tags object from Activity. Maps tag ID to array of actor IDs who added that tag.\n * Only allowed for activities created by the twist.\n * Use twistTags instead for adding/removing the twist's tags on other activities.\n */\n tags?: Partial<Record<Tag, ActorId[]>>;\n\n /**\n * Add or remove the twist's tags.\n * Maps tag ID to boolean: true = add tag, false = remove tag.\n * This is allowed on all activities the twist has access to.\n */\n twistTags?: Partial<Record<Tag, boolean>>;\n };\n\n/**\n * Represents a note within an activity.\n *\n * Notes contain the detailed content (note text, links) associated with an activity.\n * They are always ordered by creation time within their parent activity.\n */\nexport type Note = Omit<ActivityCommon, \"type\"> & {\n /** The parent activity this note belongs to */\n activity: Activity;\n /** Primary content for the note (markdown) */\n note: string | null;\n /** Array of interactive links attached to the note */\n links: Array<ActivityLink> | null;\n};\n\n/**\n * Type for creating new notes.\n *\n * Requires the activity reference, with all other fields optional.\n */\nexport type NewNote = Partial<Omit<Note, \"id\" | \"author\" | \"activity\">> & {\n /** Reference to the parent activity (required) */\n activity: Pick<Activity, \"id\">;\n\n /**\n * Format of the note content. Determines how the note is processed:\n * - 'text': Plain text that will be converted to markdown (auto-links URLs, preserves line breaks)\n * - 'markdown': Already in markdown format (default, no conversion)\n * - 'html': HTML content that will be converted to markdown\n */\n noteType?: NoteType;\n};\n\n/**\n * Type for updating existing notes.\n */\nexport type NoteUpdate = Pick<Note, \"id\"> &\n Partial<Pick<Note, \"draft\" | \"private\" | \"note\" | \"links\" | \"mentions\">> & {\n /**\n * Format of the note content. Determines how the note is processed:\n * - 'text': Plain text that will be converted to markdown (auto-links URLs, preserves line breaks)\n * - 'markdown': Already in markdown format (default, no conversion)\n * - 'html': HTML content that will be converted to markdown\n */\n noteType?: NoteType;\n\n /**\n * Full tags object from Note. Maps tag ID to array of actor IDs who added that tag.\n * Only allowed for notes created by the twist.\n * Use twistTags instead for adding/removing the twist's tags on other notes.\n */\n tags?: Partial<Record<Tag, ActorId[]>>;\n\n /**\n * Add or remove the twist's tags.\n * Maps tag ID to boolean: true = add tag, false = remove tag.\n * This is allowed on all notes the twist has access to.\n */\n twistTags?: Partial<Record<Tag, boolean>>;\n };\n\n/**\n * Represents an actor in Plot - a user, contact, or twist.\n *\n * Actors can be associated with activities as authors, assignees, or mentions.\n * The email field is only included when ContactAccess.Read permission is granted.\n *\n * @example\n * ```typescript\n * const actor: Actor = {\n * id: \"f0ffd5f8-1635-4b13-9532-35f97446db90\" as ActorId,\n * type: ActorType.Contact,\n * email: \"john.doe@example.com\", // Only if ContactAccess.Read\n * name: \"John Doe\"\n * };\n * ```\n */\nexport type Actor = {\n /** Unique identifier for the actor */\n id: ActorId;\n /** Type of actor (User, Contact, or Twist) */\n type: ActorType;\n /** Email address (only included with ContactAccess.Read permission) */\n email?: string;\n /** Display name (undefined if not included due to permissions, null if not set) */\n name?: string | null;\n};\n\n/**\n * Enumeration of author types that can create activities.\n *\n * The author type affects how activities are displayed and processed\n * within the Plot system.\n */\nexport enum ActorType {\n /** Activities created by human users */\n User,\n /** Activities created by external contacts */\n Contact,\n /** Activities created by automated twists */\n Twist,\n}\n\n/**\n * Represents contact information for creating a new contact.\n *\n * Contacts are used throughout Plot for representing people associated\n * with activities, such as event attendees or task assignees.\n *\n * @example\n * ```typescript\n * const newContact: NewContact = {\n * email: \"john.doe@example.com\",\n * name: \"John Doe\",\n * avatar: \"https://avatar.example.com/john.jpg\"\n * };\n * ```\n */\nexport type NewContact = {\n /** Email address of the contact (required) */\n email: string;\n /** Optional display name for the contact */\n name?: string;\n /** Optional avatar image URL for the contact */\n avatar?: string;\n};\n\nexport type NoteType = \"text\" | \"markdown\" | \"html\";\n";
8
8
  //# sourceMappingURL=plot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plot.js","sourceRoot":"","sources":["../../src/llm-docs/plot.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAe,wuiBAAwuiB,CAAC"}
1
+ {"version":3,"file":"plot.js","sourceRoot":"","sources":["../../src/llm-docs/plot.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAe,4mlBAA4mlB,CAAC"}
@@ -4,6 +4,6 @@
4
4
  * This file is auto-generated during build. Do not edit manually.
5
5
  * Generated from: prebuild.ts
6
6
  */
7
- declare const _default: "import {\n type Activity,\n type ActivityMeta,\n type ActivityUpdate,\n type Actor,\n type ActorId,\n ITool,\n type NewActivity,\n type NewContact,\n type NewPriority,\n type Priority,\n type Tag,\n} from \"..\";\n\nexport enum ActivityAccess {\n /**\n * Create new Activity on a thread where the twist was mentioned.\n * Add/remove tags on Activity where the twist was mentioned.\n */\n Respond,\n /**\n * Create new, top-level Activity.\n * Create new Activity in a thread the twist created.\n * All Respond permissions.\n */\n Create,\n}\n\nexport enum PriorityAccess {\n /**\n * Create a new Priority within the twist's Priority.\n * Update Priority created by the twist.\n */\n Create,\n /**\n * Read all Priority within the twist's Priority.\n * Create a new Priority within the twist's Priority.\n * Update and archive any Priority within the twist's Priority.\n */\n Full,\n}\n\nexport enum ContactAccess {\n /** Read existing contacts. */\n Read,\n /** Create and update contacts. */\n Write,\n}\n\n/**\n * Intent handler for activity mentions.\n * Defines how the twist should respond when mentioned in an activity.\n */\nexport type ActivityIntentHandler = {\n /** Human-readable description of what this intent handles */\n description: string;\n /** Example phrases or activity content that would match this intent */\n examples: string[];\n /** The function to call when this intent is matched */\n handler: (activity: Activity) => Promise<void>;\n};\n\n/**\n * Built-in tool for interacting with the core Plot data layer.\n *\n * The Plot tool provides twists with the ability to create and manage activities,\n * priorities, and contacts within the Plot system. This is the primary interface\n * for twists to persist data and interact with the Plot database.\n *\n * @example\n * ```typescript\n * class MyTwist extends Twist {\n * private plot: Plot;\n *\n * constructor(id: string, tools: ToolBuilder) {\n * super();\n * this.plot = tools.get(Plot);\n * }\n *\n * async activate(priority) {\n * // Create a welcome activity\n * await this.plot.createActivity({\n * type: ActivityType.Note,\n * title: \"Welcome to Plot!\",\n * links: [{\n * title: \"Get Started\",\n * type: ActivityLinkType.external,\n * url: \"https://plot.day/docs\"\n * }]\n * });\n * }\n * }\n * ```\n */\nexport abstract class Plot extends ITool {\n static readonly Options: {\n /**\n * Activity event callbacks.\n */\n activity?: {\n access?: ActivityAccess;\n\n /**\n * Called when an activity is updated.\n *\n * @param activity - The updated activity\n * @param changes - Optional changes object containing the previous version and tag modifications\n */\n updated?: (\n activity: Activity,\n changes?: {\n previous: Activity;\n tagsAdded: Record<Tag, ActorId[]>;\n tagsRemoved: Record<Tag, ActorId[]>;\n }\n ) => Promise<void>;\n\n /**\n * Intent handlers for activity mentions.\n * When an activity mentions this twist, the system will match the activity\n * content against these intent descriptions and call the matching handler.\n *\n * @example\n * ```typescript\n * intents: [{\n * description: \"Schedule or reschedule calendar events\",\n * examples: [\"Schedule a meeting tomorrow at 2pm\", \"Move my 3pm meeting to 4pm\"],\n * handler: this.onSchedulingRequest\n * }, {\n * description: \"Find available meeting times\",\n * examples: [\"When am I free this week?\", \"Find time for a 1 hour meeting\"],\n * handler: this.onAvailabilityRequest\n * }]\n * ```\n */\n intents?: ActivityIntentHandler[];\n };\n priority?: {\n access?: PriorityAccess;\n };\n contact?: {\n access?: ContactAccess;\n };\n };\n\n /**\n * Creates a new activity in the Plot system.\n *\n * The activity will be automatically assigned an ID and author information\n * based on the current execution context. All other fields from NewActivity\n * will be preserved in the created activity.\n *\n * @param activity - The activity data to create\n * @returns Promise resolving to the complete created activity\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract createActivity(activity: NewActivity): Promise<Activity>;\n\n /**\n * Creates multiple activities in a single batch operation.\n *\n * This method efficiently creates multiple activities at once, which is\n * more performant than calling createActivity() multiple times individually.\n * All activities are created with the same author and access control rules.\n *\n * @param activities - Array of activity data to create\n * @returns Promise resolving to array of created activities\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract createActivities(activities: NewActivity[]): Promise<Activity[]>;\n\n /**\n * Updates an existing activity in the Plot system.\n *\n * Only the fields provided in the update object will be modified - all other fields\n * remain unchanged. This enables partial updates without needing to fetch and resend\n * the entire activity object.\n *\n * For tags, provide a Record<number, boolean> where true adds a tag and false removes it.\n * Tags not included in the update remain unchanged.\n *\n * When updating the parent, the activity's path will be automatically recalculated to\n * maintain the correct hierarchical structure.\n *\n * When updating scheduling fields (start, end, recurrence*), the database will\n * automatically recalculate duration and range values to maintain consistency.\n *\n * @param activity - The activity update containing the ID and fields to change\n * @returns Promise that resolves when the update is complete\n *\n * @example\n * ```typescript\n * // Mark a task as complete\n * await this.plot.updateActivity({\n * id: \"task-123\",\n * doneAt: new Date()\n * });\n *\n * // Reschedule an event\n * await this.plot.updateActivity({\n * id: \"event-456\",\n * start: new Date(\"2024-03-15T10:00:00Z\"),\n * end: new Date(\"2024-03-15T11:00:00Z\")\n * });\n *\n * // Add and remove tags\n * await this.plot.updateActivity({\n * id: \"activity-789\",\n * tags: {\n * 1: true, // Add tag with ID 1\n * 2: false // Remove tag with ID 2\n * }\n * });\n *\n * // Update a recurring event exception\n * await this.plot.updateActivity({\n * id: \"exception-123\",\n * occurrence: new Date(\"2024-03-20T09:00:00Z\"),\n * title: \"Rescheduled meeting\"\n * });\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract updateActivity(activity: ActivityUpdate): Promise<void>;\n\n /**\n * Retrieves all activities in the same thread as the specified activity.\n *\n * A thread consists of related activities linked through parent-child\n * relationships or other associative connections. This is useful for\n * finding conversation histories or related task sequences.\n *\n * @param activity - The activity whose thread to retrieve\n * @returns Promise resolving to array of activities in the thread\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract getThread(activity: Activity): Promise<Activity[]>;\n\n /**\n * Finds an activity by its metadata.\n *\n * This method enables lookup of activities that were created from external\n * systems, using the metadata to locate the corresponding Plot activity.\n * Useful for preventing duplicate imports and maintaining sync state.\n *\n * @param meta - The activity metadata to search for\n * @returns Promise resolving to the matching activity or null if not found\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract getActivityByMeta(meta: ActivityMeta): Promise<Activity | null>;\n\n /**\n * Creates a new priority in the Plot system.\n *\n * Priorities serve as organizational containers for activities and twists.\n * The created priority will be automatically assigned a unique ID.\n *\n * @param priority - The priority data to create\n * @returns Promise resolving to the complete created priority\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract createPriority(priority: NewPriority): Promise<Priority>;\n\n /**\n * Adds contacts to the Plot system.\n *\n * Contacts are used for associating people with activities, such as\n * event attendees or task assignees. Duplicate contacts (by email)\n * will be merged or updated as appropriate.\n * This method requires ContactAccess.Write permission.\n *\n * @param contacts - Array of contact information to add\n * @returns Promise resolving to array of created/updated actors\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract addContacts(contacts: Array<NewContact>): Promise<Actor[]>;\n\n /**\n * Retrieves actors by their IDs.\n *\n * Actors represent users, contacts, or twists in the Plot system.\n * This method requires ContactAccess.Read permission.\n *\n * @param ids - Array of actor IDs to retrieve\n * @returns Promise resolving to array of actors\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract getActors(ids: ActorId[]): Promise<Actor[]>;\n}\n";
7
+ declare const _default: "import {\n type Activity,\n type ActivityUpdate,\n type Actor,\n type ActorId,\n ITool,\n type NewActivity,\n type NewActivityWithNotes,\n type NewContact,\n type NewNote,\n type NewPriority,\n type Note,\n type NoteUpdate,\n type Priority,\n type Tag,\n} from \"..\";\n\nexport enum ActivityAccess {\n /**\n * Create new Note on an Activity where the twist was mentioned.\n * Add/remove tags on Activity or Note where the twist was mentioned.\n */\n Respond,\n /**\n * Create new Activity.\n * Create new Note in an Activity the twist created.\n * All Respond permissions.\n */\n Create,\n}\n\nexport enum PriorityAccess {\n /**\n * Create a new Priority within the twist's Priority.\n * Update Priority created by the twist.\n */\n Create,\n /**\n * Read all Priority within the twist's Priority.\n * Create a new Priority within the twist's Priority.\n * Update and archive any Priority within the twist's Priority.\n */\n Full,\n}\n\nexport enum ContactAccess {\n /** Read existing contacts. */\n Read,\n /** Create and update contacts. */\n Write,\n}\n\n/**\n * Intent handler for activity mentions.\n * Defines how the twist should respond when mentioned in an activity.\n */\nexport type NoteIntentHandler = {\n /** Human-readable description of what this intent handles */\n description: string;\n /** Example phrases or activity content that would match this intent */\n examples: string[];\n /** The function to call when this intent is matched */\n handler: (note: Note) => Promise<void>;\n};\n\n/**\n * Built-in tool for interacting with the core Plot data layer.\n *\n * The Plot tool provides twists with the ability to create and manage activities,\n * priorities, and contacts within the Plot system. This is the primary interface\n * for twists to persist data and interact with the Plot database.\n *\n * @example\n * ```typescript\n * class MyTwist extends Twist {\n * private plot: Plot;\n *\n * constructor(id: string, tools: ToolBuilder) {\n * super();\n * this.plot = tools.get(Plot);\n * }\n *\n * async activate(priority) {\n * // Create a welcome activity\n * await this.plot.createActivity({\n * type: ActivityType.Note,\n * title: \"Welcome to Plot!\",\n * links: [{\n * title: \"Get Started\",\n * type: ActivityLinkType.external,\n * url: \"https://plot.day/docs\"\n * }]\n * });\n * }\n * }\n * ```\n */\nexport abstract class Plot extends ITool {\n static readonly Options: {\n activity?: {\n /**\n * Capability to create Notes and modify tags.\n */\n access?: ActivityAccess;\n /**\n * Called when an activity created by this twist is updated.\n * This is often used to implement two-way sync with an external system.\n *\n * @param activity - The updated activity\n * @param changes - Optional changes object containing the previous version and tag modifications\n */\n updated?: (\n activity: Activity,\n changes: {\n previous: Activity;\n tagsAdded: Record<Tag, ActorId[]>;\n tagsRemoved: Record<Tag, ActorId[]>;\n }\n ) => Promise<void>;\n };\n note?: {\n /**\n * Respond to mentions in notes.\n *\n * When a note mentions this twist, the system will match the note\n * content against these intents and call the matching handler.\n *\n * @example\n * ```typescript\n * intents: [{\n * description: \"Schedule or reschedule calendar events\",\n * examples: [\"Schedule a meeting tomorrow at 2pm\", \"Move my 3pm meeting to 4pm\"],\n * handler: this.onSchedulingRequest\n * }, {\n * description: \"Find available meeting times\",\n * examples: [\"When am I free this week?\", \"Find time for a 1 hour meeting\"],\n * handler: this.onAvailabilityRequest\n * }]\n * ```\n */\n intents?: NoteIntentHandler[];\n };\n priority?: {\n access?: PriorityAccess;\n };\n contact?: {\n access?: ContactAccess;\n };\n };\n\n /**\n * Creates a new activity in the Plot system.\n *\n * The activity will be automatically assigned an ID and author information\n * based on the current execution context. All other fields from NewActivity\n * will be preserved in the created activity.\n *\n * @param activity - The activity data to create\n * @returns Promise resolving to the complete created activity\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract createActivity(\n activity: NewActivity | NewActivityWithNotes\n ): Promise<Activity>;\n\n /**\n * Creates multiple activities in a single batch operation.\n *\n * This method efficiently creates multiple activities at once, which is\n * more performant than calling createActivity() multiple times individually.\n * All activities are created with the same author and access control rules.\n *\n * @param activities - Array of activity data to create\n * @returns Promise resolving to array of created activities\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract createActivities(\n activities: (NewActivity | NewActivityWithNotes)[]\n ): Promise<Activity[]>;\n\n /**\n * Updates an existing activity in the Plot system.\n *\n * Only the fields provided in the update object will be modified - all other fields\n * remain unchanged. This enables partial updates without needing to fetch and resend\n * the entire activity object.\n *\n * For tags, provide a Record<number, boolean> where true adds a tag and false removes it.\n * Tags not included in the update remain unchanged.\n *\n * When updating the parent, the activity's path will be automatically recalculated to\n * maintain the correct hierarchical structure.\n *\n * When updating scheduling fields (start, end, recurrence*), the database will\n * automatically recalculate duration and range values to maintain consistency.\n *\n * @param activity - The activity update containing the ID and fields to change\n * @returns Promise that resolves when the update is complete\n *\n * @example\n * ```typescript\n * // Mark a task as complete\n * await this.plot.updateActivity({\n * id: \"task-123\",\n * doneAt: new Date()\n * });\n *\n * // Reschedule an event\n * await this.plot.updateActivity({\n * id: \"event-456\",\n * start: new Date(\"2024-03-15T10:00:00Z\"),\n * end: new Date(\"2024-03-15T11:00:00Z\")\n * });\n *\n * // Add and remove tags\n * await this.plot.updateActivity({\n * id: \"activity-789\",\n * tags: {\n * 1: true, // Add tag with ID 1\n * 2: false // Remove tag with ID 2\n * }\n * });\n *\n * // Update a recurring event exception\n * await this.plot.updateActivity({\n * id: \"exception-123\",\n * occurrence: new Date(\"2024-03-20T09:00:00Z\"),\n * title: \"Rescheduled meeting\"\n * });\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract updateActivity(activity: ActivityUpdate): Promise<void>;\n\n /**\n * Retrieves all notes within an activity.\n *\n * Notes are detailed entries within an activity, ordered by creation time.\n * Each note can contain markdown content, links, and other detailed information\n * related to the parent activity.\n *\n * @param activity - The activity whose notes to retrieve\n * @returns Promise resolving to array of notes in the activity\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract getNotes(activity: Activity): Promise<Note[]>;\n\n /**\n * Creates a new note in an activity.\n *\n * Notes provide detailed content within an activity, supporting markdown,\n * links, and other rich content. The note will be automatically assigned\n * an ID and author information based on the current execution context.\n *\n * @param note - The note data to create\n * @returns Promise resolving to the complete created note\n *\n * @example\n * ```typescript\n * // Create a note with content\n * await this.plot.createNote({\n * activity: { id: \"activity-123\" },\n * note: \"Discussion notes from the meeting...\",\n * noteType: \"markdown\"\n * });\n *\n * // Create a note with links\n * await this.plot.createNote({\n * activity: { id: \"activity-456\" },\n * note: \"Meeting recording available\",\n * links: [{\n * type: ActivityLinkType.external,\n * title: \"View Recording\",\n * url: \"https://example.com/recording\"\n * }]\n * });\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract createNote(note: NewNote): Promise<Note>;\n\n /**\n * Creates multiple notes in a single batch operation.\n *\n * This method efficiently creates multiple notes at once, which is\n * more performant than calling createNote() multiple times individually.\n * All notes are created with the same author and access control rules.\n *\n * @param notes - Array of note data to create\n * @returns Promise resolving to array of created notes\n *\n * @example\n * ```typescript\n * // Create multiple notes in one batch\n * await this.plot.createNotes([\n * {\n * activity: { id: \"activity-123\" },\n * note: \"First message in thread\"\n * },\n * {\n * activity: { id: \"activity-123\" },\n * note: \"Second message in thread\"\n * }\n * ]);\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract createNotes(notes: NewNote[]): Promise<Note[]>;\n\n /**\n * Updates an existing note in the Plot system.\n *\n * Only the fields provided in the update object will be modified - all other fields\n * remain unchanged. This enables partial updates without needing to fetch and resend\n * the entire note object.\n *\n * @param note - The note update containing the ID and fields to change\n * @returns Promise that resolves when the update is complete\n *\n * @example\n * ```typescript\n * // Update note content\n * await this.plot.updateNote({\n * id: \"note-123\",\n * note: \"Updated content with more details\"\n * });\n *\n * // Add tags to a note\n * await this.plot.updateNote({\n * id: \"note-456\",\n * twistTags: {\n * [Tag.Important]: true\n * }\n * });\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract updateNote(note: NoteUpdate): Promise<void>;\n\n /**\n * Finds an activity by its meta.source.\n *\n * This method enables lookup of activities that were created from external\n * systems, using the metadata to locate the corresponding Plot activity.\n *\n * @param source - The meta.source value to search for\n * @returns Promise resolving to the matching activity or null if not found\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract getActivityBySource(source: string): Promise<Activity | null>;\n\n /**\n * Creates a new priority in the Plot system.\n *\n * Priorities serve as organizational containers for activities and twists.\n * The created priority will be automatically assigned a unique ID.\n *\n * @param priority - The priority data to create\n * @returns Promise resolving to the complete created priority\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract createPriority(priority: NewPriority): Promise<Priority>;\n\n /**\n * Adds contacts to the Plot system.\n *\n * Contacts are used for associating people with activities, such as\n * event attendees or task assignees. Duplicate contacts (by email)\n * will be merged or updated as appropriate.\n * This method requires ContactAccess.Write permission.\n *\n * @param contacts - Array of contact information to add\n * @returns Promise resolving to array of created/updated actors\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract addContacts(contacts: Array<NewContact>): Promise<Actor[]>;\n\n /**\n * Retrieves actors by their IDs.\n *\n * Actors represent users, contacts, or twists in the Plot system.\n * This method requires ContactAccess.Read permission.\n *\n * @param ids - Array of actor IDs to retrieve\n * @returns Promise resolving to array of actors\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract getActors(ids: ActorId[]): Promise<Actor[]>;\n}\n";
8
8
  export default _default;
9
9
  //# sourceMappingURL=plot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plot.d.ts","sourceRoot":"","sources":["../../../src/llm-docs/tools/plot.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;wBAEY,48SAA48S;AAA39S,wBAA49S"}
1
+ {"version":3,"file":"plot.d.ts","sourceRoot":"","sources":["../../../src/llm-docs/tools/plot.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;wBAEY,07YAA07Y;AAAz8Y,wBAA08Y"}