@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
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import "./ConnectionResolver.js";
|
|
2
|
+
import { Context, Effect, Schema } from "effect";
|
|
3
|
+
declare namespace ConnectionResolver_d_exports {
|
|
4
|
+
export { ConnectionError, ConnectionIdNotAllowedError, ConnectionReauthorizationRequiredError, ConnectionRequiredError, ConnectionResolutionActor, ConnectionResolutionContext, ConnectionResolutionSource, ConnectionResolutionTarget, ConnectionResolutionTenant, ConnectionResolver_d_exports as ConnectionResolver, ConnectionResolverInstance, ConnectionResolverStoreError, ConnectionSelectionRequiredError, ConnectionTargetKind, InvalidConnectionIdError, InvalidResolvedConnectionError, ResolveConnectionError, ResolveConnectionRequest, ResolvedConnectionMaterial, Service };
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Connection-aware runtime targets supported by the SDK.
|
|
8
|
+
*
|
|
9
|
+
* @since 0.0.0
|
|
10
|
+
* @category models
|
|
11
|
+
*/
|
|
12
|
+
export type ConnectionTargetKind = "action" | "trigger" | "ai_model" | "agent-channel";
|
|
13
|
+
/**
|
|
14
|
+
* Tenant boundary for connection resolution and audit.
|
|
15
|
+
*
|
|
16
|
+
* @since 0.0.0
|
|
17
|
+
* @category models
|
|
18
|
+
*/
|
|
19
|
+
export interface ConnectionResolutionTenant {
|
|
20
|
+
readonly organizationId: string;
|
|
21
|
+
readonly teamId: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Product actor on whose behalf a connection is being selected.
|
|
25
|
+
*
|
|
26
|
+
* @since 0.0.0
|
|
27
|
+
* @category models
|
|
28
|
+
*/
|
|
29
|
+
export type ConnectionResolutionActor = {
|
|
30
|
+
readonly kind: "user";
|
|
31
|
+
readonly userId: string;
|
|
32
|
+
} | {
|
|
33
|
+
readonly kind: "system";
|
|
34
|
+
readonly reason?: string | undefined;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Product source that caused the invocation.
|
|
38
|
+
*
|
|
39
|
+
* @since 0.0.0
|
|
40
|
+
* @category models
|
|
41
|
+
*/
|
|
42
|
+
export interface ConnectionResolutionSource {
|
|
43
|
+
readonly kind: string;
|
|
44
|
+
readonly subjectId?: string;
|
|
45
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Host-owned context used to select, authorize, and audit a connection.
|
|
49
|
+
*
|
|
50
|
+
* @since 0.0.0
|
|
51
|
+
* @category models
|
|
52
|
+
*/
|
|
53
|
+
export interface ConnectionResolutionContext {
|
|
54
|
+
readonly tenant?: ConnectionResolutionTenant;
|
|
55
|
+
readonly actor?: ConnectionResolutionActor;
|
|
56
|
+
readonly source?: ConnectionResolutionSource;
|
|
57
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Request sent to the host connection resolver during action or trigger execution.
|
|
61
|
+
*
|
|
62
|
+
* @since 0.0.0
|
|
63
|
+
* @category models
|
|
64
|
+
*/
|
|
65
|
+
export interface ConnectionResolutionTarget {
|
|
66
|
+
readonly providerId: string;
|
|
67
|
+
readonly targetKind: ConnectionTargetKind;
|
|
68
|
+
readonly targetId: string;
|
|
69
|
+
readonly phase?: string;
|
|
70
|
+
}
|
|
71
|
+
export interface ResolveConnectionRequest {
|
|
72
|
+
readonly target: ConnectionResolutionTarget;
|
|
73
|
+
readonly connectionId?: string;
|
|
74
|
+
readonly context?: ConnectionResolutionContext;
|
|
75
|
+
}
|
|
76
|
+
export interface ResolvedConnectionMaterial {
|
|
77
|
+
readonly encoding?: "json";
|
|
78
|
+
readonly providerId: string;
|
|
79
|
+
readonly connectionId: string;
|
|
80
|
+
readonly methodId: string;
|
|
81
|
+
readonly material: unknown;
|
|
82
|
+
readonly setup: unknown;
|
|
83
|
+
}
|
|
84
|
+
declare const ConnectionIdNotAllowedError_base: Schema.Class<ConnectionIdNotAllowedError, Schema.TaggedStruct<"ConnectionIdNotAllowedError", {
|
|
85
|
+
readonly connectionId: Schema.String;
|
|
86
|
+
readonly phase: Schema.optional<Schema.String>;
|
|
87
|
+
readonly providerId: Schema.String;
|
|
88
|
+
readonly targetId: Schema.String;
|
|
89
|
+
readonly targetKind: Schema.Literals<readonly ["action", "trigger", "ai_model", "agent-channel"]>;
|
|
90
|
+
}>, import("effect/Cause").YieldableError>;
|
|
91
|
+
/**
|
|
92
|
+
* Raised when a runtime target does not accept a connection but a connectionId was still provided.
|
|
93
|
+
*
|
|
94
|
+
* @since 0.0.0
|
|
95
|
+
* @category errors
|
|
96
|
+
*/
|
|
97
|
+
export declare class ConnectionIdNotAllowedError extends ConnectionIdNotAllowedError_base {}
|
|
98
|
+
declare const ConnectionRequiredError_base: Schema.Class<ConnectionRequiredError, Schema.TaggedStruct<"ConnectionRequiredError", {
|
|
99
|
+
readonly phase: Schema.optional<Schema.String>;
|
|
100
|
+
readonly providerId: Schema.String;
|
|
101
|
+
readonly targetId: Schema.String;
|
|
102
|
+
readonly targetKind: Schema.Literals<readonly ["action", "trigger", "ai_model", "agent-channel"]>;
|
|
103
|
+
}>, import("effect/Cause").YieldableError>;
|
|
104
|
+
/**
|
|
105
|
+
* Raised when execution requires a connection and no compatible binding is available.
|
|
106
|
+
*
|
|
107
|
+
* @since 0.0.0
|
|
108
|
+
* @category errors
|
|
109
|
+
*/
|
|
110
|
+
export declare class ConnectionRequiredError extends ConnectionRequiredError_base {}
|
|
111
|
+
declare const ConnectionSelectionRequiredError_base: Schema.Class<ConnectionSelectionRequiredError, Schema.TaggedStruct<"ConnectionSelectionRequiredError", {
|
|
112
|
+
readonly phase: Schema.optional<Schema.String>;
|
|
113
|
+
readonly providerId: Schema.String;
|
|
114
|
+
readonly targetId: Schema.String;
|
|
115
|
+
readonly targetKind: Schema.Literals<readonly ["action", "trigger", "ai_model", "agent-channel"]>;
|
|
116
|
+
}>, import("effect/Cause").YieldableError>;
|
|
117
|
+
/**
|
|
118
|
+
* Raised when several compatible connection bindings exist and the caller must choose one.
|
|
119
|
+
*
|
|
120
|
+
* @since 0.0.0
|
|
121
|
+
* @category errors
|
|
122
|
+
*/
|
|
123
|
+
export declare class ConnectionSelectionRequiredError extends ConnectionSelectionRequiredError_base {}
|
|
124
|
+
declare const InvalidConnectionIdError_base: Schema.Class<InvalidConnectionIdError, Schema.TaggedStruct<"InvalidConnectionIdError", {
|
|
125
|
+
readonly connectionId: Schema.String;
|
|
126
|
+
readonly phase: Schema.optional<Schema.String>;
|
|
127
|
+
readonly providerId: Schema.String;
|
|
128
|
+
readonly targetId: Schema.String;
|
|
129
|
+
readonly targetKind: Schema.Literals<readonly ["action", "trigger", "ai_model", "agent-channel"]>;
|
|
130
|
+
}>, import("effect/Cause").YieldableError>;
|
|
131
|
+
/**
|
|
132
|
+
* Raised when the requested connectionId does not resolve to a compatible binding.
|
|
133
|
+
*
|
|
134
|
+
* @since 0.0.0
|
|
135
|
+
* @category errors
|
|
136
|
+
*/
|
|
137
|
+
export declare class InvalidConnectionIdError extends InvalidConnectionIdError_base {}
|
|
138
|
+
declare const InvalidResolvedConnectionError_base: Schema.Class<InvalidResolvedConnectionError, Schema.TaggedStruct<"InvalidResolvedConnectionError", {
|
|
139
|
+
readonly description: Schema.String;
|
|
140
|
+
readonly methodId: Schema.String;
|
|
141
|
+
readonly phase: Schema.optional<Schema.String>;
|
|
142
|
+
readonly providerId: Schema.String;
|
|
143
|
+
readonly targetId: Schema.String;
|
|
144
|
+
readonly targetKind: Schema.Literals<readonly ["action", "trigger", "ai_model", "agent-channel"]>;
|
|
145
|
+
}>, import("effect/Cause").YieldableError>;
|
|
146
|
+
/**
|
|
147
|
+
* Raised when the resolved connection value does not satisfy the selected auth method schema.
|
|
148
|
+
*
|
|
149
|
+
* @since 0.0.0
|
|
150
|
+
* @category errors
|
|
151
|
+
*/
|
|
152
|
+
export declare class InvalidResolvedConnectionError extends InvalidResolvedConnectionError_base {}
|
|
153
|
+
declare const ConnectionReauthorizationRequiredError_base: Schema.Class<ConnectionReauthorizationRequiredError, Schema.TaggedStruct<"ConnectionReauthorizationRequiredError", {
|
|
154
|
+
readonly connectionId: Schema.String;
|
|
155
|
+
readonly message: Schema.String;
|
|
156
|
+
readonly phase: Schema.optional<Schema.String>;
|
|
157
|
+
readonly providerId: Schema.String;
|
|
158
|
+
readonly targetId: Schema.String;
|
|
159
|
+
readonly targetKind: Schema.Literals<readonly ["action", "trigger", "ai_model", "agent-channel"]>;
|
|
160
|
+
}>, import("effect/Cause").YieldableError>;
|
|
161
|
+
/**
|
|
162
|
+
* Raised when the provider refuses the connection's stored grant, so the user must sign in again.
|
|
163
|
+
*
|
|
164
|
+
* @since 0.0.0
|
|
165
|
+
* @category errors
|
|
166
|
+
*/
|
|
167
|
+
export declare class ConnectionReauthorizationRequiredError extends ConnectionReauthorizationRequiredError_base {}
|
|
168
|
+
declare const ConnectionResolverStoreError_base: Schema.Class<ConnectionResolverStoreError, Schema.TaggedStruct<"ConnectionResolverStoreError", {
|
|
169
|
+
readonly cause: Schema.Defect;
|
|
170
|
+
readonly operation: Schema.String;
|
|
171
|
+
readonly phase: Schema.optional<Schema.String>;
|
|
172
|
+
readonly providerId: Schema.String;
|
|
173
|
+
readonly targetId: Schema.String;
|
|
174
|
+
readonly targetKind: Schema.Literals<readonly ["action", "trigger", "ai_model", "agent-channel"]>;
|
|
175
|
+
}>, import("effect/Cause").YieldableError>;
|
|
176
|
+
/**
|
|
177
|
+
* Raised when the host credential store cannot be read during connection resolution.
|
|
178
|
+
*
|
|
179
|
+
* @since 0.0.0
|
|
180
|
+
* @category errors
|
|
181
|
+
*/
|
|
182
|
+
export declare class ConnectionResolverStoreError extends ConnectionResolverStoreError_base {}
|
|
183
|
+
/**
|
|
184
|
+
* Structured connection failures surfaced by SDK runtime boundaries.
|
|
185
|
+
*
|
|
186
|
+
* @since 0.0.0
|
|
187
|
+
* @category errors
|
|
188
|
+
*/
|
|
189
|
+
export type ConnectionError = ConnectionIdNotAllowedError | ConnectionRequiredError | ConnectionSelectionRequiredError | InvalidConnectionIdError | InvalidResolvedConnectionError | ConnectionReauthorizationRequiredError | ConnectionResolverStoreError;
|
|
190
|
+
/**
|
|
191
|
+
* Errors the host resolver itself is expected to surface.
|
|
192
|
+
*
|
|
193
|
+
* @since 0.0.0
|
|
194
|
+
* @category errors
|
|
195
|
+
*/
|
|
196
|
+
export type ResolveConnectionError = ConnectionRequiredError | ConnectionSelectionRequiredError | InvalidConnectionIdError | InvalidResolvedConnectionError | ConnectionReauthorizationRequiredError | ConnectionResolverStoreError;
|
|
197
|
+
/**
|
|
198
|
+
* Host-provided service used by SDK runtimes to select one concrete connection binding.
|
|
199
|
+
*
|
|
200
|
+
* The SDK narrows and validates this untyped host binding against the target's allowed methods
|
|
201
|
+
* before exposing it to handlers.
|
|
202
|
+
*
|
|
203
|
+
* @since 0.0.0
|
|
204
|
+
* @category services
|
|
205
|
+
*/
|
|
206
|
+
export interface ConnectionResolverInstance {
|
|
207
|
+
readonly resolve: (input: ResolveConnectionRequest) => Effect.Effect<ResolvedConnectionMaterial, ResolveConnectionError>;
|
|
208
|
+
}
|
|
209
|
+
declare const Service_base: Context.ServiceClass<Service, "@dual-os/sdk/ConnectionResolver", ConnectionResolverInstance>;
|
|
210
|
+
/**
|
|
211
|
+
* Host-provided connection resolver service.
|
|
212
|
+
*
|
|
213
|
+
* @since 0.0.0
|
|
214
|
+
* @category services
|
|
215
|
+
*/
|
|
216
|
+
export declare class Service extends Service_base {}
|
|
217
|
+
//#endregion
|
|
218
|
+
export { ConnectionResolver_d_exports as ConnectionResolver, ConnectionResolver_d_exports };
|
|
219
|
+
//# sourceMappingURL=ConnectionResolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectionResolver.d.ts","names":[],"sources":["../src/ConnectionResolver.ts"],"mappings":";;;;;;;;;;;YAcY;;;;;;;iBAQK;WACN;WACA;;;;;;;;YASC;WACG;WAAuB;;WACvB;WAAyB;;;;;;;;iBAQvB;WACN;WACA;WACA,WAAW,SAAS;;;;;;;;iBASd;WACN,SAAS;WACT,QAAQ;WACR,SAAS;WACT,WAAW,SAAS;;;;;;;;iBASd;WACN;WACA,YAAY;WACZ;WACA;;iBAGM;WACN,QAAQ;WACR;WACA,UAAU;;iBAGJ;WACN;WACA;WACA;WACA;WACA;WACA;;;;;;;;;;;;;;;qBASE,oCAAoC;;;;;;;;;;;;;qBAiBpC,gCAAgC;;;;;;;;;;;;;qBAgBhC,yCAAyC;;;;;;;;;;;;;;qBAgBzC,iCAAiC;;;;;;;;;;;;;;;qBAiBjC,uCAAuC;;;;;;;;;;;;;;;qBAkBvC,+CAA+C;;;;;;;;;;;;;;;qBAkB/C,qCAAqC;;;;;;;YAkBtC,kBACR,8BACA,0BACA,mCACA,2BACA,iCACA,yCACA;;;;;;;YAQQ,yBACR,0BACA,mCACA,2BACA,iCACA,yCACA;;;;;;;;;;iBAWa;WACN,UACP,OAAO,6BACJ,OAAO,OAAO,4BAA4B;;;;;;;;;qBASpC,gBAAgB"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { __exportAll } from "./_virtual/_rolldown/runtime.js";
|
|
2
|
+
import "./ConnectionResolver.js";
|
|
3
|
+
import { Context, Schema } from "effect";
|
|
4
|
+
//#region src/ConnectionResolver.ts
|
|
5
|
+
var ConnectionResolver_exports = /* @__PURE__ */ __exportAll({
|
|
6
|
+
ConnectionIdNotAllowedError: () => ConnectionIdNotAllowedError,
|
|
7
|
+
ConnectionReauthorizationRequiredError: () => ConnectionReauthorizationRequiredError,
|
|
8
|
+
ConnectionRequiredError: () => ConnectionRequiredError,
|
|
9
|
+
ConnectionResolver: () => ConnectionResolver_exports,
|
|
10
|
+
ConnectionResolverStoreError: () => ConnectionResolverStoreError,
|
|
11
|
+
ConnectionSelectionRequiredError: () => ConnectionSelectionRequiredError,
|
|
12
|
+
InvalidConnectionIdError: () => InvalidConnectionIdError,
|
|
13
|
+
InvalidResolvedConnectionError: () => InvalidResolvedConnectionError,
|
|
14
|
+
Service: () => Service
|
|
15
|
+
});
|
|
16
|
+
/**
|
|
17
|
+
* Raised when a runtime target does not accept a connection but a connectionId was still provided.
|
|
18
|
+
*
|
|
19
|
+
* @since 0.0.0
|
|
20
|
+
* @category errors
|
|
21
|
+
*/
|
|
22
|
+
var ConnectionIdNotAllowedError = class extends Schema.TaggedError()("ConnectionIdNotAllowedError", {
|
|
23
|
+
connectionId: Schema.String,
|
|
24
|
+
phase: Schema.optional(Schema.String),
|
|
25
|
+
providerId: Schema.String,
|
|
26
|
+
targetId: Schema.String,
|
|
27
|
+
targetKind: Schema.Literals([
|
|
28
|
+
"action",
|
|
29
|
+
"trigger",
|
|
30
|
+
"ai_model",
|
|
31
|
+
"agent-channel"
|
|
32
|
+
])
|
|
33
|
+
}) {};
|
|
34
|
+
/**
|
|
35
|
+
* Raised when execution requires a connection and no compatible binding is available.
|
|
36
|
+
*
|
|
37
|
+
* @since 0.0.0
|
|
38
|
+
* @category errors
|
|
39
|
+
*/
|
|
40
|
+
var ConnectionRequiredError = class extends Schema.TaggedError()("ConnectionRequiredError", {
|
|
41
|
+
phase: Schema.optional(Schema.String),
|
|
42
|
+
providerId: Schema.String,
|
|
43
|
+
targetId: Schema.String,
|
|
44
|
+
targetKind: Schema.Literals([
|
|
45
|
+
"action",
|
|
46
|
+
"trigger",
|
|
47
|
+
"ai_model",
|
|
48
|
+
"agent-channel"
|
|
49
|
+
])
|
|
50
|
+
}) {};
|
|
51
|
+
/**
|
|
52
|
+
* Raised when several compatible connection bindings exist and the caller must choose one.
|
|
53
|
+
*
|
|
54
|
+
* @since 0.0.0
|
|
55
|
+
* @category errors
|
|
56
|
+
*/
|
|
57
|
+
var ConnectionSelectionRequiredError = class extends Schema.TaggedError()("ConnectionSelectionRequiredError", {
|
|
58
|
+
phase: Schema.optional(Schema.String),
|
|
59
|
+
providerId: Schema.String,
|
|
60
|
+
targetId: Schema.String,
|
|
61
|
+
targetKind: Schema.Literals([
|
|
62
|
+
"action",
|
|
63
|
+
"trigger",
|
|
64
|
+
"ai_model",
|
|
65
|
+
"agent-channel"
|
|
66
|
+
])
|
|
67
|
+
}) {};
|
|
68
|
+
/**
|
|
69
|
+
* Raised when the requested connectionId does not resolve to a compatible binding.
|
|
70
|
+
*
|
|
71
|
+
* @since 0.0.0
|
|
72
|
+
* @category errors
|
|
73
|
+
*/
|
|
74
|
+
var InvalidConnectionIdError = class extends Schema.TaggedError()("InvalidConnectionIdError", {
|
|
75
|
+
connectionId: Schema.String,
|
|
76
|
+
phase: Schema.optional(Schema.String),
|
|
77
|
+
providerId: Schema.String,
|
|
78
|
+
targetId: Schema.String,
|
|
79
|
+
targetKind: Schema.Literals([
|
|
80
|
+
"action",
|
|
81
|
+
"trigger",
|
|
82
|
+
"ai_model",
|
|
83
|
+
"agent-channel"
|
|
84
|
+
])
|
|
85
|
+
}) {};
|
|
86
|
+
/**
|
|
87
|
+
* Raised when the resolved connection value does not satisfy the selected auth method schema.
|
|
88
|
+
*
|
|
89
|
+
* @since 0.0.0
|
|
90
|
+
* @category errors
|
|
91
|
+
*/
|
|
92
|
+
var InvalidResolvedConnectionError = class extends Schema.TaggedError()("InvalidResolvedConnectionError", {
|
|
93
|
+
description: Schema.String,
|
|
94
|
+
methodId: Schema.String,
|
|
95
|
+
phase: Schema.optional(Schema.String),
|
|
96
|
+
providerId: Schema.String,
|
|
97
|
+
targetId: Schema.String,
|
|
98
|
+
targetKind: Schema.Literals([
|
|
99
|
+
"action",
|
|
100
|
+
"trigger",
|
|
101
|
+
"ai_model",
|
|
102
|
+
"agent-channel"
|
|
103
|
+
])
|
|
104
|
+
}) {};
|
|
105
|
+
/**
|
|
106
|
+
* Raised when the provider refuses the connection's stored grant, so the user must sign in again.
|
|
107
|
+
*
|
|
108
|
+
* @since 0.0.0
|
|
109
|
+
* @category errors
|
|
110
|
+
*/
|
|
111
|
+
var ConnectionReauthorizationRequiredError = class extends Schema.TaggedError()("ConnectionReauthorizationRequiredError", {
|
|
112
|
+
connectionId: Schema.String,
|
|
113
|
+
message: Schema.String,
|
|
114
|
+
phase: Schema.optional(Schema.String),
|
|
115
|
+
providerId: Schema.String,
|
|
116
|
+
targetId: Schema.String,
|
|
117
|
+
targetKind: Schema.Literals([
|
|
118
|
+
"action",
|
|
119
|
+
"trigger",
|
|
120
|
+
"ai_model",
|
|
121
|
+
"agent-channel"
|
|
122
|
+
])
|
|
123
|
+
}) {};
|
|
124
|
+
/**
|
|
125
|
+
* Raised when the host credential store cannot be read during connection resolution.
|
|
126
|
+
*
|
|
127
|
+
* @since 0.0.0
|
|
128
|
+
* @category errors
|
|
129
|
+
*/
|
|
130
|
+
var ConnectionResolverStoreError = class extends Schema.TaggedError()("ConnectionResolverStoreError", {
|
|
131
|
+
cause: Schema.Defect(),
|
|
132
|
+
operation: Schema.String,
|
|
133
|
+
phase: Schema.optional(Schema.String),
|
|
134
|
+
providerId: Schema.String,
|
|
135
|
+
targetId: Schema.String,
|
|
136
|
+
targetKind: Schema.Literals([
|
|
137
|
+
"action",
|
|
138
|
+
"trigger",
|
|
139
|
+
"ai_model",
|
|
140
|
+
"agent-channel"
|
|
141
|
+
])
|
|
142
|
+
}) {};
|
|
143
|
+
/**
|
|
144
|
+
* Host-provided connection resolver service.
|
|
145
|
+
*
|
|
146
|
+
* @since 0.0.0
|
|
147
|
+
* @category services
|
|
148
|
+
*/
|
|
149
|
+
var Service = class extends Context.Service()("@dual-os/sdk/ConnectionResolver") {};
|
|
150
|
+
//#endregion
|
|
151
|
+
export { ConnectionIdNotAllowedError, ConnectionReauthorizationRequiredError, ConnectionRequiredError, ConnectionResolver_exports as ConnectionResolver, ConnectionResolverStoreError, ConnectionResolver_exports, ConnectionSelectionRequiredError, InvalidConnectionIdError, InvalidResolvedConnectionError, Service };
|
|
152
|
+
|
|
153
|
+
//# sourceMappingURL=ConnectionResolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectionResolver.js","names":[],"sources":["../src/ConnectionResolver.ts"],"sourcesContent":["/**\n * Host-provided connection resolution contracts for SDK execution flows.\n *\n * @since 0.0.0\n */\nimport type { Effect } from \"effect\";\nimport { Context, Schema } from \"effect\";\n\n/**\n * Connection-aware runtime targets supported by the SDK.\n *\n * @since 0.0.0\n * @category models\n */\nexport type ConnectionTargetKind = \"action\" | \"trigger\" | \"ai_model\" | \"agent-channel\";\n\n/**\n * Tenant boundary for connection resolution and audit.\n *\n * @since 0.0.0\n * @category models\n */\nexport interface ConnectionResolutionTenant {\n readonly organizationId: string;\n readonly teamId: string;\n}\n\n/**\n * Product actor on whose behalf a connection is being selected.\n *\n * @since 0.0.0\n * @category models\n */\nexport type ConnectionResolutionActor =\n | { readonly kind: \"user\"; readonly userId: string }\n | { readonly kind: \"system\"; readonly reason?: string | undefined };\n\n/**\n * Product source that caused the invocation.\n *\n * @since 0.0.0\n * @category models\n */\nexport interface ConnectionResolutionSource {\n readonly kind: string;\n readonly subjectId?: string;\n readonly metadata?: Readonly<Record<string, unknown>>;\n}\n\n/**\n * Host-owned context used to select, authorize, and audit a connection.\n *\n * @since 0.0.0\n * @category models\n */\nexport interface ConnectionResolutionContext {\n readonly tenant?: ConnectionResolutionTenant;\n readonly actor?: ConnectionResolutionActor;\n readonly source?: ConnectionResolutionSource;\n readonly metadata?: Readonly<Record<string, unknown>>;\n}\n\n/**\n * Request sent to the host connection resolver during action or trigger execution.\n *\n * @since 0.0.0\n * @category models\n */\nexport interface ConnectionResolutionTarget {\n readonly providerId: string;\n readonly targetKind: ConnectionTargetKind;\n readonly targetId: string;\n readonly phase?: string;\n}\n\nexport interface ResolveConnectionRequest {\n readonly target: ConnectionResolutionTarget;\n readonly connectionId?: string;\n readonly context?: ConnectionResolutionContext;\n}\n\nexport interface ResolvedConnectionMaterial {\n readonly encoding?: \"json\";\n readonly providerId: string;\n readonly connectionId: string;\n readonly methodId: string;\n readonly material: unknown;\n readonly setup: unknown;\n}\n\n/**\n * Raised when a runtime target does not accept a connection but a connectionId was still provided.\n *\n * @since 0.0.0\n * @category errors\n */\nexport class ConnectionIdNotAllowedError extends Schema.TaggedError<ConnectionIdNotAllowedError>()(\n \"ConnectionIdNotAllowedError\",\n {\n connectionId: Schema.String,\n phase: Schema.optional(Schema.String),\n providerId: Schema.String,\n targetId: Schema.String,\n targetKind: Schema.Literals([\"action\", \"trigger\", \"ai_model\", \"agent-channel\"]),\n },\n) {}\n\n/**\n * Raised when execution requires a connection and no compatible binding is available.\n *\n * @since 0.0.0\n * @category errors\n */\nexport class ConnectionRequiredError extends Schema.TaggedError<ConnectionRequiredError>()(\n \"ConnectionRequiredError\",\n {\n phase: Schema.optional(Schema.String),\n providerId: Schema.String,\n targetId: Schema.String,\n targetKind: Schema.Literals([\"action\", \"trigger\", \"ai_model\", \"agent-channel\"]),\n },\n) {}\n\n/**\n * Raised when several compatible connection bindings exist and the caller must choose one.\n *\n * @since 0.0.0\n * @category errors\n */\nexport class ConnectionSelectionRequiredError extends Schema.TaggedError<ConnectionSelectionRequiredError>()(\n \"ConnectionSelectionRequiredError\",\n {\n phase: Schema.optional(Schema.String),\n providerId: Schema.String,\n targetId: Schema.String,\n targetKind: Schema.Literals([\"action\", \"trigger\", \"ai_model\", \"agent-channel\"]),\n },\n) {}\n\n/**\n * Raised when the requested connectionId does not resolve to a compatible binding.\n *\n * @since 0.0.0\n * @category errors\n */\nexport class InvalidConnectionIdError extends Schema.TaggedError<InvalidConnectionIdError>()(\n \"InvalidConnectionIdError\",\n {\n connectionId: Schema.String,\n phase: Schema.optional(Schema.String),\n providerId: Schema.String,\n targetId: Schema.String,\n targetKind: Schema.Literals([\"action\", \"trigger\", \"ai_model\", \"agent-channel\"]),\n },\n) {}\n\n/**\n * Raised when the resolved connection value does not satisfy the selected auth method schema.\n *\n * @since 0.0.0\n * @category errors\n */\nexport class InvalidResolvedConnectionError extends Schema.TaggedError<InvalidResolvedConnectionError>()(\n \"InvalidResolvedConnectionError\",\n {\n description: Schema.String,\n methodId: Schema.String,\n phase: Schema.optional(Schema.String),\n providerId: Schema.String,\n targetId: Schema.String,\n targetKind: Schema.Literals([\"action\", \"trigger\", \"ai_model\", \"agent-channel\"]),\n },\n) {}\n\n/**\n * Raised when the provider refuses the connection's stored grant, so the user must sign in again.\n *\n * @since 0.0.0\n * @category errors\n */\nexport class ConnectionReauthorizationRequiredError extends Schema.TaggedError<ConnectionReauthorizationRequiredError>()(\n \"ConnectionReauthorizationRequiredError\",\n {\n connectionId: Schema.String,\n message: Schema.String,\n phase: Schema.optional(Schema.String),\n providerId: Schema.String,\n targetId: Schema.String,\n targetKind: Schema.Literals([\"action\", \"trigger\", \"ai_model\", \"agent-channel\"]),\n },\n) {}\n\n/**\n * Raised when the host credential store cannot be read during connection resolution.\n *\n * @since 0.0.0\n * @category errors\n */\nexport class ConnectionResolverStoreError extends Schema.TaggedError<ConnectionResolverStoreError>()(\n \"ConnectionResolverStoreError\",\n {\n cause: Schema.Defect(),\n operation: Schema.String,\n phase: Schema.optional(Schema.String),\n providerId: Schema.String,\n targetId: Schema.String,\n targetKind: Schema.Literals([\"action\", \"trigger\", \"ai_model\", \"agent-channel\"]),\n },\n) {}\n\n/**\n * Structured connection failures surfaced by SDK runtime boundaries.\n *\n * @since 0.0.0\n * @category errors\n */\nexport type ConnectionError =\n | ConnectionIdNotAllowedError\n | ConnectionRequiredError\n | ConnectionSelectionRequiredError\n | InvalidConnectionIdError\n | InvalidResolvedConnectionError\n | ConnectionReauthorizationRequiredError\n | ConnectionResolverStoreError;\n\n/**\n * Errors the host resolver itself is expected to surface.\n *\n * @since 0.0.0\n * @category errors\n */\nexport type ResolveConnectionError =\n | ConnectionRequiredError\n | ConnectionSelectionRequiredError\n | InvalidConnectionIdError\n | InvalidResolvedConnectionError\n | ConnectionReauthorizationRequiredError\n | ConnectionResolverStoreError;\n\n/**\n * Host-provided service used by SDK runtimes to select one concrete connection binding.\n *\n * The SDK narrows and validates this untyped host binding against the target's allowed methods\n * before exposing it to handlers.\n *\n * @since 0.0.0\n * @category services\n */\nexport interface ConnectionResolverInstance {\n readonly resolve: (\n input: ResolveConnectionRequest,\n ) => Effect.Effect<ResolvedConnectionMaterial, ResolveConnectionError>;\n}\n\n/**\n * Host-provided connection resolver service.\n *\n * @since 0.0.0\n * @category services\n */\nexport class Service extends Context.Service<Service, ConnectionResolverInstance>()(\n \"@dual-os/sdk/ConnectionResolver\",\n) {}\n\nexport * as ConnectionResolver from \"./ConnectionResolver.ts\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAgGA,IAAa,8BAAb,cAAiD,OAAO,YAAyC,CAAC,CAChG,+BACA;CACE,cAAc,OAAO;CACrB,OAAO,OAAO,SAAS,OAAO,MAAM;CACpC,YAAY,OAAO;CACnB,UAAU,OAAO;CACjB,YAAY,OAAO,SAAS;EAAC;EAAU;EAAW;EAAY;CAAe,CAAC;AAChF,CACF,CAAC,CAAC,CAAC;;;;;;;AAQH,IAAa,0BAAb,cAA6C,OAAO,YAAqC,CAAC,CACxF,2BACA;CACE,OAAO,OAAO,SAAS,OAAO,MAAM;CACpC,YAAY,OAAO;CACnB,UAAU,OAAO;CACjB,YAAY,OAAO,SAAS;EAAC;EAAU;EAAW;EAAY;CAAe,CAAC;AAChF,CACF,CAAC,CAAC,CAAC;;;;;;;AAQH,IAAa,mCAAb,cAAsD,OAAO,YAA8C,CAAC,CAC1G,oCACA;CACE,OAAO,OAAO,SAAS,OAAO,MAAM;CACpC,YAAY,OAAO;CACnB,UAAU,OAAO;CACjB,YAAY,OAAO,SAAS;EAAC;EAAU;EAAW;EAAY;CAAe,CAAC;AAChF,CACF,CAAC,CAAC,CAAC;;;;;;;AAQH,IAAa,2BAAb,cAA8C,OAAO,YAAsC,CAAC,CAC1F,4BACA;CACE,cAAc,OAAO;CACrB,OAAO,OAAO,SAAS,OAAO,MAAM;CACpC,YAAY,OAAO;CACnB,UAAU,OAAO;CACjB,YAAY,OAAO,SAAS;EAAC;EAAU;EAAW;EAAY;CAAe,CAAC;AAChF,CACF,CAAC,CAAC,CAAC;;;;;;;AAQH,IAAa,iCAAb,cAAoD,OAAO,YAA4C,CAAC,CACtG,kCACA;CACE,aAAa,OAAO;CACpB,UAAU,OAAO;CACjB,OAAO,OAAO,SAAS,OAAO,MAAM;CACpC,YAAY,OAAO;CACnB,UAAU,OAAO;CACjB,YAAY,OAAO,SAAS;EAAC;EAAU;EAAW;EAAY;CAAe,CAAC;AAChF,CACF,CAAC,CAAC,CAAC;;;;;;;AAQH,IAAa,yCAAb,cAA4D,OAAO,YAAoD,CAAC,CACtH,0CACA;CACE,cAAc,OAAO;CACrB,SAAS,OAAO;CAChB,OAAO,OAAO,SAAS,OAAO,MAAM;CACpC,YAAY,OAAO;CACnB,UAAU,OAAO;CACjB,YAAY,OAAO,SAAS;EAAC;EAAU;EAAW;EAAY;CAAe,CAAC;AAChF,CACF,CAAC,CAAC,CAAC;;;;;;;AAQH,IAAa,+BAAb,cAAkD,OAAO,YAA0C,CAAC,CAClG,gCACA;CACE,OAAO,OAAO,OAAO;CACrB,WAAW,OAAO;CAClB,OAAO,OAAO,SAAS,OAAO,MAAM;CACpC,YAAY,OAAO;CACnB,UAAU,OAAO;CACjB,YAAY,OAAO,SAAS;EAAC;EAAU;EAAW;EAAY;CAAe,CAAC;AAChF,CACF,CAAC,CAAC,CAAC;;;;;;;AAoDH,IAAa,UAAb,cAA6B,QAAQ,QAA6C,CAAC,CACjF,iCACF,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
declare namespace DefinitionError_d_exports {
|
|
3
|
+
export { BuilderCollisionError, DefinitionChildKind, DefinitionIdentifierKind, DefinitionOwnerKind, DuplicateAuthMethodIdentifierError, InvalidIdentifierError, InvalidIdentifierReason };
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* @since 0.0.0
|
|
7
|
+
* @category models
|
|
8
|
+
*/
|
|
9
|
+
export type DefinitionIdentifierKind = "dual" | "plugin" | "provider" | "group" | "action" | "trigger" | "auth-method" | "agent-channel";
|
|
10
|
+
/**
|
|
11
|
+
* @since 0.0.0
|
|
12
|
+
* @category models
|
|
13
|
+
*/
|
|
14
|
+
export type DefinitionOwnerKind = "dual" | "plugin" | "group";
|
|
15
|
+
/**
|
|
16
|
+
* @since 0.0.0
|
|
17
|
+
* @category models
|
|
18
|
+
*/
|
|
19
|
+
export type DefinitionChildKind = "plugin" | "provider" | "group" | "action" | "trigger" | "agent-channel";
|
|
20
|
+
/**
|
|
21
|
+
* @since 0.0.0
|
|
22
|
+
* @category models
|
|
23
|
+
*/
|
|
24
|
+
export type InvalidIdentifierReason = "empty" | "contains-reserved-separator" | "invalid-format";
|
|
25
|
+
declare const InvalidIdentifierError_base: Schema.Class<InvalidIdentifierError, Schema.TaggedStruct<"InvalidIdentifierError", {
|
|
26
|
+
readonly identifier: Schema.String;
|
|
27
|
+
readonly kind: Schema.Literals<readonly ["dual", "plugin", "provider", "group", "action", "trigger", "auth-method", "agent-channel"]>;
|
|
28
|
+
readonly reason: Schema.Literals<readonly ["empty", "contains-reserved-separator", "invalid-format"]>;
|
|
29
|
+
readonly reservedCharacter: Schema.optional<Schema.Literals<readonly ["/"]>>;
|
|
30
|
+
}>, import("effect/Cause").YieldableError>;
|
|
31
|
+
/**
|
|
32
|
+
* Raised when a definition identifier does not satisfy SDK constraints.
|
|
33
|
+
*
|
|
34
|
+
* @since 0.0.0
|
|
35
|
+
* @category errors
|
|
36
|
+
*/
|
|
37
|
+
export declare class InvalidIdentifierError extends InvalidIdentifierError_base {}
|
|
38
|
+
declare const BuilderCollisionError_base: Schema.Class<BuilderCollisionError, Schema.TaggedStruct<"BuilderCollisionError", {
|
|
39
|
+
readonly childKind: Schema.Literals<readonly ["agent-channel", "plugin", "provider", "group", "action", "trigger"]>;
|
|
40
|
+
readonly childPluginIdentifier: Schema.optional<Schema.String>;
|
|
41
|
+
readonly existingChildKind: Schema.Literals<readonly ["agent-channel", "plugin", "provider", "group", "action", "trigger"]>;
|
|
42
|
+
readonly existingPluginIdentifier: Schema.optional<Schema.String>;
|
|
43
|
+
readonly identifier: Schema.String;
|
|
44
|
+
readonly ownerIdentifier: Schema.String;
|
|
45
|
+
readonly ownerKind: Schema.Literals<readonly ["dual", "plugin", "group"]>;
|
|
46
|
+
}>, import("effect/Cause").YieldableError>;
|
|
47
|
+
/**
|
|
48
|
+
* Raised when two sibling definitions reuse the same identifier.
|
|
49
|
+
*
|
|
50
|
+
* @since 0.0.0
|
|
51
|
+
* @category errors
|
|
52
|
+
*/
|
|
53
|
+
export declare class BuilderCollisionError extends BuilderCollisionError_base {}
|
|
54
|
+
declare const DuplicateAuthMethodIdentifierError_base: Schema.Class<DuplicateAuthMethodIdentifierError, Schema.TaggedStruct<"DuplicateAuthMethodIdentifierError", {
|
|
55
|
+
readonly identifier: Schema.String;
|
|
56
|
+
readonly providerIdentifier: Schema.String;
|
|
57
|
+
}>, import("effect/Cause").YieldableError>;
|
|
58
|
+
/**
|
|
59
|
+
* Raised when a provider reuses an auth method identifier.
|
|
60
|
+
*
|
|
61
|
+
* @since 0.0.0
|
|
62
|
+
* @category errors
|
|
63
|
+
*/
|
|
64
|
+
export declare class DuplicateAuthMethodIdentifierError extends DuplicateAuthMethodIdentifierError_base {}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { DefinitionError_d_exports };
|
|
67
|
+
//# sourceMappingURL=DefinitionError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefinitionError.d.ts","names":[],"sources":["../src/DefinitionError.ts"],"mappings":";;;;;;;;YAWY;;;;;YAcA;;;;;YAMA;;;;;YAYA;;;;;;;;;;;;;qBAiCC,+BAA+B;;;;;;;;;;;;;;;;qBAgB/B,8BAA8B;;;;;;;;;;;qBAmB9B,2CAA2C"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { __exportAll } from "./_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
//#region src/DefinitionError.ts
|
|
4
|
+
/**
|
|
5
|
+
* Public SDK definition errors.
|
|
6
|
+
*
|
|
7
|
+
* @since 0.0.0
|
|
8
|
+
*/
|
|
9
|
+
var DefinitionError_exports = /* @__PURE__ */ __exportAll({
|
|
10
|
+
BuilderCollisionError: () => BuilderCollisionError,
|
|
11
|
+
DuplicateAuthMethodIdentifierError: () => DuplicateAuthMethodIdentifierError,
|
|
12
|
+
InvalidIdentifierError: () => InvalidIdentifierError
|
|
13
|
+
});
|
|
14
|
+
const DefinitionIdentifierKindSchema = Schema.Literals([
|
|
15
|
+
"dual",
|
|
16
|
+
"plugin",
|
|
17
|
+
"provider",
|
|
18
|
+
"group",
|
|
19
|
+
"action",
|
|
20
|
+
"trigger",
|
|
21
|
+
"auth-method",
|
|
22
|
+
"agent-channel"
|
|
23
|
+
]);
|
|
24
|
+
const DefinitionOwnerKindSchema = Schema.Literals([
|
|
25
|
+
"dual",
|
|
26
|
+
"plugin",
|
|
27
|
+
"group"
|
|
28
|
+
]);
|
|
29
|
+
const DefinitionChildKindSchema = Schema.Literals([
|
|
30
|
+
"agent-channel",
|
|
31
|
+
"plugin",
|
|
32
|
+
"provider",
|
|
33
|
+
"group",
|
|
34
|
+
"action",
|
|
35
|
+
"trigger"
|
|
36
|
+
]);
|
|
37
|
+
const InvalidIdentifierReasonSchema = Schema.Literals([
|
|
38
|
+
"empty",
|
|
39
|
+
"contains-reserved-separator",
|
|
40
|
+
"invalid-format"
|
|
41
|
+
]);
|
|
42
|
+
/**
|
|
43
|
+
* Raised when a definition identifier does not satisfy SDK constraints.
|
|
44
|
+
*
|
|
45
|
+
* @since 0.0.0
|
|
46
|
+
* @category errors
|
|
47
|
+
*/
|
|
48
|
+
var InvalidIdentifierError = class extends Schema.TaggedError()("InvalidIdentifierError", {
|
|
49
|
+
identifier: Schema.String,
|
|
50
|
+
kind: DefinitionIdentifierKindSchema,
|
|
51
|
+
reason: InvalidIdentifierReasonSchema,
|
|
52
|
+
reservedCharacter: Schema.optional(Schema.Literals(["/"]))
|
|
53
|
+
}) {};
|
|
54
|
+
/**
|
|
55
|
+
* Raised when two sibling definitions reuse the same identifier.
|
|
56
|
+
*
|
|
57
|
+
* @since 0.0.0
|
|
58
|
+
* @category errors
|
|
59
|
+
*/
|
|
60
|
+
var BuilderCollisionError = class extends Schema.TaggedError()("BuilderCollisionError", {
|
|
61
|
+
childKind: DefinitionChildKindSchema,
|
|
62
|
+
childPluginIdentifier: Schema.optional(Schema.String),
|
|
63
|
+
existingChildKind: DefinitionChildKindSchema,
|
|
64
|
+
existingPluginIdentifier: Schema.optional(Schema.String),
|
|
65
|
+
identifier: Schema.String,
|
|
66
|
+
ownerIdentifier: Schema.String,
|
|
67
|
+
ownerKind: DefinitionOwnerKindSchema
|
|
68
|
+
}) {};
|
|
69
|
+
/**
|
|
70
|
+
* Raised when a provider reuses an auth method identifier.
|
|
71
|
+
*
|
|
72
|
+
* @since 0.0.0
|
|
73
|
+
* @category errors
|
|
74
|
+
*/
|
|
75
|
+
var DuplicateAuthMethodIdentifierError = class extends Schema.TaggedError()("DuplicateAuthMethodIdentifierError", {
|
|
76
|
+
identifier: Schema.String,
|
|
77
|
+
providerIdentifier: Schema.String
|
|
78
|
+
}) {};
|
|
79
|
+
//#endregion
|
|
80
|
+
export { BuilderCollisionError, DefinitionError_exports, DuplicateAuthMethodIdentifierError, InvalidIdentifierError };
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=DefinitionError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefinitionError.js","names":[],"sources":["../src/DefinitionError.ts"],"sourcesContent":["/**\n * Public SDK definition errors.\n *\n * @since 0.0.0\n */\nimport { Schema } from \"effect\";\n\n/**\n * @since 0.0.0\n * @category models\n */\nexport type DefinitionIdentifierKind =\n | \"dual\"\n | \"plugin\"\n | \"provider\"\n | \"group\"\n | \"action\"\n | \"trigger\"\n | \"auth-method\"\n | \"agent-channel\";\n\n/**\n * @since 0.0.0\n * @category models\n */\nexport type DefinitionOwnerKind = \"dual\" | \"plugin\" | \"group\";\n\n/**\n * @since 0.0.0\n * @category models\n */\nexport type DefinitionChildKind =\n | \"plugin\"\n | \"provider\"\n | \"group\"\n | \"action\"\n | \"trigger\"\n | \"agent-channel\";\n\n/**\n * @since 0.0.0\n * @category models\n */\nexport type InvalidIdentifierReason = \"empty\" | \"contains-reserved-separator\" | \"invalid-format\";\n\nconst DefinitionIdentifierKindSchema = Schema.Literals([\n \"dual\",\n \"plugin\",\n \"provider\",\n \"group\",\n \"action\",\n \"trigger\",\n \"auth-method\",\n \"agent-channel\",\n]);\nconst DefinitionOwnerKindSchema = Schema.Literals([\"dual\", \"plugin\", \"group\"]);\nconst DefinitionChildKindSchema = Schema.Literals([\n \"agent-channel\",\n \"plugin\",\n \"provider\",\n \"group\",\n \"action\",\n \"trigger\",\n]);\nconst InvalidIdentifierReasonSchema = Schema.Literals([\n \"empty\",\n \"contains-reserved-separator\",\n \"invalid-format\",\n]);\n\n/**\n * Raised when a definition identifier does not satisfy SDK constraints.\n *\n * @since 0.0.0\n * @category errors\n */\nexport class InvalidIdentifierError extends Schema.TaggedError<InvalidIdentifierError>()(\n \"InvalidIdentifierError\",\n {\n identifier: Schema.String,\n kind: DefinitionIdentifierKindSchema,\n reason: InvalidIdentifierReasonSchema,\n reservedCharacter: Schema.optional(Schema.Literals([\"/\"])),\n },\n) {}\n\n/**\n * Raised when two sibling definitions reuse the same identifier.\n *\n * @since 0.0.0\n * @category errors\n */\nexport class BuilderCollisionError extends Schema.TaggedError<BuilderCollisionError>()(\n \"BuilderCollisionError\",\n {\n childKind: DefinitionChildKindSchema,\n childPluginIdentifier: Schema.optional(Schema.String),\n existingChildKind: DefinitionChildKindSchema,\n existingPluginIdentifier: Schema.optional(Schema.String),\n identifier: Schema.String,\n ownerIdentifier: Schema.String,\n ownerKind: DefinitionOwnerKindSchema,\n },\n) {}\n\n/**\n * Raised when a provider reuses an auth method identifier.\n *\n * @since 0.0.0\n * @category errors\n */\nexport class DuplicateAuthMethodIdentifierError extends Schema.TaggedError<DuplicateAuthMethodIdentifierError>()(\n \"DuplicateAuthMethodIdentifierError\",\n { identifier: Schema.String, providerIdentifier: Schema.String },\n) {}\n"],"mappings":";;;;;;;;;;;;;AA6CA,MAAM,iCAAiC,OAAO,SAAS;CACrD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AACD,MAAM,4BAA4B,OAAO,SAAS;CAAC;CAAQ;CAAU;AAAO,CAAC;AAC7E,MAAM,4BAA4B,OAAO,SAAS;CAChD;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AACD,MAAM,gCAAgC,OAAO,SAAS;CACpD;CACA;CACA;AACF,CAAC;;;;;;;AAQD,IAAa,yBAAb,cAA4C,OAAO,YAAoC,CAAC,CACtF,0BACA;CACE,YAAY,OAAO;CACnB,MAAM;CACN,QAAQ;CACR,mBAAmB,OAAO,SAAS,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;AAC3D,CACF,CAAC,CAAC,CAAC;;;;;;;AAQH,IAAa,wBAAb,cAA2C,OAAO,YAAmC,CAAC,CACpF,yBACA;CACE,WAAW;CACX,uBAAuB,OAAO,SAAS,OAAO,MAAM;CACpD,mBAAmB;CACnB,0BAA0B,OAAO,SAAS,OAAO,MAAM;CACvD,YAAY,OAAO;CACnB,iBAAiB,OAAO;CACxB,WAAW;AACb,CACF,CAAC,CAAC,CAAC;;;;;;;AAQH,IAAa,qCAAb,cAAwD,OAAO,YAAgD,CAAC,CAC9G,sCACA;CAAE,YAAY,OAAO;CAAQ,oBAAoB,OAAO;AAAO,CACjE,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Any } from "./Plugin.js";
|
|
2
|
+
import { Any as Any$1 } from "./AiProvider.js";
|
|
3
|
+
import { AllActionEntries } from "./internal/dual/actions.js";
|
|
4
|
+
import { AnyApp, App } from "./DualRuntime.js";
|
|
5
|
+
import { MaterializedActionCapabilityVersion, MaterializedAuthMethod, MaterializedCapabilityVersion, MaterializedChannelCapabilityVersion, MaterializedProvider, MaterializedRegistry, MaterializedRegistryOptions, MaterializedTriggerCapabilityVersion } from "./internal/dual/registry.js";
|
|
6
|
+
import { AllTriggerEntries, RuntimeTriggerEntry } from "./internal/dual/triggers.js";
|
|
7
|
+
import "./DualRegistry.js";
|
|
8
|
+
import { Schema } from "effect";
|
|
9
|
+
declare namespace DualRegistry_d_exports {
|
|
10
|
+
export { DualRegistry_d_exports as DualRegistry, MaterializedActionCapabilityVersion, MaterializedAuthMethod, MaterializedCapabilityVersion, MaterializedChannelCapabilityVersion, MaterializedPlugin, MaterializedProvider, MaterializedRegistry, MaterializedRegistryOptions, MaterializedTriggerCapabilityVersion, TriggerNotFoundError, actionIds, materializePlugin, materializePlugins, materializeRegistry, resolveTrigger, triggerIds };
|
|
11
|
+
}
|
|
12
|
+
declare const TriggerNotFoundError_base: Schema.Class<TriggerNotFoundError, Schema.TaggedStruct<"TriggerNotFoundError", {
|
|
13
|
+
readonly triggerId: Schema.String;
|
|
14
|
+
}>, import("effect/Cause").YieldableError>;
|
|
15
|
+
/** Raised when a trigger lifecycle request references an unknown trigger id. */
|
|
16
|
+
export declare class TriggerNotFoundError extends TriggerNotFoundError_base {}
|
|
17
|
+
/**
|
|
18
|
+
* Enumerate the canonical machine ids for every action in the app.
|
|
19
|
+
*
|
|
20
|
+
* @since 0.0.0
|
|
21
|
+
* @category getters
|
|
22
|
+
*/
|
|
23
|
+
export declare const actionIds: <const P extends Any, LayerOutput, LayerError, LayerRequirements, const AiProviders extends readonly Any$1[]>(app: App<P, LayerOutput, LayerError, LayerRequirements, AiProviders>) => readonly AllActionEntries<readonly [P]>["actionId"][];
|
|
24
|
+
/**
|
|
25
|
+
* Enumerate the canonical machine ids for every trigger in the app.
|
|
26
|
+
*
|
|
27
|
+
* @since 0.0.0
|
|
28
|
+
* @category getters
|
|
29
|
+
*/
|
|
30
|
+
export declare const triggerIds: <const P extends Any, LayerOutput, LayerError, LayerRequirements, const AiProviders extends readonly Any$1[]>(app: App<P, LayerOutput, LayerError, LayerRequirements, AiProviders>) => readonly AllTriggerEntries<readonly [P]>["triggerId"][];
|
|
31
|
+
/**
|
|
32
|
+
* Resolve one trigger entry from the app, including its auth methods.
|
|
33
|
+
*
|
|
34
|
+
* @since 0.0.0
|
|
35
|
+
* @category getters
|
|
36
|
+
*/
|
|
37
|
+
export declare const resolveTrigger: (app: AnyApp, triggerId: string, options?: {
|
|
38
|
+
readonly triggerVersion?: string;
|
|
39
|
+
}) => RuntimeTriggerEntry | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Materialize the capability catalog of an app's installed releases.
|
|
42
|
+
*
|
|
43
|
+
* @since 0.0.0
|
|
44
|
+
* @category registry
|
|
45
|
+
*/
|
|
46
|
+
export declare const materializeRegistry: (app: AnyApp, options?: MaterializedRegistryOptions) => MaterializedRegistry;
|
|
47
|
+
/** The contracts of one plugin release. @since 0.0.0 @category registry */
|
|
48
|
+
export interface MaterializedPlugin {
|
|
49
|
+
readonly pluginIdentifier: string;
|
|
50
|
+
readonly pluginVersion: string;
|
|
51
|
+
readonly providers: readonly MaterializedRegistry["providers"][number][];
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Extract a release's contracts without building Layers or running handlers.
|
|
55
|
+
*
|
|
56
|
+
* @since 0.0.0
|
|
57
|
+
* @category registry
|
|
58
|
+
*/
|
|
59
|
+
export declare const materializePlugin: (plugin: Any, options: MaterializedRegistryOptions & {
|
|
60
|
+
readonly version: string;
|
|
61
|
+
}) => MaterializedPlugin;
|
|
62
|
+
/** Every installed plugin release and its contracts. @since 0.0.0 @category registry */
|
|
63
|
+
export declare const materializePlugins: (app: AnyApp, options?: MaterializedRegistryOptions) => {
|
|
64
|
+
pluginIdentifier: string;
|
|
65
|
+
pluginVersion: string;
|
|
66
|
+
providers: readonly MaterializedRegistry["providers"][number][];
|
|
67
|
+
ordinal: number;
|
|
68
|
+
}[];
|
|
69
|
+
//#endregion
|
|
70
|
+
export { DualRegistry_d_exports as DualRegistry, DualRegistry_d_exports, type MaterializedActionCapabilityVersion, type MaterializedAuthMethod, type MaterializedCapabilityVersion, type MaterializedChannelCapabilityVersion, type MaterializedProvider, type MaterializedRegistry, type MaterializedRegistryOptions, type MaterializedTriggerCapabilityVersion };
|
|
71
|
+
//# sourceMappingURL=DualRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DualRegistry.d.ts","names":["Plugin.Any","AiProvider.Any"],"sources":["../src/DualRegistry.ts"],"mappings":";;;;;;;;;;;;;;;qBAwBa,6BAA6B;;;;;;;qBAW7B,kBACL,UAAUA,KAChB,aACA,YACA,yBACM,6BAA6BC,SAAgB,KAE9C,IAAI,GAAG,aAAa,YAAY,mBAAmB,0BAC9C,2BAA2B;;;;;;;qBAU1B,mBACL,UAAUD,KAChB,aACA,YACA,yBACM,6BAA6BC,SAAgB,KAE9C,IAAI,GAAG,aAAa,YAAY,mBAAmB,0BAC9C,4BAA4B;;;;;;;qBAU3B,iBAAc,KACpB,QAAM,mBACM;WACG;MACnB;;;;;;;qBAqBU,sBAAmB,KACzB,QAAM,UACF,gCACR;;iBAWc;WACN;WACA;WACA,oBAAoB;;;;;;;;qBASlB,oBAAiB,QACpBD,KAAU,SACT;WAAyC;MACjD;;qBAcU,qBAAkB,KAAS,QAAM,UAAW;EA5B5B;EACH;EACJ,oBAAS"}
|