@dual-os/sdk 0.0.0-stage → 0.8.0-next.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/LICENSE +4 -0
- package/README.md +19 -2
- package/dist/Action.d.ts +201 -0
- package/dist/Action.d.ts.map +1 -0
- package/dist/Action.js +172 -0
- package/dist/Action.js.map +1 -0
- package/dist/AgentChannel.d.ts +1717 -0
- package/dist/AgentChannel.d.ts.map +1 -0
- package/dist/AgentChannel.js +708 -0
- package/dist/AgentChannel.js.map +1 -0
- package/dist/AgentChannelConformance.d.ts +1543 -0
- package/dist/AgentChannelConformance.d.ts.map +1 -0
- package/dist/AgentChannelConformance.js +163 -0
- package/dist/AgentChannelConformance.js.map +1 -0
- package/dist/AgentChannelRuntime.d.ts +78 -0
- package/dist/AgentChannelRuntime.d.ts.map +1 -0
- package/dist/AgentChannelRuntime.js +270 -0
- package/dist/AgentChannelRuntime.js.map +1 -0
- package/dist/AiProvider.d.ts +132 -0
- package/dist/AiProvider.d.ts.map +1 -0
- package/dist/AiProvider.js +100 -0
- package/dist/AiProvider.js.map +1 -0
- package/dist/AuthMethod.d.ts +381 -0
- package/dist/AuthMethod.d.ts.map +1 -0
- package/dist/AuthMethod.js +225 -0
- package/dist/AuthMethod.js.map +1 -0
- package/dist/AuthMethodBinding.d.ts +77 -0
- package/dist/AuthMethodBinding.d.ts.map +1 -0
- package/dist/AuthMethodBinding.js +31 -0
- package/dist/AuthMethodBinding.js.map +1 -0
- package/dist/AuthMethodExecution.d.ts +223 -0
- package/dist/AuthMethodExecution.d.ts.map +1 -0
- package/dist/AuthMethodExecution.js +277 -0
- package/dist/AuthMethodExecution.js.map +1 -0
- package/dist/ConnectionResolver.d.ts +219 -0
- package/dist/ConnectionResolver.d.ts.map +1 -0
- package/dist/ConnectionResolver.js +153 -0
- package/dist/ConnectionResolver.js.map +1 -0
- package/dist/DefinitionError.d.ts +67 -0
- package/dist/DefinitionError.d.ts.map +1 -0
- package/dist/DefinitionError.js +82 -0
- package/dist/DefinitionError.js.map +1 -0
- package/dist/DualRegistry.d.ts +71 -0
- package/dist/DualRegistry.d.ts.map +1 -0
- package/dist/DualRegistry.js +96 -0
- package/dist/DualRegistry.js.map +1 -0
- package/dist/DualRuntime.d.ts +279 -0
- package/dist/DualRuntime.d.ts.map +1 -0
- package/dist/DualRuntime.js +311 -0
- package/dist/DualRuntime.js.map +1 -0
- package/dist/Files.d.ts +80 -0
- package/dist/Files.d.ts.map +1 -0
- package/dist/Files.js +66 -0
- package/dist/Files.js.map +1 -0
- package/dist/Group.d.ts +106 -0
- package/dist/Group.d.ts.map +1 -0
- package/dist/Group.js +86 -0
- package/dist/Group.js.map +1 -0
- package/dist/Http.d.ts +342 -0
- package/dist/Http.d.ts.map +1 -0
- package/dist/Http.js +677 -0
- package/dist/Http.js.map +1 -0
- package/dist/Mcp.d.ts +109 -0
- package/dist/Mcp.d.ts.map +1 -0
- package/dist/Mcp.js +176 -0
- package/dist/Mcp.js.map +1 -0
- package/dist/OAuth2TokenRefresher.d.ts +18 -0
- package/dist/OAuth2TokenRefresher.d.ts.map +1 -0
- package/dist/OAuth2TokenRefresher.js +19 -0
- package/dist/OAuth2TokenRefresher.js.map +1 -0
- package/dist/OAuthFlow.d.ts +71 -0
- package/dist/OAuthFlow.d.ts.map +1 -0
- package/dist/OAuthFlow.js +488 -0
- package/dist/OAuthFlow.js.map +1 -0
- package/dist/Plugin.d.ts +383 -0
- package/dist/Plugin.d.ts.map +1 -0
- package/dist/Plugin.js +249 -0
- package/dist/Plugin.js.map +1 -0
- package/dist/PluginRuntime.d.ts +3186 -0
- package/dist/PluginRuntime.d.ts.map +1 -0
- package/dist/PluginRuntime.js +331 -0
- package/dist/PluginRuntime.js.map +1 -0
- package/dist/Runner.d.ts +1 -0
- package/dist/Runner.js +124 -0
- package/dist/Runner.js.map +1 -0
- package/dist/ToolFile.d.ts +23 -0
- package/dist/ToolFile.d.ts.map +1 -0
- package/dist/ToolFile.js +33 -0
- package/dist/ToolFile.js.map +1 -0
- package/dist/Trigger.d.ts +358 -0
- package/dist/Trigger.d.ts.map +1 -0
- package/dist/Trigger.js +287 -0
- package/dist/Trigger.js.map +1 -0
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +24 -0
- package/dist/internal/auth-context.d.ts +23 -0
- package/dist/internal/auth-context.d.ts.map +1 -0
- package/dist/internal/auth-context.js +1 -0
- package/dist/internal/auth-execution.d.ts +27 -0
- package/dist/internal/auth-execution.d.ts.map +1 -0
- package/dist/internal/auth-execution.js +66 -0
- package/dist/internal/auth-execution.js.map +1 -0
- package/dist/internal/auth-runtime.d.ts +5 -0
- package/dist/internal/auth-runtime.d.ts.map +1 -0
- package/dist/internal/auth-runtime.js +16 -0
- package/dist/internal/auth-runtime.js.map +1 -0
- package/dist/internal/capabilities.d.ts +24 -0
- package/dist/internal/capabilities.d.ts.map +1 -0
- package/dist/internal/capabilities.js +22 -0
- package/dist/internal/capabilities.js.map +1 -0
- package/dist/internal/children.d.ts +34 -0
- package/dist/internal/children.d.ts.map +1 -0
- package/dist/internal/children.js +53 -0
- package/dist/internal/children.js.map +1 -0
- package/dist/internal/collection-utils.d.ts +4 -0
- package/dist/internal/collection-utils.d.ts.map +1 -0
- package/dist/internal/collection-utils.js +6 -0
- package/dist/internal/collection-utils.js.map +1 -0
- package/dist/internal/dual/actions.d.ts +33 -0
- package/dist/internal/dual/actions.d.ts.map +1 -0
- package/dist/internal/dual/actions.js +26 -0
- package/dist/internal/dual/actions.js.map +1 -0
- package/dist/internal/dual/invoke.d.ts +63 -0
- package/dist/internal/dual/invoke.d.ts.map +1 -0
- package/dist/internal/dual/invoke.js +75 -0
- package/dist/internal/dual/invoke.js.map +1 -0
- package/dist/internal/dual/registry.d.ts +125 -0
- package/dist/internal/dual/registry.d.ts.map +1 -0
- package/dist/internal/dual/registry.js +172 -0
- package/dist/internal/dual/registry.js.map +1 -0
- package/dist/internal/dual/triggers.d.ts +29 -0
- package/dist/internal/dual/triggers.d.ts.map +1 -0
- package/dist/internal/dual/triggers.js +26 -0
- package/dist/internal/dual/triggers.js.map +1 -0
- package/dist/internal/handler-context.d.ts +9 -0
- package/dist/internal/handler-context.d.ts.map +1 -0
- package/dist/internal/handler-context.js +31 -0
- package/dist/internal/handler-context.js.map +1 -0
- package/dist/internal/identifier.d.ts +6 -0
- package/dist/internal/identifier.d.ts.map +1 -0
- package/dist/internal/identifier.js +28 -0
- package/dist/internal/identifier.js.map +1 -0
- package/dist/internal/plugin-handlers.d.ts +38 -0
- package/dist/internal/plugin-handlers.d.ts.map +1 -0
- package/dist/internal/plugin-handlers.js +52 -0
- package/dist/internal/plugin-handlers.js.map +1 -0
- package/dist/internal/proto.d.ts +7 -0
- package/dist/internal/proto.d.ts.map +1 -0
- package/dist/internal/proto.js +10 -0
- package/dist/internal/proto.js.map +1 -0
- package/dist/internal/schema-runtime.d.ts +6 -0
- package/dist/internal/schema-runtime.d.ts.map +1 -0
- package/dist/internal/schema-runtime.js +10 -0
- package/dist/internal/schema-runtime.js.map +1 -0
- package/dist/internal/trigger-runtime-shared.d.ts +41 -0
- package/dist/internal/trigger-runtime-shared.d.ts.map +1 -0
- package/dist/internal/trigger-runtime-shared.js +132 -0
- package/dist/internal/trigger-runtime-shared.js.map +1 -0
- package/dist/internal/trigger-runtime.d.ts +12 -0
- package/dist/internal/trigger-runtime.d.ts.map +1 -0
- package/dist/internal/trigger-runtime.js +95 -0
- package/dist/internal/trigger-runtime.js.map +1 -0
- package/dist/internal/types.d.ts +7 -0
- package/dist/internal/types.d.ts.map +1 -0
- package/dist/internal/types.js +1 -0
- package/dist/remote-runtime.d.ts +585 -0
- package/dist/remote-runtime.d.ts.map +1 -0
- package/dist/remote-runtime.js +367 -0
- package/dist/remote-runtime.js.map +1 -0
- package/package.json +55 -4
- package/src/Action.ts +370 -0
- package/src/AgentChannel.ts +860 -0
- package/src/AgentChannelConformance.ts +124 -0
- package/src/AgentChannelRuntime.ts +616 -0
- package/src/AiProvider.ts +255 -0
- package/src/AuthMethod.ts +954 -0
- package/src/AuthMethodBinding.ts +112 -0
- package/src/AuthMethodExecution.ts +542 -0
- package/src/ConnectionResolver.ts +265 -0
- package/src/DefinitionError.ts +115 -0
- package/src/DualRegistry.ts +152 -0
- package/src/DualRuntime.ts +1081 -0
- package/src/Files.ts +89 -0
- package/src/Group.ts +292 -0
- package/src/Http.ts +1205 -0
- package/src/Mcp.ts +299 -0
- package/src/OAuth2TokenRefresher.ts +22 -0
- package/src/OAuthFlow.ts +874 -0
- package/src/Plugin.ts +912 -0
- package/src/PluginRuntime.ts +414 -0
- package/src/Runner.ts +248 -0
- package/src/ToolFile.ts +28 -0
- package/src/Trigger.ts +722 -0
- package/src/index.ts +158 -0
- package/src/internal/auth-context.ts +27 -0
- package/src/internal/auth-execution.ts +241 -0
- package/src/internal/auth-runtime.ts +20 -0
- package/src/internal/capabilities.ts +55 -0
- package/src/internal/children.ts +126 -0
- package/src/internal/collection-utils.ts +8 -0
- package/src/internal/dual/actions.ts +116 -0
- package/src/internal/dual/invoke.ts +307 -0
- package/src/internal/dual/registry.ts +340 -0
- package/src/internal/dual/triggers.ts +128 -0
- package/src/internal/handler-context.ts +57 -0
- package/src/internal/identifier.ts +27 -0
- package/src/internal/plugin-handlers.ts +146 -0
- package/src/internal/proto.ts +8 -0
- package/src/internal/schema-runtime.ts +15 -0
- package/src/internal/trigger-runtime-shared.ts +449 -0
- package/src/internal/trigger-runtime.ts +223 -0
- package/src/internal/types.ts +12 -0
- package/src/remote-runtime.ts +469 -0
package/dist/Plugin.d.ts
ADDED
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
import { Any as Any$1 } from "./AuthMethod.js";
|
|
2
|
+
import { ContextForContract } from "./internal/auth-context.js";
|
|
3
|
+
import { ActionHandlerFailure, Any as Any$2, HandlerContext, Input, Output as Output$1 } from "./Action.js";
|
|
4
|
+
import { Any as Any$3, RuntimeContract } from "./AgentChannel.js";
|
|
5
|
+
import { ConnectionResolutionContext } from "./ConnectionResolver.js";
|
|
6
|
+
import { ActivationResult, Any as Any$4, Config as Config$1, EmitResult, Output as Output$2, PollingInput, State, VerifyResult, WebhookActivationInput, WebhookLifecycleInput } from "./Trigger.js";
|
|
7
|
+
import { FilterChildren } from "./internal/children.js";
|
|
8
|
+
import { Any as Any$5 } from "./Group.js";
|
|
9
|
+
import { ActionHandlerService, ActionHandlerServiceOf, HandlerServices as HandlerServices$1 } from "./internal/plugin-handlers.js";
|
|
10
|
+
import { Effect, Layer, Option, Pipeable, Scope } from "effect";
|
|
11
|
+
import { HttpClientRequest } from "effect/http";
|
|
12
|
+
declare namespace Plugin_d_exports {
|
|
13
|
+
export { ActionHandlerService, ActionHandlerServiceOf, ActionsFromChildren, AddAuthMethods, AddChildren, Any, BuildError, Category, Definition, GroupsFromChildren, HandlerCollection, HandlerServices, Handlers, LayerError, LayerOutput, LayerRequirements, Plugin, Provided, Requirements, SandboxAccess, StructuralChild, TriggerHandlers, TriggersFromChildren, TypeId, ValidateReturn, add, categories, isGitRequest, isPlugin, make, provide, toLayer, withAction, withAgentChannel, withAuthMethod, withAuthMethods, withCategories, withDescription, withDocsUrl, withGroup, withGroups, withHomepageUrl, withIconUrl, withIconUrlDark, withName, withSandboxAccess, withTrigger, withTriggers };
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* @since 0.0.0
|
|
17
|
+
* @category type ids
|
|
18
|
+
*/
|
|
19
|
+
export declare const TypeId: "@dual-os/sdk/Plugin";
|
|
20
|
+
/**
|
|
21
|
+
* @since 0.0.0
|
|
22
|
+
* @category type ids
|
|
23
|
+
*/
|
|
24
|
+
export type TypeId = typeof TypeId;
|
|
25
|
+
/** @since 0.0.0 @category models */
|
|
26
|
+
export declare const categories: readonly ["sales_crm", "marketing", "customer_support", "calendar_scheduling", "communication", "project_management", "developer_tools", "data_storage", "docs_productivity", "commerce_payments", "finance_accounting", "human_resources", "analytics", "design", "it_service_management", "search", "telephony", "web_scraping"];
|
|
27
|
+
/** @since 0.0.0 @category models */
|
|
28
|
+
export type Category = (typeof categories)[number];
|
|
29
|
+
/**
|
|
30
|
+
* How a command in a run sandbox uses the plugin's Connection over HTTPS without reading its
|
|
31
|
+
* credential: Dual's sandbox gateway adds the credential to each request that the plugin allows.
|
|
32
|
+
*
|
|
33
|
+
* @since 0.0.0
|
|
34
|
+
* @category models
|
|
35
|
+
*/
|
|
36
|
+
export interface SandboxAccess<Methods extends readonly Any$1[] = readonly Any$1[]> {
|
|
37
|
+
/** Origins, such as `https://github.com`, that may receive the Connection's credential. */
|
|
38
|
+
origins(context: HandlerContext<Methods>): readonly string[];
|
|
39
|
+
/**
|
|
40
|
+
* Adds the Connection's credential to a request for one of the origins, or refuses the request.
|
|
41
|
+
* Refuse every request that can read or create a credential, such as a token rotation.
|
|
42
|
+
*/
|
|
43
|
+
authorize(request: HttpClientRequest.HttpClientRequest, context: HandlerContext<Methods>): Option.Option<HttpClientRequest.HttpClientRequest>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Whether a request is a Git smart HTTP request of a fetch, clone or push: `GET <repository>/info/refs?service=<service>`
|
|
47
|
+
* or `POST <repository>/<service>` with the service's request content type.
|
|
48
|
+
*
|
|
49
|
+
* @since 0.0.0
|
|
50
|
+
* @category predicates
|
|
51
|
+
*/
|
|
52
|
+
export declare function isGitRequest(request: HttpClientRequest.HttpClientRequest): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Constraint type for working with any {@link Plugin}.
|
|
55
|
+
*
|
|
56
|
+
* @since 0.0.0
|
|
57
|
+
* @category type-level
|
|
58
|
+
*/
|
|
59
|
+
export interface Any extends Pipeable.Pipeable {
|
|
60
|
+
readonly [TypeId]: TypeId;
|
|
61
|
+
readonly identifier: string;
|
|
62
|
+
readonly name: string | undefined;
|
|
63
|
+
readonly description: string | undefined;
|
|
64
|
+
readonly iconUrl: string | undefined;
|
|
65
|
+
readonly iconUrlDark: string | undefined;
|
|
66
|
+
readonly categories: readonly Category[];
|
|
67
|
+
readonly homepageUrl: string | undefined;
|
|
68
|
+
readonly docsUrl: string | undefined;
|
|
69
|
+
readonly authMethods: readonly Any$1[];
|
|
70
|
+
readonly groups: readonly Any$5[];
|
|
71
|
+
readonly actions: readonly Any$2[];
|
|
72
|
+
readonly triggers: readonly Any$4[];
|
|
73
|
+
readonly agentChannels: readonly Any$3[];
|
|
74
|
+
readonly sandboxAccess: SandboxAccess | undefined;
|
|
75
|
+
readonly layer: Layer.Layer<never, any, any>;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* A typed plugin definition.
|
|
79
|
+
*
|
|
80
|
+
* @since 0.0.0
|
|
81
|
+
* @category models
|
|
82
|
+
*/
|
|
83
|
+
export interface Plugin<out Identifier extends string = string, out AuthMethods extends readonly Any$1[] = readonly [], out Groups extends readonly Any$5[] = readonly [], out Actions extends readonly Any$2[] = readonly [], out Triggers extends readonly Any$4[] = readonly [], out Channels extends readonly Any$3[] = readonly [], LayerOutput = never, out LayerError = never, out LayerRequirements = never> extends Pipeable.Pipeable {
|
|
84
|
+
readonly [TypeId]: TypeId;
|
|
85
|
+
readonly identifier: Identifier;
|
|
86
|
+
readonly name: string | undefined;
|
|
87
|
+
readonly description: string | undefined;
|
|
88
|
+
readonly iconUrl: string | undefined;
|
|
89
|
+
readonly iconUrlDark: string | undefined;
|
|
90
|
+
readonly categories: readonly Category[];
|
|
91
|
+
readonly homepageUrl: string | undefined;
|
|
92
|
+
readonly docsUrl: string | undefined;
|
|
93
|
+
readonly authMethods: AuthMethods;
|
|
94
|
+
readonly groups: Groups;
|
|
95
|
+
readonly actions: Actions;
|
|
96
|
+
readonly triggers: Triggers;
|
|
97
|
+
readonly agentChannels: Channels;
|
|
98
|
+
readonly sandboxAccess: SandboxAccess | undefined;
|
|
99
|
+
readonly layer: Layer.Layer<LayerOutput, LayerError, LayerRequirements>;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The contract of a plugin without its Layer.
|
|
103
|
+
*
|
|
104
|
+
* @since 0.6.0
|
|
105
|
+
* @category models
|
|
106
|
+
*/
|
|
107
|
+
export type Definition<Identifier extends string, Methods extends readonly Any$1[] = readonly [], Groups extends readonly Any$5[] = readonly [], Actions extends readonly Any$2[] = readonly [], Triggers extends readonly Any$4[] = readonly [], Channels extends readonly Any$3[] = readonly []> = Plugin<Identifier, Methods, Groups, Actions, Triggers, Channels>;
|
|
108
|
+
/**
|
|
109
|
+
* A plugin contract with the services its Layer provides.
|
|
110
|
+
*
|
|
111
|
+
* @since 0.7.0
|
|
112
|
+
* @category models
|
|
113
|
+
*/
|
|
114
|
+
export type Provided<P extends Any, LayerOutput, LayerError = never, LayerRequirements = never> = Plugin<P["identifier"], P["authMethods"], P["groups"], P["actions"], P["triggers"], P["agentChannels"], LayerOutput, LayerError, LayerRequirements>;
|
|
115
|
+
/**
|
|
116
|
+
* Runtime services produced by plugin layers.
|
|
117
|
+
*
|
|
118
|
+
* @since 0.0.0
|
|
119
|
+
* @category type-level
|
|
120
|
+
*/
|
|
121
|
+
export type LayerOutput<Plugins extends readonly Any[]> = Plugins[number] extends Plugin<any, any, any, any, any, any, infer Output, any, any> ? Output : never;
|
|
122
|
+
/**
|
|
123
|
+
* Errors surfaced while constructing plugin layers.
|
|
124
|
+
*
|
|
125
|
+
* @since 0.0.0
|
|
126
|
+
* @category type-level
|
|
127
|
+
*/
|
|
128
|
+
export type LayerError<Plugins extends readonly Any[]> = Plugins[number] extends Plugin<any, any, any, any, any, any, any, infer Error, any> ? Error : never;
|
|
129
|
+
/**
|
|
130
|
+
* Runtime services required by plugin layers.
|
|
131
|
+
*
|
|
132
|
+
* @since 0.0.0
|
|
133
|
+
* @category type-level
|
|
134
|
+
*/
|
|
135
|
+
export type LayerRequirements<Plugins extends readonly Any[]> = Plugins[number] extends Plugin<any, any, any, any, any, any, any, any, infer Requirements> ? Requirements : never;
|
|
136
|
+
/** @since 0.0.0 @category type-level */
|
|
137
|
+
export type StructuralChild = Any$5 | Any$2 | Any$4;
|
|
138
|
+
/** @since 0.0.0 @category type-level */
|
|
139
|
+
export type GroupsFromChildren<Children extends readonly StructuralChild[]> = FilterChildren<Children, Any$5>;
|
|
140
|
+
/** @since 0.0.0 @category type-level */
|
|
141
|
+
export type ActionsFromChildren<Children extends readonly StructuralChild[]> = FilterChildren<Children, Any$2>;
|
|
142
|
+
/** @since 0.0.0 @category type-level */
|
|
143
|
+
export type TriggersFromChildren<Children extends readonly StructuralChild[]> = FilterChildren<Children, Any$4>;
|
|
144
|
+
/**
|
|
145
|
+
* Result of appending capabilities to a plugin.
|
|
146
|
+
*
|
|
147
|
+
* @since 0.0.0
|
|
148
|
+
* @category type-level
|
|
149
|
+
*/
|
|
150
|
+
export type AddChildren<P extends Any, AddedGroups extends readonly Any$5[] = readonly [], AddedActions extends readonly Any$2[] = readonly [], AddedTriggers extends readonly Any$4[] = readonly [], AddedChannels extends readonly Any$3[] = readonly []> = P extends Plugin<infer Identifier, infer Methods, infer Groups, infer Actions, infer Triggers, infer Channels, infer Output, infer Error, infer Requirements> ? Plugin<Identifier, Methods, readonly [...Groups, ...AddedGroups], readonly [...Actions, ...AddedActions], readonly [...Triggers, ...AddedTriggers], readonly [...Channels, ...AddedChannels], Output, Error, Requirements> : never;
|
|
151
|
+
/**
|
|
152
|
+
* Result of appending auth methods to a plugin.
|
|
153
|
+
*
|
|
154
|
+
* @since 0.0.0
|
|
155
|
+
* @category type-level
|
|
156
|
+
*/
|
|
157
|
+
export type AddAuthMethods<P extends Any, AddedMethods extends readonly Any$1[]> = P extends Plugin<infer Identifier, infer Methods, infer Groups, infer Actions, infer Triggers, infer Channels, infer Output, infer Error, infer Requirements> ? Plugin<Identifier, readonly [...Methods, ...AddedMethods], Groups, Actions, Triggers, Channels, Output, Error, Requirements> : never;
|
|
158
|
+
/**
|
|
159
|
+
* Create an empty {@link Plugin}.
|
|
160
|
+
*
|
|
161
|
+
* @since 0.0.0
|
|
162
|
+
* @category constructors
|
|
163
|
+
*/
|
|
164
|
+
export declare const make: <const Identifier extends string>(identifier: Identifier) => Plugin<Identifier>;
|
|
165
|
+
/**
|
|
166
|
+
* Check if a value is a {@link Plugin}.
|
|
167
|
+
*
|
|
168
|
+
* @since 0.0.0
|
|
169
|
+
* @category guards
|
|
170
|
+
*/
|
|
171
|
+
export declare const isPlugin: (u: unknown) => u is Any;
|
|
172
|
+
/** @since 0.0.0 @category combinators */
|
|
173
|
+
export declare const withName: {
|
|
174
|
+
(value: string): <P extends Any>(plugin: P) => P;
|
|
175
|
+
<P extends Any>(plugin: P, value: string): P;
|
|
176
|
+
};
|
|
177
|
+
/** @since 0.0.0 @category combinators */
|
|
178
|
+
export declare const withDescription: {
|
|
179
|
+
(value: string): <P extends Any>(plugin: P) => P;
|
|
180
|
+
<P extends Any>(plugin: P, value: string): P;
|
|
181
|
+
};
|
|
182
|
+
/** @since 0.6.0 @category combinators */
|
|
183
|
+
export declare const withIconUrl: {
|
|
184
|
+
(value: string): <P extends Any>(plugin: P) => P;
|
|
185
|
+
<P extends Any>(plugin: P, value: string): P;
|
|
186
|
+
};
|
|
187
|
+
/** @since 0.6.0 @category combinators */
|
|
188
|
+
export declare const withIconUrlDark: {
|
|
189
|
+
(value: string): <P extends Any>(plugin: P) => P;
|
|
190
|
+
<P extends Any>(plugin: P, value: string): P;
|
|
191
|
+
};
|
|
192
|
+
/** @since 0.6.0 @category combinators */
|
|
193
|
+
export declare const withHomepageUrl: {
|
|
194
|
+
(value: string): <P extends Any>(plugin: P) => P;
|
|
195
|
+
<P extends Any>(plugin: P, value: string): P;
|
|
196
|
+
};
|
|
197
|
+
/** @since 0.6.0 @category combinators */
|
|
198
|
+
export declare const withDocsUrl: {
|
|
199
|
+
(value: string): <P extends Any>(plugin: P) => P;
|
|
200
|
+
<P extends Any>(plugin: P, value: string): P;
|
|
201
|
+
};
|
|
202
|
+
/** @since 0.6.0 @category combinators */
|
|
203
|
+
export declare const withCategories: {
|
|
204
|
+
(categories: readonly Category[]): <P extends Any>(plugin: P) => P;
|
|
205
|
+
<P extends Any>(plugin: P, categories: readonly Category[]): P;
|
|
206
|
+
};
|
|
207
|
+
/**
|
|
208
|
+
* Add authentication alternatives. Actions and triggers accept every method.
|
|
209
|
+
*
|
|
210
|
+
* @since 0.6.0
|
|
211
|
+
* @category combinators
|
|
212
|
+
*/
|
|
213
|
+
export declare const withAuthMethods: <const Methods extends readonly Any$1[]>(methods: Methods) => <P extends Any>(plugin: P) => AddAuthMethods<P, Methods>;
|
|
214
|
+
/**
|
|
215
|
+
* Add an authentication alternative. Actions and triggers accept every method.
|
|
216
|
+
*
|
|
217
|
+
* @since 0.6.0
|
|
218
|
+
* @category combinators
|
|
219
|
+
*/
|
|
220
|
+
export declare const withAuthMethod: {
|
|
221
|
+
<const Method extends Any$1>(method: Method): <P extends Any>(plugin: P) => AddAuthMethods<P, readonly [Method]>;
|
|
222
|
+
<P extends Any, const Method extends Any$1>(plugin: P, method: Method): AddAuthMethods<P, readonly [Method]>;
|
|
223
|
+
};
|
|
224
|
+
/**
|
|
225
|
+
* Lets commands in a run sandbox use the plugin's Connection through Dual's sandbox gateway.
|
|
226
|
+
*
|
|
227
|
+
* @since 0.6.0
|
|
228
|
+
* @category combinators
|
|
229
|
+
*/
|
|
230
|
+
export declare const withSandboxAccess: <Methods extends readonly Any$1[]>(access: SandboxAccess<Methods>) => <P extends Any>(plugin: P & {
|
|
231
|
+
readonly authMethods: Methods;
|
|
232
|
+
}) => P;
|
|
233
|
+
/** @since 0.6.0 @category combinators */
|
|
234
|
+
export declare const withAction: {
|
|
235
|
+
<const Added extends Any$2>(action: Added): <P extends Any>(plugin: P) => AddChildren<P, readonly [], readonly [Added]>;
|
|
236
|
+
<P extends Any, const Added extends Any$2>(plugin: P, action: Added): AddChildren<P, readonly [], readonly [Added]>;
|
|
237
|
+
};
|
|
238
|
+
/** @since 0.6.0 @category combinators */
|
|
239
|
+
export declare const withGroup: {
|
|
240
|
+
<const Added extends Any$5>(group: Added): <P extends Any>(plugin: P) => AddChildren<P, readonly [Added]>;
|
|
241
|
+
<P extends Any, const Added extends Any$5>(plugin: P, group: Added): AddChildren<P, readonly [Added]>;
|
|
242
|
+
};
|
|
243
|
+
/** @since 0.6.0 @category combinators */
|
|
244
|
+
export declare const withTrigger: {
|
|
245
|
+
<const Added extends Any$4>(trigger: Added): <P extends Any>(plugin: P) => AddChildren<P, readonly [], readonly [], readonly [Added]>;
|
|
246
|
+
<P extends Any, const Added extends Any$4>(plugin: P, trigger: Added): AddChildren<P, readonly [], readonly [], readonly [Added]>;
|
|
247
|
+
};
|
|
248
|
+
/** Add the generated action groups. @since 0.6.0 @category combinators */
|
|
249
|
+
export declare const withGroups: <const Groups extends readonly Any$5[]>(groups: Groups) => <P extends Any>(plugin: P) => AddChildren<P, Groups>;
|
|
250
|
+
/** Add trigger definitions from an overlay. @since 0.6.0 @category combinators */
|
|
251
|
+
export declare const withTriggers: <const Triggers extends readonly Any$4[]>(triggers: Triggers) => <P extends Any>(plugin: P) => AddChildren<P, readonly [], readonly [], Triggers>;
|
|
252
|
+
/** Add grouped capabilities. @since 0.6.0 @category combinators */
|
|
253
|
+
export declare const add: <const Children extends readonly StructuralChild[]>(...children: Children) => <P extends Any>(plugin: P) => AddChildren<P, GroupsFromChildren<Children>, ActionsFromChildren<Children>, TriggersFromChildren<Children>>;
|
|
254
|
+
/** Add an Agent Channel; its definition owns its exact auth subset. @since 0.6.0 @category combinators */
|
|
255
|
+
export declare const withAgentChannel: <const Channel extends Any$3>(channel: Channel) => <P extends Any>(plugin: P) => AddChildren<P, readonly [], readonly [], readonly [], readonly [Channel]>;
|
|
256
|
+
/**
|
|
257
|
+
* Attach runtime services to a plugin definition.
|
|
258
|
+
*
|
|
259
|
+
* @since 0.0.0
|
|
260
|
+
* @category combinators
|
|
261
|
+
*/
|
|
262
|
+
export declare const provide: {
|
|
263
|
+
<AddedOutput, AddedError, AddedRequirements>(layer: Layer.Layer<AddedOutput, AddedError, AddedRequirements>): <P extends Any>(plugin: P) => Provided<P, LayerOutput<readonly [P]> | AddedOutput, LayerError<readonly [P]> | AddedError, AddedRequirements | Exclude<LayerRequirements<readonly [P]>, AddedOutput>>;
|
|
264
|
+
<P extends Any, AddedOutput, AddedError, AddedRequirements>(plugin: P, layer: Layer.Layer<AddedOutput, AddedError, AddedRequirements>): Provided<P, LayerOutput<readonly [P]> | AddedOutput, LayerError<readonly [P]> | AddedError, AddedRequirements | Exclude<LayerRequirements<readonly [P]>, AddedOutput>>;
|
|
265
|
+
};
|
|
266
|
+
/** Runtime handler services contributed by a plugin. @since 0.6.0 @category type-level */
|
|
267
|
+
export type HandlerServices<P extends Any> = HandlerServices$1<P>;
|
|
268
|
+
interface Node {
|
|
269
|
+
readonly actions: readonly Any$2[];
|
|
270
|
+
readonly groups: readonly Any$5[];
|
|
271
|
+
readonly triggers: readonly Any$4[];
|
|
272
|
+
readonly agentChannels?: readonly Any$3[];
|
|
273
|
+
}
|
|
274
|
+
type ActionName<N extends Node> = N["actions"][number]["identifier"];
|
|
275
|
+
type GroupName<N extends Node> = N["groups"][number]["identifier"];
|
|
276
|
+
type TriggerName<N extends Node> = N["triggers"][number]["identifier"];
|
|
277
|
+
type ActionNamed<N extends Node, Name> = Extract<N["actions"][number], {
|
|
278
|
+
readonly identifier: Name;
|
|
279
|
+
}>;
|
|
280
|
+
type GroupNamed<N extends Node, Name> = Extract<N["groups"][number], {
|
|
281
|
+
readonly identifier: Name;
|
|
282
|
+
}>;
|
|
283
|
+
type TriggerNamed<N extends Node, Name> = Extract<N["triggers"][number], {
|
|
284
|
+
readonly identifier: Name;
|
|
285
|
+
}>;
|
|
286
|
+
type Channels<N extends Node> = N extends {
|
|
287
|
+
readonly agentChannels: infer C extends readonly Any$3[];
|
|
288
|
+
} ? C[number] : never;
|
|
289
|
+
type ChannelName<N extends Node> = Channels<N>["identifier"];
|
|
290
|
+
type ChannelNamed<N extends Node, Name> = Extract<Channels<N>, {
|
|
291
|
+
readonly identifier: Name;
|
|
292
|
+
}>;
|
|
293
|
+
type Names<N extends Node> = ActionName<N> | GroupName<N> | TriggerName<N> | ChannelName<N>;
|
|
294
|
+
type ActionHandler<A extends Any$2, Methods extends readonly Any$1[], R> = (input: Input<A>, context: ContextForContract<Methods, A["requireAuth"]>) => Effect.Effect<Output$1<A>, ActionHandlerFailure, R>;
|
|
295
|
+
type TriggerContext<T extends Any$4, Methods extends readonly Any$1[]> = ContextForContract<Methods, T["requireAuth"]> & ConnectionResolutionContext;
|
|
296
|
+
type Emit<T extends Any$4> = EmitResult<Output$2<T>, State<T>>;
|
|
297
|
+
type WebhookInput<T extends Any$4> = WebhookLifecycleInput<Config$1<T>, State<T>>;
|
|
298
|
+
type ActivationInput<T extends Any$4> = WebhookActivationInput<Config$1<T>, State<T>>;
|
|
299
|
+
/** Lifecycle handlers each trigger kind must implement; each hook infers its own requirements. */
|
|
300
|
+
type TriggerLifecycle<T extends Any$4, Methods extends readonly Any$1[], RActivate, RDeactivate, RVerify, REmit> = T["kind"] extends "webhook" ? {
|
|
301
|
+
readonly activate?: (input: ActivationInput<T>, context: TriggerContext<T, Methods>) => Effect.Effect<ActivationResult<State<T>>, unknown, RActivate>;
|
|
302
|
+
readonly deactivate?: (input: ActivationInput<T>, context: TriggerContext<T, Methods>) => Effect.Effect<void, unknown, RDeactivate>;
|
|
303
|
+
readonly verify?: (input: WebhookInput<T>, context: TriggerContext<T, Methods>) => Effect.Effect<void | VerifyResult<State<T>>, unknown, RVerify>;
|
|
304
|
+
readonly parse: (input: WebhookInput<T>, context: TriggerContext<T, Methods>) => Effect.Effect<Emit<T>, unknown, REmit>;
|
|
305
|
+
} : {
|
|
306
|
+
readonly poll: (input: PollingInput<Config$1<T>, State<T>>, context: TriggerContext<T, Methods>) => Effect.Effect<Emit<T>, unknown, REmit>;
|
|
307
|
+
};
|
|
308
|
+
type UnionToIntersection<U> = (U extends unknown ? (value: U) => void : never) extends ((value: infer I) => void) ? I : never;
|
|
309
|
+
/** Typed lifecycles exported by a trigger overlay. @since 0.6.0 @category handlers */
|
|
310
|
+
export type TriggerHandlers<Triggers extends readonly Any$4[], Methods extends readonly Any$1[]> = { readonly [T in Triggers[number] as T["identifier"]]: TriggerLifecycle<T, Methods, any, any, any, any>; };
|
|
311
|
+
type LifecycleRequirements<H> = H extends ((...args: any[]) => Effect.Effect<any, any, infer R>) ? R : H extends object ? { [K in keyof H]: LifecycleRequirements<H[K]>; }[keyof H] : never;
|
|
312
|
+
/** Rejects a union of names, which would mark several capabilities handled by one handler. */
|
|
313
|
+
type Single<Name> = [Name] extends [UnionToIntersection<Name>] ? unknown : never;
|
|
314
|
+
/**
|
|
315
|
+
* Immutable handler collection for one plugin or group. Each registration
|
|
316
|
+
* removes its name from the names still accepted.
|
|
317
|
+
*
|
|
318
|
+
* @since 0.6.0
|
|
319
|
+
* @category handlers
|
|
320
|
+
*/
|
|
321
|
+
export interface HandlerCollection<N extends Node, Methods extends readonly Any$1[], Handled extends PropertyKey = never, R = never> {
|
|
322
|
+
readonly "~node": N;
|
|
323
|
+
readonly "~handled": Handled;
|
|
324
|
+
readonly "~requirements": R;
|
|
325
|
+
/** @internal */
|
|
326
|
+
readonly actions: Readonly<Record<string, unknown>>;
|
|
327
|
+
/** @internal */
|
|
328
|
+
readonly triggers: Readonly<Record<string, unknown>>;
|
|
329
|
+
readonly agentChannels: Readonly<Record<string, unknown>>;
|
|
330
|
+
/** Implement a Channel declared by the plugin. */
|
|
331
|
+
channel<const Name extends Exclude<ChannelName<N>, Handled>, R1>(name: Name & Single<Name>, lifecycle: RuntimeContract<ChannelNamed<N, Name>["definition"], R1>): HandlerCollection<N, Methods, Handled | Name, R | R1>;
|
|
332
|
+
/** Register the lifecycles from a typed trigger overlay. */
|
|
333
|
+
withTriggers<H extends TriggerHandlers<N["triggers"], Methods>>(lifecycles: H & Record<Exclude<keyof H, TriggerName<N>>, never> & ([Extract<Handled, TriggerName<N>>] extends [never] ? unknown : never)): HandlerCollection<N, Methods, Handled | TriggerName<N>, R | LifecycleRequirements<H>>;
|
|
334
|
+
/** Implement an action declared directly on this plugin or group. */
|
|
335
|
+
action<const Name extends Exclude<ActionName<N>, Handled>, R1>(name: Name & Single<Name>, handler: ActionHandler<ActionNamed<N, Name>, Methods, R1>): HandlerCollection<N, Methods, Handled | Name, R | R1>;
|
|
336
|
+
/** Implement every capability of a nested group. */
|
|
337
|
+
group<const Name extends Exclude<GroupName<N>, Handled>, Return>(name: Name & Single<Name>, build: (handlers: HandlerCollection<GroupNamed<N, Name>, Methods>) => ValidateHandlers<Return, GroupNamed<N, Name>>): HandlerCollection<N, Methods, Handled | Name, R | Requirements<Return>>;
|
|
338
|
+
/** Implement the lifecycle of a trigger declared directly on this plugin or group. */
|
|
339
|
+
trigger<const Name extends Exclude<TriggerName<N>, Handled>, RActivate = never, RDeactivate = never, RVerify = never, REmit = never>(name: Name & Single<Name>, lifecycle: TriggerLifecycle<TriggerNamed<N, Name>, Methods, RActivate, RDeactivate, RVerify, REmit>): HandlerCollection<N, Methods, Handled | Name, R | RActivate | RDeactivate | RVerify | REmit>;
|
|
340
|
+
}
|
|
341
|
+
type Built<Return> = Return extends Effect.Effect<infer H, any, any> ? H : Return;
|
|
342
|
+
/** Accept the expected node's handler collection once every capability is implemented. */
|
|
343
|
+
type ValidateHandlers<H, N extends Node> = H extends HandlerCollection<N, any, infer Handled, any> ? [Exclude<Names<N>, Handled>] extends [never] ? H : `Capability not handled: ${Exclude<Names<N>, Handled> & string}` : "Must return the handlers of this plugin or group";
|
|
344
|
+
/**
|
|
345
|
+
* Accept the plugin's handlers, or an Effect building them, once every
|
|
346
|
+
* declared capability is implemented.
|
|
347
|
+
*
|
|
348
|
+
* @since 0.6.0
|
|
349
|
+
* @category type-level
|
|
350
|
+
*/
|
|
351
|
+
export type ValidateReturn<Return, N extends Node> = [ValidateHandlers<Built<Return>, N>] extends [HandlerCollection<any, any, any, any>] ? Return : ValidateHandlers<Built<Return>, N>;
|
|
352
|
+
/**
|
|
353
|
+
* Services the handlers need, including those needed to build them.
|
|
354
|
+
*
|
|
355
|
+
* @since 0.6.0
|
|
356
|
+
* @category type-level
|
|
357
|
+
*/
|
|
358
|
+
export type Requirements<Return> = Return extends Effect.Effect<HandlerCollection<any, any, any, infer R>, any, infer RX> ? R | RX : Return extends HandlerCollection<any, any, any, infer R> ? R : never;
|
|
359
|
+
/**
|
|
360
|
+
* Failures raised while building the handlers.
|
|
361
|
+
*
|
|
362
|
+
* @since 0.6.0
|
|
363
|
+
* @category type-level
|
|
364
|
+
*/
|
|
365
|
+
export type BuildError<Return> = Return extends Effect.Effect<any, infer E, any> ? E : never;
|
|
366
|
+
/**
|
|
367
|
+
* Handler collection passed to {@link toLayer}.
|
|
368
|
+
*
|
|
369
|
+
* @since 0.6.0
|
|
370
|
+
* @category handlers
|
|
371
|
+
*/
|
|
372
|
+
export type Handlers<P extends Any> = HandlerCollection<P, P["authMethods"]>;
|
|
373
|
+
/**
|
|
374
|
+
* Implement a plugin's capabilities. `build` registers one handler per action,
|
|
375
|
+
* trigger and Channel; the Layer is rejected until every capability is implemented.
|
|
376
|
+
*
|
|
377
|
+
* @since 0.6.0
|
|
378
|
+
* @category handlers
|
|
379
|
+
*/
|
|
380
|
+
export declare const toLayer: <P extends Any, Return>(plugin: P, build: (handlers: Handlers<P>) => ValidateReturn<Return, P>) => Layer.Layer<HandlerServices<P>, BuildError<Return>, Exclude<Requirements<Return>, Scope.Scope>>;
|
|
381
|
+
//#endregion
|
|
382
|
+
export { type ActionHandlerService, type ActionHandlerServiceOf, Plugin_d_exports };
|
|
383
|
+
//# sourceMappingURL=Plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Plugin.d.ts","names":["AuthMethod.Any","Action.HandlerContext","Group.Any","Action.Any","Trigger.Any","AgentChannel.Any","PluginHandlerServices","Action.Input","Action.Output","Action.ActionHandlerFailure","Trigger.Output","Trigger.State","Trigger.EmitResult","Trigger.Config","Trigger.WebhookLifecycleInput","Trigger.WebhookActivationInput","Trigger.ActivationResult","Trigger.VerifyResult","Trigger.PollingInput","AgentChannel.RuntimeContract"],"sources":["../src/Plugin.ts"],"mappings":";;;;;;;;;;;;;;;;;;qBA0Ca;;;;;YAMD,gBAAgB;;qBAGf;;YAsBD,mBAAmB;;;;;;;;iBASd,cACf,yBAAyBA,mBAA4BA;;EAGrD,QAAQ,SAASC,eAAsB;;;;;EAKvC,UACE,SAAS,kBAAkB,mBAC3B,SAASA,eAAsB,WAC9B,OAAO,OAAO,kBAAkB;;;;;;;;;wBAYrB,aAAa,SAAS,kBAAkB;;;;;;;iBA2BvC,YAAY,SAAS;YAC1B,SAAS;WACV;WACA;WACA;WACA;WACA;WACA,qBAAqB;WACrB;WACA;WACA,sBAAsBD;WACtB,iBAAiBE;WACjB,kBAAkBC;WAClB,mBAAmBC;WACnB,wBAAwBC;WACxB,eAAe;WACf,OAAO,MAAM;;;;;;;;iBASP,WACX,wCACA,6BAA6BL,2BAC7B,wBAAwBE,2BACxB,yBAAyBC,2BACzB,0BAA0BC,2BAC1B,0BAA0BC,uBAC9B,yBACI,wBACA,mCAEI,SAAS;YACP,SAAS;WACV,YAAY;WACZ;WACA;WACA;WACA;WACA,qBAAqB;WACrB;WACA;WACA,aAAa;WACb,QAAQ;WACR,SAAS;WACT,UAAU;WACV,eAAe;WACf,eAAe;WACf,OAAO,MAAM,MAAM,aAAa,YAAY;;;;;;;;YAS3C,WACV,2BACA,yBAAyBL,uBACzB,wBAAwBE,uBACxB,yBAAyBC,uBACzB,0BAA0BC,uBAC1B,0BAA0BC,yBACxB,OAAO,YAAY,SAAS,QAAQ,SAAS,UAAU;;;;;;;YAQ/C,SACV,UAAU,KACV,aACA,oBACA,6BACE,OACF,iBACA,kBACA,aACA,cACA,eACA,oBACA,aACA,YACA;;;;;;;YASU,YAAY,yBAAyB,SAC/C,wBAAwB,2CAA2C,oBAC/D;;;;;;;YASM,WAAW,yBAAyB,SAC9C,wBAAwB,gDAAgD,cACpE;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SACX,QAAQ,aAAa,SAAS,MAAM"}
|
package/dist/Plugin.js
ADDED
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { __exportAll } from "./_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { validateIdentifier } from "./internal/identifier.js";
|
|
3
|
+
import { PipeableProto } from "./internal/proto.js";
|
|
4
|
+
import { ChannelError, validateDefinition } from "./AgentChannel.js";
|
|
5
|
+
import { assertNoDuplicateAuthMethodIdentifiers } from "./internal/auth-runtime.js";
|
|
6
|
+
import { appendElements } from "./internal/collection-utils.js";
|
|
7
|
+
import { assertUniqueMixedChildIdentifiers, assertUniqueStructuralChildIdentifiers, partitionChildren } from "./internal/children.js";
|
|
8
|
+
import { toHandlers } from "./internal/plugin-handlers.js";
|
|
9
|
+
import { Array, Effect, Function, Layer, Option, Predicate, Result, String } from "effect";
|
|
10
|
+
import { Url, UrlParams } from "effect/http";
|
|
11
|
+
//#region src/Plugin.ts
|
|
12
|
+
var Plugin_exports = /* @__PURE__ */ __exportAll({
|
|
13
|
+
TypeId: () => TypeId,
|
|
14
|
+
add: () => add,
|
|
15
|
+
categories: () => categories,
|
|
16
|
+
isGitRequest: () => isGitRequest,
|
|
17
|
+
isPlugin: () => isPlugin,
|
|
18
|
+
make: () => make,
|
|
19
|
+
provide: () => provide,
|
|
20
|
+
toLayer: () => toLayer,
|
|
21
|
+
withAction: () => withAction,
|
|
22
|
+
withAgentChannel: () => withAgentChannel,
|
|
23
|
+
withAuthMethod: () => withAuthMethod,
|
|
24
|
+
withAuthMethods: () => withAuthMethods,
|
|
25
|
+
withCategories: () => withCategories,
|
|
26
|
+
withDescription: () => withDescription,
|
|
27
|
+
withDocsUrl: () => withDocsUrl,
|
|
28
|
+
withGroup: () => withGroup,
|
|
29
|
+
withGroups: () => withGroups,
|
|
30
|
+
withHomepageUrl: () => withHomepageUrl,
|
|
31
|
+
withIconUrl: () => withIconUrl,
|
|
32
|
+
withIconUrlDark: () => withIconUrlDark,
|
|
33
|
+
withName: () => withName,
|
|
34
|
+
withSandboxAccess: () => withSandboxAccess,
|
|
35
|
+
withTrigger: () => withTrigger,
|
|
36
|
+
withTriggers: () => withTriggers
|
|
37
|
+
});
|
|
38
|
+
/**
|
|
39
|
+
* @since 0.0.0
|
|
40
|
+
* @category type ids
|
|
41
|
+
*/
|
|
42
|
+
const TypeId = "@dual-os/sdk/Plugin";
|
|
43
|
+
/** @since 0.0.0 @category models */
|
|
44
|
+
const categories = [
|
|
45
|
+
"sales_crm",
|
|
46
|
+
"marketing",
|
|
47
|
+
"customer_support",
|
|
48
|
+
"calendar_scheduling",
|
|
49
|
+
"communication",
|
|
50
|
+
"project_management",
|
|
51
|
+
"developer_tools",
|
|
52
|
+
"data_storage",
|
|
53
|
+
"docs_productivity",
|
|
54
|
+
"commerce_payments",
|
|
55
|
+
"finance_accounting",
|
|
56
|
+
"human_resources",
|
|
57
|
+
"analytics",
|
|
58
|
+
"design",
|
|
59
|
+
"it_service_management",
|
|
60
|
+
"search",
|
|
61
|
+
"telephony",
|
|
62
|
+
"web_scraping"
|
|
63
|
+
];
|
|
64
|
+
const gitServices = ["git-upload-pack", "git-receive-pack"];
|
|
65
|
+
/**
|
|
66
|
+
* Whether a request is a Git smart HTTP request of a fetch, clone or push: `GET <repository>/info/refs?service=<service>`
|
|
67
|
+
* or `POST <repository>/<service>` with the service's request content type.
|
|
68
|
+
*
|
|
69
|
+
* @since 0.0.0
|
|
70
|
+
* @category predicates
|
|
71
|
+
*/
|
|
72
|
+
function isGitRequest(request) {
|
|
73
|
+
return Result.match(Url.fromString(request.url), {
|
|
74
|
+
onFailure: () => false,
|
|
75
|
+
onSuccess: (url) => {
|
|
76
|
+
const service = Option.orElse(UrlParams.getFirst(Url.urlParams(url), "service"), () => UrlParams.getFirst(request.urlParams, "service"));
|
|
77
|
+
return Array.some(gitServices, (name) => request.method === "GET" && String.endsWith("/info/refs")(url.pathname) && Option.contains(service, name) || request.method === "POST" && String.endsWith(`/${name}`)(url.pathname) && request.headers["content-type"] === `application/x-${name}-request`);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
const Proto = {
|
|
82
|
+
...PipeableProto,
|
|
83
|
+
[TypeId]: TypeId
|
|
84
|
+
};
|
|
85
|
+
const makePlugin = (fields) => {
|
|
86
|
+
validateIdentifier("plugin", fields.identifier);
|
|
87
|
+
assertNoDuplicateAuthMethodIdentifiers(fields.identifier, fields.authMethods);
|
|
88
|
+
return Object.assign(Object.create(Proto), fields);
|
|
89
|
+
};
|
|
90
|
+
const update = (plugin, fields) => makePlugin({
|
|
91
|
+
...plugin,
|
|
92
|
+
...fields
|
|
93
|
+
});
|
|
94
|
+
/**
|
|
95
|
+
* Create an empty {@link Plugin}.
|
|
96
|
+
*
|
|
97
|
+
* @since 0.0.0
|
|
98
|
+
* @category constructors
|
|
99
|
+
*/
|
|
100
|
+
const make = (identifier) => makePlugin({
|
|
101
|
+
actions: [],
|
|
102
|
+
agentChannels: [],
|
|
103
|
+
authMethods: [],
|
|
104
|
+
categories: [],
|
|
105
|
+
description: void 0,
|
|
106
|
+
docsUrl: void 0,
|
|
107
|
+
groups: [],
|
|
108
|
+
homepageUrl: void 0,
|
|
109
|
+
iconUrl: void 0,
|
|
110
|
+
iconUrlDark: void 0,
|
|
111
|
+
identifier,
|
|
112
|
+
layer: Layer.empty,
|
|
113
|
+
name: void 0,
|
|
114
|
+
sandboxAccess: void 0,
|
|
115
|
+
triggers: []
|
|
116
|
+
});
|
|
117
|
+
/**
|
|
118
|
+
* Check if a value is a {@link Plugin}.
|
|
119
|
+
*
|
|
120
|
+
* @since 0.0.0
|
|
121
|
+
* @category guards
|
|
122
|
+
*/
|
|
123
|
+
const isPlugin = (u) => Predicate.hasProperty(u, TypeId);
|
|
124
|
+
const metadata = (key) => Function.dual(2, (plugin, value) => update(plugin, { [key]: value }));
|
|
125
|
+
/** @since 0.0.0 @category combinators */
|
|
126
|
+
const withName = metadata("name");
|
|
127
|
+
/** @since 0.0.0 @category combinators */
|
|
128
|
+
const withDescription = metadata("description");
|
|
129
|
+
/** @since 0.6.0 @category combinators */
|
|
130
|
+
const withIconUrl = metadata("iconUrl");
|
|
131
|
+
/** @since 0.6.0 @category combinators */
|
|
132
|
+
const withIconUrlDark = metadata("iconUrlDark");
|
|
133
|
+
/** @since 0.6.0 @category combinators */
|
|
134
|
+
const withHomepageUrl = metadata("homepageUrl");
|
|
135
|
+
/** @since 0.6.0 @category combinators */
|
|
136
|
+
const withDocsUrl = metadata("docsUrl");
|
|
137
|
+
/** @since 0.6.0 @category combinators */
|
|
138
|
+
const withCategories = Function.dual(2, (plugin, categories) => update(plugin, { categories: [...categories] }));
|
|
139
|
+
/**
|
|
140
|
+
* Add authentication alternatives. Actions and triggers accept every method.
|
|
141
|
+
*
|
|
142
|
+
* @since 0.6.0
|
|
143
|
+
* @category combinators
|
|
144
|
+
*/
|
|
145
|
+
const withAuthMethods = (methods) => (plugin) => {
|
|
146
|
+
if (plugin.sandboxAccess !== void 0) throw new Error(`plugin "${plugin.identifier}" must declare auth methods before its sandbox access`);
|
|
147
|
+
return update(plugin, { authMethods: appendElements(plugin.authMethods, methods) });
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* Add an authentication alternative. Actions and triggers accept every method.
|
|
151
|
+
*
|
|
152
|
+
* @since 0.6.0
|
|
153
|
+
* @category combinators
|
|
154
|
+
*/
|
|
155
|
+
const withAuthMethod = Function.dual(2, (plugin, method) => withAuthMethods([method])(plugin));
|
|
156
|
+
/**
|
|
157
|
+
* Lets commands in a run sandbox use the plugin's Connection through Dual's sandbox gateway.
|
|
158
|
+
*
|
|
159
|
+
* @since 0.6.0
|
|
160
|
+
* @category combinators
|
|
161
|
+
*/
|
|
162
|
+
const withSandboxAccess = (access) => (plugin) => update(plugin, { sandboxAccess: access });
|
|
163
|
+
const appendChildren = (plugin, children, childKind) => {
|
|
164
|
+
if (childKind === void 0) assertUniqueMixedChildIdentifiers("plugin", plugin.identifier, plugin, children);
|
|
165
|
+
else assertUniqueStructuralChildIdentifiers("plugin", plugin.identifier, plugin, children, childKind);
|
|
166
|
+
const partitioned = partitionChildren(children);
|
|
167
|
+
return update(plugin, {
|
|
168
|
+
actions: appendElements(plugin.actions, partitioned.actions),
|
|
169
|
+
groups: appendElements(plugin.groups, partitioned.groups),
|
|
170
|
+
triggers: appendElements(plugin.triggers, partitioned.triggers)
|
|
171
|
+
});
|
|
172
|
+
};
|
|
173
|
+
/** @since 0.6.0 @category combinators */
|
|
174
|
+
const withAction = Function.dual(2, (plugin, action) => appendChildren(plugin, [action], "action"));
|
|
175
|
+
/** @since 0.6.0 @category combinators */
|
|
176
|
+
const withGroup = Function.dual(2, (plugin, group) => appendChildren(plugin, [group], "group"));
|
|
177
|
+
/** @since 0.6.0 @category combinators */
|
|
178
|
+
const withTrigger = Function.dual(2, (plugin, trigger) => appendChildren(plugin, [trigger], "trigger"));
|
|
179
|
+
/** Add the generated action groups. @since 0.6.0 @category combinators */
|
|
180
|
+
const withGroups = (groups) => (plugin) => appendChildren(plugin, groups, "group");
|
|
181
|
+
/** Add trigger definitions from an overlay. @since 0.6.0 @category combinators */
|
|
182
|
+
const withTriggers = (triggers) => (plugin) => appendChildren(plugin, triggers, "trigger");
|
|
183
|
+
/** Add grouped capabilities. @since 0.6.0 @category combinators */
|
|
184
|
+
const add = (...children) => (plugin) => appendChildren(plugin, children);
|
|
185
|
+
/** Add an Agent Channel; its definition owns its exact auth subset. @since 0.6.0 @category combinators */
|
|
186
|
+
const withAgentChannel = (channel) => (plugin) => {
|
|
187
|
+
if ([
|
|
188
|
+
...plugin.actions,
|
|
189
|
+
...plugin.triggers,
|
|
190
|
+
...plugin.groups,
|
|
191
|
+
...plugin.agentChannels
|
|
192
|
+
].some((child) => child.identifier === channel.identifier)) throw new ChannelError({ code: "invalid_definition" });
|
|
193
|
+
validateDefinition(channel.definition, plugin.identifier, plugin.authMethods);
|
|
194
|
+
return update(plugin, { agentChannels: [...plugin.agentChannels, channel] });
|
|
195
|
+
};
|
|
196
|
+
/**
|
|
197
|
+
* Attach runtime services to a plugin definition.
|
|
198
|
+
*
|
|
199
|
+
* @since 0.0.0
|
|
200
|
+
* @category combinators
|
|
201
|
+
*/
|
|
202
|
+
const provide = Function.dual(2, (plugin, layer) => update(plugin, { layer: Layer.provideMerge(plugin.layer, layer) }));
|
|
203
|
+
const makeHandlers = (actions, triggers, agentChannels = {}) => ({
|
|
204
|
+
action: (name, handler) => makeHandlers({
|
|
205
|
+
...actions,
|
|
206
|
+
[name]: handler
|
|
207
|
+
}, triggers, agentChannels),
|
|
208
|
+
actions,
|
|
209
|
+
agentChannels,
|
|
210
|
+
channel: (name, lifecycle) => makeHandlers(actions, triggers, {
|
|
211
|
+
...agentChannels,
|
|
212
|
+
[name]: lifecycle
|
|
213
|
+
}),
|
|
214
|
+
group: (name, build) => {
|
|
215
|
+
const group = build(makeHandlers({}, {}));
|
|
216
|
+
return makeHandlers({
|
|
217
|
+
...actions,
|
|
218
|
+
[name]: group.actions
|
|
219
|
+
}, {
|
|
220
|
+
...triggers,
|
|
221
|
+
[name]: group.triggers
|
|
222
|
+
}, agentChannels);
|
|
223
|
+
},
|
|
224
|
+
trigger: (name, lifecycle) => makeHandlers(actions, {
|
|
225
|
+
...triggers,
|
|
226
|
+
[name]: lifecycle
|
|
227
|
+
}, agentChannels),
|
|
228
|
+
triggers,
|
|
229
|
+
withTriggers: (lifecycles) => makeHandlers(actions, {
|
|
230
|
+
...triggers,
|
|
231
|
+
...lifecycles
|
|
232
|
+
}, agentChannels)
|
|
233
|
+
});
|
|
234
|
+
/**
|
|
235
|
+
* Implement a plugin's capabilities. `build` registers one handler per action,
|
|
236
|
+
* trigger and Channel; the Layer is rejected until every capability is implemented.
|
|
237
|
+
*
|
|
238
|
+
* @since 0.6.0
|
|
239
|
+
* @category handlers
|
|
240
|
+
*/
|
|
241
|
+
const toLayer = (plugin, build) => Layer.effectContext(Effect.gen(function* () {
|
|
242
|
+
const result = build(makeHandlers({}, {}));
|
|
243
|
+
const handlers = Effect.isEffect(result) ? yield* result : result;
|
|
244
|
+
return yield* toHandlers(plugin, handlers);
|
|
245
|
+
}));
|
|
246
|
+
//#endregion
|
|
247
|
+
export { Plugin_exports, TypeId, add, categories, isGitRequest, isPlugin, make, provide, toLayer, withAction, withAgentChannel, withAuthMethod, withAuthMethods, withCategories, withDescription, withDocsUrl, withGroup, withGroups, withHomepageUrl, withIconUrl, withIconUrlDark, withName, withSandboxAccess, withTrigger, withTriggers };
|
|
248
|
+
|
|
249
|
+
//# sourceMappingURL=Plugin.js.map
|