@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
@@ -2,20 +2,13 @@ import { Any as Any$1, Value } from "./AuthMethod.js";
2
2
  import "./AgentChannel.js";
3
3
  import { Context, Effect, Pipeable, Schema } from "effect";
4
4
  declare namespace AgentChannel_d_exports {
5
- export { AccessOutcome, AgentChannel, Any, Asset, AssetFile, ChannelError, ChannelOptions, CheckedResult, Command, CommandFor, CommandV2, Content, ContextMessage, Contract, Definition, DeliveryUpdate, Destination, Echo, ErrorCode, Event, EventV2, Exposure, FailureCode, Features, Handler, HandlerContext, HandlerError, Key, Message, Operation, OperationKind, Plan, PlanItem, Protocol, Reaction, Request, RequiredChecks, ResolvedAuth, Result, ResultFor, ResultV2, RuntimeContract, Stop, Timestamp, TypeId, Verification, VerifiedIdentity, WebhookResponse, commandSchema, commandSchemaV2, handlerKey, isAgentChannel, make, projectContract, resultSchema, resultSchemaV2, schemasFor, validateDefinition };
5
+ export { AccessOutcome, AgentChannel, Any, Asset, AssetFile, ChannelError, ChannelOptions, CheckedResult, Command, CommandFor, Content, ContextMessage, Contract, Definition, DeliveryUpdate, Destination, Echo, ErrorCode, Event, Exposure, FailureCode, Features, Handler, HandlerContext, HandlerError, Key, Message, Operation, OperationKind, Plan, PlanItem, Reaction, Request, RequiredChecks, ResolvedAuth, Result, ResultFor, RuntimeContract, Stop, Timestamp, TypeId, Verification, VerifiedIdentity, WebhookResponse, commandSchema, contextResult, handlerKey, isAgentChannel, make, projectContract, resultByteLimit, resultSchema, validateDefinition };
6
6
  }
7
7
  export declare const TypeId: "@dual-os/sdk/AgentChannel";
8
8
  export type TypeId = typeof TypeId;
9
9
  /** Keys are opaque and installation-scoped. Never parse them into product identities. */
10
10
  export declare const Key: Schema.NonEmptyString;
11
- /**
12
- * The command and result schemas a version uses. Absent means the original protocol, whose
13
- * projection stays byte-identical for contracts already published with it. `v2` adds the stop
14
- * event, conversation reads and output operations.
15
- */
16
- export declare const Protocol: Schema.Literals<readonly ["v2"]>;
17
- export type Protocol = typeof Protocol.Type;
18
- /** What a `v2` destination can show. Every channel shows `present_outcome`. */
11
+ /** What a destination can show. Every channel shows `present_outcome`. */
19
12
  export declare const OperationKind: Schema.Literals<readonly ["present_outcome", "create_message", "update_message", "delete_message", "set_reaction", "set_activity", "render_plan"]>;
20
13
  export type OperationKind = typeof OperationKind.Type;
