@dual-os/sdk 0.0.0-stage → 0.8.0-next.1
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 +7 -2
- package/dist/Action.d.ts +200 -0
- package/dist/Action.d.ts.map +1 -0
- package/dist/Action.js +171 -0
- package/dist/Action.js.map +1 -0
- package/dist/AgentChannel.d.ts +1725 -0
- package/dist/AgentChannel.d.ts.map +1 -0
- package/dist/AgentChannel.js +734 -0
- package/dist/AgentChannel.js.map +1 -0
- package/dist/AgentChannelConformance.d.ts +1542 -0
- package/dist/AgentChannelConformance.d.ts.map +1 -0
- package/dist/AgentChannelConformance.js +162 -0
- package/dist/AgentChannelConformance.js.map +1 -0
- package/dist/AgentChannelRuntime.d.ts +77 -0
- package/dist/AgentChannelRuntime.d.ts.map +1 -0
- package/dist/AgentChannelRuntime.js +269 -0
- package/dist/AgentChannelRuntime.js.map +1 -0
- package/dist/AiProvider.d.ts +131 -0
- package/dist/AiProvider.d.ts.map +1 -0
- package/dist/AiProvider.js +99 -0
- package/dist/AiProvider.js.map +1 -0
- package/dist/AuthMethod.d.ts +380 -0
- package/dist/AuthMethod.d.ts.map +1 -0
- package/dist/AuthMethod.js +224 -0
- package/dist/AuthMethod.js.map +1 -0
- package/dist/AuthMethodBinding.d.ts +76 -0
- package/dist/AuthMethodBinding.d.ts.map +1 -0
- package/dist/AuthMethodBinding.js +30 -0
- package/dist/AuthMethodBinding.js.map +1 -0
- package/dist/AuthMethodExecution.d.ts +222 -0
- package/dist/AuthMethodExecution.d.ts.map +1 -0
- package/dist/AuthMethodExecution.js +276 -0
- package/dist/AuthMethodExecution.js.map +1 -0
- package/dist/ConnectionResolver.d.ts +218 -0
- package/dist/ConnectionResolver.d.ts.map +1 -0
- package/dist/ConnectionResolver.js +152 -0
- package/dist/ConnectionResolver.js.map +1 -0
- package/dist/DefinitionError.d.ts +66 -0
- package/dist/DefinitionError.d.ts.map +1 -0
- package/dist/DefinitionError.js +81 -0
- package/dist/DefinitionError.js.map +1 -0
- package/dist/DualRegistry.d.ts +70 -0
- package/dist/DualRegistry.d.ts.map +1 -0
- package/dist/DualRegistry.js +95 -0
- package/dist/DualRegistry.js.map +1 -0
- package/dist/DualRuntime.d.ts +278 -0
- package/dist/DualRuntime.d.ts.map +1 -0
- package/dist/DualRuntime.js +310 -0
- package/dist/DualRuntime.js.map +1 -0
- package/dist/Files.d.ts +79 -0
- package/dist/Files.d.ts.map +1 -0
- package/dist/Files.js +65 -0
- package/dist/Files.js.map +1 -0
- package/dist/Group.d.ts +105 -0
- package/dist/Group.d.ts.map +1 -0
- package/dist/Group.js +85 -0
- package/dist/Group.js.map +1 -0
- package/dist/Http.d.ts +341 -0
- package/dist/Http.d.ts.map +1 -0
- package/dist/Http.js +676 -0
- package/dist/Http.js.map +1 -0
- package/dist/Mcp.d.ts +108 -0
- package/dist/Mcp.d.ts.map +1 -0
- package/dist/Mcp.js +175 -0
- package/dist/Mcp.js.map +1 -0
- package/dist/OAuth2TokenRefresher.d.ts +17 -0
- package/dist/OAuth2TokenRefresher.d.ts.map +1 -0
- package/dist/OAuth2TokenRefresher.js +18 -0
- package/dist/OAuth2TokenRefresher.js.map +1 -0
- package/dist/OAuthFlow.d.ts +70 -0
- package/dist/OAuthFlow.d.ts.map +1 -0
- package/dist/OAuthFlow.js +487 -0
- package/dist/OAuthFlow.js.map +1 -0
- package/dist/Plugin.d.ts +382 -0
- package/dist/Plugin.d.ts.map +1 -0
- package/dist/Plugin.js +248 -0
- package/dist/Plugin.js.map +1 -0
- package/dist/PluginRuntime.d.ts +3185 -0
- package/dist/PluginRuntime.d.ts.map +1 -0
- package/dist/PluginRuntime.js +330 -0
- package/dist/PluginRuntime.js.map +1 -0
- package/dist/Runner.d.ts +1 -0
- package/dist/Runner.js +123 -0
- package/dist/Runner.js.map +1 -0
- package/dist/ToolFile.d.ts +22 -0
- package/dist/ToolFile.d.ts.map +1 -0
- package/dist/ToolFile.js +32 -0
- package/dist/ToolFile.js.map +1 -0
- package/dist/Trigger.d.ts +357 -0
- package/dist/Trigger.d.ts.map +1 -0
- package/dist/Trigger.js +286 -0
- package/dist/Trigger.js.map +1 -0
- package/dist/_virtual/_rolldown/runtime.js +12 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +24 -0
- package/dist/internal/auth-context.d.ts +21 -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 +25 -0
- package/dist/internal/auth-execution.d.ts.map +1 -0
- package/dist/internal/auth-execution.js +65 -0
- package/dist/internal/auth-execution.js.map +1 -0
- package/dist/internal/auth-runtime.d.ts +3 -0
- package/dist/internal/auth-runtime.d.ts.map +1 -0
- package/dist/internal/auth-runtime.js +15 -0
- package/dist/internal/auth-runtime.js.map +1 -0
- package/dist/internal/capabilities.d.ts +22 -0
- package/dist/internal/capabilities.d.ts.map +1 -0
- package/dist/internal/capabilities.js +21 -0
- package/dist/internal/capabilities.js.map +1 -0
- package/dist/internal/children.d.ts +32 -0
- package/dist/internal/children.d.ts.map +1 -0
- package/dist/internal/children.js +52 -0
- package/dist/internal/children.js.map +1 -0
- package/dist/internal/collection-utils.d.ts +2 -0
- package/dist/internal/collection-utils.d.ts.map +1 -0
- package/dist/internal/collection-utils.js +5 -0
- package/dist/internal/collection-utils.js.map +1 -0
- package/dist/internal/dual/actions.d.ts +31 -0
- package/dist/internal/dual/actions.d.ts.map +1 -0
- package/dist/internal/dual/actions.js +25 -0
- package/dist/internal/dual/actions.js.map +1 -0
- package/dist/internal/dual/invoke.d.ts +61 -0
- package/dist/internal/dual/invoke.d.ts.map +1 -0
- package/dist/internal/dual/invoke.js +74 -0
- package/dist/internal/dual/invoke.js.map +1 -0
- package/dist/internal/dual/registry.d.ts +123 -0
- package/dist/internal/dual/registry.d.ts.map +1 -0
- package/dist/internal/dual/registry.js +171 -0
- package/dist/internal/dual/registry.js.map +1 -0
- package/dist/internal/dual/triggers.d.ts +27 -0
- package/dist/internal/dual/triggers.d.ts.map +1 -0
- package/dist/internal/dual/triggers.js +25 -0
- package/dist/internal/dual/triggers.js.map +1 -0
- package/dist/internal/handler-context.d.ts +7 -0
- package/dist/internal/handler-context.d.ts.map +1 -0
- package/dist/internal/handler-context.js +30 -0
- package/dist/internal/handler-context.js.map +1 -0
- package/dist/internal/identifier.d.ts +4 -0
- package/dist/internal/identifier.d.ts.map +1 -0
- package/dist/internal/identifier.js +27 -0
- package/dist/internal/identifier.js.map +1 -0
- package/dist/internal/plugin-handlers.d.ts +36 -0
- package/dist/internal/plugin-handlers.d.ts.map +1 -0
- package/dist/internal/plugin-handlers.js +51 -0
- package/dist/internal/plugin-handlers.js.map +1 -0
- package/dist/internal/proto.d.ts +5 -0
- package/dist/internal/proto.d.ts.map +1 -0
- package/dist/internal/proto.js +9 -0
- package/dist/internal/proto.js.map +1 -0
- package/dist/internal/schema-runtime.d.ts +4 -0
- package/dist/internal/schema-runtime.d.ts.map +1 -0
- package/dist/internal/schema-runtime.js +9 -0
- package/dist/internal/schema-runtime.js.map +1 -0
- package/dist/internal/trigger-runtime-shared.d.ts +39 -0
- package/dist/internal/trigger-runtime-shared.d.ts.map +1 -0
- package/dist/internal/trigger-runtime-shared.js +131 -0
- package/dist/internal/trigger-runtime-shared.js.map +1 -0
- package/dist/internal/trigger-runtime.d.ts +10 -0
- package/dist/internal/trigger-runtime.d.ts.map +1 -0
- package/dist/internal/trigger-runtime.js +94 -0
- package/dist/internal/trigger-runtime.js.map +1 -0
- package/dist/internal/types.d.ts +5 -0
- package/dist/internal/types.d.ts.map +1 -0
- package/dist/internal/types.js +1 -0
- package/dist/remote-runtime.d.ts +584 -0
- package/dist/remote-runtime.d.ts.map +1 -0
- package/dist/remote-runtime.js +366 -0
- package/dist/remote-runtime.js.map +1 -0
- package/package.json +54 -4
- package/src/Action.ts +370 -0
- package/src/AgentChannel.ts +888 -0
- package/src/AgentChannelConformance.ts +124 -0
- package/src/AgentChannelRuntime.ts +617 -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 +1222 -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 +249 -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/LICENSE
ADDED
package/README.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @dual-os/sdk
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Runtime-neutral integration definitions and execution. Importing the SDK starts no services.
|
|
4
|
+
|
|
5
|
+
- **Start.** [SDK guide](../docs/content/sdk/index.mdx) and [checked examples](../docs/examples/).
|
|
6
|
+
- **Public API.** The installed package's `exports` and declarations; shipped implementation modules are not supported entrypoints.
|
|
7
|
+
- **Hosting.** [Runtime guide](../docs/content/sdk/runtime.mdx); the SDK does not provision a product deployment.
|
|
8
|
+
- **Distribution.** Private registry access; [release procedure](../../docs/releasing.md).
|
package/dist/Action.d.ts
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { Any as Any$1 } from "./AuthMethod.js";
|
|
2
|
+
import { ContextForMethods } from "./internal/auth-context.js";
|
|
3
|
+
import { Context, Effect, Pipeable, Schema } from "effect";
|
|
4
|
+
import { Headers, HttpClientError } from "effect/http";
|
|
5
|
+
declare namespace Action_d_exports {
|
|
6
|
+
export { Action, ActionExample, ActionHandlerError, ActionHandlerFailure, ActionOptions, Any, ContractOptions, DeclaredResponseFailure, Handler, HandlerContext, HttpClientFailure, Input, InputSchema, Output, OutputSchema, RetryableActionHandlerError, TypeId, fromHttpClientFailure, handlerKey, isAction, make, orHttpClientFailure };
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* @since 0.0.0
|
|
10
|
+
* @category type ids
|
|
11
|
+
*/
|
|
12
|
+
export declare const TypeId: "@dual-os/sdk/Action";
|
|
13
|
+
/**
|
|
14
|
+
* @since 0.0.0
|
|
15
|
+
* @category type ids
|
|
16
|
+
*/
|
|
17
|
+
export type TypeId = typeof TypeId;
|
|
18
|
+
/**
|
|
19
|
+
* Constraint type for working with any {@link Action}.
|
|
20
|
+
*
|
|
21
|
+
* @since 0.0.0
|
|
22
|
+
* @category type-level
|
|
23
|
+
*/
|
|
24
|
+
export interface Any extends Pipeable.Pipeable {
|
|
25
|
+
readonly [TypeId]: TypeId;
|
|
26
|
+
readonly identifier: string;
|
|
27
|
+
readonly name: string | undefined;
|
|
28
|
+
readonly description: string | undefined;
|
|
29
|
+
readonly input: Schema.Top;
|
|
30
|
+
readonly output: Schema.Top;
|
|
31
|
+
readonly examples: readonly ActionExample<unknown>[];
|
|
32
|
+
readonly requireAuth: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Stable action metadata.
|
|
36
|
+
*
|
|
37
|
+
* @since 0.0.0
|
|
38
|
+
* @category models
|
|
39
|
+
*/
|
|
40
|
+
export interface ActionOptions {
|
|
41
|
+
readonly name?: string | undefined;
|
|
42
|
+
readonly description?: string | undefined;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Example input shown alongside an action definition.
|
|
46
|
+
*
|
|
47
|
+
* @since 0.0.0
|
|
48
|
+
* @category models
|
|
49
|
+
*/
|
|
50
|
+
export interface ActionExample<Input> {
|
|
51
|
+
readonly title?: string;
|
|
52
|
+
readonly input: Input;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Handler context exposed to an action implementation.
|
|
56
|
+
*
|
|
57
|
+
* @since 0.0.0
|
|
58
|
+
* @category models
|
|
59
|
+
*/
|
|
60
|
+
export type HandlerContext<EffectiveAuthMethods extends readonly Any$1[]> = ContextForMethods<EffectiveAuthMethods>;
|
|
61
|
+
declare const ActionHandlerError_base: Schema.Class<ActionHandlerError, Schema.TaggedStruct<"ActionHandlerError", {
|
|
62
|
+
readonly cause: Schema.optional<Schema.Defect>;
|
|
63
|
+
readonly details: Schema.optional<Schema.Unknown>;
|
|
64
|
+
readonly message: Schema.String;
|
|
65
|
+
readonly status: Schema.optional<Schema.Number>;
|
|
66
|
+
}>, import("effect/Cause").YieldableError>;
|
|
67
|
+
/**
|
|
68
|
+
* Non-retryable failure reported by a trusted action handler.
|
|
69
|
+
*
|
|
70
|
+
* The invoke boundary owns action/provider/version metadata, so handler errors
|
|
71
|
+
* intentionally describe only the failed operation itself.
|
|
72
|
+
*
|
|
73
|
+
* @since 0.0.0
|
|
74
|
+
* @category errors
|
|
75
|
+
*/
|
|
76
|
+
export declare class ActionHandlerError extends ActionHandlerError_base {}
|
|
77
|
+
declare const RetryableActionHandlerError_base: Schema.Class<RetryableActionHandlerError, Schema.TaggedStruct<"RetryableActionHandlerError", {
|
|
78
|
+
readonly cause: Schema.optional<Schema.Defect>;
|
|
79
|
+
readonly details: Schema.optional<Schema.Unknown>;
|
|
80
|
+
readonly message: Schema.String;
|
|
81
|
+
readonly retryAfterSeconds: Schema.optional<Schema.Number>;
|
|
82
|
+
readonly status: Schema.optional<Schema.Number>;
|
|
83
|
+
}>, import("effect/Cause").YieldableError>;
|
|
84
|
+
/**
|
|
85
|
+
* Retryable failure reported by a trusted action handler.
|
|
86
|
+
*
|
|
87
|
+
* @since 0.0.0
|
|
88
|
+
* @category errors
|
|
89
|
+
*/
|
|
90
|
+
export declare class RetryableActionHandlerError extends RetryableActionHandlerError_base {}
|
|
91
|
+
/** @since 0.0.0 @category errors */
|
|
92
|
+
export type ActionHandlerFailure = ActionHandlerError | RetryableActionHandlerError;
|
|
93
|
+
/**
|
|
94
|
+
* Failures produced while an Effect HTTP client executes or decodes a request.
|
|
95
|
+
*
|
|
96
|
+
* @since 0.0.0
|
|
97
|
+
* @category errors
|
|
98
|
+
*/
|
|
99
|
+
export type HttpClientFailure = HttpClientError.HttpClientError | Schema.SchemaError;
|
|
100
|
+
/**
|
|
101
|
+
* A response the provider declared as an error, as a generated client raises it:
|
|
102
|
+
* the received response plus its decoded body.
|
|
103
|
+
*
|
|
104
|
+
* @since 0.0.0
|
|
105
|
+
* @category errors
|
|
106
|
+
*/
|
|
107
|
+
export interface DeclaredResponseFailure {
|
|
108
|
+
readonly response: {
|
|
109
|
+
readonly status: number;
|
|
110
|
+
readonly headers: Headers.Headers;
|
|
111
|
+
};
|
|
112
|
+
readonly cause: unknown;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Map an Effect HTTP client failure to the action failure contract.
|
|
116
|
+
*
|
|
117
|
+
* Transport failures, rate limits, and server errors can be retried, carrying
|
|
118
|
+
* the provider's Retry-After delay (at most an hour) when the response sent
|
|
119
|
+
* one. Request construction, response decoding, declared client errors, and
|
|
120
|
+
* other client errors are terminal.
|
|
121
|
+
*
|
|
122
|
+
* @since 0.0.0
|
|
123
|
+
* @category errors
|
|
124
|
+
*/
|
|
125
|
+
export declare const fromHttpClientFailure: (error: HttpClientFailure | DeclaredResponseFailure) => ActionHandlerFailure;
|
|
126
|
+
/**
|
|
127
|
+
* Map an Effect HTTP client effect onto the action failure contract.
|
|
128
|
+
*
|
|
129
|
+
* @since 0.0.0
|
|
130
|
+
* @category errors
|
|
131
|
+
*/
|
|
132
|
+
export declare const orHttpClientFailure: <A, R>(effect: Effect.Effect<A, HttpClientFailure | DeclaredResponseFailure, R>) => Effect.Effect<A, ActionHandlerFailure, R>;
|
|
133
|
+
/**
|
|
134
|
+
* A runtime handler service for one canonical action id.
|
|
135
|
+
*
|
|
136
|
+
* @since 0.0.0
|
|
137
|
+
* @category models
|
|
138
|
+
*/
|
|
139
|
+
export interface Handler<ActionId extends string = string> {
|
|
140
|
+
readonly _: unique symbol;
|
|
141
|
+
readonly actionId: ActionId;
|
|
142
|
+
readonly context: Context.Context<never>;
|
|
143
|
+
readonly handler: (input: unknown, context: unknown) => Effect.Effect<unknown, ActionHandlerFailure, unknown>;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Context key used for the action handler with the supplied canonical id.
|
|
147
|
+
*
|
|
148
|
+
* @since 0.0.0
|
|
149
|
+
* @category handlers
|
|
150
|
+
*/
|
|
151
|
+
export declare const handlerKey: (actionId: string) => string;
|
|
152
|
+
/**
|
|
153
|
+
* Options used to declare an action contract.
|
|
154
|
+
*
|
|
155
|
+
* @since 0.6.0
|
|
156
|
+
* @category models
|
|
157
|
+
*/
|
|
158
|
+
export interface ContractOptions<Input extends Schema.Top, Output extends Schema.Top, RequireAuth extends boolean> extends ActionOptions {
|
|
159
|
+
readonly input: Input;
|
|
160
|
+
readonly output: Output;
|
|
161
|
+
readonly examples?: readonly ActionExample<Schema.Schema.Type<Input>>[];
|
|
162
|
+
/** Set to `false` to make a connection optional for this action. */
|
|
163
|
+
readonly requireAuth?: RequireAuth;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* A typed action declaration.
|
|
167
|
+
*
|
|
168
|
+
* @since 0.0.0
|
|
169
|
+
* @category models
|
|
170
|
+
*/
|
|
171
|
+
export interface Action<out Identifier extends string = string, out Input extends Schema.Top = Schema.Top, out Output extends Schema.Top = Schema.Top, out RequireAuth extends boolean = boolean> extends Pipeable.Pipeable {
|
|
172
|
+
readonly [TypeId]: TypeId;
|
|
173
|
+
readonly identifier: Identifier;
|
|
174
|
+
readonly name: string | undefined;
|
|
175
|
+
readonly description: string | undefined;
|
|
176
|
+
readonly input: Input;
|
|
177
|
+
readonly output: Output;
|
|
178
|
+
readonly examples: readonly ActionExample<Schema.Schema.Type<Input>>[];
|
|
179
|
+
readonly requireAuth: RequireAuth;
|
|
180
|
+
}
|
|
181
|
+
export type InputSchema<ActionDef extends Any> = ActionDef["input"];
|
|
182
|
+
export type OutputSchema<ActionDef extends Any> = ActionDef["output"];
|
|
183
|
+
export type Input<ActionDef extends Any> = Schema.Schema.Type<InputSchema<ActionDef>>;
|
|
184
|
+
export type Output<ActionDef extends Any> = Schema.Schema.Type<OutputSchema<ActionDef>>;
|
|
185
|
+
/**
|
|
186
|
+
* Create an {@link Action} from its contract.
|
|
187
|
+
*
|
|
188
|
+
* @since 0.0.0
|
|
189
|
+
* @category constructors
|
|
190
|
+
*/
|
|
191
|
+
export declare const make: <const Identifier extends string, Input extends Schema.Top, Output extends Schema.Top, const RequireAuth extends boolean = true>(identifier: Identifier, options: ContractOptions<Input, Output, RequireAuth>) => Action<Identifier, Input, Output, RequireAuth>;
|
|
192
|
+
/**
|
|
193
|
+
* Check if a value is an {@link Action}.
|
|
194
|
+
*
|
|
195
|
+
* @since 0.0.0
|
|
196
|
+
* @category guards
|
|
197
|
+
*/
|
|
198
|
+
export declare const isAction: (u: unknown) => u is Any;
|
|
199
|
+
export { Action_d_exports };
|
|
200
|
+
//# sourceMappingURL=Action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
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AO,KAAK,YAAY;YAE9D,OAAO,kBAAkB,OAAO,OAAO,OAAO,KAAK,aAAa;;;;;;;qBAU/D,aACL,2BACN,cAAc,OAAO,KACrB,eAAe,OAAO,WAChB,oCAAkC,YAE5B,YAAU,SACb,gBAAgB,OAAO,QAAQ,iBACvC,OAAO,YAAY,OAAO,QAAQ;;;;;;;qBAmBxB,WAAQ,eAAiB,KAAK"}
|
package/dist/Action.js
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { __exportAll } from "./_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { validateIdentifier } from "./internal/identifier.js";
|
|
3
|
+
import { PipeableProto } from "./internal/proto.js";
|
|
4
|
+
import { Array, DateTime, Duration, Effect, Match, Number, Option, Predicate, Schema, pipe } from "effect";
|
|
5
|
+
import { Headers, HttpClientError } from "effect/http";
|
|
6
|
+
// src/Action.ts
|
|
7
|
+
var Action_exports = /* @__PURE__ */ __exportAll({
|
|
8
|
+
ActionHandlerError: () => ActionHandlerError,
|
|
9
|
+
RetryableActionHandlerError: () => RetryableActionHandlerError,
|
|
10
|
+
TypeId: () => TypeId,
|
|
11
|
+
fromHttpClientFailure: () => fromHttpClientFailure,
|
|
12
|
+
handlerKey: () => handlerKey,
|
|
13
|
+
isAction: () => isAction,
|
|
14
|
+
make: () => make,
|
|
15
|
+
orHttpClientFailure: () => orHttpClientFailure
|
|
16
|
+
});
|
|
17
|
+
/**
|
|
18
|
+
* @since 0.0.0
|
|
19
|
+
* @category type ids
|
|
20
|
+
*/
|
|
21
|
+
const TypeId = "@dual-os/sdk/Action";
|
|
22
|
+
/**
|
|
23
|
+
* Non-retryable failure reported by a trusted action handler.
|
|
24
|
+
*
|
|
25
|
+
* The invoke boundary owns action/provider/version metadata, so handler errors
|
|
26
|
+
* intentionally describe only the failed operation itself.
|
|
27
|
+
*
|
|
28
|
+
* @since 0.0.0
|
|
29
|
+
* @category errors
|
|
30
|
+
*/
|
|
31
|
+
var ActionHandlerError = class extends Schema.TaggedError()("ActionHandlerError", {
|
|
32
|
+
cause: Schema.optional(Schema.Defect()),
|
|
33
|
+
details: Schema.optional(Schema.Unknown),
|
|
34
|
+
message: Schema.String,
|
|
35
|
+
status: Schema.optional(Schema.Number)
|
|
36
|
+
}) {};
|
|
37
|
+
/**
|
|
38
|
+
* Retryable failure reported by a trusted action handler.
|
|
39
|
+
*
|
|
40
|
+
* @since 0.0.0
|
|
41
|
+
* @category errors
|
|
42
|
+
*/
|
|
43
|
+
var RetryableActionHandlerError = class extends Schema.TaggedError()("RetryableActionHandlerError", {
|
|
44
|
+
cause: Schema.optional(Schema.Defect()),
|
|
45
|
+
details: Schema.optional(Schema.Unknown),
|
|
46
|
+
message: Schema.String,
|
|
47
|
+
retryAfterSeconds: Schema.optional(Schema.Number),
|
|
48
|
+
status: Schema.optional(Schema.Number)
|
|
49
|
+
}) {};
|
|
50
|
+
function retryAfterSeconds(headers) {
|
|
51
|
+
return pipe(Option.fromNullishOr(headers), Option.flatMap(Headers.get("retry-after")), Option.flatMap((value) => Option.orElse(Number.parse(value), () => Option.map(DateTime.make(value), (date) => Duration.toSeconds(DateTime.distance(DateTime.nowUnsafe(), date))))), Option.map(Number.clamp({
|
|
52
|
+
maximum: 3600,
|
|
53
|
+
minimum: 0
|
|
54
|
+
})), Option.getOrUndefined);
|
|
55
|
+
}
|
|
56
|
+
function schemaIssuesAt(issue, path) {
|
|
57
|
+
return pipe(Match.value(issue), Match.tags({
|
|
58
|
+
AnyOf: (anyOf) => Array.match(anyOf.issues, {
|
|
59
|
+
onEmpty: () => [{
|
|
60
|
+
kind: anyOf._tag,
|
|
61
|
+
path
|
|
62
|
+
}],
|
|
63
|
+
onNonEmpty: (issues) => Array.flatMap(issues, (inner) => schemaIssuesAt(inner, path))
|
|
64
|
+
}),
|
|
65
|
+
Composite: (composite) => Array.flatMap(composite.issues, (inner) => schemaIssuesAt(inner, path)),
|
|
66
|
+
Encoding: (encoding) => schemaIssuesAt(encoding.issue, path),
|
|
67
|
+
Pointer: (pointer) => schemaIssuesAt(pointer.issue, [...path, ...pointer.path])
|
|
68
|
+
}), Match.orElse((leaf) => [{
|
|
69
|
+
kind: leaf._tag,
|
|
70
|
+
path
|
|
71
|
+
}]));
|
|
72
|
+
}
|
|
73
|
+
function schemaIssues(issue) {
|
|
74
|
+
return Array.map(schemaIssuesAt(issue, []), (located) => ({
|
|
75
|
+
kind: located.kind,
|
|
76
|
+
path: Array.filter(located.path, Predicate.or(Predicate.isString, Predicate.isNumber))
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Map an Effect HTTP client failure to the action failure contract.
|
|
81
|
+
*
|
|
82
|
+
* Transport failures, rate limits, and server errors can be retried, carrying
|
|
83
|
+
* the provider's Retry-After delay (at most an hour) when the response sent
|
|
84
|
+
* one. Request construction, response decoding, declared client errors, and
|
|
85
|
+
* other client errors are terminal.
|
|
86
|
+
*
|
|
87
|
+
* @since 0.0.0
|
|
88
|
+
* @category errors
|
|
89
|
+
*/
|
|
90
|
+
const fromHttpClientFailure = (error) => {
|
|
91
|
+
if (Schema.isSchemaError(error)) return new ActionHandlerError({
|
|
92
|
+
cause: error,
|
|
93
|
+
details: {
|
|
94
|
+
issues: schemaIssues(error.issue),
|
|
95
|
+
reason: "SchemaError"
|
|
96
|
+
},
|
|
97
|
+
message: "HTTP response did not match the expected schema"
|
|
98
|
+
});
|
|
99
|
+
if (!HttpClientError.isHttpClientError(error)) {
|
|
100
|
+
const status = error.response.status;
|
|
101
|
+
const fields = {
|
|
102
|
+
details: error.cause,
|
|
103
|
+
message: `HTTP request failed with status ${status}`,
|
|
104
|
+
status
|
|
105
|
+
};
|
|
106
|
+
return status === 429 || status >= 500 ? RetryableActionHandlerError.make({
|
|
107
|
+
...fields,
|
|
108
|
+
retryAfterSeconds: retryAfterSeconds(error.response.headers)
|
|
109
|
+
}) : new ActionHandlerError(fields);
|
|
110
|
+
}
|
|
111
|
+
const status = error.response?.status;
|
|
112
|
+
const fields = {
|
|
113
|
+
message: status === void 0 ? "HTTP request failed" : `HTTP request failed with status ${status}`,
|
|
114
|
+
...status === void 0 ? {} : { status },
|
|
115
|
+
details: {
|
|
116
|
+
method: error.request.method,
|
|
117
|
+
reason: error.reason._tag
|
|
118
|
+
},
|
|
119
|
+
cause: error
|
|
120
|
+
};
|
|
121
|
+
return error.reason._tag === "TransportError" || status === 429 || status !== void 0 && status >= 500 ? RetryableActionHandlerError.make({
|
|
122
|
+
...fields,
|
|
123
|
+
retryAfterSeconds: retryAfterSeconds(error.response?.headers)
|
|
124
|
+
}) : new ActionHandlerError(fields);
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Map an Effect HTTP client effect onto the action failure contract.
|
|
128
|
+
*
|
|
129
|
+
* @since 0.0.0
|
|
130
|
+
* @category errors
|
|
131
|
+
*/
|
|
132
|
+
const orHttpClientFailure = (effect) => Effect.mapError(effect, fromHttpClientFailure);
|
|
133
|
+
/**
|
|
134
|
+
* Context key used for the action handler with the supplied canonical id.
|
|
135
|
+
*
|
|
136
|
+
* @since 0.0.0
|
|
137
|
+
* @category handlers
|
|
138
|
+
*/
|
|
139
|
+
const handlerKey = (actionId) => `@dual-os/sdk/Action/Handler/${actionId}`;
|
|
140
|
+
const Proto = {
|
|
141
|
+
...PipeableProto,
|
|
142
|
+
[TypeId]: TypeId
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Create an {@link Action} from its contract.
|
|
146
|
+
*
|
|
147
|
+
* @since 0.0.0
|
|
148
|
+
* @category constructors
|
|
149
|
+
*/
|
|
150
|
+
const make = (identifier, options) => {
|
|
151
|
+
validateIdentifier("action", identifier);
|
|
152
|
+
return Object.assign(Object.create(Proto), {
|
|
153
|
+
description: options.description,
|
|
154
|
+
examples: options.examples ?? [],
|
|
155
|
+
identifier,
|
|
156
|
+
input: options.input,
|
|
157
|
+
name: options.name,
|
|
158
|
+
output: options.output,
|
|
159
|
+
requireAuth: options.requireAuth ?? true
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Check if a value is an {@link Action}.
|
|
164
|
+
*
|
|
165
|
+
* @since 0.0.0
|
|
166
|
+
* @category guards
|
|
167
|
+
*/
|
|
168
|
+
const isAction = (u) => Predicate.hasProperty(u, TypeId);
|
|
169
|
+
export { ActionHandlerError, Action_exports, RetryableActionHandlerError, TypeId, fromHttpClientFailure, handlerKey, isAction, make, orHttpClientFailure };
|
|
170
|
+
|
|
171
|
+
//# sourceMappingURL=Action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Action.js","names":[],"sources":["../src/Action.ts"],"sourcesContent":["/**\n * Canonical action definition builders and types for the Dual SDK.\n *\n * @since 0.0.0\n */\nimport type { Context, Pipeable, SchemaIssue } from \"effect\";\nimport {\n Array,\n DateTime,\n Duration,\n Effect,\n Match,\n Number,\n Option,\n pipe,\n Predicate,\n Schema,\n} from \"effect\";\n\nimport { Headers, HttpClientError } from \"effect/http\";\n\nimport type * as AuthMethod from \"./AuthMethod.ts\";\nimport type { ContextForMethods } from \"./internal/auth-context.ts\";\nimport { validateIdentifier } from \"./internal/identifier.ts\";\nimport { PipeableProto } from \"./internal/proto.ts\";\n\n/**\n * @since 0.0.0\n * @category type ids\n */\nexport const TypeId = \"@dual-os/sdk/Action\" as const;\n\n/**\n * @since 0.0.0\n * @category type ids\n */\nexport type TypeId = typeof TypeId;\n\n/**\n * Constraint type for working with any {@link Action}.\n *\n * @since 0.0.0\n * @category type-level\n */\nexport interface Any extends Pipeable.Pipeable {\n readonly [TypeId]: TypeId;\n readonly identifier: string;\n readonly name: string | undefined;\n readonly description: string | undefined;\n readonly input: Schema.Top;\n readonly output: Schema.Top;\n readonly examples: readonly ActionExample<unknown>[];\n readonly requireAuth: boolean;\n}\n\n/**\n * Stable action metadata.\n *\n * @since 0.0.0\n * @category models\n */\nexport interface ActionOptions {\n readonly name?: string | undefined;\n readonly description?: string | undefined;\n}\n\n/**\n * Example input shown alongside an action definition.\n *\n * @since 0.0.0\n * @category models\n */\nexport interface ActionExample<Input> {\n readonly title?: string;\n readonly input: Input;\n}\n\n/**\n * Handler context exposed to an action implementation.\n *\n * @since 0.0.0\n * @category models\n */\nexport type HandlerContext<EffectiveAuthMethods extends readonly AuthMethod.Any[]> =\n ContextForMethods<EffectiveAuthMethods>;\n\n/**\n * Non-retryable failure reported by a trusted action handler.\n *\n * The invoke boundary owns action/provider/version metadata, so handler errors\n * intentionally describe only the failed operation itself.\n *\n * @since 0.0.0\n * @category errors\n */\nexport class ActionHandlerError extends Schema.TaggedError<ActionHandlerError>()(\n \"ActionHandlerError\",\n {\n cause: Schema.optional(Schema.Defect()),\n details: Schema.optional(Schema.Unknown),\n message: Schema.String,\n status: Schema.optional(Schema.Number),\n },\n) {}\n\n/**\n * Retryable failure reported by a trusted action handler.\n *\n * @since 0.0.0\n * @category errors\n */\nexport class RetryableActionHandlerError extends Schema.TaggedError<RetryableActionHandlerError>()(\n \"RetryableActionHandlerError\",\n {\n cause: Schema.optional(Schema.Defect()),\n details: Schema.optional(Schema.Unknown),\n message: Schema.String,\n retryAfterSeconds: Schema.optional(Schema.Number),\n status: Schema.optional(Schema.Number),\n },\n) {}\n\n/** @since 0.0.0 @category errors */\nexport type ActionHandlerFailure = ActionHandlerError | RetryableActionHandlerError;\n\n/**\n * Failures produced while an Effect HTTP client executes or decodes a request.\n *\n * @since 0.0.0\n * @category errors\n */\nexport type HttpClientFailure = HttpClientError.HttpClientError | Schema.SchemaError;\n\n/**\n * A response the provider declared as an error, as a generated client raises it:\n * the received response plus its decoded body.\n *\n * @since 0.0.0\n * @category errors\n */\nexport interface DeclaredResponseFailure {\n readonly response: { readonly status: number; readonly headers: Headers.Headers };\n readonly cause: unknown;\n}\n\nfunction retryAfterSeconds(headers?: Headers.Headers) {\n return pipe(\n Option.fromNullishOr(headers),\n Option.flatMap(Headers.get(\"retry-after\")),\n Option.flatMap(value =>\n Option.orElse(Number.parse(value), () =>\n Option.map(DateTime.make(value), date =>\n Duration.toSeconds(DateTime.distance(DateTime.nowUnsafe(), date)),\n ),\n ),\n ),\n Option.map(Number.clamp({ maximum: 3600, minimum: 0 })),\n Option.getOrUndefined,\n );\n}\n\ninterface SchemaIssueAt {\n readonly kind: string;\n readonly path: ReadonlyArray<PropertyKey>;\n}\n\n// Where a response broke its schema and how, as issue tags only. Effect's formatters can quote\n// the received value, such as an unmatched union member, and failure details are stored with\n// the run, so the provider's data stays out of them.\nfunction schemaIssuesAt(\n issue: SchemaIssue.Issue,\n path: ReadonlyArray<PropertyKey>,\n): Array<SchemaIssueAt> {\n return pipe(\n Match.value(issue),\n Match.tags({\n AnyOf: anyOf =>\n Array.match(anyOf.issues, {\n onEmpty: () => [{ kind: anyOf._tag, path }],\n onNonEmpty: issues => Array.flatMap(issues, inner => schemaIssuesAt(inner, path)),\n }),\n Composite: composite => Array.flatMap(composite.issues, inner => schemaIssuesAt(inner, path)),\n Encoding: encoding => schemaIssuesAt(encoding.issue, path),\n Pointer: pointer => schemaIssuesAt(pointer.issue, [...path, ...pointer.path]),\n }),\n Match.orElse(leaf => [{ kind: leaf._tag, path }]),\n );\n}\n\nfunction schemaIssues(issue: SchemaIssue.Issue) {\n return Array.map(schemaIssuesAt(issue, []), located => ({\n kind: located.kind,\n path: Array.filter(located.path, Predicate.or(Predicate.isString, Predicate.isNumber)),\n }));\n}\n\n/**\n * Map an Effect HTTP client failure to the action failure contract.\n *\n * Transport failures, rate limits, and server errors can be retried, carrying\n * the provider's Retry-After delay (at most an hour) when the response sent\n * one. Request construction, response decoding, declared client errors, and\n * other client errors are terminal.\n *\n * @since 0.0.0\n * @category errors\n */\nexport const fromHttpClientFailure = (\n error: HttpClientFailure | DeclaredResponseFailure,\n): ActionHandlerFailure => {\n if (Schema.isSchemaError(error)) {\n return new ActionHandlerError({\n cause: error,\n details: { issues: schemaIssues(error.issue), reason: \"SchemaError\" },\n message: \"HTTP response did not match the expected schema\",\n });\n }\n if (!HttpClientError.isHttpClientError(error)) {\n const status = error.response.status;\n const fields = {\n details: error.cause,\n message: `HTTP request failed with status ${status}`,\n status,\n };\n return status === 429 || status >= 500\n ? RetryableActionHandlerError.make({\n ...fields,\n retryAfterSeconds: retryAfterSeconds(error.response.headers),\n })\n : new ActionHandlerError(fields);\n }\n\n const status = error.response?.status;\n const fields = {\n message:\n status === undefined ? \"HTTP request failed\" : `HTTP request failed with status ${status}`,\n ...(status === undefined ? {} : { status }),\n details: { method: error.request.method, reason: error.reason._tag },\n cause: error,\n };\n\n return error.reason._tag === \"TransportError\" ||\n status === 429 ||\n (status !== undefined && status >= 500)\n ? RetryableActionHandlerError.make({\n ...fields,\n retryAfterSeconds: retryAfterSeconds(error.response?.headers),\n })\n : new ActionHandlerError(fields);\n};\n\n/**\n * Map an Effect HTTP client effect onto the action failure contract.\n *\n * @since 0.0.0\n * @category errors\n */\nexport const orHttpClientFailure = <A, R>(\n effect: Effect.Effect<A, HttpClientFailure | DeclaredResponseFailure, R>,\n): Effect.Effect<A, ActionHandlerFailure, R> => Effect.mapError(effect, fromHttpClientFailure);\n\n/**\n * A runtime handler service for one canonical action id.\n *\n * @since 0.0.0\n * @category models\n */\nexport interface Handler<ActionId extends string = string> {\n readonly _: unique symbol;\n readonly actionId: ActionId;\n readonly context: Context.Context<never>;\n readonly handler: (\n input: unknown,\n context: unknown,\n ) => Effect.Effect<unknown, ActionHandlerFailure, unknown>;\n}\n\n/**\n * Context key used for the action handler with the supplied canonical id.\n *\n * @since 0.0.0\n * @category handlers\n */\nexport const handlerKey = (actionId: string): string => `@dual-os/sdk/Action/Handler/${actionId}`;\n\n/**\n * Options used to declare an action contract.\n *\n * @since 0.6.0\n * @category models\n */\nexport interface ContractOptions<\n Input extends Schema.Top,\n Output extends Schema.Top,\n RequireAuth extends boolean,\n> extends ActionOptions {\n readonly input: Input;\n readonly output: Output;\n readonly examples?: readonly ActionExample<Schema.Schema.Type<Input>>[];\n /** Set to `false` to make a connection optional for this action. */\n readonly requireAuth?: RequireAuth;\n}\n\n/**\n * A typed action declaration.\n *\n * @since 0.0.0\n * @category models\n */\nexport interface Action<\n out Identifier extends string = string,\n out Input extends Schema.Top = Schema.Top,\n out Output extends Schema.Top = Schema.Top,\n out RequireAuth extends boolean = boolean,\n>\n extends Pipeable.Pipeable {\n readonly [TypeId]: TypeId;\n readonly identifier: Identifier;\n readonly name: string | undefined;\n readonly description: string | undefined;\n readonly input: Input;\n readonly output: Output;\n readonly examples: readonly ActionExample<Schema.Schema.Type<Input>>[];\n readonly requireAuth: RequireAuth;\n}\n\nexport type InputSchema<ActionDef extends Any> = ActionDef[\"input\"];\n\nexport type OutputSchema<ActionDef extends Any> = ActionDef[\"output\"];\n\nexport type Input<ActionDef extends Any> = Schema.Schema.Type<InputSchema<ActionDef>>;\n\nexport type Output<ActionDef extends Any> = Schema.Schema.Type<OutputSchema<ActionDef>>;\n\nconst Proto = { ...PipeableProto, [TypeId]: TypeId };\n\n/**\n * Create an {@link Action} from its contract.\n *\n * @since 0.0.0\n * @category constructors\n */\nexport const make = <\n const Identifier extends string,\n Input extends Schema.Top,\n Output extends Schema.Top,\n const RequireAuth extends boolean = true,\n>(\n identifier: Identifier,\n options: ContractOptions<Input, Output, RequireAuth>,\n): Action<Identifier, Input, Output, RequireAuth> => {\n validateIdentifier(\"action\", identifier);\n return Object.assign(Object.create(Proto), {\n description: options.description,\n examples: options.examples ?? [],\n identifier,\n input: options.input,\n name: options.name,\n output: options.output,\n requireAuth: options.requireAuth ?? true,\n });\n};\n\n/**\n * Check if a value is an {@link Action}.\n *\n * @since 0.0.0\n * @category guards\n */\nexport const isAction = (u: unknown): u is Any => Predicate.hasProperty(u, TypeId);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA8BA,MAAa,SAAS;;;;;;;;;;AAiEtB,IAAa,qBAAb,cAAwC,OAAO,YAAgC,CAAC,CAC9E,sBACA;CACE,OAAO,OAAO,SAAS,OAAO,OAAO,CAAC;CACtC,SAAS,OAAO,SAAS,OAA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