@dual-os/sdk 0.8.0-next.0 → 0.8.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -17
- package/dist/Action.d.ts +0 -1
- package/dist/Action.js +1 -2
- package/dist/AgentChannel.d.ts +27 -930
- package/dist/AgentChannel.d.ts.map +1 -1
- package/dist/AgentChannel.js +53 -161
- package/dist/AgentChannel.js.map +1 -1
- package/dist/AgentChannelConformance.d.ts +8 -501
- package/dist/AgentChannelConformance.d.ts.map +1 -1
- package/dist/AgentChannelConformance.js +4 -5
- package/dist/AgentChannelConformance.js.map +1 -1
- package/dist/AgentChannelRuntime.d.ts +0 -1
- package/dist/AgentChannelRuntime.d.ts.map +1 -1
- package/dist/AgentChannelRuntime.js +8 -10
- package/dist/AgentChannelRuntime.js.map +1 -1
- package/dist/AiProvider.d.ts +0 -1
- package/dist/AiProvider.js +1 -2
- package/dist/AuthMethod.d.ts +0 -1
- package/dist/AuthMethod.js +1 -2
- package/dist/AuthMethodBinding.d.ts +0 -1
- package/dist/AuthMethodBinding.js +1 -2
- package/dist/AuthMethodExecution.d.ts +0 -1
- package/dist/AuthMethodExecution.js +1 -2
- package/dist/ConnectionResolver.d.ts +0 -1
- package/dist/ConnectionResolver.js +1 -2
- package/dist/DefinitionError.d.ts +0 -1
- package/dist/DefinitionError.js +1 -2
- package/dist/DualRegistry.d.ts +0 -1
- package/dist/DualRegistry.js +1 -2
- package/dist/DualRuntime.d.ts +0 -1
- package/dist/DualRuntime.js +1 -2
- package/dist/Files.d.ts +0 -1
- package/dist/Files.js +1 -2
- package/dist/Group.d.ts +0 -1
- package/dist/Group.js +1 -2
- package/dist/Http.d.ts +0 -1
- package/dist/Http.d.ts.map +1 -1
- package/dist/Http.js +4 -5
- package/dist/Http.js.map +1 -1
- package/dist/Mcp.d.ts +0 -1
- package/dist/Mcp.js +1 -2
- package/dist/OAuth2TokenRefresher.d.ts +0 -1
- package/dist/OAuth2TokenRefresher.js +1 -2
- package/dist/OAuthFlow.d.ts +0 -1
- package/dist/OAuthFlow.js +1 -2
- package/dist/Plugin.d.ts +0 -1
- package/dist/Plugin.js +1 -2
- package/dist/PluginRuntime.d.ts +0 -1
- package/dist/PluginRuntime.js +1 -2
- package/dist/Runner.js +3 -4
- package/dist/Runner.js.map +1 -1
- package/dist/ToolFile.d.ts +0 -1
- package/dist/ToolFile.js +1 -2
- package/dist/Trigger.d.ts +0 -1
- package/dist/Trigger.js +1 -2
- package/dist/_virtual/_rolldown/runtime.js +1 -2
- package/dist/internal/auth-context.d.ts +0 -2
- package/dist/internal/auth-context.d.ts.map +1 -1
- package/dist/internal/auth-execution.d.ts +0 -2
- package/dist/internal/auth-execution.d.ts.map +1 -1
- package/dist/internal/auth-execution.js +1 -2
- package/dist/internal/auth-runtime.d.ts +0 -2
- package/dist/internal/auth-runtime.d.ts.map +1 -1
- package/dist/internal/auth-runtime.js +1 -2
- package/dist/internal/capabilities.d.ts +0 -2
- package/dist/internal/capabilities.d.ts.map +1 -1
- package/dist/internal/capabilities.js +1 -2
- package/dist/internal/children.d.ts +0 -2
- package/dist/internal/children.d.ts.map +1 -1
- package/dist/internal/children.js +1 -2
- package/dist/internal/collection-utils.d.ts +0 -2
- package/dist/internal/collection-utils.d.ts.map +1 -1
- package/dist/internal/collection-utils.js +1 -2
- package/dist/internal/dual/actions.d.ts +0 -2
- package/dist/internal/dual/actions.d.ts.map +1 -1
- package/dist/internal/dual/actions.js +1 -2
- package/dist/internal/dual/invoke.d.ts +0 -2
- package/dist/internal/dual/invoke.d.ts.map +1 -1
- package/dist/internal/dual/invoke.js +1 -2
- package/dist/internal/dual/registry.d.ts +1 -5
- package/dist/internal/dual/registry.d.ts.map +1 -1
- package/dist/internal/dual/registry.js +1 -2
- package/dist/internal/dual/registry.js.map +1 -1
- package/dist/internal/dual/triggers.d.ts +0 -2
- package/dist/internal/dual/triggers.d.ts.map +1 -1
- package/dist/internal/dual/triggers.js +1 -2
- package/dist/internal/handler-context.d.ts +0 -2
- package/dist/internal/handler-context.d.ts.map +1 -1
- package/dist/internal/handler-context.js +1 -2
- package/dist/internal/identifier.d.ts +0 -2
- package/dist/internal/identifier.d.ts.map +1 -1
- package/dist/internal/identifier.js +1 -2
- package/dist/internal/plugin-handlers.d.ts +0 -2
- package/dist/internal/plugin-handlers.d.ts.map +1 -1
- package/dist/internal/plugin-handlers.js +5 -4
- package/dist/internal/plugin-handlers.js.map +1 -1
- package/dist/internal/proto.d.ts +0 -2
- package/dist/internal/proto.d.ts.map +1 -1
- package/dist/internal/proto.js +1 -2
- package/dist/internal/schema-runtime.d.ts +0 -2
- package/dist/internal/schema-runtime.d.ts.map +1 -1
- package/dist/internal/schema-runtime.js +1 -2
- package/dist/internal/trigger-runtime-shared.d.ts +0 -2
- package/dist/internal/trigger-runtime-shared.d.ts.map +1 -1
- package/dist/internal/trigger-runtime-shared.js +1 -2
- package/dist/internal/trigger-runtime.d.ts +0 -2
- package/dist/internal/trigger-runtime.d.ts.map +1 -1
- package/dist/internal/trigger-runtime.js +1 -2
- package/dist/internal/types.d.ts +0 -2
- package/dist/internal/types.d.ts.map +1 -1
- package/dist/remote-runtime.d.ts +0 -1
- package/dist/remote-runtime.js +1 -2
- package/package.json +6 -7
- package/src/AgentChannel.ts +52 -150
- package/src/AgentChannelConformance.ts +2 -6
- package/src/AgentChannelRuntime.ts +11 -14
- package/src/Http.ts +21 -4
- package/src/Runner.ts +5 -4
- package/src/internal/dual/registry.ts +0 -2
- package/src/internal/plugin-handlers.ts +5 -2
package/src/Http.ts
CHANGED
|
@@ -32,6 +32,8 @@ import {
|
|
|
32
32
|
HttpClient,
|
|
33
33
|
HttpClientError,
|
|
34
34
|
HttpClientRequest,
|
|
35
|
+
Headers,
|
|
36
|
+
UrlParams,
|
|
35
37
|
} from "effect/http";
|
|
36
38
|
import type { HttpClientResponse } from "effect/http";
|
|
37
39
|
|
|
@@ -661,9 +663,14 @@ export function continuation(request: HttpClientRequest.HttpClientRequest, nextL
|
|
|
661
663
|
return refused("A continuation URL must be an HTTPS link to the same operation path");
|
|
662
664
|
}
|
|
663
665
|
return Effect.succeed(
|
|
664
|
-
HttpClientRequest.
|
|
665
|
-
|
|
666
|
-
|
|
666
|
+
HttpClientRequest.makeWith(
|
|
667
|
+
request.method,
|
|
668
|
+
`${declared.origin}${next.pathname}${next.search}`,
|
|
669
|
+
UrlParams.empty,
|
|
670
|
+
Option.none(),
|
|
671
|
+
request.headers,
|
|
672
|
+
HttpBody.empty,
|
|
673
|
+
),
|
|
667
674
|
);
|
|
668
675
|
}
|
|
669
676
|
|
|
@@ -707,7 +714,17 @@ function redirect(response: HttpClientResponse.HttpClientResponse) {
|
|
|
707
714
|
: sent;
|
|
708
715
|
return url.origin === new URL(sent.url).origin
|
|
709
716
|
? HttpClientRequest.setUrl(request, url)
|
|
710
|
-
: HttpClientRequest.
|
|
717
|
+
: HttpClientRequest.setUrl(
|
|
718
|
+
HttpClientRequest.makeWith(
|
|
719
|
+
request.method,
|
|
720
|
+
"",
|
|
721
|
+
UrlParams.empty,
|
|
722
|
+
Option.none(),
|
|
723
|
+
Headers.empty,
|
|
724
|
+
request.body,
|
|
725
|
+
),
|
|
726
|
+
url,
|
|
727
|
+
);
|
|
711
728
|
}
|
|
712
729
|
|
|
713
730
|
function follow(
|
package/src/Runner.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NodeRuntime, NodeServices } from "@effect/platform-node";
|
|
1
|
+
import { NodeCrypto, NodeRuntime, NodeServices } from "@effect/platform-node";
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
Array,
|
|
@@ -60,7 +60,9 @@ function initializationError(cause: unknown) {
|
|
|
60
60
|
// This executable runs only in the plugin's process, using its own SDK and Effect.
|
|
61
61
|
pipe(
|
|
62
62
|
Effect.gen(function* () {
|
|
63
|
-
const guestServices = yield* Effect.context<
|
|
63
|
+
const guestServices = yield* Effect.context<
|
|
64
|
+
NodeServices.NodeServices | Layer.Success<typeof NodeCrypto.layer>
|
|
65
|
+
>();
|
|
64
66
|
const scope = yield* Scope.Scope;
|
|
65
67
|
const runtimeScope = yield* Scope.fork(scope, "sequential");
|
|
66
68
|
const failed = yield* Deferred.make<never, PluginRuntime.PluginExecutionError>();
|
|
@@ -242,7 +244,6 @@ pipe(
|
|
|
242
244
|
);
|
|
243
245
|
}),
|
|
244
246
|
Effect.scoped,
|
|
245
|
-
|
|
246
|
-
Effect.provide(NodeServices.layer),
|
|
247
|
+
Effect.provide([NodeServices.layer, NodeCrypto.layer]),
|
|
247
248
|
NodeRuntime.runMain({ disableErrorReporting: process.argv[4] !== "inspect" }),
|
|
248
249
|
);
|
|
@@ -106,8 +106,6 @@ export interface MaterializedChannelCapabilityVersion {
|
|
|
106
106
|
readonly extensionsSchemaJson: Readonly<Record<string, unknown>>;
|
|
107
107
|
readonly featuresJson: AgentChannel.Features;
|
|
108
108
|
readonly exposure: typeof AgentChannel.Exposure.Type;
|
|
109
|
-
/** Absent for the original protocol. */
|
|
110
|
-
readonly protocol?: AgentChannel.Protocol;
|
|
111
109
|
readonly requiredChecks: typeof AgentChannel.RequiredChecks.Type;
|
|
112
110
|
}
|
|
113
111
|
export type MaterializedCapabilityVersion =
|
|
@@ -112,8 +112,11 @@ export const toHandlers = (
|
|
|
112
112
|
handlers: Declarations,
|
|
113
113
|
): Effect.Effect<Context.Context<never>> =>
|
|
114
114
|
Effect.gen(function* () {
|
|
115
|
-
const
|
|
116
|
-
const
|
|
115
|
+
const context = yield* Effect.context();
|
|
116
|
+
const services = withoutGroups(context);
|
|
117
|
+
// Composed capability layers of the same plugin share one handler group.
|
|
118
|
+
const inherited = context.mapUnsafe.get(handlerGroupKey(plugin.identifier));
|
|
119
|
+
const map = new Map(Predicate.isMap(inherited) ? inherited : []);
|
|
117
120
|
// A declared but invalid handler, such as `null` from JavaScript, fails when it is used.
|
|
118
121
|
const find = (kind: string, declarations: unknown, localId: string) => {
|
|
119
122
|
const handler = getNestedHandler(declarations, localId);
|