@plotday/twister 0.35.0 → 0.37.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 +4 -2
- package/bin/commands/create.js +37 -3
- package/bin/commands/create.js.map +1 -1
- package/bin/commands/deploy.js +4 -0
- package/bin/commands/deploy.js.map +1 -1
- package/bin/index.js +1 -0
- package/bin/index.js.map +1 -1
- package/bin/templates/AGENTS.template.md +188 -271
- package/bin/templates/README.template.md +2 -23
- package/cli/templates/AGENTS.template.md +188 -271
- package/cli/templates/README.template.md +2 -23
- package/dist/docs/assets/hierarchy.js +1 -1
- package/dist/docs/assets/navigation.js +1 -1
- package/dist/docs/assets/search.js +1 -1
- package/dist/docs/classes/index.Options.html +10 -0
- package/dist/docs/classes/index.Source.html +184 -0
- package/dist/docs/classes/tool.ITool.html +1 -1
- package/dist/docs/classes/tool.Tool.html +21 -21
- package/dist/docs/classes/tools_ai.AI.html +1 -1
- package/dist/docs/classes/tools_callbacks.Callbacks.html +2 -2
- package/dist/docs/classes/tools_integrations.Integrations.html +38 -16
- package/dist/docs/classes/tools_network.Network.html +1 -1
- package/dist/docs/classes/tools_plot.Plot.html +86 -60
- package/dist/docs/classes/tools_store.Store.html +1 -1
- package/dist/docs/classes/tools_tasks.Tasks.html +1 -1
- package/dist/docs/classes/tools_twists.Twists.html +1 -1
- package/dist/docs/classes/twist.Twist.html +42 -10
- package/dist/docs/documents/Building_Sources.html +137 -0
- package/dist/docs/documents/Built-in_Tools.html +11 -2
- package/dist/docs/documents/Core_Concepts.html +5 -10
- package/dist/docs/documents/Getting_Started.html +1 -1
- package/dist/docs/enums/{plot.ActivityLinkType.html → plot.ActionType.html} +8 -8
- package/dist/docs/enums/plot.ActorType.html +7 -7
- package/dist/docs/enums/plot.ConferencingProvider.html +6 -6
- package/dist/docs/enums/plot.ThemeColor.html +9 -9
- package/dist/docs/enums/tag.Tag.html +3 -10
- package/dist/docs/enums/tools_integrations.AuthProvider.html +11 -11
- package/dist/docs/enums/tools_plot.ContactAccess.html +3 -3
- package/dist/docs/enums/tools_plot.PriorityAccess.html +3 -3
- package/dist/docs/enums/{tools_plot.ActivityAccess.html → tools_plot.ThreadAccess.html} +6 -6
- package/dist/docs/hierarchy.html +1 -1
- package/dist/docs/index.html +5 -6
- package/dist/docs/interfaces/utils_types.ToolShed.html +5 -5
- package/dist/docs/media/AGENTS.md +910 -0
- package/dist/docs/media/MULTI_USER_AUTH.md +111 -0
- package/dist/docs/media/SYNC_STRATEGIES.md +7 -7
- package/dist/docs/modules/index.html +1 -1
- package/dist/docs/modules/plot.html +1 -1
- package/dist/docs/modules/tool.html +1 -1
- package/dist/docs/modules/tools_integrations.html +1 -1
- package/dist/docs/modules/tools_plot.html +1 -1
- package/dist/docs/modules.html +1 -1
- package/dist/docs/types/index.BooleanDef.html +7 -0
- package/dist/docs/types/index.NewSchedule.html +33 -0
- package/dist/docs/types/index.NewScheduleContact.html +5 -0
- package/dist/docs/types/index.NewScheduleOccurrence.html +6 -0
- package/dist/docs/types/index.NumberDef.html +9 -0
- package/dist/docs/types/index.OptionDef.html +2 -0
- package/dist/docs/types/index.OptionsSchema.html +3 -0
- package/dist/docs/types/index.ResolvedOptions.html +4 -0
- package/dist/docs/types/index.Schedule.html +37 -0
- package/dist/docs/types/index.ScheduleContact.html +5 -0
- package/dist/docs/types/index.ScheduleContactRole.html +1 -0
- package/dist/docs/types/index.ScheduleContactStatus.html +1 -0
- package/dist/docs/types/index.ScheduleOccurrence.html +17 -0
- package/dist/docs/types/index.ScheduleOccurrenceUpdate.html +2 -0
- package/dist/docs/types/index.SelectDef.html +8 -0
- package/dist/docs/types/index.TextDef.html +8 -0
- package/dist/docs/types/plot.Action.html +26 -0
- package/dist/docs/types/plot.Actor.html +6 -6
- package/dist/docs/types/plot.ActorId.html +1 -1
- package/dist/docs/types/plot.ContentType.html +1 -1
- package/dist/docs/types/plot.Link.html +36 -0
- package/dist/docs/types/plot.NewActor.html +1 -1
- package/dist/docs/types/plot.NewContact.html +5 -5
- package/dist/docs/types/plot.NewLink.html +26 -0
- package/dist/docs/types/plot.NewLinkWithNotes.html +7 -0
- package/dist/docs/types/plot.NewNote.html +10 -10
- package/dist/docs/types/plot.NewPriority.html +1 -1
- package/dist/docs/types/plot.NewTags.html +1 -1
- package/dist/docs/types/plot.NewThread.html +27 -0
- package/dist/docs/types/plot.NewThreadWithNotes.html +1 -0
- package/dist/docs/types/plot.Note.html +9 -8
- package/dist/docs/types/plot.NoteUpdate.html +2 -2
- package/dist/docs/types/plot.PickPriorityConfig.html +8 -10
- package/dist/docs/types/plot.Priority.html +6 -6
- package/dist/docs/types/plot.PriorityUpdate.html +1 -1
- package/dist/docs/types/plot.Tags.html +1 -1
- package/dist/docs/types/plot.Thread.html +1 -0
- package/dist/docs/types/plot.ThreadCommon.html +17 -0
- package/dist/docs/types/plot.ThreadFilter.html +2 -0
- package/dist/docs/types/plot.ThreadMeta.html +11 -0
- package/dist/docs/types/plot.ThreadUpdate.html +3 -0
- package/dist/docs/types/plot.ThreadWithNotes.html +1 -0
- package/dist/docs/types/tools_integrations.ArchiveLinkFilter.html +11 -0
- package/dist/docs/types/tools_integrations.AuthToken.html +4 -4
- package/dist/docs/types/tools_integrations.Authorization.html +4 -4
- package/dist/docs/types/tools_integrations.Channel.html +11 -0
- package/dist/docs/types/tools_integrations.LinkTypeConfig.html +17 -0
- package/dist/docs/types/tools_plot.LinkFilter.html +10 -0
- package/dist/docs/types/tools_plot.NoteIntentHandler.html +6 -6
- package/dist/docs/types/tools_twists.TwistPermissions.html +1 -1
- package/dist/docs/types/utils_types.BuiltInTools.html +2 -2
- package/dist/docs/types/utils_types.ExtractBuildReturn.html +1 -1
- package/dist/docs/types/utils_types.InferOptions.html +1 -1
- package/dist/docs/types/utils_types.InferTools.html +1 -1
- package/dist/docs/types/utils_types.JSONValue.html +1 -1
- package/dist/docs/types/utils_types.PromiseValues.html +1 -1
- package/dist/docs/types/utils_types.ToolBuilder.html +2 -2
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/llm-docs/index.d.ts.map +1 -1
- package/dist/llm-docs/index.js +6 -8
- package/dist/llm-docs/index.js.map +1 -1
- package/dist/llm-docs/options.d.ts +9 -0
- package/dist/llm-docs/options.d.ts.map +1 -0
- package/dist/llm-docs/options.js +8 -0
- package/dist/llm-docs/options.js.map +1 -0
- 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/schedule.d.ts +9 -0
- package/dist/llm-docs/schedule.d.ts.map +1 -0
- package/dist/llm-docs/schedule.js +8 -0
- package/dist/llm-docs/schedule.js.map +1 -0
- package/dist/llm-docs/source.d.ts +9 -0
- package/dist/llm-docs/source.d.ts.map +1 -0
- package/dist/llm-docs/source.js +8 -0
- package/dist/llm-docs/source.js.map +1 -0
- package/dist/llm-docs/tag.d.ts +1 -1
- package/dist/llm-docs/tag.d.ts.map +1 -1
- package/dist/llm-docs/tag.js +1 -1
- package/dist/llm-docs/tag.js.map +1 -1
- package/dist/llm-docs/tool.d.ts +1 -1
- package/dist/llm-docs/tool.d.ts.map +1 -1
- package/dist/llm-docs/tool.js +1 -1
- package/dist/llm-docs/tool.js.map +1 -1
- package/dist/llm-docs/tools/callbacks.d.ts +1 -1
- package/dist/llm-docs/tools/callbacks.d.ts.map +1 -1
- package/dist/llm-docs/tools/callbacks.js +1 -1
- package/dist/llm-docs/tools/callbacks.js.map +1 -1
- package/dist/llm-docs/tools/integrations.d.ts +1 -1
- package/dist/llm-docs/tools/integrations.d.ts.map +1 -1
- package/dist/llm-docs/tools/integrations.js +1 -1
- package/dist/llm-docs/tools/integrations.js.map +1 -1
- package/dist/llm-docs/tools/plot.d.ts +1 -1
- package/dist/llm-docs/tools/plot.d.ts.map +1 -1
- package/dist/llm-docs/tools/plot.js +1 -1
- package/dist/llm-docs/tools/plot.js.map +1 -1
- package/dist/llm-docs/tools/twists.d.ts +1 -1
- package/dist/llm-docs/tools/twists.d.ts.map +1 -1
- package/dist/llm-docs/tools/twists.js +1 -1
- package/dist/llm-docs/tools/twists.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/llm-docs/twist.d.ts +1 -1
- package/dist/llm-docs/twist.d.ts.map +1 -1
- package/dist/llm-docs/twist.js +1 -1
- package/dist/llm-docs/twist.js.map +1 -1
- package/dist/options.d.ts +104 -0
- package/dist/options.d.ts.map +1 -0
- package/dist/options.js +40 -0
- package/dist/options.js.map +1 -0
- package/dist/plot.d.ts +254 -588
- package/dist/plot.d.ts.map +1 -1
- package/dist/plot.js +16 -49
- package/dist/plot.js.map +1 -1
- package/dist/schedule.d.ts +172 -0
- package/dist/schedule.d.ts.map +1 -0
- package/dist/schedule.js +2 -0
- package/dist/schedule.js.map +1 -0
- package/dist/source.d.ts +133 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +116 -0
- package/dist/source.js.map +1 -0
- package/dist/tag.d.ts +3 -10
- package/dist/tag.d.ts.map +1 -1
- package/dist/tag.js +2 -11
- package/dist/tag.js.map +1 -1
- package/dist/tool.d.ts +1 -15
- package/dist/tool.d.ts.map +1 -1
- package/dist/tool.js.map +1 -1
- package/dist/tools/callbacks.d.ts +1 -1
- package/dist/tools/callbacks.js +1 -1
- package/dist/tools/integrations.d.ts +107 -50
- package/dist/tools/integrations.d.ts.map +1 -1
- package/dist/tools/integrations.js +23 -22
- package/dist/tools/integrations.js.map +1 -1
- package/dist/tools/plot.d.ts +133 -117
- package/dist/tools/plot.d.ts.map +1 -1
- package/dist/tools/plot.js +19 -21
- package/dist/tools/plot.js.map +1 -1
- package/dist/tools/twists.d.ts +1 -1
- package/dist/twist-guide.d.ts +1 -1
- package/dist/twist-guide.d.ts.map +1 -1
- package/dist/twist.d.ts +66 -11
- package/dist/twist.d.ts.map +1 -1
- package/dist/twist.js +79 -10
- package/dist/twist.js.map +1 -1
- package/dist/utils/types.d.ts +5 -1
- package/dist/utils/types.d.ts.map +1 -1
- package/package.json +16 -41
- package/dist/common/calendar.d.ts +0 -135
- package/dist/common/calendar.d.ts.map +0 -1
- package/dist/common/calendar.js +0 -2
- package/dist/common/calendar.js.map +0 -1
- package/dist/common/documents.d.ts +0 -122
- package/dist/common/documents.d.ts.map +0 -1
- package/dist/common/documents.js +0 -2
- package/dist/common/documents.js.map +0 -1
- package/dist/common/messaging.d.ts +0 -84
- package/dist/common/messaging.d.ts.map +0 -1
- package/dist/common/messaging.js +0 -2
- package/dist/common/messaging.js.map +0 -1
- package/dist/common/projects.d.ts +0 -112
- package/dist/common/projects.d.ts.map +0 -1
- package/dist/common/projects.js +0 -2
- package/dist/common/projects.js.map +0 -1
- package/dist/docs/documents/Building_Custom_Tools.html +0 -215
- package/dist/docs/enums/plot.ActivityKind.html +0 -14
- package/dist/docs/enums/plot.ActivityType.html +0 -10
- package/dist/docs/modules/common_calendar.html +0 -1
- package/dist/docs/types/common_calendar.Calendar.html +0 -13
- package/dist/docs/types/common_calendar.CalendarTool.html +0 -81
- package/dist/docs/types/common_calendar.SyncOptions.html +0 -24
- package/dist/docs/types/plot.Activity.html +0 -2
- package/dist/docs/types/plot.ActivityCommon.html +0 -20
- package/dist/docs/types/plot.ActivityFilter.html +0 -3
- package/dist/docs/types/plot.ActivityLink.html +0 -26
- package/dist/docs/types/plot.ActivityMeta.html +0 -11
- package/dist/docs/types/plot.ActivityOccurrence.html +0 -22
- package/dist/docs/types/plot.ActivityOccurrenceUpdate.html +0 -3
- package/dist/docs/types/plot.ActivityUpdate.html +0 -3
- package/dist/docs/types/plot.ActivityWithNotes.html +0 -1
- package/dist/docs/types/plot.NewActivity.html +0 -81
- package/dist/docs/types/plot.NewActivityOccurrence.html +0 -24
- package/dist/docs/types/plot.NewActivityWithNotes.html +0 -1
- package/dist/docs/types/tool.SyncToolOptions.html +0 -9
- package/dist/docs/types/tools_integrations.IntegrationOptions.html +0 -4
- package/dist/docs/types/tools_integrations.IntegrationProviderConfig.html +0 -13
- package/dist/docs/types/tools_integrations.Syncable.html +0 -7
- package/dist/llm-docs/common/calendar.d.ts +0 -9
- package/dist/llm-docs/common/calendar.d.ts.map +0 -1
- package/dist/llm-docs/common/calendar.js +0 -8
- package/dist/llm-docs/common/calendar.js.map +0 -1
- package/dist/llm-docs/common/documents.d.ts +0 -9
- package/dist/llm-docs/common/documents.d.ts.map +0 -1
- package/dist/llm-docs/common/documents.js +0 -8
- package/dist/llm-docs/common/documents.js.map +0 -1
- package/dist/llm-docs/common/messaging.d.ts +0 -9
- package/dist/llm-docs/common/messaging.d.ts.map +0 -1
- package/dist/llm-docs/common/messaging.js +0 -8
- package/dist/llm-docs/common/messaging.js.map +0 -1
- package/dist/llm-docs/common/projects.d.ts +0 -9
- package/dist/llm-docs/common/projects.d.ts.map +0 -1
- package/dist/llm-docs/common/projects.js +0 -8
- package/dist/llm-docs/common/projects.js.map +0 -1
package/dist/tag.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Thread tags. Three types:
|
|
3
3
|
* 1. Special tags, which trigger other behaviors
|
|
4
4
|
* 2. Toggle tags, which anyone can toggle a shared value on or off
|
|
5
5
|
* 3. Count tags, where everyone can add or remove their own
|
|
@@ -7,15 +7,11 @@
|
|
|
7
7
|
export var Tag;
|
|
8
8
|
(function (Tag) {
|
|
9
9
|
// Special tags
|
|
10
|
-
Tag[Tag["
|
|
11
|
-
Tag[Tag["Later"] = 2] = "Later";
|
|
10
|
+
Tag[Tag["Todo"] = 1] = "Todo";
|
|
12
11
|
Tag[Tag["Done"] = 3] = "Done";
|
|
13
|
-
Tag[Tag["Archived"] = 4] = "Archived";
|
|
14
|
-
Tag[Tag["Someday"] = 7] = "Someday";
|
|
15
12
|
// Toggle tags
|
|
16
13
|
Tag[Tag["Pinned"] = 100] = "Pinned";
|
|
17
14
|
Tag[Tag["Urgent"] = 101] = "Urgent";
|
|
18
|
-
Tag[Tag["Inbox"] = 102] = "Inbox";
|
|
19
15
|
Tag[Tag["Goal"] = 103] = "Goal";
|
|
20
16
|
Tag[Tag["Decision"] = 104] = "Decision";
|
|
21
17
|
Tag[Tag["Waiting"] = 105] = "Waiting";
|
|
@@ -43,10 +39,5 @@ export var Tag;
|
|
|
43
39
|
Tag[Tag["Applause"] = 1016] = "Applause";
|
|
44
40
|
Tag[Tag["Cool"] = 1017] = "Cool";
|
|
45
41
|
Tag[Tag["Sad"] = 1018] = "Sad";
|
|
46
|
-
// RSVP tags - mutually exclusive per actor
|
|
47
|
-
// When an actor adds one of these tags, the other two are automatically removed
|
|
48
|
-
Tag[Tag["Attend"] = 1019] = "Attend";
|
|
49
|
-
Tag[Tag["Skip"] = 1020] = "Skip";
|
|
50
|
-
Tag[Tag["Undecided"] = 1021] = "Undecided";
|
|
51
42
|
})(Tag || (Tag = {}));
|
|
52
43
|
//# sourceMappingURL=tag.js.map
|
package/dist/tag.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag.js","sourceRoot":"","sources":["../src/tag.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"tag.js","sourceRoot":"","sources":["../src/tag.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAN,IAAY,GAoCX;AApCD,WAAY,GAAG;IACb,eAAe;IACf,6BAAQ,CAAA;IACR,6BAAQ,CAAA;IAER,cAAc;IACd,mCAAY,CAAA;IACZ,mCAAY,CAAA;IACZ,+BAAU,CAAA;IACV,uCAAc,CAAA;IACd,qCAAa,CAAA;IACb,qCAAa,CAAA;IACb,qCAAa,CAAA;IACb,uCAAc,CAAA;IACd,iCAAW,CAAA;IACX,+BAAU,CAAA;IACV,+BAAU,CAAA;IAEV,aAAa;IACb,8BAAU,CAAA;IACV,4BAAS,CAAA;IACT,0CAAgB,CAAA;IAChB,gCAAW,CAAA;IACX,gCAAW,CAAA;IACX,sCAAc,CAAA;IACd,sCAAc,CAAA;IACd,gCAAW,CAAA;IACX,oCAAa,CAAA;IACb,wCAAe,CAAA;IACf,oCAAa,CAAA;IACb,kCAAY,CAAA;IACZ,gCAAW,CAAA;IACX,oCAAa,CAAA;IACb,wCAAe,CAAA;IACf,gCAAW,CAAA;IACX,8BAAU,CAAA;AACZ,CAAC,EApCW,GAAG,KAAH,GAAG,QAoCd"}
|
package/dist/tool.d.ts
CHANGED
|
@@ -1,21 +1,7 @@
|
|
|
1
|
-
import { type Actor, type
|
|
1
|
+
import { type Actor, type Priority } from "./plot";
|
|
2
2
|
import type { Callback } from "./tools/callbacks";
|
|
3
3
|
import type { InferOptions, InferTools, Serializable, ToolBuilder, ToolShed } from "./utils/types";
|
|
4
4
|
export type { ToolBuilder };
|
|
5
|
-
/**
|
|
6
|
-
* Options for tools that sync activities from external services.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* static readonly Options: SyncToolOptions;
|
|
11
|
-
* ```
|
|
12
|
-
*/
|
|
13
|
-
export type SyncToolOptions = {
|
|
14
|
-
/** Callback invoked for each synced item. The tool adds sync metadata before passing it. */
|
|
15
|
-
onItem: (item: NewActivityWithNotes) => Promise<void>;
|
|
16
|
-
/** Callback invoked when a syncable is disabled, receiving an ActivityFilter for bulk operations. */
|
|
17
|
-
onSyncableDisabled?: (filter: ActivityFilter) => Promise<void>;
|
|
18
|
-
};
|
|
19
5
|
/**
|
|
20
6
|
* Abstrtact parent for both built-in tools and regular Tools.
|
|
21
7
|
* Regular tools extend Tool.
|
package/dist/tool.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3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ASG;IAEH,YAAY,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,EAAE,KAAK,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3E;;;;;;;;OAQG;IACH,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B;;;;;;;OAOG;IACH,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5B;;;;;;;;OAQG;IACH,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAI9B;;;;;;;OAOG;IACH,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAI/B;;;;OAIG;IACG,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;CAGpC"}
|
package/dist/tool.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../src/tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../src/tool.ts"],"names":[],"mappings":"AAeA;;;GAGG;AACH,MAAM,OAAgB,KAAK;CAAG;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,OAAgB,IAAI;IAEZ;IACA;IACF;IAHV,YACY,EAAU,EACV,OAA4B,EAC9B,QAAkB;QAFhB,OAAE,GAAF,EAAE,CAAQ;QACV,YAAO,GAAP,OAAO,CAAqB;QAC9B,aAAQ,GAAR,QAAQ,CAAU;IACzB,CAAC;IAEJ;;;OAGG;IACH,IAAc,KAAK;QACjB,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAqB,CAAC;IACrD,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,6DAA6D;IAC7D,KAAK,CAAC,KAAkB;QACtB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED;;;;;;;;;;;;;OAaG;IACO,KAAK,CAAC,QAAQ,CAGtB,EAAM,EAAE,GAAG,SAAgB;QAC3B,OAAO,IAAI,CAAC,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export type Callback = string & {
|
|
|
32
32
|
* **When to use callbacks:**
|
|
33
33
|
* - Webhook handlers that need persistent function references
|
|
34
34
|
* - Scheduled operations that run after worker timeouts
|
|
35
|
-
* - User interaction
|
|
35
|
+
* - User interaction actions (ActionType.callback)
|
|
36
36
|
* - Cross-tool communication that survives restarts
|
|
37
37
|
*
|
|
38
38
|
* **Type Safety:**
|
package/dist/tools/callbacks.js
CHANGED
|
@@ -14,7 +14,7 @@ import { ITool } from "..";
|
|
|
14
14
|
* **When to use callbacks:**
|
|
15
15
|
* - Webhook handlers that need persistent function references
|
|
16
16
|
* - Scheduled operations that run after worker timeouts
|
|
17
|
-
* - User interaction
|
|
17
|
+
* - User interaction actions (ActionType.callback)
|
|
18
18
|
* - Cross-tool communication that survives restarts
|
|
19
19
|
*
|
|
20
20
|
* **Type Safety:**
|
|
@@ -1,74 +1,80 @@
|
|
|
1
|
-
import { type Actor, type ActorId, ITool, Serializable } from "..";
|
|
1
|
+
import { type Actor, type ActorId, type NewContact, type NewLinkWithNotes, ITool, Serializable } from "..";
|
|
2
|
+
import type { JSONValue } from "../utils/types";
|
|
2
3
|
import type { Uuid } from "../utils/uuid";
|
|
3
4
|
/**
|
|
4
5
|
* A resource that can be synced (e.g., a calendar, project, channel).
|
|
5
|
-
* Returned by
|
|
6
|
+
* Returned by getChannels() and managed by users in the twist setup/edit modal.
|
|
6
7
|
*/
|
|
7
|
-
export type
|
|
8
|
+
export type Channel = {
|
|
8
9
|
/** External ID shared across users (e.g., Google calendar ID) */
|
|
9
10
|
id: string;
|
|
10
11
|
/** Display name shown in the UI */
|
|
11
12
|
title: string;
|
|
13
|
+
/** Optional nested channel resources (e.g., subfolders) */
|
|
14
|
+
children?: Channel[];
|
|
15
|
+
/** Priority ID this channel is routed to (set when channel is enabled) */
|
|
16
|
+
priorityId?: string;
|
|
12
17
|
};
|
|
13
18
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
19
|
+
* Describes a link type that a source creates.
|
|
20
|
+
* Used for display in the UI (icons, labels).
|
|
16
21
|
*/
|
|
17
|
-
export type
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
22
|
+
export type LinkTypeConfig = {
|
|
23
|
+
/** Machine-readable type identifier (e.g., "issue", "pull_request") */
|
|
24
|
+
type: string;
|
|
25
|
+
/** Human-readable label (e.g., "Issue", "Pull Request") */
|
|
26
|
+
label: string;
|
|
27
|
+
/** URL to an icon for this link type (light mode). Prefer Iconify `logos/*` URLs. */
|
|
28
|
+
logo?: string;
|
|
29
|
+
/** URL to an icon for dark mode. Use when the default logo is invisible on dark backgrounds (e.g., Iconify `simple-icons/*` with `?color=`). */
|
|
30
|
+
logoDark?: string;
|
|
31
|
+
/** URL to a monochrome icon (uses `currentColor`). Prefer Iconify `simple-icons/*` URLs without a `?color=` param. */
|
|
32
|
+
logoMono?: string;
|
|
33
|
+
/** Possible status values for this type */
|
|
34
|
+
statuses?: Array<{
|
|
35
|
+
/** Machine-readable status (e.g., "open", "done") */
|
|
36
|
+
status: string;
|
|
37
|
+
/** Human-readable label (e.g., "Open", "Done") */
|
|
38
|
+
label: string;
|
|
39
|
+
}>;
|
|
35
40
|
};
|
|
36
41
|
/**
|
|
37
|
-
* Built-in tool for managing OAuth authentication and
|
|
42
|
+
* Built-in tool for managing OAuth authentication and channel resources.
|
|
38
43
|
*
|
|
39
|
-
* The
|
|
40
|
-
* 1.
|
|
41
|
-
* 2.
|
|
42
|
-
* 3.
|
|
43
|
-
* 4.
|
|
44
|
+
* The Integrations tool:
|
|
45
|
+
* 1. Manages channel resources (calendars, projects, etc.) per actor
|
|
46
|
+
* 2. Returns tokens for the user who enabled sync on a channel
|
|
47
|
+
* 3. Supports per-actor auth via actAs() for write-back operations
|
|
48
|
+
* 4. Provides saveLink/saveContacts for Sources to save data directly
|
|
44
49
|
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
50
|
+
* Sources declare their provider, scopes, and channel lifecycle methods as
|
|
51
|
+
* class properties and methods. The Integrations tool reads these automatically.
|
|
52
|
+
* Auth and channel management is handled in the twist edit modal in Flutter.
|
|
47
53
|
*
|
|
48
54
|
* @example
|
|
49
55
|
* ```typescript
|
|
50
|
-
* class
|
|
51
|
-
*
|
|
52
|
-
*
|
|
56
|
+
* class CalendarSource extends Source<CalendarSource> {
|
|
57
|
+
* readonly provider = AuthProvider.Google;
|
|
58
|
+
* readonly scopes = ["https://www.googleapis.com/auth/calendar"];
|
|
53
59
|
*
|
|
54
60
|
* build(build: ToolBuilder) {
|
|
55
61
|
* return {
|
|
56
|
-
* integrations: build(Integrations,
|
|
57
|
-
* providers: [{
|
|
58
|
-
* provider: AuthProvider.Google,
|
|
59
|
-
* scopes: CalendarTool.SCOPES,
|
|
60
|
-
* getSyncables: this.getSyncables,
|
|
61
|
-
* onSyncEnabled: this.onSyncEnabled,
|
|
62
|
-
* onSyncDisabled: this.onSyncDisabled,
|
|
63
|
-
* }]
|
|
64
|
-
* }),
|
|
62
|
+
* integrations: build(Integrations),
|
|
65
63
|
* };
|
|
66
64
|
* }
|
|
67
65
|
*
|
|
68
|
-
* async
|
|
66
|
+
* async getChannels(auth: Authorization, token: AuthToken): Promise<Channel[]> {
|
|
69
67
|
* const calendars = await this.listCalendars(token);
|
|
70
68
|
* return calendars.map(c => ({ id: c.id, title: c.name }));
|
|
71
69
|
* }
|
|
70
|
+
*
|
|
71
|
+
* async onChannelEnabled(channel: Channel) {
|
|
72
|
+
* // Start syncing
|
|
73
|
+
* }
|
|
74
|
+
*
|
|
75
|
+
* async onChannelDisabled(channel: Channel) {
|
|
76
|
+
* // Stop syncing
|
|
77
|
+
* }
|
|
72
78
|
* }
|
|
73
79
|
* ```
|
|
74
80
|
*/
|
|
@@ -81,16 +87,24 @@ export declare abstract class Integrations extends ITool {
|
|
|
81
87
|
*/
|
|
82
88
|
static MergeScopes(...scopeArrays: string[][]): string[];
|
|
83
89
|
/**
|
|
84
|
-
* Retrieves an access token for a
|
|
90
|
+
* Retrieves an access token for a channel resource.
|
|
85
91
|
*
|
|
86
|
-
* Returns the token of the user who enabled sync on the given
|
|
87
|
-
* If the
|
|
92
|
+
* Returns the token of the user who enabled sync on the given channel.
|
|
93
|
+
* If the channel is not enabled or the token is expired/invalid, returns null.
|
|
88
94
|
*
|
|
89
|
-
* @param
|
|
90
|
-
* @param syncableId - The syncable resource ID (e.g., calendar ID)
|
|
95
|
+
* @param channelId - The channel resource ID (e.g., calendar ID)
|
|
91
96
|
* @returns Promise resolving to the access token or null
|
|
92
97
|
*/
|
|
93
|
-
abstract get(
|
|
98
|
+
abstract get(channelId: string): Promise<AuthToken | null>;
|
|
99
|
+
/**
|
|
100
|
+
* Retrieves an access token for a channel resource.
|
|
101
|
+
*
|
|
102
|
+
* @param provider - The OAuth provider (deprecated, ignored for single-provider sources)
|
|
103
|
+
* @param channelId - The channel resource ID (e.g., calendar ID)
|
|
104
|
+
* @returns Promise resolving to the access token or null
|
|
105
|
+
* @deprecated Use get(channelId) instead. The provider is implicit from the source.
|
|
106
|
+
*/
|
|
107
|
+
abstract get(provider: AuthProvider, channelId: string): Promise<AuthToken | null>;
|
|
94
108
|
/**
|
|
95
109
|
* Execute a callback as a specific actor, requesting auth if needed.
|
|
96
110
|
*
|
|
@@ -105,7 +119,50 @@ export declare abstract class Integrations extends ITool {
|
|
|
105
119
|
* @param extraArgs - Additional arguments to pass to the callback
|
|
106
120
|
*/
|
|
107
121
|
abstract actAs<TArgs extends Serializable[], TCallback extends (token: AuthToken, ...args: TArgs) => any>(provider: AuthProvider, actorId: ActorId, activityId: Uuid, callback: TCallback, ...extraArgs: TArgs): Promise<void>;
|
|
122
|
+
/**
|
|
123
|
+
* Saves a link with notes to the source's priority.
|
|
124
|
+
*
|
|
125
|
+
* Creates a thread+link pair. The thread is a lightweight container;
|
|
126
|
+
* the link holds the external entity data (source, meta, type, status, etc.).
|
|
127
|
+
*
|
|
128
|
+
* This method is available only to Sources (not regular Twists).
|
|
129
|
+
*
|
|
130
|
+
* @param link - The link with notes to save
|
|
131
|
+
* @returns Promise resolving to the saved thread's UUID
|
|
132
|
+
*/
|
|
133
|
+
abstract saveLink(link: NewLinkWithNotes): Promise<Uuid>;
|
|
134
|
+
/**
|
|
135
|
+
* Saves contacts to the source's priority.
|
|
136
|
+
*
|
|
137
|
+
* @param contacts - Array of contacts to save
|
|
138
|
+
* @returns Promise resolving to the saved actors
|
|
139
|
+
*/
|
|
140
|
+
abstract saveContacts(contacts: NewContact[]): Promise<Actor[]>;
|
|
141
|
+
/**
|
|
142
|
+
* Archives links matching the given filter that were created by this source.
|
|
143
|
+
*
|
|
144
|
+
* For each archived link's thread, if no other non-archived links remain,
|
|
145
|
+
* the thread is also archived.
|
|
146
|
+
*
|
|
147
|
+
* @param filter - Filter criteria for which links to archive
|
|
148
|
+
* @returns Promise that resolves when archiving is complete
|
|
149
|
+
*/
|
|
150
|
+
abstract archiveLinks(filter: ArchiveLinkFilter): Promise<void>;
|
|
108
151
|
}
|
|
152
|
+
/**
|
|
153
|
+
* Filter criteria for archiving links.
|
|
154
|
+
* All fields are optional; only provided fields are used for matching.
|
|
155
|
+
*/
|
|
156
|
+
export type ArchiveLinkFilter = {
|
|
157
|
+
/** Filter by channel ID */
|
|
158
|
+
channelId?: string;
|
|
159
|
+
/** Filter by link type (e.g., "issue", "pull_request") */
|
|
160
|
+
type?: string;
|
|
161
|
+
/** Filter by link status (e.g., "open", "closed") */
|
|
162
|
+
status?: string;
|
|
163
|
+
/** Filter by metadata fields (uses containment matching) */
|
|
164
|
+
meta?: Record<string, JSONValue>;
|
|
165
|
+
};
|
|
109
166
|
/**
|
|
110
167
|
* Enumeration of supported OAuth providers.
|
|
111
168
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../src/tools/integrations.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../src/tools/integrations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,EACL,YAAY,EACb,MAAM,IAAI,CAAC;AACZ,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,iEAAiE;IACjE,EAAE,EAAE,MAAM,CAAC;IACX,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,0EAA0E;IAC1E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,KAAK,EAAE,MAAM,CAAC;IACd,qFAAqF;IACrF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gJAAgJ;IAChJ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sHAAsH;IACtH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,KAAK,CAAC;QACf,qDAAqD;QACrD,MAAM,EAAE,MAAM,CAAC;QACf,kDAAkD;QAClD,KAAK,EAAE,MAAM,CAAC;KACf,CAAC,CAAC;CACJ,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,8BAAsB,YAAa,SAAQ,KAAK;IAC9C;;;;;OAKG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AAC,MAAM,EAAE,SAAS,CAAC,CAAC;CAClC,CAAC;AAEF;;;;;GAKG;AACH,oBAAY,YAAY;IACtB,0DAA0D;IAC1D,MAAM,WAAW;IACjB,0DAA0D;IAC1D,SAAS,cAAc;IACvB,kDAAkD;IAClD,MAAM,WAAW;IACjB,gDAAgD;IAChD,KAAK,UAAU;IACf,uDAAuD;IACvD,SAAS,cAAc;IACvB,kDAAkD;IAClD,MAAM,WAAW;IACjB,gCAAgC;IAChC,MAAM,WAAW;IACjB,sEAAsE;IACtE,MAAM,WAAW;IACjB,gDAAgD;IAChD,KAAK,UAAU;IACf,6CAA6C;IAC7C,OAAO,YAAY;CACpB;AAED;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,mDAAmD;IACnD,QAAQ,EAAE,YAAY,CAAC;IACvB,sDAAsD;IACtD,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,0EAA0E;IAC1E,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC,CAAC"}
|
|
@@ -1,40 +1,41 @@
|
|
|
1
|
-
import { ITool } from "..";
|
|
1
|
+
import { ITool, } from "..";
|
|
2
2
|
/**
|
|
3
|
-
* Built-in tool for managing OAuth authentication and
|
|
3
|
+
* Built-in tool for managing OAuth authentication and channel resources.
|
|
4
4
|
*
|
|
5
|
-
* The
|
|
6
|
-
* 1.
|
|
7
|
-
* 2.
|
|
8
|
-
* 3.
|
|
9
|
-
* 4.
|
|
5
|
+
* The Integrations tool:
|
|
6
|
+
* 1. Manages channel resources (calendars, projects, etc.) per actor
|
|
7
|
+
* 2. Returns tokens for the user who enabled sync on a channel
|
|
8
|
+
* 3. Supports per-actor auth via actAs() for write-back operations
|
|
9
|
+
* 4. Provides saveLink/saveContacts for Sources to save data directly
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* Sources declare their provider, scopes, and channel lifecycle methods as
|
|
12
|
+
* class properties and methods. The Integrations tool reads these automatically.
|
|
13
|
+
* Auth and channel management is handled in the twist edit modal in Flutter.
|
|
13
14
|
*
|
|
14
15
|
* @example
|
|
15
16
|
* ```typescript
|
|
16
|
-
* class
|
|
17
|
-
*
|
|
18
|
-
*
|
|
17
|
+
* class CalendarSource extends Source<CalendarSource> {
|
|
18
|
+
* readonly provider = AuthProvider.Google;
|
|
19
|
+
* readonly scopes = ["https://www.googleapis.com/auth/calendar"];
|
|
19
20
|
*
|
|
20
21
|
* build(build: ToolBuilder) {
|
|
21
22
|
* return {
|
|
22
|
-
* integrations: build(Integrations,
|
|
23
|
-
* providers: [{
|
|
24
|
-
* provider: AuthProvider.Google,
|
|
25
|
-
* scopes: CalendarTool.SCOPES,
|
|
26
|
-
* getSyncables: this.getSyncables,
|
|
27
|
-
* onSyncEnabled: this.onSyncEnabled,
|
|
28
|
-
* onSyncDisabled: this.onSyncDisabled,
|
|
29
|
-
* }]
|
|
30
|
-
* }),
|
|
23
|
+
* integrations: build(Integrations),
|
|
31
24
|
* };
|
|
32
25
|
* }
|
|
33
26
|
*
|
|
34
|
-
* async
|
|
27
|
+
* async getChannels(auth: Authorization, token: AuthToken): Promise<Channel[]> {
|
|
35
28
|
* const calendars = await this.listCalendars(token);
|
|
36
29
|
* return calendars.map(c => ({ id: c.id, title: c.name }));
|
|
37
30
|
* }
|
|
31
|
+
*
|
|
32
|
+
* async onChannelEnabled(channel: Channel) {
|
|
33
|
+
* // Start syncing
|
|
34
|
+
* }
|
|
35
|
+
*
|
|
36
|
+
* async onChannelDisabled(channel: Channel) {
|
|
37
|
+
* // Stop syncing
|
|
38
|
+
* }
|
|
38
39
|
* }
|
|
39
40
|
* ```
|
|
40
41
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integrations.js","sourceRoot":"","sources":["../../src/tools/integrations.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"integrations.js","sourceRoot":"","sources":["../../src/tools/integrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,GAEN,MAAM,IAAI,CAAC;AA2CZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAM,OAAgB,YAAa,SAAQ,KAAK;IAC9C;;;;;OAKG;IACH,MAAM,CAAC,WAAW,CAAC,GAAG,WAAuB;QAC3C,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACjD,CAAC;CAmFF;AAiBD;;;;;GAKG;AACH,MAAM,CAAN,IAAY,YAqBX;AArBD,WAAY,YAAY;IACtB,0DAA0D;IAC1D,iCAAiB,CAAA;IACjB,0DAA0D;IAC1D,uCAAuB,CAAA;IACvB,kDAAkD;IAClD,iCAAiB,CAAA;IACjB,gDAAgD;IAChD,+BAAe,CAAA;IACf,uDAAuD;IACvD,uCAAuB,CAAA;IACvB,kDAAkD;IAClD,iCAAiB,CAAA;IACjB,gCAAgC;IAChC,iCAAiB,CAAA;IACjB,sEAAsE;IACtE,iCAAiB,CAAA;IACjB,gDAAgD;IAChD,+BAAe,CAAA;IACf,6CAA6C;IAC7C,mCAAmB,CAAA;AACrB,CAAC,EArBW,YAAY,KAAZ,YAAY,QAqBvB"}
|