@plotday/twister 0.20.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/bin/templates/AGENTS.template.md +5 -5
- package/bin/templates/README.template.md +1 -1
- package/cli/templates/AGENTS.template.md +5 -5
- package/cli/templates/README.template.md +1 -1
- package/dist/common/calendar.d.ts +1 -1
- package/dist/docs/assets/search.js +1 -1
- package/dist/docs/documents/Advanced.html +6 -6
- package/dist/docs/documents/Building_Custom_Tools.html +3 -3
- package/dist/docs/documents/Built-in_Tools.html +3 -3
- package/dist/docs/documents/Core_Concepts.html +3 -3
- package/dist/docs/documents/Getting_Started.html +1 -1
- package/dist/docs/documents/Runtime_Environment.html +2 -2
- package/dist/docs/enums/plot.ActivityType.html +3 -3
- package/dist/docs/interfaces/common_calendar.CalendarTool.html +1 -1
- package/dist/docs/types/plot.Activity.html +1 -1
- package/dist/docs/types/plot.NewActivity.html +1 -1
- package/dist/llm-docs/common/calendar.d.ts +1 -1
- package/dist/llm-docs/common/calendar.d.ts.map +1 -1
- package/dist/llm-docs/common/calendar.js +1 -1
- package/dist/llm-docs/common/calendar.js.map +1 -1
- package/dist/llm-docs/plot.d.ts +1 -1
- package/dist/llm-docs/plot.d.ts.map +1 -1
- package/dist/llm-docs/plot.js +1 -1
- package/dist/llm-docs/plot.js.map +1 -1
- package/dist/llm-docs/twist-guide-template.d.ts +1 -1
- package/dist/llm-docs/twist-guide-template.d.ts.map +1 -1
- package/dist/llm-docs/twist-guide-template.js +1 -1
- package/dist/llm-docs/twist-guide-template.js.map +1 -1
- package/dist/plot.d.ts +5 -5
- package/dist/plot.d.ts.map +1 -1
- package/dist/plot.js +1 -1
- package/dist/plot.js.map +1 -1
- package/dist/twist-guide.d.ts +1 -1
- package/dist/twist-guide.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
</ul>
|
|
32
32
|
<hr>
|
|
33
33
|
<h2 id="limitations" class="tsd-anchor-link">Limitations<a href="#limitations" 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></h2><h3 id="1-no-persistent-instance-state" class="tsd-anchor-link">1. No Persistent Instance State<a href="#1-no-persistent-instance-state" 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><p>Instance variables don't survive between invocations:</p>
|
|
34
|
-
<pre><code class="typescript"><span class="hl-7">// ❌ WRONG - This doesn't work!</span><br/><span class="hl-4">class</span><span class="hl-1"> </span><span class="hl-5">MyTwist</span><span class="hl-1"> </span><span class="hl-4">extends</span><span class="hl-1"> </span><span class="hl-5">
|
|
34
|
+
<pre><code class="typescript"><span class="hl-7">// ❌ WRONG - This doesn't work!</span><br/><span class="hl-4">class</span><span class="hl-1"> </span><span class="hl-5">MyTwist</span><span class="hl-1"> </span><span class="hl-4">extends</span><span class="hl-1"> </span><span class="hl-5">Twist</span><span class="hl-1"><</span><span class="hl-5">MyTwist</span><span class="hl-1">> {</span><br/><span class="hl-1"> </span><span class="hl-4">private</span><span class="hl-1"> </span><span class="hl-2">syncToken</span><span class="hl-1">: </span><span class="hl-5">string</span><span class="hl-1"> = </span><span class="hl-3">""</span><span class="hl-1">; </span><span class="hl-7">// Lost after execution!</span><br/><br/><span class="hl-1"> </span><span class="hl-4">async</span><span class="hl-1"> </span><span class="hl-6">activate</span><span class="hl-1">() {</span><br/><span class="hl-1"> </span><span class="hl-4">this</span><span class="hl-1">.</span><span class="hl-2">syncToken</span><span class="hl-1"> = </span><span class="hl-3">"abc123"</span><span class="hl-1">; </span><span class="hl-7">// Saved to instance</span><br/><span class="hl-1"> }</span><br/><br/><span class="hl-1"> </span><span class="hl-4">async</span><span class="hl-1"> </span><span class="hl-6">someMethod</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-4">this</span><span class="hl-1">.</span><span class="hl-2">syncToken</span><span class="hl-1">); </span><span class="hl-7">// Undefined! Different execution context</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">}</span><br/><br/><span class="hl-7">// ✅ CORRECT - Use Store</span><br/><span class="hl-4">class</span><span class="hl-1"> </span><span class="hl-5">MyTwist</span><span class="hl-1"> </span><span class="hl-4">extends</span><span class="hl-1"> </span><span class="hl-5">Twist</span><span class="hl-1"><</span><span class="hl-5">MyTwist</span><span class="hl-1">> {</span><br/><span class="hl-1"> </span><span class="hl-4">async</span><span class="hl-1"> </span><span class="hl-6">activate</span><span class="hl-1">() {</span><br/><span class="hl-1"> </span><span class="hl-0">await</span><span class="hl-1"> </span><span class="hl-4">this</span><span class="hl-1">.</span><span class="hl-6">set</span><span class="hl-1">(</span><span class="hl-3">"sync_token"</span><span class="hl-1">, </span><span class="hl-3">"abc123"</span><span class="hl-1">); </span><span class="hl-7">// Persisted</span><br/><span class="hl-1"> }</span><br/><br/><span class="hl-1"> </span><span class="hl-4">async</span><span class="hl-1"> </span><span class="hl-6">someMethod</span><span class="hl-1">() {</span><br/><span class="hl-1"> </span><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-8">token</span><span class="hl-1"> = </span><span class="hl-0">await</span><span class="hl-1"> </span><span class="hl-4">this</span><span class="hl-1">.</span><span class="hl-6">get</span><span class="hl-1"><</span><span class="hl-5">string</span><span class="hl-1">>(</span><span class="hl-3">"sync_token"</span><span class="hl-1">); </span><span class="hl-7">// Retrieved</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-2">token</span><span class="hl-1">); </span><span class="hl-7">// "abc123"</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">}</span>
|
|
35
35
|
</code><button type="button">Copy</button></pre>
|
|
36
36
|
|
|
37
37
|
<h3 id="2-limited-execution-time" class="tsd-anchor-link">2. Limited Execution Time<a href="#2-limited-execution-time" 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><p>Long-running operations must be broken into batches:</p>
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
|
|
85
85
|
<hr>
|
|
86
86
|
<h2 id="performance-optimization" class="tsd-anchor-link">Performance Optimization<a href="#performance-optimization" 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></h2><h3 id="1-minimize-api-calls" class="tsd-anchor-link">1. Minimize API Calls<a href="#1-minimize-api-calls" 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><p>Batch operations where possible:</p>
|
|
87
|
-
<pre><code class="typescript"><span class="hl-7">// ❌ SLOW - Multiple round trips</span><br/><span class="hl-0">for</span><span class="hl-1"> (</span><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-8">item</span><span class="hl-1"> </span><span class="hl-4">of</span><span class="hl-1"> </span><span class="hl-2">items</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-0">await</span><span class="hl-1"> </span><span class="hl-4">this</span><span class="hl-1">.</span><span class="hl-2">tools</span><span class="hl-1">.</span><span class="hl-2">plot</span><span class="hl-1">.</span><span class="hl-6">createActivity</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-2">type:</span><span class="hl-1"> </span><span class="hl-2">ActivityType</span><span class="hl-1">.</span><span class="hl-2">
|
|
87
|
+
<pre><code class="typescript"><span class="hl-7">// ❌ SLOW - Multiple round trips</span><br/><span class="hl-0">for</span><span class="hl-1"> (</span><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-8">item</span><span class="hl-1"> </span><span class="hl-4">of</span><span class="hl-1"> </span><span class="hl-2">items</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-0">await</span><span class="hl-1"> </span><span class="hl-4">this</span><span class="hl-1">.</span><span class="hl-2">tools</span><span class="hl-1">.</span><span class="hl-2">plot</span><span class="hl-1">.</span><span class="hl-6">createActivity</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-2">type:</span><span class="hl-1"> </span><span class="hl-2">ActivityType</span><span class="hl-1">.</span><span class="hl-2">Action</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">title:</span><span class="hl-1"> </span><span class="hl-2">item</span><span class="hl-1">.</span><span class="hl-2">title</span><span class="hl-1">,</span><br/><span class="hl-1"> });</span><br/><span class="hl-1">}</span><br/><br/><span class="hl-7">// ✅ FAST - Batch create</span><br/><span class="hl-0">await</span><span class="hl-1"> </span><span class="hl-4">this</span><span class="hl-1">.</span><span class="hl-2">tools</span><span class="hl-1">.</span><span class="hl-2">plot</span><span class="hl-1">.</span><span class="hl-6">createActivities</span><span class="hl-1">(</span><br/><span class="hl-1"> </span><span class="hl-2">items</span><span class="hl-1">.</span><span class="hl-6">map</span><span class="hl-1">((</span><span class="hl-2">item</span><span class="hl-1">) </span><span class="hl-4">=></span><span class="hl-1"> ({</span><br/><span class="hl-1"> </span><span class="hl-2">type:</span><span class="hl-1"> </span><span class="hl-2">ActivityType</span><span class="hl-1">.</span><span class="hl-2">Action</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">title:</span><span class="hl-1"> </span><span class="hl-2">item</span><span class="hl-1">.</span><span class="hl-2">title</span><span class="hl-1">,</span><br/><span class="hl-1"> }))</span><br/><span class="hl-1">);</span>
|
|
88
88
|
</code><button type="button">Copy</button></pre>
|
|
89
89
|
|
|
90
90
|
<h3 id="2-parallel-operations" class="tsd-anchor-link">2. Parallel Operations<a href="#2-parallel-operations" 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><p>Run independent operations in parallel:</p>
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
<p>Each activity type has different behaviors and rendering characteristics
|
|
3
3
|
within the Plot application.</p>
|
|
4
4
|
</div></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/plotday/plot/blob/main/twist/twister/src/plot.ts#L44">plot.ts:44</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">Enumeration Members</h3><div class="tsd-index-list"><a href="#note" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Enumeration Member"><use href="../assets/icons.svg#icon-16"></use></svg><span>Note</span></a>
|
|
5
|
-
<a href="#
|
|
5
|
+
<a href="#action" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Enumeration Member"><use href="../assets/icons.svg#icon-16"></use></svg><span>Action</span></a>
|
|
6
6
|
<a href="#event" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Enumeration Member"><use href="../assets/icons.svg#icon-16"></use></svg><span>Event</span></a>
|
|
7
7
|
</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-Enumeration Members"><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>Enumeration Members</h2></summary><section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="note"><span>Note</span><a href="#note" 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-enum-member">Note</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">0</span></div><div class="tsd-comment tsd-typography"><p>A note or piece of information without actionable requirements</p>
|
|
8
|
-
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/plotday/plot/blob/main/twist/twister/src/plot.ts#L46">plot.ts:46</a></li></ul></aside></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="
|
|
8
|
+
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/plotday/plot/blob/main/twist/twister/src/plot.ts#L46">plot.ts:46</a></li></ul></aside></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="action"><span>Action</span><a href="#action" 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-enum-member">Action</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">1</span></div><div class="tsd-comment tsd-typography"><p>An actionable item that can be completed</p>
|
|
9
9
|
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/plotday/plot/blob/main/twist/twister/src/plot.ts#L48">plot.ts:48</a></li></ul></aside></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="event"><span>Event</span><a href="#event" 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-enum-member">Event</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">2</span></div><div class="tsd-comment tsd-typography"><p>A scheduled occurrence with start and optional end time</p>
|
|
10
|
-
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/plotday/plot/blob/main/twist/twister/src/plot.ts#L50">plot.ts:50</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-Enumeration Members"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Enumeration Members</summary><div><a href="#note"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Enumeration Member"><use href="../assets/icons.svg#icon-16"></use></svg><span>Note</span></a><a href="#
|
|
10
|
+
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/plotday/plot/blob/main/twist/twister/src/plot.ts#L50">plot.ts:50</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-Enumeration Members"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Enumeration Members</summary><div><a href="#note"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Enumeration Member"><use href="../assets/icons.svg#icon-16"></use></svg><span>Note</span></a><a href="#action"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Enumeration Member"><use href="../assets/icons.svg#icon-16"></use></svg><span>Action</span></a><a href="#event"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Enumeration Member"><use href="../assets/icons.svg#icon-16"></use></svg><span>Event</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>
|
|
@@ -11,7 +11,7 @@ Outlook Calendar, etc.</p>
|
|
|
11
11
|
<li>Start sync for selected calendars</li>
|
|
12
12
|
<li>Process incoming events via callbacks</li>
|
|
13
13
|
</ol>
|
|
14
|
-
</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-7">// Typical calendar integration flow</span><br/><span class="hl-4">class</span><span class="hl-1"> </span><span class="hl-5">MyCalendarTwist</span><span class="hl-1"> </span><span class="hl-4">extends</span><span class="hl-1"> </span><span class="hl-5">Twist</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">private</span><span class="hl-1"> </span><span class="hl-2">googleCalendar</span><span class="hl-1">: </span><span class="hl-5">GoogleCalendar</span><span class="hl-1">;</span><br/><br/><span class="hl-1"> </span><span class="hl-4">async</span><span class="hl-1"> </span><span class="hl-6">activate</span><span class="hl-1">() {</span><br/><span class="hl-1"> </span><span class="hl-7">// Step 1: Request authorization</span><br/><span class="hl-1"> </span><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-8">authLink</span><span class="hl-1"> = </span><span class="hl-0">await</span><span class="hl-1"> </span><span class="hl-4">this</span><span class="hl-1">.</span><span class="hl-2">googleCalendar</span><span class="hl-1">.</span><span class="hl-6">requestAuth</span><span class="hl-1">(</span><span class="hl-3">"onAuthComplete"</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-0">await</span><span class="hl-1"> </span><span class="hl-4">this</span><span class="hl-1">.</span><span class="hl-2">plot</span><span class="hl-1">.</span><span class="hl-6">createActivity</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-2">type:</span><span class="hl-1"> </span><span class="hl-2">ActivityType</span><span class="hl-1">.</span><span class="hl-2">
|
|
14
|
+
</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-7">// Typical calendar integration flow</span><br/><span class="hl-4">class</span><span class="hl-1"> </span><span class="hl-5">MyCalendarTwist</span><span class="hl-1"> </span><span class="hl-4">extends</span><span class="hl-1"> </span><span class="hl-5">Twist</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">private</span><span class="hl-1"> </span><span class="hl-2">googleCalendar</span><span class="hl-1">: </span><span class="hl-5">GoogleCalendar</span><span class="hl-1">;</span><br/><br/><span class="hl-1"> </span><span class="hl-4">async</span><span class="hl-1"> </span><span class="hl-6">activate</span><span class="hl-1">() {</span><br/><span class="hl-1"> </span><span class="hl-7">// Step 1: Request authorization</span><br/><span class="hl-1"> </span><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-8">authLink</span><span class="hl-1"> = </span><span class="hl-0">await</span><span class="hl-1"> </span><span class="hl-4">this</span><span class="hl-1">.</span><span class="hl-2">googleCalendar</span><span class="hl-1">.</span><span class="hl-6">requestAuth</span><span class="hl-1">(</span><span class="hl-3">"onAuthComplete"</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-0">await</span><span class="hl-1"> </span><span class="hl-4">this</span><span class="hl-1">.</span><span class="hl-2">plot</span><span class="hl-1">.</span><span class="hl-6">createActivity</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-2">type:</span><span class="hl-1"> </span><span class="hl-2">ActivityType</span><span class="hl-1">.</span><span class="hl-2">Action</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">title:</span><span class="hl-1"> </span><span class="hl-3">"Connect Google Calendar"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">links:</span><span class="hl-1"> [</span><span class="hl-2">authLink</span><span class="hl-1">],</span><br/><span class="hl-1"> });</span><br/><span class="hl-1"> }</span><br/><br/><span class="hl-1"> </span><span class="hl-4">async</span><span class="hl-1"> </span><span class="hl-6">onAuthComplete</span><span class="hl-1">(</span><span class="hl-2">auth</span><span class="hl-1">: </span><span class="hl-5">CalendarAuth</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-7">// Step 2: Get available calendars</span><br/><span class="hl-1"> </span><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-8">calendars</span><span class="hl-1"> = </span><span class="hl-0">await</span><span class="hl-1"> </span><span class="hl-4">this</span><span class="hl-1">.</span><span class="hl-2">googleCalendar</span><span class="hl-1">.</span><span class="hl-6">getCalendars</span><span class="hl-1">(</span><span class="hl-2">auth</span><span class="hl-1">.</span><span class="hl-2">authToken</span><span class="hl-1">);</span><br/><br/><span class="hl-1"> </span><span class="hl-7">// Step 3: Start sync for primary calendar</span><br/><span class="hl-1"> </span><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-8">primaryCalendar</span><span class="hl-1"> = </span><span class="hl-2">calendars</span><span class="hl-1">.</span><span class="hl-6">find</span><span class="hl-1">(</span><span class="hl-2">c</span><span class="hl-1"> </span><span class="hl-4">=></span><span class="hl-1"> </span><span class="hl-2">c</span><span class="hl-1">.</span><span class="hl-2">primary</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-0">if</span><span class="hl-1"> (</span><span class="hl-2">primaryCalendar</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-0">await</span><span class="hl-1"> </span><span class="hl-4">this</span><span class="hl-1">.</span><span class="hl-2">googleCalendar</span><span class="hl-1">.</span><span class="hl-6">startSync</span><span class="hl-1">(</span><br/><span class="hl-1"> </span><span class="hl-2">auth</span><span class="hl-1">.</span><span class="hl-2">authToken</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">primaryCalendar</span><span class="hl-1">.</span><span class="hl-2">id</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-3">"onCalendarEvent"</span><br/><span class="hl-1"> );</span><br/><span class="hl-1"> }</span><br/><span class="hl-1"> }</span><br/><br/><span class="hl-1"> </span><span class="hl-4">async</span><span class="hl-1"> </span><span class="hl-6">onCalendarEvent</span><span class="hl-1">(</span><span class="hl-2">activity</span><span class="hl-1">: </span><span class="hl-5">Activity</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-7">// Step 4: Process synced events</span><br/><span class="hl-1"> </span><span class="hl-0">await</span><span class="hl-1"> </span><span class="hl-4">this</span><span class="hl-1">.</span><span class="hl-2">plot</span><span class="hl-1">.</span><span class="hl-6">createActivity</span><span class="hl-1">(</span><span class="hl-2">activity</span><span class="hl-1">);</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">}</span>
|
|
15
15
|
</code><button type="button">Copy</button></pre>
|
|
16
16
|
|
|
17
17
|
</div></div></section><div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">CalendarTool</span> <span class="tsd-signature-symbol">{</span><br/> <a class="tsd-kind-call-signature" href="#requestauth-1">requestAuth</a><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#requestauthtcallback">TCallback</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">auth</span><span class="tsd-signature-symbol">:</span> <a href="../types/common_calendar.CalendarAuth.html" class="tsd-signature-type tsd-kind-type-alias">CalendarAuth</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span> <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><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">callback</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#requestauthtcallback">TCallback</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">extraArgs</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#requestauthtcallback">TCallback</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">auth</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">rest</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type tsd-kind-type-parameter">R</span><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">any</span> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type tsd-kind-type-parameter">R</span> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/plot.ActivityLink.html" class="tsd-signature-type tsd-kind-type-alias">ActivityLink</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-call-signature" href="#getcalendars-1">getCalendars</a><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">authToken</span><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> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="common_calendar.Calendar.html" class="tsd-signature-type tsd-kind-interface">Calendar</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-call-signature" href="#startsync-1">startSync</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#startsynctcallback">TCallback</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">activity</span><span class="tsd-signature-symbol">:</span> <a href="../types/plot.Activity.html" class="tsd-signature-type tsd-kind-type-alias">Activity</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">authToken</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">calendarId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">callback</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#startsynctcallback">TCallback</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">extraArgs</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#startsynctcallback">TCallback</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">activity</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">rest</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type tsd-kind-type-parameter">R</span><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">any</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type tsd-kind-type-parameter">R</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-call-signature" href="#stopsync-1">stopSync</a><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">authToken</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">calendarId</span><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> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></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/common/calendar.ts#L99">common/calendar.ts:99</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">Methods</h3><div class="tsd-index-list"><a href="#requestauth" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>request<wbr/>Auth</span></a>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<p>Activities are the core entities in Plot, representing anything from simple notes
|
|
3
3
|
to complex recurring events. They support rich metadata including scheduling,
|
|
4
4
|
recurrence patterns, links, and external source tracking.</p>
|
|
5
|
-
</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-7">// Simple note</span><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-8">task</span><span class="hl-1">: </span><span class="hl-5">Activity</span><span class="hl-1"> = {</span><br/><span class="hl-1"> </span><span class="hl-2">type:</span><span class="hl-1"> </span><span class="hl-2">ActivityType</span><span class="hl-1">.</span><span class="hl-2">Note</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">title:</span><span class="hl-1"> </span><span class="hl-3">"New campaign brainstorming ideas"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">note:</span><span class="hl-1"> </span><span class="hl-3">"We could rent a bouncy castle..."</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">author:</span><span class="hl-1"> { </span><span class="hl-2">id:</span><span class="hl-1"> </span><span class="hl-3">"user-1"</span><span class="hl-1">, </span><span class="hl-2">name:</span><span class="hl-1"> </span><span class="hl-3">"John Doe"</span><span class="hl-1">, </span><span class="hl-2">type:</span><span class="hl-1"> </span><span class="hl-2">ActorType</span><span class="hl-1">.</span><span class="hl-2">User</span><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-2">priority:</span><span class="hl-1"> { </span><span class="hl-2">id:</span><span class="hl-1"> </span><span class="hl-3">"work"</span><span class="hl-1">, </span><span class="hl-2">title:</span><span class="hl-1"> </span><span class="hl-3">"Work"</span><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-7">// ... other fields</span><br/><span class="hl-1">};</span><br/><br/><span class="hl-7">// Simple
|
|
5
|
+
</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-7">// Simple note</span><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-8">task</span><span class="hl-1">: </span><span class="hl-5">Activity</span><span class="hl-1"> = {</span><br/><span class="hl-1"> </span><span class="hl-2">type:</span><span class="hl-1"> </span><span class="hl-2">ActivityType</span><span class="hl-1">.</span><span class="hl-2">Note</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">title:</span><span class="hl-1"> </span><span class="hl-3">"New campaign brainstorming ideas"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">note:</span><span class="hl-1"> </span><span class="hl-3">"We could rent a bouncy castle..."</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">author:</span><span class="hl-1"> { </span><span class="hl-2">id:</span><span class="hl-1"> </span><span class="hl-3">"user-1"</span><span class="hl-1">, </span><span class="hl-2">name:</span><span class="hl-1"> </span><span class="hl-3">"John Doe"</span><span class="hl-1">, </span><span class="hl-2">type:</span><span class="hl-1"> </span><span class="hl-2">ActorType</span><span class="hl-1">.</span><span class="hl-2">User</span><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-2">priority:</span><span class="hl-1"> { </span><span class="hl-2">id:</span><span class="hl-1"> </span><span class="hl-3">"work"</span><span class="hl-1">, </span><span class="hl-2">title:</span><span class="hl-1"> </span><span class="hl-3">"Work"</span><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-7">// ... other fields</span><br/><span class="hl-1">};</span><br/><br/><span class="hl-7">// Simple action</span><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-8">action</span><span class="hl-1">: </span><span class="hl-5">Activity</span><span class="hl-1"> = {</span><br/><span class="hl-1"> </span><span class="hl-2">type:</span><span class="hl-1"> </span><span class="hl-2">ActivityType</span><span class="hl-1">.</span><span class="hl-2">Action</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">title:</span><span class="hl-1"> </span><span class="hl-3">"Review budget proposal"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">author:</span><span class="hl-1"> { </span><span class="hl-2">id:</span><span class="hl-1"> </span><span class="hl-3">"user-1"</span><span class="hl-1">, </span><span class="hl-2">name:</span><span class="hl-1"> </span><span class="hl-3">"John Doe"</span><span class="hl-1">, </span><span class="hl-2">type:</span><span class="hl-1"> </span><span class="hl-2">ActorType</span><span class="hl-1">.</span><span class="hl-2">User</span><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-2">end:</span><span class="hl-1"> </span><span class="hl-4">null</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">priority:</span><span class="hl-1"> { </span><span class="hl-2">id:</span><span class="hl-1"> </span><span class="hl-3">"work"</span><span class="hl-1">, </span><span class="hl-2">title:</span><span class="hl-1"> </span><span class="hl-3">"Work"</span><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-7">// ... other fields</span><br/><span class="hl-1">};</span><br/><br/><span class="hl-7">// Recurring event</span><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-8">meeting</span><span class="hl-1">: </span><span class="hl-5">Activity</span><span class="hl-1"> = {</span><br/><span class="hl-1"> </span><span class="hl-2">type:</span><span class="hl-1"> </span><span class="hl-2">ActivityType</span><span class="hl-1">.</span><span class="hl-2">Event</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">title:</span><span class="hl-1"> </span><span class="hl-3">"Weekly standup"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">recurrenceRule:</span><span class="hl-1"> </span><span class="hl-3">"FREQ=WEEKLY;BYDAY=MO"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">recurrenceCount:</span><span class="hl-1"> </span><span class="hl-12">12</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-7">// ... other fields</span><br/><span class="hl-1">};</span>
|
|
6
6
|
</code><button type="button">Copy</button></pre>
|
|
7
7
|
|
|
8
8
|
</div></div></section><div class="tsd-signature"><span class="tsd-signature-keyword">type</span> <span class="tsd-kind-type-alias">Activity</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-symbol">{</span><br/> <a class="tsd-kind-property" href="#id">id</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="#type">type</a><span class="tsd-signature-symbol">:</span> <a href="../enums/plot.ActivityType.html" class="tsd-signature-type tsd-kind-enum">ActivityType</a><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#author">author</a><span class="tsd-signature-symbol">:</span> <a href="plot.Actor.html" class="tsd-signature-type tsd-kind-type-alias">Actor</a><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#title">title</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#note">note</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#start">start</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#end">end</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#recurrenceuntil">recurrenceUntil</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#recurrencecount">recurrenceCount</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#doneat">doneAt</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#parent">parent</a><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-type-alias">Activity</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#threadroot">threadRoot</a><span class="tsd-signature-symbol">?:</span> <a href="" class="tsd-signature-type tsd-kind-type-alias">Activity</a><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#links">links</a><span class="tsd-signature-symbol">:</span> <a href="plot.ActivityLink.html" class="tsd-signature-type tsd-kind-type-alias">ActivityLink</a><span class="tsd-signature-symbol">[]</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#priority">priority</a><span class="tsd-signature-symbol">:</span> <a href="plot.Priority.html" class="tsd-signature-type tsd-kind-type-alias">Priority</a><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#recurrencerule">recurrenceRule</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#recurrenceexdates">recurrenceExdates</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">[]</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#recurrencedates">recurrenceDates</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">[]</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#recurrence">recurrence</a><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-type-alias">Activity</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#occurrence">occurrence</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#meta">meta</a><span class="tsd-signature-symbol">:</span> <a href="plot.ActivityMeta.html" class="tsd-signature-type tsd-kind-type-alias">ActivityMeta</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#tags">tags</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><a href="../enums/tag.Tag.html" class="tsd-signature-type tsd-kind-enum">Tag</a><span class="tsd-signature-symbol">,</span> <a href="plot.ActorId.html" class="tsd-signature-type tsd-kind-type-alias">ActorId</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#mentions">mentions</a><span class="tsd-signature-symbol">:</span> <a href="plot.ActorId.html" class="tsd-signature-type tsd-kind-type-alias">ActorId</a><span class="tsd-signature-symbol">[]</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</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/plot.ts#L232">plot.ts:232</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="#id" 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>id</span></a>
|
|
@@ -10,7 +10,7 @@ based on the current execution context.</p>
|
|
|
10
10
|
</ol>
|
|
11
11
|
</div><div class="tsd-type-declaration"><h4>Type Declaration</h4><ul><li><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">priority</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Pick</span><span class="tsd-signature-symbol"><</span><a href="plot.Priority.html" class="tsd-signature-type tsd-kind-type-alias">Priority</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">"id"</span><span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">}</span><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">priority</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Pick</span><span class="tsd-signature-symbol"><</span><a href="plot.Priority.html" class="tsd-signature-type tsd-kind-type-alias">Priority</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">"id"</span><span class="tsd-signature-symbol">></span></h5><div class="tsd-comment tsd-typography"><p>Explicit priority (required when specified) - disables automatic priority matching</p>
|
|
12
12
|
</div></li></ul></li><li><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">pickPriority</span><span class="tsd-signature-symbol">?:</span> <a href="plot.PickPriorityConfig.html" class="tsd-signature-type tsd-kind-type-alias">PickPriorityConfig</a> <span class="tsd-signature-symbol">}</span><ul class="tsd-parameters"><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">pickPriority</span><span class="tsd-signature-symbol">?: </span><a href="plot.PickPriorityConfig.html" class="tsd-signature-type tsd-kind-type-alias">PickPriorityConfig</a></h5><div class="tsd-comment tsd-typography"><p>Configuration for automatic priority selection based on similarity</p>
|
|
13
|
-
</div></li></ul></li><li><span class="tsd-signature-symbol">{}</span></li></ul></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-7">// Explicit priority (disables automatic matching)</span><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-8">newTask</span><span class="hl-1">: </span><span class="hl-5">NewActivity</span><span class="hl-1"> = {</span><br/><span class="hl-1"> </span><span class="hl-2">type:</span><span class="hl-1"> </span><span class="hl-2">ActivityType</span><span class="hl-1">.</span><span class="hl-2">
|
|
13
|
+
</div></li></ul></li><li><span class="tsd-signature-symbol">{}</span></li></ul></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-7">// Explicit priority (disables automatic matching)</span><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-8">newTask</span><span class="hl-1">: </span><span class="hl-5">NewActivity</span><span class="hl-1"> = {</span><br/><span class="hl-1"> </span><span class="hl-2">type:</span><span class="hl-1"> </span><span class="hl-2">ActivityType</span><span class="hl-1">.</span><span class="hl-2">Action</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">title:</span><span class="hl-1"> </span><span class="hl-3">"Review pull request"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">priority:</span><span class="hl-1"> { </span><span class="hl-2">id:</span><span class="hl-1"> </span><span class="hl-3">"work-project-123"</span><span class="hl-1"> }</span><br/><span class="hl-1">};</span><br/><br/><span class="hl-7">// Automatic priority matching (default behavior)</span><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-8">newNote</span><span class="hl-1">: </span><span class="hl-5">NewActivity</span><span class="hl-1"> = {</span><br/><span class="hl-1"> </span><span class="hl-2">type:</span><span class="hl-1"> </span><span class="hl-2">ActivityType</span><span class="hl-1">.</span><span class="hl-2">Note</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">title:</span><span class="hl-1"> </span><span class="hl-3">"Meeting notes"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">note:</span><span class="hl-1"> </span><span class="hl-3">"Discussed Q4 roadmap..."</span><br/><span class="hl-1"> </span><span class="hl-7">// Defaults to pickPriority: { content: true }</span><br/><span class="hl-1">};</span><br/><br/><span class="hl-7">// Custom priority matching</span><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-8">newEvent</span><span class="hl-1">: </span><span class="hl-5">NewActivity</span><span class="hl-1"> = {</span><br/><span class="hl-1"> </span><span class="hl-2">type:</span><span class="hl-1"> </span><span class="hl-2">ActivityType</span><span class="hl-1">.</span><span class="hl-2">Event</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">title:</span><span class="hl-1"> </span><span class="hl-3">"Team standup"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">pickPriority:</span><span class="hl-1"> { </span><span class="hl-2">type:</span><span class="hl-1"> </span><span class="hl-4">true</span><span class="hl-1">, </span><span class="hl-2">content:</span><span class="hl-1"> </span><span class="hl-12">50</span><span class="hl-1"> }</span><br/><span class="hl-1">};</span>
|
|
14
14
|
</code><button type="button">Copy</button></pre>
|
|
15
15
|
|
|
16
16
|
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/plotday/plot/blob/main/twist/twister/src/plot.ts#L375">plot.ts:375</a></li></ul></aside></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></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.
|
|
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";
|
|
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,
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../src/llm-docs/common/calendar.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;wBAEY,8nLAA8nL;AAA7oL,wBAA8oL"}
|
|
@@ -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.
|
|
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";
|
|
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,
|
|
1
|
+
{"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../../src/llm-docs/common/calendar.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAe,8nLAA8nL,CAAC"}
|
package/dist/llm-docs/plot.d.ts
CHANGED
|
@@ -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 Task,\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 task\n * const task: Activity = {\n * type: ActivityType.Task,\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.Task,\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 * 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";
|
|
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,
|
|
1
|
+
{"version":3,"file":"plot.d.ts","sourceRoot":"","sources":["../../src/llm-docs/plot.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;wBAEY,kviBAAwuiB;AAAvviB,wBAAwviB"}
|