21
14
  export declare const Features: Schema.Struct<{
@@ -28,9 +21,9 @@ export declare const Features: Schema.Struct<{
28
21
  /** Maximum Unicode code points per physical text message, including server-added prefixes. */
29
22
  readonly maxTextLength: Schema.optionalKey<Schema.Int>;
30
23
  readonly mentions: Schema.Boolean;
31
- /** `v2` only: the output operations every destination of this version shows. */
24
+ /** Every definition declares operations; retired catalog contracts still decode without them. */
32
25
  readonly operations: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["present_outcome", "create_message", "update_message", "delete_message", "set_reaction", "set_activity", "render_plan"]>>>;
33
- /** `v2` only: whether `read_context` returns the conversation's earlier messages. */
26
+ /** Whether `read_context` returns the conversation's earlier messages. */
34
27
  readonly readContext: Schema.optionalKey<Schema.Boolean>;
35
28
  readonly replies: Schema.Boolean;
36
29
  /** Maximum age of the original responding input before preparation and delivery. */
@@ -68,7 +61,10 @@ export declare const Request: Schema.Struct<{
68
61
  readonly url: Schema.String;
69
62
  }>;
70
63
  export type Request = typeof Request.Type;
71
- /** Bounded provider-required webhook response, returned only after request verification. */
64
+ /**
65
+ * Bounded provider-required webhook response, returned only after request verification. A 204 or
66
+ * 205 response has an empty body.
67
+ */
72
68
  export declare const WebhookResponse: Schema.Struct<{
73
69
  readonly body: Schema.String;
74
70
  readonly headers: Schema.optionalKey<Schema.$Record<Schema.NonEmptyString, Schema.String>>;
@@ -144,54 +140,7 @@ export declare const Echo: Schema.Struct<{
144
140
  readonly messageKey: Schema.NonEmptyString;
145
141
  readonly timestamp: Schema.String;
146
142
  }>;
147
- export declare const Event: Schema.Union<readonly [Schema.Struct<{
148
- readonly content: Schema.Struct<{
149
- readonly assets: Schema.optionalKey<Schema.$Array<Schema.Struct<{
150
- readonly assetKey: Schema.NonEmptyString;
151
- readonly mediaType: Schema.NonEmptyString;
152
- readonly url: Schema.String;
153
- }>>>;
154
- readonly mentions: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
155
- readonly replyToMessageKey: Schema.optionalKey<Schema.NonEmptyString>;
156
- readonly text: Schema.String;
157
- }>;
158
- readonly conversation: Schema.Struct<{
159
- readonly conversationKey: Schema.NonEmptyString;
160
- readonly kind: Schema.Literals<readonly ["direct", "group"]>;
161
- readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
162
- }>;
163
- readonly eventKey: Schema.NonEmptyString;
164
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
165
- readonly kind: Schema.Literal<"message">;
166
- readonly messageKey: Schema.NonEmptyString;
167
- readonly respond: Schema.Boolean;
168
- readonly senderKey: Schema.NonEmptyString;
169
- readonly timestamp: Schema.String;
170
- }>, Schema.Struct<{
171
- readonly conversation: Schema.Struct<{
172
- readonly conversationKey: Schema.NonEmptyString;
173
- readonly kind: Schema.Literals<readonly ["direct", "group"]>;
174
- readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
175
- }>;
176
- readonly senderKey: Schema.NonEmptyString;
177
- readonly eventKey: Schema.NonEmptyString;
178
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
179
- readonly kind: Schema.Literal<"echo">;
180
- readonly messageKey: Schema.NonEmptyString;
181
- readonly timestamp: Schema.String;
182
- }>, Schema.Struct<{
183
- readonly deliveryKey: Schema.NonEmptyString;
184
- readonly deliveryUpdateKey: Schema.NonEmptyString;
185
- readonly eventKey: Schema.NonEmptyString;
186
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
187
- readonly kind: Schema.Literal<"delivery_update">;
188
- readonly providerDeliveryKey: Schema.NonEmptyString;
189
- readonly sequence: Schema.Natural;
190
- readonly status: Schema.Literals<readonly ["succeeded", "failed"]>;
191
- readonly timestamp: Schema.String;
192
- }>]>;
193
- export type Event = typeof Event.Type;
194
- /** `v2`: the sender asked the agent to stop working in this conversation. Access applies. */
143
+ /** The sender asked the agent to stop working in this conversation. Access applies. */
195
144
  export declare const Stop: Schema.Struct<{
196
145
  readonly conversation: Schema.Struct<{
197
146
  readonly conversationKey: Schema.NonEmptyString;
@@ -204,7 +153,7 @@ export declare const Stop: Schema.Struct<{
204
153
  readonly kind: Schema.Literal<"stop">;
205
154
  readonly timestamp: Schema.String;
206
155
  }>;
207
- export declare const EventV2: Schema.Union<readonly [Schema.Struct<{
156
+ export declare const Event: Schema.Union<readonly [Schema.Struct<{
208
157
  readonly content: Schema.Struct<{
209
158
  readonly assets: Schema.optionalKey<Schema.$Array<Schema.Struct<{
210
159
  readonly assetKey: Schema.NonEmptyString;
@@ -261,8 +210,8 @@ export declare const EventV2: Schema.Union<readonly [Schema.Struct<{
261
210
  readonly kind: Schema.Literal<"stop">;
262
211
  readonly timestamp: Schema.String;
263
212
  }>]>;
264
- export type EventV2 = typeof EventV2.Type;
265
- /** The reactions every `v2` provider can show. Each provider maps them to its own emoji. */
213
+ export type Event = typeof Event.Type;
214
+ /** The reactions every provider can show. Each provider maps them to its own emoji. */
266
215
  export declare const Reaction: Schema.Literals<readonly ["thumbs_up", "thumbs_down", "laugh", "confused", "heart", "hooray", "rocket", "eyes"]>;
267
216
  export type Reaction = typeof Reaction.Type;
268
217
  export declare const PlanItem: Schema.Struct<{
@@ -283,7 +232,7 @@ export declare const Plan: Schema.Struct<{
283
232
  }>;
284
233
  export type Plan = typeof Plan.Type;
285
234
  /**
286
- * One piece of `v2` output. A `reference` is the `providerDeliveryKey` the provider returned for
235
+ * One piece of output. A `reference` is the `providerDeliveryKey` the provider returned for
287
236
  * the message or plan it made; only that provider reads it.
288
237
  */
289
238
  export declare const Operation: Schema.Union<readonly [Schema.Struct<{
@@ -394,181 +343,6 @@ export declare const commandSchema: <State extends Schema.Top>(state: State) =>
394
343
  readonly method: Schema.Literals<readonly ["GET", "POST", "PUT", "PATCH", "DELETE"]>;
395
344
  readonly url: Schema.String;
396
345
  }>;
397
- }>, Schema.Struct<{
398
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
399
- readonly operationKey: Schema.NonEmptyString;
400
- readonly installationKey: Schema.NonEmptyString;
401
- readonly state: State;
402
- readonly kind: Schema.Literal<"deliver">;
403
- readonly deliveryKey: Schema.NonEmptyString;
404
- readonly destination: Schema.Struct<{
405
- readonly conversationKey: Schema.NonEmptyString;
406
- readonly kind: Schema.Literals<readonly ["direct", "group"]>;
407
- readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
408
- }>;
409
- readonly content: Schema.Struct<{
410
- readonly assets: Schema.optionalKey<Schema.$Array<Schema.Struct<{
411
- readonly assetKey: Schema.NonEmptyString;
412
- readonly mediaType: Schema.NonEmptyString;
413
- readonly url: Schema.String;
414
- }>>>;
415
- readonly mentions: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
416
- readonly replyToMessageKey: Schema.optionalKey<Schema.NonEmptyString>;
417
- readonly text: Schema.String;
418
- }>;
419
- /** Original responding input timestamp; retries must preserve this reference. */
420
- readonly responseToTimestamp: Schema.optionalKey<Schema.String>;
421
- }>]>, Schema.Struct<{
422
- readonly asset: Schema.Struct<{
423
- readonly assetKey: Schema.NonEmptyString;
424
- readonly mediaType: Schema.NonEmptyString;
425
- readonly url: Schema.String;
426
- }>;
427
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
428
- readonly identity: Schema.Struct<{
429
- readonly conversation: Schema.Struct<{
430
- readonly conversationKey: Schema.NonEmptyString;
431
- readonly kind: Schema.Literals<readonly ["direct", "group"]>;
432
- readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
433
- }>;
434
- readonly senderKey: Schema.NonEmptyString;
435
- }>;
436
- readonly installationKey: Schema.NonEmptyString;
437
- readonly kind: Schema.Literal<"read_asset">;
438
- readonly operationKey: Schema.NonEmptyString;
439
- readonly state: State;
440
- }>]>;
441
- export declare const resultSchema: <State extends Schema.Top>(state: State) => Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
442
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
443
- readonly operationKey: Schema.NonEmptyString;
444
- readonly kind: Schema.Literal<"activate">;
445
- readonly installationKey: Schema.NonEmptyString;
446
- readonly state: State;
447
- /** Durable read-only provider state that the host must persist before retrying activation. */
448
- readonly checkpoint: Schema.optionalKey<Schema.Literal<true>>;
449
- /** The host must observe a verified webhook handshake before cutover. */
450
- readonly verification: Schema.optionalKey<Schema.Literal<"ingress">>;
451
- }>, Schema.Struct<{
452
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
453
- readonly operationKey: Schema.NonEmptyString;
454
- readonly kind: Schema.Literal<"deactivate">;
455
- }>, Schema.Struct<{
456
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
457
- readonly operationKey: Schema.NonEmptyString;
458
- readonly kind: Schema.Literal<"receive">;
459
- readonly verified: Schema.Literal<true>;
460
- readonly deniedEventKeys: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
461
- readonly events: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
462
- readonly content: Schema.Struct<{
463
- readonly assets: Schema.optionalKey<Schema.$Array<Schema.Struct<{
464
- readonly assetKey: Schema.NonEmptyString;
465
- readonly mediaType: Schema.NonEmptyString;
466
- readonly url: Schema.String;
467
- }>>>;
468
- readonly mentions: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
469
- readonly replyToMessageKey: Schema.optionalKey<Schema.NonEmptyString>;
470
- readonly text: Schema.String;
471
- }>;
472
- readonly conversation: Schema.Struct<{
473
- readonly conversationKey: Schema.NonEmptyString;
474
- readonly kind: Schema.Literals<readonly ["direct", "group"]>;
475
- readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
476
- }>;
477
- readonly eventKey: Schema.NonEmptyString;
478
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
479
- readonly kind: Schema.Literal<"message">;
480
- readonly messageKey: Schema.NonEmptyString;
481
- readonly respond: Schema.Boolean;
482
- readonly senderKey: Schema.NonEmptyString;
483
- readonly timestamp: Schema.String;
484
- }>, Schema.Struct<{
485
- readonly conversation: Schema.Struct<{
486
- readonly conversationKey: Schema.NonEmptyString;
487
- readonly kind: Schema.Literals<readonly ["direct", "group"]>;
488
- readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
489
- }>;
490
- readonly senderKey: Schema.NonEmptyString;
491
- readonly eventKey: Schema.NonEmptyString;
492
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
493
- readonly kind: Schema.Literal<"echo">;
494
- readonly messageKey: Schema.NonEmptyString;
495
- readonly timestamp: Schema.String;
496
- }>, Schema.Struct<{
497
- readonly deliveryKey: Schema.NonEmptyString;
498
- readonly deliveryUpdateKey: Schema.NonEmptyString;
499
- readonly eventKey: Schema.NonEmptyString;
500
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
501
- readonly kind: Schema.Literal<"delivery_update">;
502
- readonly providerDeliveryKey: Schema.NonEmptyString;
503
- readonly sequence: Schema.Natural;
504
- readonly status: Schema.Literals<readonly ["succeeded", "failed"]>;
505
- readonly timestamp: Schema.String;
506
- }>]>>;
507
- readonly response: Schema.optionalKey<Schema.Struct<{
508
- readonly body: Schema.String;
509
- readonly headers: Schema.optionalKey<Schema.$Record<Schema.NonEmptyString, Schema.String>>;
510
- readonly status: Schema.Int;
511
- }>>;
512
- /** A provider-native setup challenge or ping proved the configured ingress. */
513
- readonly activationProof: Schema.optionalKey<Schema.Literal<"verified">>;
514
- }>, Schema.Struct<{
515
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
516
- readonly operationKey: Schema.NonEmptyString;
517
- readonly kind: Schema.Literal<"deliver">;
518
- readonly deliveryKey: Schema.NonEmptyString;
519
- readonly status: Schema.Literal<"succeeded">;
520
- readonly providerDeliveryKey: Schema.NonEmptyString;
521
- }>, Schema.Struct<{
522
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
523
- readonly operationKey: Schema.NonEmptyString;
524
- readonly kind: Schema.Literal<"deliver">;
525
- readonly deliveryKey: Schema.NonEmptyString;
526
- readonly status: Schema.Literal<"pending">;
527
- readonly providerDeliveryKey: Schema.NonEmptyString;
528
- }>, Schema.Struct<{
529
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
530
- readonly operationKey: Schema.NonEmptyString;
531
- readonly kind: Schema.Literal<"deliver">;
532
- readonly deliveryKey: Schema.NonEmptyString;
533
- readonly status: Schema.Literal<"failed">;
534
- readonly code: Schema.Literals<readonly ["rejected", "unauthorized", "rate_limited", "unavailable", "window_closed"]>;
535
- }>]>, Schema.Struct<{
536
- readonly assetKey: Schema.NonEmptyString;
537
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
538
- readonly file: Schema.Struct<{
539
- readonly _tag: Schema.tag<"ToolFile">;
540
- readonly contentBase64: Schema.String;
541
- readonly contentType: Schema.NullOr<Schema.String>;
542
- readonly filename: Schema.NullOr<Schema.String>;
543
- readonly sizeBytes: Schema.Natural;
544
- }>;
545
- readonly kind: Schema.Literal<"read_asset">;
546
- readonly operationKey: Schema.NonEmptyString;
547
- }>]>;
548
- export declare const commandSchemaV2: <State extends Schema.Top>(state: State) => Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
549
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
550
- readonly operationKey: Schema.NonEmptyString;
551
- readonly kind: Schema.Literal<"activate">;
552
- readonly ingressUrl: Schema.String;
553
- readonly state: Schema.optionalKey<State>;
554
- }>, Schema.Struct<{
555
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
556
- readonly operationKey: Schema.NonEmptyString;
557
- readonly installationKey: Schema.NonEmptyString;
558
- readonly state: State;
559
- readonly kind: Schema.Literal<"deactivate">;
560
- }>, Schema.Struct<{
561
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
562
- readonly operationKey: Schema.NonEmptyString;
563
- readonly installationKey: Schema.NonEmptyString;
564
- readonly state: State;
565
- readonly kind: Schema.Literal<"receive">;
566
- readonly request: Schema.Struct<{
567
- readonly body: Schema.String;
568
- readonly headers: Schema.$Record<Schema.NonEmptyString, Schema.String>;
569
- readonly method: Schema.Literals<readonly ["GET", "POST", "PUT", "PATCH", "DELETE"]>;
570
- readonly url: Schema.String;
571
- }>;
572
346
  }>, Schema.Struct<{
573
347
  readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
574
348
  readonly operationKey: Schema.NonEmptyString;
@@ -667,7 +441,7 @@ export declare const commandSchemaV2: <State extends Schema.Top>(state: State) =
667
441
  readonly operationKey: Schema.NonEmptyString;
668
442
  readonly state: State;
669
443
  }>]>;
670
- export declare const resultSchemaV2: <State extends Schema.Top>(state: State) => Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
444
+ export declare const resultSchema: <State extends Schema.Top>(state: State) => Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
671
445
  readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
672
446
  readonly operationKey: Schema.NonEmptyString;
673
447
  readonly kind: Schema.Literal<"activate">;
@@ -800,682 +574,13 @@ export declare const resultSchemaV2: <State extends Schema.Top>(state: State) =>
800
574
  }>]>;
801
575
  export type Command<State extends Schema.Top = Schema.Unknown> = ReturnType<typeof commandSchema<State>>["Type"];
802
576
  export type Result<State extends Schema.Top = Schema.Unknown> = ReturnType<typeof resultSchema<State>>["Type"];
803
- export type CommandV2<State extends Schema.Top = Schema.Unknown> = ReturnType<typeof commandSchemaV2<State>>["Type"];
804
- export type ResultV2<State extends Schema.Top = Schema.Unknown> = ReturnType<typeof resultSchemaV2<State>>["Type"];
805
- /** The command and result schemas of a Channel's protocol. */
806
- export declare const schemasFor: (definition: Pick<Definition, "protocol" | "state">) => {
807
- command: Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
808
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
809
- readonly operationKey: Schema.NonEmptyString;
810
- readonly kind: Schema.Literal<"activate">;
811
- readonly ingressUrl: Schema.String;
812
- readonly state: Schema.optionalKey<Schema.Top>;
813
- }>, Schema.Struct<{
814
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
815
- readonly operationKey: Schema.NonEmptyString;
816
- readonly installationKey: Schema.NonEmptyString;
817
- readonly state: Schema.Top;
818
- readonly kind: Schema.Literal<"deactivate">;
819
- }>, Schema.Struct<{
820
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
821
- readonly operationKey: Schema.NonEmptyString;
822
- readonly installationKey: Schema.NonEmptyString;
823
- readonly state: Schema.Top;
824
- readonly kind: Schema.Literal<"receive">;
825
- readonly request: Schema.Struct<{
826
- readonly body: Schema.String;
827
- readonly headers: Schema.$Record<Schema.NonEmptyString, Schema.String>;
828
- readonly method: Schema.Literals<readonly ["GET", "POST", "PUT", "PATCH", "DELETE"]>;
829
- readonly url: Schema.String;
830
- }>;
831
- }>, Schema.Struct<{
832
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
833
- readonly operationKey: Schema.NonEmptyString;
834
- readonly installationKey: Schema.NonEmptyString;
835
- readonly state: Schema.Top;
836
- readonly kind: Schema.Literal<"deliver">;
837
- /** The provider message that started the turn, when the host knows it. */
838
- readonly activationMessageKey: Schema.optionalKey<Schema.NonEmptyString>;
839
- readonly deliveryKey: Schema.NonEmptyString;
840
- readonly destination: Schema.Struct<{
841
- readonly conversationKey: Schema.NonEmptyString;
842
- readonly kind: Schema.Literals<readonly ["direct", "group"]>;
843
- readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
844
- }>;
845
- readonly operation: Schema.Union<readonly [Schema.Struct<{
846
- readonly kind: Schema.Literal<"present_outcome">;
847
- readonly options: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
848
- readonly outcome: Schema.Literals<readonly ["completed", "failed", "awaiting_input"]>;
849
- readonly text: Schema.String;
850
- }>, Schema.Struct<{
851
- readonly kind: Schema.Literal<"create_message">;
852
- readonly messageKey: Schema.NonEmptyString;
853
- readonly text: Schema.String;
854
- }>, Schema.Struct<{
855
- readonly kind: Schema.Literal<"update_message">;
856
- readonly messageKey: Schema.NonEmptyString;
857
- readonly reference: Schema.NonEmptyString;
858
- readonly text: Schema.String;
859
- }>, Schema.Struct<{
860
- readonly kind: Schema.Literal<"delete_message">;
861
- readonly messageKey: Schema.NonEmptyString;
862
- readonly reference: Schema.NonEmptyString;
863
- }>, Schema.Struct<{
864
- readonly active: Schema.Boolean;
865
- readonly kind: Schema.Literal<"set_reaction">;
866
- readonly reaction: Schema.Literals<readonly ["thumbs_up", "thumbs_down", "laugh", "confused", "heart", "hooray", "rocket", "eyes"]>;
867
- readonly target: Schema.Union<readonly [Schema.Struct<{
868
- readonly kind: Schema.Literal<"activation">;
869
- }>, Schema.Struct<{
870
- readonly kind: Schema.Literal<"message">;
871
- readonly reference: Schema.NonEmptyString;
872
- }>]>;
873
- }>, Schema.Struct<{
874
- readonly activity: Schema.Union<readonly [Schema.Struct<{
875
- readonly kind: Schema.Literal<"working">;
876
- readonly text: Schema.optionalKey<Schema.NonEmptyString>;
877
- }>, Schema.Struct<{
878
- readonly kind: Schema.Literal<"idle">;
879
- }>]>;
880
- readonly kind: Schema.Literal<"set_activity">;
881
- }>, Schema.Struct<{
882
- readonly kind: Schema.Literal<"render_plan">;
883
- readonly plan: Schema.Struct<{
884
- readonly items: Schema.$Array<Schema.Struct<{
885
- readonly itemKey: Schema.NonEmptyString;
886
- readonly note: Schema.optionalKey<Schema.NonEmptyString>;
887
- readonly state: Schema.Literals<readonly ["pending", "in_progress", "completed", "failed"]>;
888
- readonly title: Schema.NonEmptyString;
889
- }>>;
890
- readonly title: Schema.optionalKey<Schema.NonEmptyString>;
891
- }>;
892
- readonly reference: Schema.optionalKey<Schema.NonEmptyString>;
893
- readonly revision: Schema.Int;
894
- }>]>;
895
- /** Original responding input timestamp; retries must preserve this reference. */
896
- readonly responseToTimestamp: Schema.optionalKey<Schema.String>;
897
- }>, Schema.Struct<{
898
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
899
- readonly operationKey: Schema.NonEmptyString;
900
- readonly installationKey: Schema.NonEmptyString;
901
- readonly state: Schema.Top;
902
- readonly kind: Schema.Literal<"read_context">;
903
- readonly destination: Schema.Struct<{
904
- readonly conversationKey: Schema.NonEmptyString;
905
- readonly kind: Schema.Literals<readonly ["direct", "group"]>;
906
- readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
907
- }>;
908
- readonly limit: Schema.Int;
909
- }>]>, Schema.Struct<{
910
- readonly asset: Schema.Struct<{
911
- readonly assetKey: Schema.NonEmptyString;
912
- readonly mediaType: Schema.NonEmptyString;
913
- readonly url: Schema.String;
914
- }>;
915
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
916
- readonly identity: Schema.Struct<{
917
- readonly conversation: Schema.Struct<{
918
- readonly conversationKey: Schema.NonEmptyString;
919
- readonly kind: Schema.Literals<readonly ["direct", "group"]>;
920
- readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
921
- }>;
922
- readonly senderKey: Schema.NonEmptyString;
923
- }>;
924
- readonly installationKey: Schema.NonEmptyString;
925
- readonly kind: Schema.Literal<"read_asset">;
926
- readonly operationKey: Schema.NonEmptyString;
927
- readonly state: Schema.Top;
928
- }>]>;
929
- result: Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
930
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
931
- readonly operationKey: Schema.NonEmptyString;
932
- readonly kind: Schema.Literal<"activate">;
933
- readonly installationKey: Schema.NonEmptyString;
934
- readonly state: Schema.Top;
935
- /** Durable read-only provider state that the host must persist before retrying activation. */
936
- readonly checkpoint: Schema.optionalKey<Schema.Literal<true>>;
937
- /** The host must observe a verified webhook handshake before cutover. */
938
- readonly verification: Schema.optionalKey<Schema.Literal<"ingress">>;
939
- }>, Schema.Struct<{
940
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
941
- readonly operationKey: Schema.NonEmptyString;
942
- readonly kind: Schema.Literal<"deactivate">;
943
- }>, Schema.Struct<{
944
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
945
- readonly operationKey: Schema.NonEmptyString;
946
- readonly kind: Schema.Literal<"receive">;
947
- readonly verified: Schema.Literal<true>;
948
- readonly deniedEventKeys: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
949
- readonly events: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
950
- readonly content: Schema.Struct<{
951
- readonly assets: Schema.optionalKey<Schema.$Array<Schema.Struct<{
952
- readonly assetKey: Schema.NonEmptyString;
953
- readonly mediaType: Schema.NonEmptyString;
954
- readonly url: Schema.String;
955
- }>>>;
956
- readonly mentions: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
957
- readonly replyToMessageKey: Schema.optionalKey<Schema.NonEmptyString>;
958
- readonly text: Schema.String;
959
- }>;
960
- readonly conversation: Schema.Struct<{
961
- readonly conversationKey: Schema.NonEmptyString;
962
- readonly kind: Schema.Literals<readonly ["direct", "group"]>;
963
- readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
964
- }>;
965
- readonly eventKey: Schema.NonEmptyString;
966
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
967
- readonly kind: Schema.Literal<"message">;
968
- readonly messageKey: Schema.NonEmptyString;
969
- readonly respond: Schema.Boolean;
970
- readonly senderKey: Schema.NonEmptyString;
971
- readonly timestamp: Schema.String;
972
- }>, Schema.Struct<{
973
- readonly conversation: Schema.Struct<{
974
- readonly conversationKey: Schema.NonEmptyString;
975
- readonly kind: Schema.Literals<readonly ["direct", "group"]>;
976
- readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
977
- }>;
978
- readonly senderKey: Schema.NonEmptyString;
979
- readonly eventKey: Schema.NonEmptyString;
980
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
981
- readonly kind: Schema.Literal<"echo">;
982
- readonly messageKey: Schema.NonEmptyString;
983
- readonly timestamp: Schema.String;
984
- }>, Schema.Struct<{
985
- readonly deliveryKey: Schema.NonEmptyString;
986
- readonly deliveryUpdateKey: Schema.NonEmptyString;
987
- readonly eventKey: Schema.NonEmptyString;
988
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
989
- readonly kind: Schema.Literal<"delivery_update">;
990
- readonly providerDeliveryKey: Schema.NonEmptyString;
991
- readonly sequence: Schema.Natural;
992
- readonly status: Schema.Literals<readonly ["succeeded", "failed"]>;
993
- readonly timestamp: Schema.String;
994
- }>, Schema.Struct<{
995
- readonly conversation: Schema.Struct<{
996
- readonly conversationKey: Schema.NonEmptyString;
997
- readonly kind: Schema.Literals<readonly ["direct", "group"]>;
998
- readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
999
- }>;
1000
- readonly senderKey: Schema.NonEmptyString;
1001
- readonly eventKey: Schema.NonEmptyString;
1002
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1003
- readonly kind: Schema.Literal<"stop">;
1004
- readonly timestamp: Schema.String;
1005
- }>]>>;
1006
- readonly response: Schema.optionalKey<Schema.Struct<{
1007
- readonly body: Schema.String;
1008
- readonly headers: Schema.optionalKey<Schema.$Record<Schema.NonEmptyString, Schema.String>>;
1009
- readonly status: Schema.Int;
1010
- }>>;
1011
- /** A provider-native setup challenge or ping proved the configured ingress. */
1012
- readonly activationProof: Schema.optionalKey<Schema.Literal<"verified">>;
1013
- }>, Schema.Struct<{
1014
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1015
- readonly operationKey: Schema.NonEmptyString;
1016
- readonly kind: Schema.Literal<"deliver">;
1017
- readonly deliveryKey: Schema.NonEmptyString;
1018
- readonly status: Schema.Literal<"succeeded">;
1019
- readonly providerDeliveryKey: Schema.NonEmptyString;
1020
- }>, Schema.Struct<{
1021
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1022
- readonly operationKey: Schema.NonEmptyString;
1023
- readonly kind: Schema.Literal<"deliver">;
1024
- readonly deliveryKey: Schema.NonEmptyString;
1025
- readonly status: Schema.Literal<"pending">;
1026
- readonly providerDeliveryKey: Schema.NonEmptyString;
1027
- }>, Schema.Struct<{
1028
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1029
- readonly operationKey: Schema.NonEmptyString;
1030
- readonly kind: Schema.Literal<"deliver">;
1031
- readonly deliveryKey: Schema.NonEmptyString;
1032
- readonly status: Schema.Literal<"failed">;
1033
- readonly code: Schema.Literals<readonly ["rejected", "unauthorized", "rate_limited", "unavailable", "window_closed"]>;
1034
- }>, Schema.Struct<{
1035
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1036
- readonly operationKey: Schema.NonEmptyString;
1037
- readonly kind: Schema.Literal<"read_context">;
1038
- readonly messages: Schema.$Array<Schema.Struct<{
1039
- readonly messageKey: Schema.NonEmptyString;
1040
- /** The agent's own message. */
1041
- readonly own: Schema.Boolean;
1042
- readonly senderKey: Schema.NonEmptyString;
1043
- readonly senderName: Schema.optionalKey<Schema.NonEmptyString>;
1044
- readonly text: Schema.String;
1045
- readonly timestamp: Schema.String;
1046
- }>>;
1047
- }>]>, Schema.Struct<{
1048
- readonly assetKey: Schema.NonEmptyString;
1049
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1050
- readonly file: Schema.Struct<{
1051
- readonly _tag: Schema.tag<"ToolFile">;
1052
- readonly contentBase64: Schema.String;
1053
- readonly contentType: Schema.NullOr<Schema.String>;
1054
- readonly filename: Schema.NullOr<Schema.String>;
1055
- readonly sizeBytes: Schema.Natural;
1056
- }>;
1057
- readonly kind: Schema.Literal<"read_asset">;
1058
- readonly operationKey: Schema.NonEmptyString;
1059
- }>]>;
1060
- typeResult: Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
1061
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1062
- readonly operationKey: Schema.NonEmptyString;
1063
- readonly kind: Schema.Literal<"activate">;
1064
- readonly installationKey: Schema.NonEmptyString;
1065
- readonly state: Schema.toType<Schema.Top>;
1066
- /** Durable read-only provider state that the host must persist before retrying activation. */
1067
- readonly checkpoint: Schema.optionalKey<Schema.Literal<true>>;
1068
- /** The host must observe a verified webhook handshake before cutover. */
1069
- readonly verification: Schema.optionalKey<Schema.Literal<"ingress">>;
1070
- }>, Schema.Struct<{
1071
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1072
- readonly operationKey: Schema.NonEmptyString;
1073
- readonly kind: Schema.Literal<"deactivate">;
1074
- }>, Schema.Struct<{
1075
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1076
- readonly operationKey: Schema.NonEmptyString;
1077
- readonly kind: Schema.Literal<"receive">;
1078
- readonly verified: Schema.Literal<true>;
1079
- readonly deniedEventKeys: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
1080
- readonly events: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
1081
- readonly content: Schema.Struct<{
1082
- readonly assets: Schema.optionalKey<Schema.$Array<Schema.Struct<{
1083
- readonly assetKey: Schema.NonEmptyString;
1084
- readonly mediaType: Schema.NonEmptyString;
1085
- readonly url: Schema.String;
1086
- }>>>;
1087
- readonly mentions: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
1088
- readonly replyToMessageKey: Schema.optionalKey<Schema.NonEmptyString>;
1089
- readonly text: Schema.String;
1090
- }>;
1091
- readonly conversation: Schema.Struct<{
1092
- readonly conversationKey: Schema.NonEmptyString;
1093
- readonly kind: Schema.Literals<readonly ["direct", "group"]>;
1094
- readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
1095
- }>;
1096
- readonly eventKey: Schema.NonEmptyString;
1097
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1098
- readonly kind: Schema.Literal<"message">;
1099
- readonly messageKey: Schema.NonEmptyString;
1100
- readonly respond: Schema.Boolean;
1101
- readonly senderKey: Schema.NonEmptyString;
1102
- readonly timestamp: Schema.String;
1103
- }>, Schema.Struct<{
1104
- readonly conversation: Schema.Struct<{
1105
- readonly conversationKey: Schema.NonEmptyString;
1106
- readonly kind: Schema.Literals<readonly ["direct", "group"]>;
1107
- readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
1108
- }>;
1109
- readonly senderKey: Schema.NonEmptyString;
1110
- readonly eventKey: Schema.NonEmptyString;
1111
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1112
- readonly kind: Schema.Literal<"echo">;
1113
- readonly messageKey: Schema.NonEmptyString;
1114
- readonly timestamp: Schema.String;
1115
- }>, Schema.Struct<{
1116
- readonly deliveryKey: Schema.NonEmptyString;
1117
- readonly deliveryUpdateKey: Schema.NonEmptyString;
1118
- readonly eventKey: Schema.NonEmptyString;
1119
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1120
- readonly kind: Schema.Literal<"delivery_update">;
1121
- readonly providerDeliveryKey: Schema.NonEmptyString;
1122
- readonly sequence: Schema.Natural;
1123
- readonly status: Schema.Literals<readonly ["succeeded", "failed"]>;
1124
- readonly timestamp: Schema.String;
1125
- }>, Schema.Struct<{
1126
- readonly conversation: Schema.Struct<{
1127
- readonly conversationKey: Schema.NonEmptyString;
1128
- readonly kind: Schema.Literals<readonly ["direct", "group"]>;
1129
- readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
1130
- }>;
1131
- readonly senderKey: Schema.NonEmptyString;
1132
- readonly eventKey: Schema.NonEmptyString;
1133
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1134
- readonly kind: Schema.Literal<"stop">;
1135
- readonly timestamp: Schema.String;
1136
- }>]>>;
1137
- readonly response: Schema.optionalKey<Schema.Struct<{
1138
- readonly body: Schema.String;
1139
- readonly headers: Schema.optionalKey<Schema.$Record<Schema.NonEmptyString, Schema.String>>;
1140
- readonly status: Schema.Int;
1141
- }>>;
1142
- /** A provider-native setup challenge or ping proved the configured ingress. */
1143
- readonly activationProof: Schema.optionalKey<Schema.Literal<"verified">>;
1144
- }>, Schema.Struct<{
1145
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1146
- readonly operationKey: Schema.NonEmptyString;
1147
- readonly kind: Schema.Literal<"deliver">;
1148
- readonly deliveryKey: Schema.NonEmptyString;
1149
- readonly status: Schema.Literal<"succeeded">;
1150
- readonly providerDeliveryKey: Schema.NonEmptyString;
1151
- }>, Schema.Struct<{
1152
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1153
- readonly operationKey: Schema.NonEmptyString;
1154
- readonly kind: Schema.Literal<"deliver">;
1155
- readonly deliveryKey: Schema.NonEmptyString;
1156
- readonly status: Schema.Literal<"pending">;
1157
- readonly providerDeliveryKey: Schema.NonEmptyString;
1158
- }>, Schema.Struct<{
1159
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1160
- readonly operationKey: Schema.NonEmptyString;
1161
- readonly kind: Schema.Literal<"deliver">;
1162
- readonly deliveryKey: Schema.NonEmptyString;
1163
- readonly status: Schema.Literal<"failed">;
1164
- readonly code: Schema.Literals<readonly ["rejected", "unauthorized", "rate_limited", "unavailable", "window_closed"]>;
1165
- }>, Schema.Struct<{
1166
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1167
- readonly operationKey: Schema.NonEmptyString;
1168
- readonly kind: Schema.Literal<"read_context">;
1169
- readonly messages: Schema.$Array<Schema.Struct<{
1170
- readonly messageKey: Schema.NonEmptyString;
1171
- /** The agent's own message. */
1172
- readonly own: Schema.Boolean;
1173
- readonly senderKey: Schema.NonEmptyString;
1174
- readonly senderName: Schema.optionalKey<Schema.NonEmptyString>;
1175
- readonly text: Schema.String;
1176
- readonly timestamp: Schema.String;
1177
- }>>;
1178
- }>]>, Schema.Struct<{
1179
- readonly assetKey: Schema.NonEmptyString;
1180
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1181
- readonly file: Schema.Struct<{
1182
- readonly _tag: Schema.tag<"ToolFile">;
1183
- readonly contentBase64: Schema.String;
1184
- readonly contentType: Schema.NullOr<Schema.String>;
1185
- readonly filename: Schema.NullOr<Schema.String>;
1186
- readonly sizeBytes: Schema.Natural;
1187
- }>;
1188
- readonly kind: Schema.Literal<"read_asset">;
1189
- readonly operationKey: Schema.NonEmptyString;
1190
- }>]>;
1191
- } | {
1192
- command: Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
1193
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1194
- readonly operationKey: Schema.NonEmptyString;
1195
- readonly kind: Schema.Literal<"activate">;
1196
- readonly ingressUrl: Schema.String;
1197
- readonly state: Schema.optionalKey<Schema.Top>;
1198
- }>, Schema.Struct<{
1199
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1200
- readonly operationKey: Schema.NonEmptyString;
1201
- readonly installationKey: Schema.NonEmptyString;
1202
- readonly state: Schema.Top;
1203
- readonly kind: Schema.Literal<"deactivate">;
1204
- }>, Schema.Struct<{
1205
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1206
- readonly operationKey: Schema.NonEmptyString;
1207
- readonly installationKey: Schema.NonEmptyString;
1208
- readonly state: Schema.Top;
1209
- readonly kind: Schema.Literal<"receive">;
1210
- readonly request: Schema.Struct<{
1211
- readonly body: Schema.String;
1212
- readonly headers: Schema.$Record<Schema.NonEmptyString, Schema.String>;
1213
- readonly method: Schema.Literals<readonly ["GET", "POST", "PUT", "PATCH", "DELETE"]>;
1214
- readonly url: Schema.String;
1215
- }>;
1216
- }>, Schema.Struct<{
1217
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1218
- readonly operationKey: Schema.NonEmptyString;
1219
- readonly installationKey: Schema.NonEmptyString;
1220
- readonly state: Schema.Top;
1221
- readonly kind: Schema.Literal<"deliver">;
1222
- readonly deliveryKey: Schema.NonEmptyString;
1223
- readonly destination: Schema.Struct<{
1224
- readonly conversationKey: Schema.NonEmptyString;
1225
- readonly kind: Schema.Literals<readonly ["direct", "group"]>;
1226
- readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
1227
- }>;
1228
- readonly content: Schema.Struct<{
1229
- readonly assets: Schema.optionalKey<Schema.$Array<Schema.Struct<{
1230
- readonly assetKey: Schema.NonEmptyString;
1231
- readonly mediaType: Schema.NonEmptyString;
1232
- readonly url: Schema.String;
1233
- }>>>;
1234
- readonly mentions: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
1235
- readonly replyToMessageKey: Schema.optionalKey<Schema.NonEmptyString>;
1236
- readonly text: Schema.String;
1237
- }>;
1238
- /** Original responding input timestamp; retries must preserve this reference. */
1239
- readonly responseToTimestamp: Schema.optionalKey<Schema.String>;
1240
- }>]>, Schema.Struct<{
1241
- readonly asset: Schema.Struct<{
1242
- readonly assetKey: Schema.NonEmptyString;
1243
- readonly mediaType: Schema.NonEmptyString;
1244
- readonly url: Schema.String;
1245
- }>;
1246
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1247
- readonly identity: Schema.Struct<{
1248
- readonly conversation: Schema.Struct<{
1249
- readonly conversationKey: Schema.NonEmptyString;
1250
- readonly kind: Schema.Literals<readonly ["direct", "group"]>;
1251
- readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
1252
- }>;
1253
- readonly senderKey: Schema.NonEmptyString;
1254
- }>;
1255
- readonly installationKey: Schema.NonEmptyString;
1256
- readonly kind: Schema.Literal<"read_asset">;
1257
- readonly operationKey: Schema.NonEmptyString;
1258
- readonly state: Schema.Top;
1259
- }>]>;
1260
- result: Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
1261
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1262
- readonly operationKey: Schema.NonEmptyString;
1263
- readonly kind: Schema.Literal<"activate">;
1264
- readonly installationKey: Schema.NonEmptyString;
1265
- readonly state: Schema.Top;
1266
- /** Durable read-only provider state that the host must persist before retrying activation. */
1267
- readonly checkpoint: Schema.optionalKey<Schema.Literal<true>>;
1268
- /** The host must observe a verified webhook handshake before cutover. */
1269
- readonly verification: Schema.optionalKey<Schema.Literal<"ingress">>;
1270
- }>, Schema.Struct<{
1271
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1272
- readonly operationKey: Schema.NonEmptyString;
1273
- readonly kind: Schema.Literal<"deactivate">;
1274
- }>, Schema.Struct<{
1275
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1276
- readonly operationKey: Schema.NonEmptyString;
1277
- readonly kind: Schema.Literal<"receive">;
1278
- readonly verified: Schema.Literal<true>;
1279
- readonly deniedEventKeys: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
1280
- readonly events: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
1281
- readonly content: Schema.Struct<{
1282
- readonly assets: Schema.optionalKey<Schema.$Array<Schema.Struct<{
1283
- readonly assetKey: Schema.NonEmptyString;
1284
- readonly mediaType: Schema.NonEmptyString;
1285
- readonly url: Schema.String;
1286
- }>>>;
1287
- readonly mentions: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
1288
- readonly replyToMessageKey: Schema.optionalKey<Schema.NonEmptyString>;
1289
- readonly text: Schema.String;
1290
- }>;
1291
- readonly conversation: Schema.Struct<{
1292
- readonly conversationKey: Schema.NonEmptyString;
1293
- readonly kind: Schema.Literals<readonly ["direct", "group"]>;
1294
- readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
1295
- }>;
1296
- readonly eventKey: Schema.NonEmptyString;
1297
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1298
- readonly kind: Schema.Literal<"message">;
1299
- readonly messageKey: Schema.NonEmptyString;
1300
- readonly respond: Schema.Boolean;
1301
- readonly senderKey: Schema.NonEmptyString;
1302
- readonly timestamp: Schema.String;
1303
- }>, Schema.Struct<{
1304
- readonly conversation: Schema.Struct<{
1305
- readonly conversationKey: Schema.NonEmptyString;
1306
- readonly kind: Schema.Literals<readonly ["direct", "group"]>;
1307
- readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
1308
- }>;
1309
- readonly senderKey: Schema.NonEmptyString;
1310
- readonly eventKey: Schema.NonEmptyString;
1311
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1312
- readonly kind: Schema.Literal<"echo">;
1313
- readonly messageKey: Schema.NonEmptyString;
1314
- readonly timestamp: Schema.String;
1315
- }>, Schema.Struct<{
1316
- readonly deliveryKey: Schema.NonEmptyString;
1317
- readonly deliveryUpdateKey: Schema.NonEmptyString;
1318
- readonly eventKey: Schema.NonEmptyString;
1319
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1320
- readonly kind: Schema.Literal<"delivery_update">;
1321
- readonly providerDeliveryKey: Schema.NonEmptyString;
1322
- readonly sequence: Schema.Natural;
1323
- readonly status: Schema.Literals<readonly ["succeeded", "failed"]>;
1324
- readonly timestamp: Schema.String;
1325
- }>]>>;
1326
- readonly response: Schema.optionalKey<Schema.Struct<{
1327
- readonly body: Schema.String;
1328
- readonly headers: Schema.optionalKey<Schema.$Record<Schema.NonEmptyString, Schema.String>>;
1329
- readonly status: Schema.Int;
1330
- }>>;
1331
- /** A provider-native setup challenge or ping proved the configured ingress. */
1332
- readonly activationProof: Schema.optionalKey<Schema.Literal<"verified">>;
1333
- }>, Schema.Struct<{
1334
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1335
- readonly operationKey: Schema.NonEmptyString;
1336
- readonly kind: Schema.Literal<"deliver">;
1337
- readonly deliveryKey: Schema.NonEmptyString;
1338
- readonly status: Schema.Literal<"succeeded">;
1339
- readonly providerDeliveryKey: Schema.NonEmptyString;
1340
- }>, Schema.Struct<{
1341
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1342
- readonly operationKey: Schema.NonEmptyString;
1343
- readonly kind: Schema.Literal<"deliver">;
1344
- readonly deliveryKey: Schema.NonEmptyString;
1345
- readonly status: Schema.Literal<"pending">;
1346
- readonly providerDeliveryKey: Schema.NonEmptyString;
1347
- }>, Schema.Struct<{
1348
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1349
- readonly operationKey: Schema.NonEmptyString;
1350
- readonly kind: Schema.Literal<"deliver">;
1351
- readonly deliveryKey: Schema.NonEmptyString;
1352
- readonly status: Schema.Literal<"failed">;
1353
- readonly code: Schema.Literals<readonly ["rejected", "unauthorized", "rate_limited", "unavailable", "window_closed"]>;
1354
- }>]>, Schema.Struct<{
1355
- readonly assetKey: Schema.NonEmptyString;
1356
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1357
- readonly file: Schema.Struct<{
1358
- readonly _tag: Schema.tag<"ToolFile">;
1359
- readonly contentBase64: Schema.String;
1360
- readonly contentType: Schema.NullOr<Schema.String>;
1361
- readonly filename: Schema.NullOr<Schema.String>;
1362
- readonly sizeBytes: Schema.Natural;
1363
- }>;
1364
- readonly kind: Schema.Literal<"read_asset">;
1365
- readonly operationKey: Schema.NonEmptyString;
1366
- }>]>;
1367
- typeResult: Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
1368
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1369
- readonly operationKey: Schema.NonEmptyString;
1370
- readonly kind: Schema.Literal<"activate">;
1371
- readonly installationKey: Schema.NonEmptyString;
1372
- readonly state: Schema.toType<Schema.Top>;
1373
- /** Durable read-only provider state that the host must persist before retrying activation. */
1374
- readonly checkpoint: Schema.optionalKey<Schema.Literal<true>>;
1375
- /** The host must observe a verified webhook handshake before cutover. */
1376
- readonly verification: Schema.optionalKey<Schema.Literal<"ingress">>;
1377
- }>, Schema.Struct<{
1378
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1379
- readonly operationKey: Schema.NonEmptyString;
1380
- readonly kind: Schema.Literal<"deactivate">;
1381
- }>, Schema.Struct<{
1382
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1383
- readonly operationKey: Schema.NonEmptyString;
1384
- readonly kind: Schema.Literal<"receive">;
1385
- readonly verified: Schema.Literal<true>;
1386
- readonly deniedEventKeys: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
1387
- readonly events: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
1388
- readonly content: Schema.Struct<{
1389
- readonly assets: Schema.optionalKey<Schema.$Array<Schema.Struct<{
1390
- readonly assetKey: Schema.NonEmptyString;
1391
- readonly mediaType: Schema.NonEmptyString;
1392
- readonly url: Schema.String;
1393
- }>>>;
1394
- readonly mentions: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
1395
- readonly replyToMessageKey: Schema.optionalKey<Schema.NonEmptyString>;
1396
- readonly text: Schema.String;
1397
- }>;
1398
- readonly conversation: Schema.Struct<{
1399
- readonly conversationKey: Schema.NonEmptyString;
1400
- readonly kind: Schema.Literals<readonly ["direct", "group"]>;
1401
- readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
1402
- }>;
1403
- readonly eventKey: Schema.NonEmptyString;
1404
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1405
- readonly kind: Schema.Literal<"message">;
1406
- readonly messageKey: Schema.NonEmptyString;
1407
- readonly respond: Schema.Boolean;
1408
- readonly senderKey: Schema.NonEmptyString;
1409
- readonly timestamp: Schema.String;
1410
- }>, Schema.Struct<{
1411
- readonly conversation: Schema.Struct<{
1412
- readonly conversationKey: Schema.NonEmptyString;
1413
- readonly kind: Schema.Literals<readonly ["direct", "group"]>;
1414
- readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
1415
- }>;
1416
- readonly senderKey: Schema.NonEmptyString;
1417
- readonly eventKey: Schema.NonEmptyString;
1418
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1419
- readonly kind: Schema.Literal<"echo">;
1420
- readonly messageKey: Schema.NonEmptyString;
1421
- readonly timestamp: Schema.String;
1422
- }>, Schema.Struct<{
1423
- readonly deliveryKey: Schema.NonEmptyString;
1424
- readonly deliveryUpdateKey: Schema.NonEmptyString;
1425
- readonly eventKey: Schema.NonEmptyString;
1426
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1427
- readonly kind: Schema.Literal<"delivery_update">;
1428
- readonly providerDeliveryKey: Schema.NonEmptyString;
1429
- readonly sequence: Schema.Natural;
1430
- readonly status: Schema.Literals<readonly ["succeeded", "failed"]>;
1431
- readonly timestamp: Schema.String;
1432
- }>]>>;
1433
- readonly response: Schema.optionalKey<Schema.Struct<{
1434
- readonly body: Schema.String;
1435
- readonly headers: Schema.optionalKey<Schema.$Record<Schema.NonEmptyString, Schema.String>>;
1436
- readonly status: Schema.Int;
1437
- }>>;
1438
- /** A provider-native setup challenge or ping proved the configured ingress. */
1439
- readonly activationProof: Schema.optionalKey<Schema.Literal<"verified">>;
1440
- }>, Schema.Struct<{
1441
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1442
- readonly operationKey: Schema.NonEmptyString;
1443
- readonly kind: Schema.Literal<"deliver">;
1444
- readonly deliveryKey: Schema.NonEmptyString;
1445
- readonly status: Schema.Literal<"succeeded">;
1446
- readonly providerDeliveryKey: Schema.NonEmptyString;
1447
- }>, Schema.Struct<{
1448
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1449
- readonly operationKey: Schema.NonEmptyString;
1450
- readonly kind: Schema.Literal<"deliver">;
1451
- readonly deliveryKey: Schema.NonEmptyString;
1452
- readonly status: Schema.Literal<"pending">;
1453
- readonly providerDeliveryKey: Schema.NonEmptyString;
1454
- }>, Schema.Struct<{
1455
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1456
- readonly operationKey: Schema.NonEmptyString;
1457
- readonly kind: Schema.Literal<"deliver">;
1458
- readonly deliveryKey: Schema.NonEmptyString;
1459
- readonly status: Schema.Literal<"failed">;
1460
- readonly code: Schema.Literals<readonly ["rejected", "unauthorized", "rate_limited", "unavailable", "window_closed"]>;
1461
- }>]>, Schema.Struct<{
1462
- readonly assetKey: Schema.NonEmptyString;
1463
- readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1464
- readonly file: Schema.Struct<{
1465
- readonly _tag: Schema.tag<"ToolFile">;
1466
- readonly contentBase64: Schema.String;
1467
- readonly contentType: Schema.NullOr<Schema.String>;
1468
- readonly filename: Schema.NullOr<Schema.String>;
1469
- readonly sizeBytes: Schema.Natural;
1470
- }>;
1471
- readonly kind: Schema.Literal<"read_asset">;
1472
- readonly operationKey: Schema.NonEmptyString;
1473
- }>]>;
1474
- };
1475
- /**
1476
- * Encoded, JSON-safe runtime result suitable for host persistence. It accepts both protocols;
1477
- * a `v1` result decodes unchanged.
1478
- */
577
+ /** Maximum UTF-8 bytes in an ordinary Channel command or result, including its JSON envelope. */
578
+ export declare const resultByteLimit = 2097152;
579
+ /** Keep the newest context messages within the checked result budget, oldest first. */
580
+ export declare function contextResult(operationKey: string, context: readonly ContextMessage[]): Extract<Result, {
581
+ readonly kind: "read_context";
582
+ }>;
583
+ /** Encoded, JSON-safe runtime result suitable for host persistence. */
1479
584
  export declare const CheckedResult: Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
