@dual-os/telegram 8.0.4 → 8.0.5

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.
@@ -93,11 +93,10 @@ import {
93
93
  EncodingError,
94
94
  encode2,
95
95
  decode2,
96
- fail2,
97
96
  findErrorOption,
98
97
  hasInterrupts,
99
98
  succeed3,
100
- empty3,
99
+ empty2,
101
100
  effect,
102
101
  effectContext,
103
102
  provide,
@@ -131,15 +130,11 @@ import {
131
130
  serviceOption,
132
131
  updateContext,
133
132
  provideService,
134
- acquireRelease,
135
133
  ensuring,
136
134
  onError,
137
135
  interrupt,
138
136
  fnUntraced,
139
137
  fn,
140
- offerUnsafe,
141
- failCauseUnsafe,
142
- endUnsafe,
143
138
  encode3,
144
139
  decode3,
145
140
  make4,
@@ -203,7 +198,6 @@ import {
203
198
  toJsonSchemaDocument,
204
199
  toCodecJson,
205
200
  Json,
206
- callback2,
207
201
  interruptWhen,
208
202
  ensuring2,
209
203
  runForEach,
@@ -228,9 +222,9 @@ import {
228
222
  make8,
229
223
  mapRequest,
230
224
  layerMergedContext
231
- } from "./index-wxqy9zdg.js";
225
+ } from "./index-sdgqen8s.js";
232
226
 
233
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/_virtual/_rolldown/runtime.js
227
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/_virtual/_rolldown/runtime.js
234
228
  var __defProp = Object.defineProperty;
235
229
  var __exportAll = (all, no_symbols) => {
236
230
  let target = {};
@@ -1377,7 +1371,7 @@ var tags2 = tags;
1377
1371
  var orElse = orElse3;
1378
1372
  var exhaustive2 = exhaustive;
1379
1373
 
1380
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/DefinitionError.js
1374
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/DefinitionError.js
1381
1375
  var DefinitionIdentifierKindSchema = Literals([
1382
1376
  "dual",
1383
1377
  "plugin",
@@ -1429,7 +1423,7 @@ var DuplicateAuthMethodIdentifierError = class extends TaggedError2()("Duplicate
1429
1423
  }) {
1430
1424
  };
1431
1425
 
1432
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/identifier.js
1426
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/identifier.js
1433
1427
  var identifierSchema = String3.check(isPattern(/^[a-z0-9]+(?:-[a-z0-9]+)*$/));
1434
1428
  var isIdentifier = is(identifierSchema);
1435
1429
  var validateIdentifier = (kind, identifier) => {
@@ -1454,12 +1448,12 @@ var validateIdentifier = (kind, identifier) => {
1454
1448
  });
1455
1449
  };
1456
1450
 
1457
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/proto.js
1451
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/proto.js
1458
1452
  var PipeableProto = { pipe() {
1459
1453
  return pipeArguments(this, arguments);
1460
1454
  } };
1461
1455
 
1462
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/AuthMethodBinding.js
1456
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/AuthMethodBinding.js
1463
1457
  var makeBinding = (options) => ({
1464
1458
  connectionId: options.connectionId,
1465
1459
  method: options.method,
@@ -1469,7 +1463,7 @@ var makeBinding = (options) => ({
1469
1463
  });
1470
1464
  var isBindingForMethod = (binding, method) => binding.method === method;
1471
1465
 
1472
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/OAuth2TokenRefresher.js
1466
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/OAuth2TokenRefresher.js
1473
1467
  var OAuth2TokenRefresher_exports = /* @__PURE__ */ __exportAll({
1474
1468
  OAuth2TokenRefresher: () => OAuth2TokenRefresher_exports,
1475
1469
  Service: () => Service3
@@ -1477,7 +1471,7 @@ var OAuth2TokenRefresher_exports = /* @__PURE__ */ __exportAll({
1477
1471
  var Service3 = class extends Service2()("@dual-os/sdk/AuthMethod/OAuth2TokenRefresher") {
1478
1472
  };
1479
1473
 
1480
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/AuthMethodExecution.js
1474
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/AuthMethodExecution.js
1481
1475
  var hookError = (methodIdentifier, operation, cause) => new AuthMethodHookError({
1482
1476
  cause,
1483
1477
  methodIdentifier,
@@ -1639,7 +1633,7 @@ var test = (method, material, context) => {
1639
1633
  return decodeMaterial(method, material).pipe(flatMap3((decodedMaterial) => testHook === undefined ? succeed4({ ok: true }) : runHook(impl.identifier, "test", () => testHook(decodedMaterial, hookContext(context)))));
1640
1634
  };
1641
1635
 
1642
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/AuthMethod.js
1636
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/AuthMethod.js
1643
1637
  var AuthMethod_exports = /* @__PURE__ */ __exportAll({
1644
1638
  AuthMethodHookError: () => AuthMethodHookError,
1645
1639
  AuthMethodHookOperation: () => AuthMethodHookOperation,
@@ -1813,7 +1807,7 @@ var oauth2 = (identifier, options) => {
1813
1807
  };
1814
1808
  var isAuthMethod = (u) => hasProperty(u, TypeId2);
1815
1809
 
1816
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/ToolFile.js
1810
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/ToolFile.js
1817
1811
  var Schema = TaggedStruct("ToolFile", {
1818
1812
  contentBase64: String3.annotate({
1819
1813
  contentEncoding: "base64",
@@ -1824,7 +1818,7 @@ var Schema = TaggedStruct("ToolFile", {
1824
1818
  sizeBytes: Natural
1825
1819
  });
1826
1820
 
1827
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/AgentChannel.js
1821
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/AgentChannel.js
1828
1822
  var AgentChannel_exports = /* @__PURE__ */ __exportAll({
1829
1823
  AccessOutcome: () => AccessOutcome,
1830
1824
  AgentChannel: () => AgentChannel_exports,
@@ -2396,7 +2390,7 @@ var make9 = (identifier, options) => {
2396
2390
  };
2397
2391
  var isAgentChannel = (value2) => hasProperty(value2, TypeId3);
2398
2392
 
2399
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/auth-runtime.js
2393
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/auth-runtime.js
2400
2394
  var assertNoDuplicateAuthMethodIdentifiers = (providerIdentifier, methods) => {
2401
2395
  const seen = /* @__PURE__ */ new Set;
2402
2396
  for (const method of methods) {
@@ -2409,7 +2403,7 @@ var assertNoDuplicateAuthMethodIdentifiers = (providerIdentifier, methods) => {
2409
2403
  }
2410
2404
  };
2411
2405
 
2412
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/collection-utils.js
2406
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/collection-utils.js
2413
2407
  var appendElements = (existing, additions) => [...existing, ...additions];
2414
2408
 
2415
2409
  // ../../../../node_modules/.bun/effect@4.1.2/node_modules/effect/dist/http/FetchHttpClient.js
@@ -2531,7 +2525,7 @@ var fetch = /* @__PURE__ */ make8((request, url, signal, fiber) => {
2531
2525
  });
2532
2526
  var layer4 = /* @__PURE__ */ layerMergedContext(/* @__PURE__ */ succeed4(fetch));
2533
2527
 
2534
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/Action.js
2528
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/Action.js
2535
2529
  var Action_exports = /* @__PURE__ */ __exportAll({
2536
2530
  ActionHandlerError: () => ActionHandlerError,
2537
2531
  RetryableActionHandlerError: () => RetryableActionHandlerError,
@@ -2644,7 +2638,7 @@ var make10 = (identifier, options) => {
2644
2638
  };
2645
2639
  var isAction = (u) => hasProperty(u, TypeId4);
2646
2640
 
2647
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/handler-context.js
2641
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/handler-context.js
2648
2642
  var groupKeyPrefix = "@dual-os/sdk/Plugin/Handlers/";
2649
2643
  var handlerGroupKey = (pluginId) => `${groupKeyPrefix}${pluginId}`;
2650
2644
  var isGroupKey = startsWith(groupKeyPrefix);
@@ -2665,13 +2659,13 @@ var findHandler = (context, providerId, handlerKey) => {
2665
2659
  return isMap(group) ? group.get(handlerKey) : undefined;
2666
2660
  };
2667
2661
 
2668
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/schema-runtime.js
2662
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/schema-runtime.js
2669
2663
  function decodeJson(schema, value) {
2670
2664
  return decodeUnknownEffect(toCodecJson(schema))(value);
2671
2665
  }
2672
2666
  var decodeJsonMapError = (schema, value, mapError2) => decodeJson(schema, value).pipe(mapError(mapError2));
2673
2667
 
2674
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/ConnectionResolver.js
2668
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/ConnectionResolver.js
2675
2669
  var ConnectionIdNotAllowedError = class extends TaggedError2()("ConnectionIdNotAllowedError", {
2676
2670
  connectionId: String3,
2677
2671
  phase: optional(String3),
@@ -2767,7 +2761,7 @@ var ConnectionResolverStoreError = class extends TaggedError2()("ConnectionResol
2767
2761
  var Service4 = class extends Service2()("@dual-os/sdk/ConnectionResolver") {
2768
2762
  };
2769
2763
 
2770
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/auth-execution.js
2764
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/auth-execution.js
2771
2765
  var knownAuthMethodIds = (methods) => methods.map((method) => method.identifier);
2772
2766
  var fullAuthMethodId = (providerId, method) => `${providerId}/${method.identifier}`;
2773
2767
  var findMethod = (providerId, methods, methodId) => methods.find((method) => method.identifier === methodId || fullAuthMethodId(providerId, method) === methodId);
@@ -2827,7 +2821,7 @@ var resolveRuntimeConnection = (targetKind, targetId, phase, providerId, methods
2827
2821
  });
2828
2822
  });
2829
2823
 
2830
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/trigger-runtime-shared.js
2824
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/trigger-runtime-shared.js
2831
2825
  var decodeConfig = (triggerId, schema, value) => decodeJsonMapError(schema, value, (error) => new InvalidTriggerConfigError({
2832
2826
  description: error.message,
2833
2827
  triggerId
@@ -2962,7 +2956,7 @@ var withRuntimeContext = (entry, phase, connectionId, context2, run) => {
2962
2956
  return resolveRuntimeConnection("trigger", entry.triggerId, phase, entry.providerId, requiredAuthMethods, connectionId, context2).pipe(flatMap3((binding) => run(runtimeContext(authRuntimeContext(binding)))));
2963
2957
  };
2964
2958
 
2965
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/trigger-runtime.js
2959
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/trigger-runtime.js
2966
2960
  var runPhase = (options) => gen2(function* () {
2967
2961
  const { entry, phase, request } = options;
2968
2962
  const runtime = yield* options.hook;
@@ -3045,7 +3039,7 @@ var poll = (entry, request) => runPhase({
3045
3039
  phase: "poll",
3046
3040
  request
3047
3041
  });
3048
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/Trigger.js
3042
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/Trigger.js
3049
3043
  var Trigger_exports = /* @__PURE__ */ __exportAll({
3050
3044
  InvalidTriggerConfigError: () => InvalidTriggerConfigError,
3051
3045
  InvalidTriggerOutputError: () => InvalidTriggerOutputError,
@@ -3257,7 +3251,7 @@ var verify2 = verify;
3257
3251
  var parse3 = parse2;
3258
3252
  var poll2 = poll;
3259
3253
 
3260
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/Group.js
3254
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/Group.js
3261
3255
  var Group_exports = /* @__PURE__ */ __exportAll({
3262
3256
  TypeId: () => TypeId6,
3263
3257
  add: () => add3,
@@ -3319,7 +3313,7 @@ var withAction = dual(2, (value, action) => appendChildren(value, [action], "act
3319
3313
  var withTrigger = dual(2, (value, trigger) => appendChildren(value, [trigger], "trigger"));
3320
3314
  var add3 = dual((args) => isGroup(args[0]), (group, ...children) => appendChildren(group, children));
3321
3315
 
3322
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/children.js
3316
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/children.js
3323
3317
  var partitionChildren = (children) => ({
3324
3318
  actions: children.filter(isAction),
3325
3319
  groups: children.filter(isGroup),
@@ -3359,7 +3353,7 @@ var assertUniqueMixedChildIdentifiers = (ownerKind, ownerIdentifier, existing, a
3359
3353
  assertAdditions(ownerKind, ownerIdentifier, seenChildren(existing), additions.map((addition) => [addition, childKind(addition)]));
3360
3354
  };
3361
3355
 
3362
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/capabilities.js
3356
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/capabilities.js
3363
3357
  var walkCapabilities = (provider, select) => {
3364
3358
  const entries = [];
3365
3359
  const visit = (owner, prefix) => {
@@ -3378,7 +3372,7 @@ var walkCapabilities = (provider, select) => {
3378
3372
  return entries;
3379
3373
  };
3380
3374
 
3381
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/plugin-handlers.js
3375
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/plugin-handlers.js
3382
3376
  var missingDeclaration = (kind, localId, pluginId) => {
3383
3377
  throw new Error(`missing ${kind} handler for "${localId}" in plugin "${pluginId}"`);
3384
3378
  };
@@ -3423,7 +3417,7 @@ var toHandlers = (plugin, handlers) => gen2(function* () {
3423
3417
  return makeUnsafe(/* @__PURE__ */ new Map([[handlerGroupKey(plugin.identifier), map]]));
3424
3418
  });
3425
3419
 
3426
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/Plugin.js
3420
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/Plugin.js
3427
3421
  var Plugin_exports = /* @__PURE__ */ __exportAll({
3428
3422
  TypeId: () => TypeId7,
3429
3423
  add: () => add4,
@@ -3506,7 +3500,7 @@ var make = (identifier) => makePlugin({
3506
3500
  iconUrl: undefined,
3507
3501
  iconUrlDark: undefined,
3508
3502
  identifier,
3509
- layer: empty3,
3503
+ layer: empty2,
3510
3504
  name: undefined,
3511
3505
  sandboxAccess: undefined,
3512
3506
  triggers: []
@@ -3594,7 +3588,7 @@ var toLayer2 = (plugin, build) => effectContext(gen2(function* () {
3594
3588
  return yield* toHandlers(plugin, handlers);
3595
3589
  }));
3596
3590
 
3597
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/AgentChannelRuntime.js
3591
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/AgentChannelRuntime.js
3598
3592
  var ConnectionContext = Struct({
3599
3593
  actor: optionalKey(Union([Struct({
3600
3594
  kind: Literal("user"),
@@ -3631,8 +3625,8 @@ var AccessInput = Struct({
3631
3625
  });
3632
3626
  var Service5 = class extends Service2()("@dual-os/sdk/AgentChannelRuntime") {
3633
3627
  };
3634
- var fail3 = (code) => new ChannelError({ code });
3635
- var safe = (effect2, code) => effect2.pipe(catchCause((cause) => hasInterrupts(cause) ? interrupt : fail5(fail3(code))));
3628
+ var fail2 = (code) => new ChannelError({ code });
3629
+ var safe = (effect2, code) => effect2.pipe(catchCause((cause) => hasInterrupts(cause) ? interrupt : fail5(fail2(code))));
3636
3630
  var AssetResultJson = Json.check(makeFilter((value) => new TextEncoder().encode(JSON.stringify(value)).byteLength <= 14680064));
3637
3631
  var Json2 = Json.check(makeFilter((value) => new TextEncoder().encode(JSON.stringify(value)).byteLength <= resultByteLimit));
3638
3632
  var strict = { onExcessProperty: "error" };
@@ -3652,13 +3646,13 @@ var invokeHandler = (handler, effect2) => effect2.pipe(provideContext(handler.co
3652
3646
  if (hasInterrupts(cause))
3653
3647
  return interrupt;
3654
3648
  const error = findErrorOption(cause);
3655
- return isSome(error) && error.value instanceof ChannelError ? fail5(error.value) : fail5(fail3("provider_failure"));
3649
+ return isSome(error) && error.value instanceof ChannelError ? fail5(error.value) : fail5(fail2("provider_failure"));
3656
3650
  }));
3657
3651
  var checkExtensions = fn("AgentChannelRuntime.checkExtensions")(function* (definition, extensions, code) {
3658
3652
  for (const [key, value] of Object.entries(extensions ?? {})) {
3659
3653
  const schema = definition.extensions?.[key];
3660
3654
  if (schema === undefined)
3661
- return yield* fail3(code);
3655
+ return yield* fail2(code);
3662
3656
  yield* decodeData(toType(schema), value, code);
3663
3657
  }
3664
3658
  });
@@ -3676,14 +3670,14 @@ var ResolveHook = declare((value) => isFunction(value));
3676
3670
  var resolveAuth = fn("AgentChannelRuntime.resolveAuth")(function* (providerId, channelId, definition, connectionId, phase, context2) {
3677
3671
  if (definition.authMethods.length === 0) {
3678
3672
  if (connectionId !== undefined)
3679
- return yield* fail3("invalid_auth");
3673
+ return yield* fail2("invalid_auth");
3680
3674
  return;
3681
3675
  }
3682
3676
  if (connectionId === undefined)
3683
- return yield* fail3("invalid_auth");
3677
+ return yield* fail2("invalid_auth");
3684
3678
  const resolver = yield* serviceOption(Service4);
3685
3679
  if (isNone(resolver))
3686
- return yield* fail3("invalid_auth");
3680
+ return yield* fail2("invalid_auth");
3687
3681
  const raw = yield* safe(suspend(() => resolver.value.resolve({
3688
3682
  connectionId,
3689
3683
  target: {
@@ -3696,10 +3690,10 @@ var resolveAuth = fn("AgentChannelRuntime.resolveAuth")(function* (providerId, c
3696
3690
  })), "invalid_auth");
3697
3691
  const resolved = yield* decode4(Material, raw, "invalid_auth");
3698
3692
  if (resolved.providerId !== providerId || resolved.connectionId !== connectionId)
3699
- return yield* fail3("invalid_auth");
3693
+ return yield* fail2("invalid_auth");
3700
3694
  const method = definition.authMethods.find((method) => resolved.methodId === method.identifier || resolved.methodId === `${providerId}/${method.identifier}`);
3701
3695
  if (method === undefined)
3702
- return yield* fail3("invalid_auth");
3696
+ return yield* fail2("invalid_auth");
3703
3697
  const decodeAuth = (schema, value) => decode4(resolved.encoding === "json" ? toCodecJson(schema) : schema, value, "invalid_auth");
3704
3698
  const setup = method.setup === undefined ? yield* decode4(Undefined, resolved.setup, "invalid_auth") : yield* decodeAuth(method.setup, resolved.setup);
3705
3699
  const material = yield* decodeAuth(method.material, resolved.material);
@@ -3735,13 +3729,13 @@ var layer = (plugins) => effect(Service5, gen2(function* () {
3735
3729
  const pin = yield* decode4(Pin, input, "invalid_input");
3736
3730
  const found = find(plugins, pin);
3737
3731
  if (found === undefined)
3738
- return yield* fail3("not_found");
3732
+ return yield* fail2("not_found");
3739
3733
  yield* safe(sync(() => {
3740
3734
  validateDefinition(found.definition, found.provider.identifier, found.provider.authMethods);
3741
3735
  }), "invalid_definition");
3742
3736
  const handler = fromNullishOr(findHandler(context2, found.provider.identifier, handlerKey(pin.channelId)));
3743
3737
  if (isNone(handler) || !isObject(handler.value.runtime) || !isFunction(handler.value.runtime.execute) || !isFunction(handler.value.runtime.verify) || !isFunction(handler.value.runtime.checkAccess))
3744
- return yield* fail3("handler_unavailable");
3738
+ return yield* fail2("handler_unavailable");
3745
3739
  return found.definition;
3746
3740
  });
3747
3741
  const checkAccess = fn("AgentChannelRuntime.checkAccess")(function* (input) {
@@ -3750,15 +3744,15 @@ var layer = (plugins) => effect(Service5, gen2(function* () {
3750
3744
  const definition = yield* get({ channelId: request.channelId });
3751
3745
  const found = find(plugins, request);
3752
3746
  if (found === undefined)
3753
- return yield* fail3("not_found");
3747
+ return yield* fail2("not_found");
3754
3748
  const definitionSettings = yield* decodeData(definition.definitionSettings, request.definitionSettings, "invalid_input");
3755
3749
  const deploymentSettings = yield* decodeData(definition.deploymentSettings, request.deploymentSettings, "invalid_input");
3756
3750
  if (!checkMessage(definition.features, request.identity.conversation, { text: "" }))
3757
- return yield* fail3("unsupported_feature");
3751
+ return yield* fail2("unsupported_feature");
3758
3752
  const auth = yield* resolveAuth(found.provider.identifier, request.channelId, definition, request.connectionId, "check_access", request.context);
3759
3753
  const handler = fromNullishOr(findHandler(context2, found.provider.identifier, handlerKey(request.channelId)));
3760
3754
  if (isNone(handler))
3761
- return yield* fail3("handler_unavailable");
3755
+ return yield* fail2("handler_unavailable");
3762
3756
  const output = yield* invokeHandler(handler.value, suspend(() => handler.value.runtime.checkAccess(request.identity, {
3763
3757
  definitionSettings,
3764
3758
  deploymentSettings,
@@ -3772,22 +3766,22 @@ var layer = (plugins) => effect(Service5, gen2(function* () {
3772
3766
  const definition = yield* get({ channelId: request.channelId });
3773
3767
  const found = find(plugins, request);
3774
3768
  if (found === undefined)
3775
- return yield* fail3("not_found");
3769
+ return yield* fail2("not_found");
3776
3770
  const definitionSettings = yield* decodeData(definition.definitionSettings, request.definitionSettings, "invalid_input");
3777
3771
  const deploymentSettings = yield* decodeData(definition.deploymentSettings, request.deploymentSettings, "invalid_input");
3778
3772
  const command = yield* decodeData(commandSchema(definition.state), request.command, "invalid_input");
3779
3773
  yield* checkExtensions(definition, command.extensions, "invalid_input");
3780
3774
  if (command.kind === "deliver" && command.operationKey !== command.deliveryKey)
3781
- return yield* fail3("invalid_input");
3775
+ return yield* fail2("invalid_input");
3782
3776
  if (command.kind === "deliver" && !checkDelivery(definition.features, command))
3783
- return yield* fail3("unsupported_feature");
3777
+ return yield* fail2("unsupported_feature");
3784
3778
  if (command.kind === "deliver" && command.operation.kind === "set_reaction" && command.operation.target.kind === "activation" && command.activationMessageKey === undefined)
3785
- return yield* fail3("invalid_input");
3779
+ return yield* fail2("invalid_input");
3786
3780
  if (command.kind === "read_context" && (definition.features.readContext !== true || !checkMessage(definition.features, command.destination, { text: "" })))
3787
- return yield* fail3("unsupported_feature");
3781
+ return yield* fail2("unsupported_feature");
3788
3782
  const handler = fromNullishOr(findHandler(context2, found.provider.identifier, handlerKey(request.channelId)));
3789
3783
  if (isNone(handler))
3790
- return yield* fail3("handler_unavailable");
3784
+ return yield* fail2("handler_unavailable");
3791
3785
  const auth = yield* resolveAuth(found.provider.identifier, request.channelId, definition, request.connectionId, command.kind, request.context);
3792
3786
  const operationKey = command.operationKey;
3793
3787
  const kind = command.kind;
@@ -3799,12 +3793,12 @@ var layer = (plugins) => effect(Service5, gen2(function* () {
3799
3793
  ...auth === undefined ? {} : { auth }
3800
3794
  };
3801
3795
  if (!isFunction(handler.value.runtime.execute) || !isFunction(handler.value.runtime.verify) || !isFunction(handler.value.runtime.checkAccess))
3802
- return yield* fail3("handler_unavailable");
3796
+ return yield* fail2("handler_unavailable");
3803
3797
  if (command.kind === "receive")
3804
3798
  yield* decodeData(Verification, yield* invokeHandler(handler.value, suspend(() => handler.value.runtime.verify(command.request, adapterContext))), "invalid_result");
3805
3799
  if (command.kind === "read_asset") {
3806
3800
  if (!definition.features.assets)
3807
- return yield* fail3("unsupported_feature");
3801
+ return yield* fail2("unsupported_feature");
3808
3802
  if ((yield* decodeData(AccessOutcome, yield* invokeHandler(handler.value, suspend(() => handler.value.runtime.checkAccess(command.identity, adapterContext))), "invalid_result")).decision !== "allow")
3809
3803
  return yield* new ChannelError({
3810
3804
  code: "provider_failure",
@@ -3814,28 +3808,28 @@ var layer = (plugins) => effect(Service5, gen2(function* () {
3814
3808
  const output = yield* invokeHandler(handler.value, suspend(() => handler.value.runtime.execute(command, adapterContext)));
3815
3809
  const result = yield* decodeData(resultSchema(toType(definition.state), definition.features), output, "invalid_result", kind === "read_asset");
3816
3810
  if (result.kind !== kind || result.operationKey !== operationKey || result.kind === "deliver" && result.deliveryKey !== deliveryKey || result.kind === "read_asset" && result.assetKey !== assetKey)
3817
- return yield* fail3("invalid_result");
3811
+ return yield* fail2("invalid_result");
3818
3812
  yield* checkExtensions(definition, result.extensions, "invalid_result");
3819
3813
  if (result.kind === "deliver" && result.status === "pending" && !definition.features.deliveryState)
3820
- return yield* fail3("invalid_result");
3814
+ return yield* fail2("invalid_result");
3821
3815
  const allowedEvents = [];
3822
3816
  const deniedEventKeys = [];
3823
3817
  if (result.kind === "receive") {
3824
3818
  if (result.deniedEventKeys !== undefined)
3825
- return yield* fail3("invalid_result");
3819
+ return yield* fail2("invalid_result");
3826
3820
  if (result.activationProof === "verified" && (result.response === undefined || result.events.length !== 0))
3827
- return yield* fail3("invalid_result");
3821
+ return yield* fail2("invalid_result");
3828
3822
  const eventKeys = /* @__PURE__ */ new Set;
3829
3823
  for (const event of result.events) {
3830
3824
  if (eventKeys.has(event.eventKey))
3831
- return yield* fail3("invalid_result");
3825
+ return yield* fail2("invalid_result");
3832
3826
  eventKeys.add(event.eventKey);
3833
3827
  if (event.kind === "message" && !checkMessage(definition.features, event.conversation, event.content))
3834
- return yield* fail3("invalid_result");
3828
+ return yield* fail2("invalid_result");
3835
3829
  if ((event.kind === "echo" || event.kind === "stop") && !checkMessage(definition.features, event.conversation, { text: "" }))
3836
- return yield* fail3("invalid_result");
3830
+ return yield* fail2("invalid_result");
3837
3831
  if (event.kind === "delivery_update" && !definition.features.deliveryState)
3838
- return yield* fail3("invalid_result");
3832
+ return yield* fail2("invalid_result");
3839
3833
  yield* checkExtensions(definition, event.extensions, "invalid_result");
3840
3834
  let denied = false;
3841
3835
  if (event.kind === "message" || event.kind === "echo" || event.kind === "stop") {
@@ -3878,7 +3872,7 @@ var layer = (plugins) => effect(Service5, gen2(function* () {
3878
3872
  });
3879
3873
  }));
3880
3874
 
3881
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/AiProvider.js
3875
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/AiProvider.js
3882
3876
  var TypeId8 = "@dual-os/sdk/AiProvider";
3883
3877
  var RuntimeConfig = Struct({
3884
3878
  apiKey: optional(String3),
@@ -3936,7 +3930,7 @@ var withAuthMethods2 = dual(2, (provider, methods) => {
3936
3930
  var withAuthMethod2 = dual(2, (provider, method) => withAuthMethods2(provider, [method]));
3937
3931
  var withRuntimeConfig = dual(2, (provider, resolve) => makeProvider2(optionsFromProvider(provider), provider.authMethods, resolve));
3938
3932
 
3939
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/dual/actions.js
3933
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/dual/actions.js
3940
3934
  var entriesOf = (installation) => walkCapabilities(installation.plugin, (owner) => owner.actions).map(({ localId, canonicalId, node }) => ({
3941
3935
  action: node,
3942
3936
  actionId: canonicalId,
@@ -3957,7 +3951,7 @@ var resolveAction = (installations, actionId, version) => {
3957
3951
  return entry === undefined || version !== undefined && entry.pluginVersion !== version ? undefined : entry;
3958
3952
  };
3959
3953
 
3960
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/dual/triggers.js
3954
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/dual/triggers.js
3961
3955
  var entriesOf2 = (installation) => walkCapabilities(installation.plugin, (owner) => owner.triggers).map((walked) => ({
3962
3956
  authMethods: installation.plugin.authMethods,
3963
3957
  localId: walked.localId,
@@ -3978,7 +3972,7 @@ var resolveRuntimeTrigger = (installations, triggerId, version) => {
3978
3972
  return entry === undefined || version !== undefined && entry.pluginVersion !== version ? undefined : entry;
3979
3973
  };
3980
3974
 
3981
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/dual/registry.js
3975
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/dual/registry.js
3982
3976
  var authMethodId = (providerId, methodId) => `${providerId}/${methodId}`;
3983
3977
  var schemaJson = (schema) => toJsonSchemaDocument(schema, { onExcessProperty: "error" });
3984
3978
  var authMethodMetadataJson = (method) => {
@@ -4137,7 +4131,7 @@ var materializeResolvedRegistry = (input) => {
4137
4131
  };
4138
4132
  };
4139
4133
 
4140
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/DualRegistry.js
4134
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/DualRegistry.js
4141
4135
  var TriggerNotFoundError = class extends TaggedError2()("TriggerNotFoundError", { triggerId: String3 }) {
4142
4136
  };
4143
4137
  var materializePlugin = (plugin, options) => ({
@@ -4156,7 +4150,7 @@ var materializePlugin = (plugin, options) => ({
4156
4150
  }).providers
4157
4151
  });
4158
4152
 
4159
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/dual/invoke.js
4153
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/dual/invoke.js
4160
4154
  var FieldIssue = class extends Class("FieldIssue")({
4161
4155
  message: String3,
4162
4156
  path: String3
@@ -4229,7 +4223,7 @@ var invokeResolvedActionJson = (providerId, actionId, pluginVersion, action, aut
4229
4223
  fields: schemaErrorFields(error)
4230
4224
  }))));
4231
4225
 
4232
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/DualRuntime.js
4226
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/DualRuntime.js
4233
4227
  var install = (plugin, version) => ({
4234
4228
  plugin,
4235
4229
  version
@@ -4433,7 +4427,7 @@ var toLayer = (app) => {
4433
4427
  })).pipe(provide(layer(app.plugins.map((installation) => installation.plugin))), provide(app.layer));
4434
4428
  };
4435
4429
 
4436
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/Files.js
4430
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/Files.js
4437
4431
  var File = TaggedStruct("File", {
4438
4432
  contentType: String3,
4439
4433
  id: NonEmptyString,
@@ -4455,7 +4449,7 @@ var write = fnUntraced(function* (file) {
4455
4449
  return yield* (yield* service).write(file);
4456
4450
  });
4457
4451
 
4458
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/OAuthFlow.js
4452
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/OAuthFlow.js
4459
4453
  var OAuthConnectionValidationFailed = class extends TaggedError2()("OAuthConnectionValidationFailed", {
4460
4454
  cause: optionalKey(Redacted(Defect())),
4461
4455
  message: String3
@@ -4871,7 +4865,7 @@ var oauth2TokenRefresherLayer = effect(Service3, gen2(function* () {
4871
4865
  }).pipe(map3((refreshed) => refreshed.tokens)) });
4872
4866
  }));
4873
4867
 
4874
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/remote-runtime.js
4868
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/remote-runtime.js
4875
4869
  var Identity = Struct({
4876
4870
  artifactDigest: String3.check(isPattern(/^[a-f0-9]{128}$/u)),
4877
4871
  invocationId: NonEmptyString,
@@ -5211,7 +5205,7 @@ var execute2 = fn("RemoteRuntime.execute")(function* (request) {
5211
5205
  })));
5212
5206
  });
5213
5207
 
5214
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/PluginRuntime.js
5208
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/PluginRuntime.js
5215
5209
  var PluginExecutionError = class extends TaggedError2()("PluginExecutionError", {
5216
5210
  category: Literals([
5217
5211
  "transport",
@@ -5227,49 +5221,6 @@ var PluginExecutionError = class extends TaggedError2()("PluginExecutionError",
5227
5221
  var maxPayloadBytes = 1048576;
5228
5222
  var maxMetadataBytes = 67108864;
5229
5223
  var maxChannelResultBytes = 16777216;
5230
- function ipcMessages(channel) {
5231
- return callback2((queue) => {
5232
- const message = (value) => {
5233
- offerUnsafe(queue, value);
5234
- };
5235
- const disconnected = () => {
5236
- endUnsafe(queue);
5237
- };
5238
- const failed = (cause) => {
5239
- failCauseUnsafe(queue, fail2(PluginExecutionError.make({
5240
- category: "runner",
5241
- cause: make5(cause),
5242
- message: "Plugin IPC channel failed"
5243
- })));
5244
- };
5245
- return acquireRelease(sync(() => {
5246
- channel.on("message", message);
5247
- channel.on("disconnect", disconnected);
5248
- channel.on("error", failed);
5249
- }), () => sync(() => {
5250
- channel.removeListener("message", message);
5251
- channel.removeListener("disconnect", disconnected);
5252
- channel.removeListener("error", failed);
5253
- }));
5254
- });
5255
- }
5256
- function sendIpc(channel, value) {
5257
- return try_2({
5258
- try: () => {
5259
- if (!channel.connected || channel.send === undefined)
5260
- throw PluginExecutionError.make({
5261
- category: "runner",
5262
- message: "Plugin IPC channel is closed"
5263
- });
5264
- channel.send(value);
5265
- },
5266
- catch: (cause) => PluginExecutionError.make({
5267
- category: "runner",
5268
- cause: make5(cause),
5269
- message: "Cannot send plugin IPC message"
5270
- })
5271
- });
5272
- }
5273
5224
  var OAuthContinuation = Struct({
5274
5225
  expiresAt: DateFromString,
5275
5226
  pkceVerifier: NullOr(String3),
@@ -5337,8 +5288,6 @@ var ExecutionRequest = Union([
5337
5288
  ChannelSettingsRequest
5338
5289
  ]);
5339
5290
  var Request4 = Union([ExecutionRequest, TaggedStruct("extract", { identity: Identity })]);
5340
- var Input2 = Union([Request4, TaggedStruct("cancel", { identity: Identity })]);
5341
- var Output = Union([Response, TaggedStruct("interrupted", { identity: Identity })]);
5342
5291
  function checkMessageSize(value, maximum) {
5343
5292
  if (new TextEncoder().encode(JSON.stringify(value)).byteLength <= maximum)
5344
5293
  return void_2;
@@ -5348,24 +5297,24 @@ function checkMessageSize(value, maximum) {
5348
5297
  }));
5349
5298
  }
5350
5299
  var encodeInput = fnUntraced(function* (input) {
5351
- const encoded = yield* encodeEffect(Input2)(input);
5300
+ const encoded = yield* encodeEffect(Request4)(input);
5352
5301
  yield* checkMessageSize(encoded, maxPayloadBytes);
5353
5302
  return encoded;
5354
5303
  });
5355
5304
  var decodeInput = fnUntraced(function* (input) {
5356
5305
  const json = yield* decodeUnknownEffect(Json)(input);
5357
5306
  yield* checkMessageSize(json, maxPayloadBytes);
5358
- return yield* decodeUnknownEffect(Input2)(json);
5307
+ return yield* decodeUnknownEffect(Request4)(json);
5359
5308
  });
5360
5309
  var encodeOutput = fnUntraced(function* (output, maximum) {
5361
- const encoded = yield* encodeEffect(Output)(output);
5310
+ const encoded = yield* encodeEffect(Response)(output);
5362
5311
  yield* checkMessageSize(encoded, maximum);
5363
5312
  return encoded;
5364
5313
  });
5365
5314
  var decodeOutput = fnUntraced(function* (output) {
5366
5315
  const json = yield* decodeUnknownEffect(Json)(output);
5367
5316
  yield* checkMessageSize(json, maxMetadataBytes);
5368
- return yield* decodeUnknownEffect(Output)(json);
5317
+ return yield* decodeUnknownEffect(Response)(json);
5369
5318
  });
5370
5319
  function responseLimit(request) {
5371
5320
  if ("_tag" in request && request._tag === "extract")
@@ -5518,7 +5467,7 @@ var execute = fnUntraced(function* (request) {
5518
5467
  return yield* executeChannelSettings(request);
5519
5468
  });
5520
5469
 
5521
- export { increment, toLowerCase, replace, trim, slice, isEmpty, isNonEmpty, split, startsWith, endsWith, match, replaceAll, encode, decode, layer3, fromUnknown, value, when, orElse, RequestInit, layer4, Action_exports, ActionHandlerError, AuthMethod_exports, Schema, AgentChannel_exports, Key, Event, commandSchema, materializePlugin, Trigger_exports, fromPlugin, Service, toLayer, File, read, write, Group_exports, layer5, oauth2TokenRefresherLayer, Plugin_exports, make, isPlugin, Identity, filesUnavailable, PluginExecutionError, ipcMessages, sendIpc, decodeInput, encodeOutput, responseLimit, execute };
5470
+ export { increment, toLowerCase, replace, trim, slice, isEmpty, isNonEmpty, split, startsWith, endsWith, match, replaceAll, encode, decode, layer3, fromUnknown, value, when, orElse, RequestInit, layer4, Action_exports, ActionHandlerError, AuthMethod_exports, Schema, AgentChannel_exports, Key, Event, commandSchema, materializePlugin, Trigger_exports, fromPlugin, Service, toLayer, File, read, write, Group_exports, layer5, oauth2TokenRefresherLayer, Plugin_exports, make, isPlugin, filesUnavailable, PluginExecutionError, decodeInput, encodeOutput, responseLimit, execute };
5522
5471
 
5523
- //# debugId=6E22A26BC3C2ED8F64756E2164756E21
5524
- //# sourceMappingURL=index-rakjqjpr.js.map
5472
+ //# debugId=C3E2ABAF7C67856C64756E2164756E21
5473
+ //# sourceMappingURL=index-ppnnem2q.js.map