@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.
Files changed (120) hide show
  1. package/README.md +5 -17
  2. package/dist/Action.d.ts +0 -1
  3. package/dist/Action.js +1 -2
  4. package/dist/AgentChannel.d.ts +27 -930
  5. package/dist/AgentChannel.d.ts.map +1 -1
  6. package/dist/AgentChannel.js +53 -161
  7. package/dist/AgentChannel.js.map +1 -1
  8. package/dist/AgentChannelConformance.d.ts +8 -501
  9. package/dist/AgentChannelConformance.d.ts.map +1 -1
  10. package/dist/AgentChannelConformance.js +4 -5
  11. package/dist/AgentChannelConformance.js.map +1 -1
  12. package/dist/AgentChannelRuntime.d.ts +0 -1
  13. package/dist/AgentChannelRuntime.d.ts.map +1 -1
  14. package/dist/AgentChannelRuntime.js +8 -10
  15. package/dist/AgentChannelRuntime.js.map +1 -1
  16. package/dist/AiProvider.d.ts +0 -1
  17. package/dist/AiProvider.js +1 -2
  18. package/dist/AuthMethod.d.ts +0 -1
  19. package/dist/AuthMethod.js +1 -2
  20. package/dist/AuthMethodBinding.d.ts +0 -1
  21. package/dist/AuthMethodBinding.js +1 -2
  22. package/dist/AuthMethodExecution.d.ts +0 -1
  23. package/dist/AuthMethodExecution.js +1 -2
  24. package/dist/ConnectionResolver.d.ts +0 -1
  25. package/dist/ConnectionResolver.js +1 -2
  26. package/dist/DefinitionError.d.ts +0 -1
  27. package/dist/DefinitionError.js +1 -2
  28. package/dist/DualRegistry.d.ts +0 -1
  29. package/dist/DualRegistry.js +1 -2
  30. package/dist/DualRuntime.d.ts +0 -1
  31. package/dist/DualRuntime.js +1 -2
  32. package/dist/Files.d.ts +0 -1
  33. package/dist/Files.js +1 -2
  34. package/dist/Group.d.ts +0 -1
  35. package/dist/Group.js +1 -2
  36. package/dist/Http.d.ts +0 -1
  37. package/dist/Http.d.ts.map +1 -1
  38. package/dist/Http.js +4 -5
  39. package/dist/Http.js.map +1 -1
  40. package/dist/Mcp.d.ts +0 -1
  41. package/dist/Mcp.js +1 -2
  42. package/dist/OAuth2TokenRefresher.d.ts +0 -1
  43. package/dist/OAuth2TokenRefresher.js +1 -2
  44. package/dist/OAuthFlow.d.ts +0 -1
  45. package/dist/OAuthFlow.js +1 -2
  46. package/dist/Plugin.d.ts +0 -1
  47. package/dist/Plugin.js +1 -2
  48. package/dist/PluginRuntime.d.ts +0 -1
  49. package/dist/PluginRuntime.js +1 -2
  50. package/dist/Runner.js +3 -4
  51. package/dist/Runner.js.map +1 -1
  52. package/dist/ToolFile.d.ts +0 -1
  53. package/dist/ToolFile.js +1 -2
  54. package/dist/Trigger.d.ts +0 -1
  55. package/dist/Trigger.js +1 -2
  56. package/dist/_virtual/_rolldown/runtime.js +1 -2
  57. package/dist/internal/auth-context.d.ts +0 -2
  58. package/dist/internal/auth-context.d.ts.map +1 -1
  59. package/dist/internal/auth-execution.d.ts +0 -2
  60. package/dist/internal/auth-execution.d.ts.map +1 -1
  61. package/dist/internal/auth-execution.js +1 -2
  62. package/dist/internal/auth-runtime.d.ts +0 -2
  63. package/dist/internal/auth-runtime.d.ts.map +1 -1
  64. package/dist/internal/auth-runtime.js +1 -2
  65. package/dist/internal/capabilities.d.ts +0 -2
  66. package/dist/internal/capabilities.d.ts.map +1 -1
  67. package/dist/internal/capabilities.js +1 -2
  68. package/dist/internal/children.d.ts +0 -2
  69. package/dist/internal/children.d.ts.map +1 -1
  70. package/dist/internal/children.js +1 -2
  71. package/dist/internal/collection-utils.d.ts +0 -2
  72. package/dist/internal/collection-utils.d.ts.map +1 -1
  73. package/dist/internal/collection-utils.js +1 -2
  74. package/dist/internal/dual/actions.d.ts +0 -2
  75. package/dist/internal/dual/actions.d.ts.map +1 -1
  76. package/dist/internal/dual/actions.js +1 -2
  77. package/dist/internal/dual/invoke.d.ts +0 -2
  78. package/dist/internal/dual/invoke.d.ts.map +1 -1
  79. package/dist/internal/dual/invoke.js +1 -2
  80. package/dist/internal/dual/registry.d.ts +1 -5
  81. package/dist/internal/dual/registry.d.ts.map +1 -1
  82. package/dist/internal/dual/registry.js +1 -2
  83. package/dist/internal/dual/registry.js.map +1 -1
  84. package/dist/internal/dual/triggers.d.ts +0 -2
  85. package/dist/internal/dual/triggers.d.ts.map +1 -1
  86. package/dist/internal/dual/triggers.js +1 -2
  87. package/dist/internal/handler-context.d.ts +0 -2
  88. package/dist/internal/handler-context.d.ts.map +1 -1
  89. package/dist/internal/handler-context.js +1 -2
  90. package/dist/internal/identifier.d.ts +0 -2
  91. package/dist/internal/identifier.d.ts.map +1 -1
  92. package/dist/internal/identifier.js +1 -2
  93. package/dist/internal/plugin-handlers.d.ts +0 -2
  94. package/dist/internal/plugin-handlers.d.ts.map +1 -1
  95. package/dist/internal/plugin-handlers.js +5 -4
  96. package/dist/internal/plugin-handlers.js.map +1 -1
  97. package/dist/internal/proto.d.ts +0 -2
  98. package/dist/internal/proto.d.ts.map +1 -1
  99. package/dist/internal/proto.js +1 -2
  100. package/dist/internal/schema-runtime.d.ts +0 -2
  101. package/dist/internal/schema-runtime.d.ts.map +1 -1
  102. package/dist/internal/schema-runtime.js +1 -2
  103. package/dist/internal/trigger-runtime-shared.d.ts +0 -2
  104. package/dist/internal/trigger-runtime-shared.d.ts.map +1 -1
  105. package/dist/internal/trigger-runtime-shared.js +1 -2
  106. package/dist/internal/trigger-runtime.d.ts +0 -2
  107. package/dist/internal/trigger-runtime.d.ts.map +1 -1
  108. package/dist/internal/trigger-runtime.js +1 -2
  109. package/dist/internal/types.d.ts +0 -2
  110. package/dist/internal/types.d.ts.map +1 -1
  111. package/dist/remote-runtime.d.ts +0 -1
  112. package/dist/remote-runtime.js +1 -2
  113. package/package.json +6 -7
  114. package/src/AgentChannel.ts +52 -150
  115. package/src/AgentChannelConformance.ts +2 -6
  116. package/src/AgentChannelRuntime.ts +11 -14
  117. package/src/Http.ts +21 -4
  118. package/src/Runner.ts +5 -4
  119. package/src/internal/dual/registry.ts +0 -2
  120. 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.make(request.method)(`${declared.origin}${next.pathname}${next.search}`, {
665
- headers: request.headers,
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.make(request.method)(url, { body: request.body });
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<NodeServices.NodeServices>();
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
- // @effect-diagnostics-next-line strictEffectProvide:off -- This executable owns the guest process services.
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 services = withoutGroups(yield* Effect.context());
116
- const map = new Map<string, unknown>();
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);