1480
585
  readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1481
586
  readonly operationKey: Schema.NonEmptyString;
@@ -1624,9 +729,9 @@ export declare const Contract: Schema.Struct<{
1624
729
  /** Maximum Unicode code points per physical text message, including server-added prefixes. */
1625
730
  readonly maxTextLength: Schema.optionalKey<Schema.Int>;
1626
731
  readonly mentions: Schema.Boolean;
1627
- /** `v2` only: the output operations every destination of this version shows. */
732
+ /** Every definition declares operations; retired catalog contracts still decode without them. */
1628
733
  readonly operations: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["present_outcome", "create_message", "update_message", "delete_message", "set_reaction", "set_activity", "render_plan"]>>>;
1629
- /** `v2` only: whether `read_context` returns the conversation's earlier messages. */
734
+ /** Whether `read_context` returns the conversation's earlier messages. */
1630
735
  readonly readContext: Schema.optionalKey<Schema.Boolean>;
1631
736
  readonly replies: Schema.Boolean;
1632
737
  /** Maximum age of the original responding input before preparation and delivery. */
@@ -1635,14 +740,11 @@ export declare const Contract: Schema.Struct<{
1635
740
  }>;
1636
741
  readonly operationInputSchemaJson: Schema.Codec<Schema.Json, Schema.Json, never, never>;
1637
742
  readonly operationOutputSchemaJson: Schema.Codec<Schema.Json, Schema.Json, never, never>;
1638
- readonly protocol: Schema.optionalKey<Schema.Literals<readonly ["v2"]>>;
1639
743
  readonly requiredChecks: Schema.Tuple<readonly [Schema.Literal<"access">]>;
1640
744
  readonly stateSchemaJson: Schema.Codec<Schema.Json, Schema.Json, never, never>;
1641
745
  }>;
1642
746
  export type Contract = typeof Contract.Type;
1643
747
  export interface Definition<Settings extends Schema.Top = Schema.Top, Mappings extends Schema.Top = Schema.Top, State extends Schema.Top = Schema.Top, Methods extends readonly Any$1[] = readonly Any$1[]> {
1644
- /** Absent for the original protocol. Publish a new release to change it. */
1645
- readonly protocol?: Protocol;
1646
748
  readonly definitionSettings: Settings;
1647
749
  readonly deploymentSettings: Mappings;
1648
750
  readonly state: State;
@@ -1679,14 +781,10 @@ export type HandlerContext<D extends Definition> = {
1679
781
  } : {
1680
782
  readonly auth: ResolvedAuth<D["authMethods"]>;
1681
783
  });
1682
- /** The command a Channel's handler receives, by its protocol. */
1683
- export type CommandFor<D extends Definition> = D extends {
1684
- readonly protocol: "v2";
1685
- } ? CommandV2<D["state"]> : Command<D["state"]>;
1686
- /** The result a Channel's handler returns, by its protocol. */
1687
- export type ResultFor<D extends Definition> = D extends {
1688
- readonly protocol: "v2";
1689
- } ? ResultV2<D["state"]> : Result<D["state"]>;
784
+ /** The command a Channel's handler receives. */
785
+ export type CommandFor<D extends Definition> = Command<D["state"]>;
786
+ /** The result a Channel's handler returns. */
787
+ export type ResultFor<D extends Definition> = Result<D["state"]>;
1690
788
  export interface RuntimeContract<D extends Definition, R = never> {
1691
789
  readonly verify: (request: Request, context: HandlerContext<D>) => Effect.Effect<Verification, HandlerError, R>;
1692
790
  readonly checkAccess: (identity: VerifiedIdentity, context: HandlerContext<D>) => Effect.Effect<AccessOutcome, HandlerError, R>;
@@ -1712,6 +810,5 @@ export interface ChannelOptions {
1712
810
  /** Create a Channel from its contract. */
1713
811
  export declare const make: <const Id extends string, const O extends Definition & ChannelOptions>(identifier: Id, options: O) => AgentChannel<Id, O>;
1714
812
  export declare const isAgentChannel: (value: unknown) => value is Any;
1715
- //#endregion
1716
813
  export { AgentChannel_d_exports };
1717
814
  //# sourceMappingURL=AgentChannel.d.ts.map