@dual-os/sdk 0.0.0-stage → 0.8.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +4 -0
- package/README.md +19 -2
- package/dist/Action.d.ts +201 -0
- package/dist/Action.d.ts.map +1 -0
- package/dist/Action.js +172 -0
- package/dist/Action.js.map +1 -0
- package/dist/AgentChannel.d.ts +1717 -0
- package/dist/AgentChannel.d.ts.map +1 -0
- package/dist/AgentChannel.js +708 -0
- package/dist/AgentChannel.js.map +1 -0
- package/dist/AgentChannelConformance.d.ts +1543 -0
- package/dist/AgentChannelConformance.d.ts.map +1 -0
- package/dist/AgentChannelConformance.js +163 -0
- package/dist/AgentChannelConformance.js.map +1 -0
- package/dist/AgentChannelRuntime.d.ts +78 -0
- package/dist/AgentChannelRuntime.d.ts.map +1 -0
- package/dist/AgentChannelRuntime.js +270 -0
- package/dist/AgentChannelRuntime.js.map +1 -0
- package/dist/AiProvider.d.ts +132 -0
- package/dist/AiProvider.d.ts.map +1 -0
- package/dist/AiProvider.js +100 -0
- package/dist/AiProvider.js.map +1 -0
- package/dist/AuthMethod.d.ts +381 -0
- package/dist/AuthMethod.d.ts.map +1 -0
- package/dist/AuthMethod.js +225 -0
- package/dist/AuthMethod.js.map +1 -0
- package/dist/AuthMethodBinding.d.ts +77 -0
- package/dist/AuthMethodBinding.d.ts.map +1 -0
- package/dist/AuthMethodBinding.js +31 -0
- package/dist/AuthMethodBinding.js.map +1 -0
- package/dist/AuthMethodExecution.d.ts +223 -0
- package/dist/AuthMethodExecution.d.ts.map +1 -0
- package/dist/AuthMethodExecution.js +277 -0
- package/dist/AuthMethodExecution.js.map +1 -0
- package/dist/ConnectionResolver.d.ts +219 -0
- package/dist/ConnectionResolver.d.ts.map +1 -0
- package/dist/ConnectionResolver.js +153 -0
- package/dist/ConnectionResolver.js.map +1 -0
- package/dist/DefinitionError.d.ts +67 -0
- package/dist/DefinitionError.d.ts.map +1 -0
- package/dist/DefinitionError.js +82 -0
- package/dist/DefinitionError.js.map +1 -0
- package/dist/DualRegistry.d.ts +71 -0
- package/dist/DualRegistry.d.ts.map +1 -0
- package/dist/DualRegistry.js +96 -0
- package/dist/DualRegistry.js.map +1 -0
- package/dist/DualRuntime.d.ts +279 -0
- package/dist/DualRuntime.d.ts.map +1 -0
- package/dist/DualRuntime.js +311 -0
- package/dist/DualRuntime.js.map +1 -0
- package/dist/Files.d.ts +80 -0
- package/dist/Files.d.ts.map +1 -0
- package/dist/Files.js +66 -0
- package/dist/Files.js.map +1 -0
- package/dist/Group.d.ts +106 -0
- package/dist/Group.d.ts.map +1 -0
- package/dist/Group.js +86 -0
- package/dist/Group.js.map +1 -0
- package/dist/Http.d.ts +342 -0
- package/dist/Http.d.ts.map +1 -0
- package/dist/Http.js +677 -0
- package/dist/Http.js.map +1 -0
- package/dist/Mcp.d.ts +109 -0
- package/dist/Mcp.d.ts.map +1 -0
- package/dist/Mcp.js +176 -0
- package/dist/Mcp.js.map +1 -0
- package/dist/OAuth2TokenRefresher.d.ts +18 -0
- package/dist/OAuth2TokenRefresher.d.ts.map +1 -0
- package/dist/OAuth2TokenRefresher.js +19 -0
- package/dist/OAuth2TokenRefresher.js.map +1 -0
- package/dist/OAuthFlow.d.ts +71 -0
- package/dist/OAuthFlow.d.ts.map +1 -0
- package/dist/OAuthFlow.js +488 -0
- package/dist/OAuthFlow.js.map +1 -0
- package/dist/Plugin.d.ts +383 -0
- package/dist/Plugin.d.ts.map +1 -0
- package/dist/Plugin.js +249 -0
- package/dist/Plugin.js.map +1 -0
- package/dist/PluginRuntime.d.ts +3186 -0
- package/dist/PluginRuntime.d.ts.map +1 -0
- package/dist/PluginRuntime.js +331 -0
- package/dist/PluginRuntime.js.map +1 -0
- package/dist/Runner.d.ts +1 -0
- package/dist/Runner.js +124 -0
- package/dist/Runner.js.map +1 -0
- package/dist/ToolFile.d.ts +23 -0
- package/dist/ToolFile.d.ts.map +1 -0
- package/dist/ToolFile.js +33 -0
- package/dist/ToolFile.js.map +1 -0
- package/dist/Trigger.d.ts +358 -0
- package/dist/Trigger.d.ts.map +1 -0
- package/dist/Trigger.js +287 -0
- package/dist/Trigger.js.map +1 -0
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +24 -0
- package/dist/internal/auth-context.d.ts +23 -0
- package/dist/internal/auth-context.d.ts.map +1 -0
- package/dist/internal/auth-context.js +1 -0
- package/dist/internal/auth-execution.d.ts +27 -0
- package/dist/internal/auth-execution.d.ts.map +1 -0
- package/dist/internal/auth-execution.js +66 -0
- package/dist/internal/auth-execution.js.map +1 -0
- package/dist/internal/auth-runtime.d.ts +5 -0
- package/dist/internal/auth-runtime.d.ts.map +1 -0
- package/dist/internal/auth-runtime.js +16 -0
- package/dist/internal/auth-runtime.js.map +1 -0
- package/dist/internal/capabilities.d.ts +24 -0
- package/dist/internal/capabilities.d.ts.map +1 -0
- package/dist/internal/capabilities.js +22 -0
- package/dist/internal/capabilities.js.map +1 -0
- package/dist/internal/children.d.ts +34 -0
- package/dist/internal/children.d.ts.map +1 -0
- package/dist/internal/children.js +53 -0
- package/dist/internal/children.js.map +1 -0
- package/dist/internal/collection-utils.d.ts +4 -0
- package/dist/internal/collection-utils.d.ts.map +1 -0
- package/dist/internal/collection-utils.js +6 -0
- package/dist/internal/collection-utils.js.map +1 -0
- package/dist/internal/dual/actions.d.ts +33 -0
- package/dist/internal/dual/actions.d.ts.map +1 -0
- package/dist/internal/dual/actions.js +26 -0
- package/dist/internal/dual/actions.js.map +1 -0
- package/dist/internal/dual/invoke.d.ts +63 -0
- package/dist/internal/dual/invoke.d.ts.map +1 -0
- package/dist/internal/dual/invoke.js +75 -0
- package/dist/internal/dual/invoke.js.map +1 -0
- package/dist/internal/dual/registry.d.ts +125 -0
- package/dist/internal/dual/registry.d.ts.map +1 -0
- package/dist/internal/dual/registry.js +172 -0
- package/dist/internal/dual/registry.js.map +1 -0
- package/dist/internal/dual/triggers.d.ts +29 -0
- package/dist/internal/dual/triggers.d.ts.map +1 -0
- package/dist/internal/dual/triggers.js +26 -0
- package/dist/internal/dual/triggers.js.map +1 -0
- package/dist/internal/handler-context.d.ts +9 -0
- package/dist/internal/handler-context.d.ts.map +1 -0
- package/dist/internal/handler-context.js +31 -0
- package/dist/internal/handler-context.js.map +1 -0
- package/dist/internal/identifier.d.ts +6 -0
- package/dist/internal/identifier.d.ts.map +1 -0
- package/dist/internal/identifier.js +28 -0
- package/dist/internal/identifier.js.map +1 -0
- package/dist/internal/plugin-handlers.d.ts +38 -0
- package/dist/internal/plugin-handlers.d.ts.map +1 -0
- package/dist/internal/plugin-handlers.js +52 -0
- package/dist/internal/plugin-handlers.js.map +1 -0
- package/dist/internal/proto.d.ts +7 -0
- package/dist/internal/proto.d.ts.map +1 -0
- package/dist/internal/proto.js +10 -0
- package/dist/internal/proto.js.map +1 -0
- package/dist/internal/schema-runtime.d.ts +6 -0
- package/dist/internal/schema-runtime.d.ts.map +1 -0
- package/dist/internal/schema-runtime.js +10 -0
- package/dist/internal/schema-runtime.js.map +1 -0
- package/dist/internal/trigger-runtime-shared.d.ts +41 -0
- package/dist/internal/trigger-runtime-shared.d.ts.map +1 -0
- package/dist/internal/trigger-runtime-shared.js +132 -0
- package/dist/internal/trigger-runtime-shared.js.map +1 -0
- package/dist/internal/trigger-runtime.d.ts +12 -0
- package/dist/internal/trigger-runtime.d.ts.map +1 -0
- package/dist/internal/trigger-runtime.js +95 -0
- package/dist/internal/trigger-runtime.js.map +1 -0
- package/dist/internal/types.d.ts +7 -0
- package/dist/internal/types.d.ts.map +1 -0
- package/dist/internal/types.js +1 -0
- package/dist/remote-runtime.d.ts +585 -0
- package/dist/remote-runtime.d.ts.map +1 -0
- package/dist/remote-runtime.js +367 -0
- package/dist/remote-runtime.js.map +1 -0
- package/package.json +55 -4
- package/src/Action.ts +370 -0
- package/src/AgentChannel.ts +860 -0
- package/src/AgentChannelConformance.ts +124 -0
- package/src/AgentChannelRuntime.ts +616 -0
- package/src/AiProvider.ts +255 -0
- package/src/AuthMethod.ts +954 -0
- package/src/AuthMethodBinding.ts +112 -0
- package/src/AuthMethodExecution.ts +542 -0
- package/src/ConnectionResolver.ts +265 -0
- package/src/DefinitionError.ts +115 -0
- package/src/DualRegistry.ts +152 -0
- package/src/DualRuntime.ts +1081 -0
- package/src/Files.ts +89 -0
- package/src/Group.ts +292 -0
- package/src/Http.ts +1205 -0
- package/src/Mcp.ts +299 -0
- package/src/OAuth2TokenRefresher.ts +22 -0
- package/src/OAuthFlow.ts +874 -0
- package/src/Plugin.ts +912 -0
- package/src/PluginRuntime.ts +414 -0
- package/src/Runner.ts +248 -0
- package/src/ToolFile.ts +28 -0
- package/src/Trigger.ts +722 -0
- package/src/index.ts +158 -0
- package/src/internal/auth-context.ts +27 -0
- package/src/internal/auth-execution.ts +241 -0
- package/src/internal/auth-runtime.ts +20 -0
- package/src/internal/capabilities.ts +55 -0
- package/src/internal/children.ts +126 -0
- package/src/internal/collection-utils.ts +8 -0
- package/src/internal/dual/actions.ts +116 -0
- package/src/internal/dual/invoke.ts +307 -0
- package/src/internal/dual/registry.ts +340 -0
- package/src/internal/dual/triggers.ts +128 -0
- package/src/internal/handler-context.ts +57 -0
- package/src/internal/identifier.ts +27 -0
- package/src/internal/plugin-handlers.ts +146 -0
- package/src/internal/proto.ts +8 -0
- package/src/internal/schema-runtime.ts +15 -0
- package/src/internal/trigger-runtime-shared.ts +449 -0
- package/src/internal/trigger-runtime.ts +223 -0
- package/src/internal/types.ts +12 -0
- package/src/remote-runtime.ts +469 -0
|
@@ -0,0 +1,1717 @@
|
|
|
1
|
+
import { Any as Any$1, Value } from "./AuthMethod.js";
|
|
2
|
+
import "./AgentChannel.js";
|
|
3
|
+
import { Context, Effect, Pipeable, Schema } from "effect";
|
|
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 };
|
|
6
|
+
}
|
|
7
|
+
export declare const TypeId: "@dual-os/sdk/AgentChannel";
|
|
8
|
+
export type TypeId = typeof TypeId;
|
|
9
|
+
/** Keys are opaque and installation-scoped. Never parse them into product identities. */
|
|
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`. */
|
|
19
|
+
export declare const OperationKind: Schema.Literals<readonly ["present_outcome", "create_message", "update_message", "delete_message", "set_reaction", "set_activity", "render_plan"]>;
|
|
20
|
+
export type OperationKind = typeof OperationKind.Type;
|
|
21
|
+
export declare const Features: Schema.Struct<{
|
|
22
|
+
readonly assets: Schema.Boolean;
|
|
23
|
+
/** Whether replaying one durable delivery key is safe at the provider boundary. */
|
|
24
|
+
readonly deliveryMode: Schema.Literals<readonly ["idempotent", "at-most-once"]>;
|
|
25
|
+
readonly deliveryState: Schema.Boolean;
|
|
26
|
+
readonly directText: Schema.Literal<true>;
|
|
27
|
+
readonly groups: Schema.Boolean;
|
|
28
|
+
/** Maximum Unicode code points per physical text message, including server-added prefixes. */
|
|
29
|
+
readonly maxTextLength: Schema.optionalKey<Schema.Int>;
|
|
30
|
+
readonly mentions: Schema.Boolean;
|
|
31
|
+
/** `v2` only: the output operations every destination of this version shows. */
|
|
32
|
+
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. */
|
|
34
|
+
readonly readContext: Schema.optionalKey<Schema.Boolean>;
|
|
35
|
+
readonly replies: Schema.Boolean;
|
|
36
|
+
/** Maximum age of the original responding input before preparation and delivery. */
|
|
37
|
+
readonly responseWindowMs: Schema.optionalKey<Schema.Int>;
|
|
38
|
+
readonly threads: Schema.Boolean;
|
|
39
|
+
}>;
|
|
40
|
+
export type Features = typeof Features.Type;
|
|
41
|
+
export declare const Destination: Schema.Struct<{
|
|
42
|
+
readonly conversationKey: Schema.NonEmptyString;
|
|
43
|
+
readonly kind: Schema.Literals<readonly ["direct", "group"]>;
|
|
44
|
+
readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
|
|
45
|
+
}>;
|
|
46
|
+
export type Destination = typeof Destination.Type;
|
|
47
|
+
export declare const Asset: Schema.Struct<{
|
|
48
|
+
readonly assetKey: Schema.NonEmptyString;
|
|
49
|
+
readonly mediaType: Schema.NonEmptyString;
|
|
50
|
+
readonly url: Schema.String;
|
|
51
|
+
}>;
|
|
52
|
+
export declare const Content: Schema.Struct<{
|
|
53
|
+
readonly assets: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
54
|
+
readonly assetKey: Schema.NonEmptyString;
|
|
55
|
+
readonly mediaType: Schema.NonEmptyString;
|
|
56
|
+
readonly url: Schema.String;
|
|
57
|
+
}>>>;
|
|
58
|
+
readonly mentions: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
|
|
59
|
+
readonly replyToMessageKey: Schema.optionalKey<Schema.NonEmptyString>;
|
|
60
|
+
readonly text: Schema.String;
|
|
61
|
+
}>;
|
|
62
|
+
export type Content = typeof Content.Type;
|
|
63
|
+
/** The body is the unmodified UTF-8 provider body, before JSON parsing/signature verification. */
|
|
64
|
+
export declare const Request: Schema.Struct<{
|
|
65
|
+
readonly body: Schema.String;
|
|
66
|
+
readonly headers: Schema.$Record<Schema.NonEmptyString, Schema.String>;
|
|
67
|
+
readonly method: Schema.Literals<readonly ["GET", "POST", "PUT", "PATCH", "DELETE"]>;
|
|
68
|
+
readonly url: Schema.String;
|
|
69
|
+
}>;
|
|
70
|
+
export type Request = typeof Request.Type;
|
|
71
|
+
/** Bounded provider-required webhook response, returned only after request verification. */
|
|
72
|
+
export declare const WebhookResponse: Schema.Struct<{
|
|
73
|
+
readonly body: Schema.String;
|
|
74
|
+
readonly headers: Schema.optionalKey<Schema.$Record<Schema.NonEmptyString, Schema.String>>;
|
|
75
|
+
readonly status: Schema.Int;
|
|
76
|
+
}>;
|
|
77
|
+
export type WebhookResponse = typeof WebhookResponse.Type;
|
|
78
|
+
export declare const Timestamp: Schema.String;
|
|
79
|
+
export declare const VerifiedIdentity: Schema.Struct<{
|
|
80
|
+
readonly conversation: Schema.Struct<{
|
|
81
|
+
readonly conversationKey: Schema.NonEmptyString;
|
|
82
|
+
readonly kind: Schema.Literals<readonly ["direct", "group"]>;
|
|
83
|
+
readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
|
|
84
|
+
}>;
|
|
85
|
+
readonly senderKey: Schema.NonEmptyString;
|
|
86
|
+
}>;
|
|
87
|
+
export type VerifiedIdentity = typeof VerifiedIdentity.Type;
|
|
88
|
+
export declare const AccessOutcome: Schema.Struct<{
|
|
89
|
+
readonly decision: Schema.Literals<readonly ["allow", "deny"]>;
|
|
90
|
+
}>;
|
|
91
|
+
export type AccessOutcome = typeof AccessOutcome.Type;
|
|
92
|
+
export declare const Verification: Schema.Struct<{
|
|
93
|
+
readonly verified: Schema.Literal<true>;
|
|
94
|
+
}>;
|
|
95
|
+
export type Verification = typeof Verification.Type;
|
|
96
|
+
export declare const Exposure: Schema.Literals<readonly ["webhook", "host"]>;
|
|
97
|
+
export declare const RequiredChecks: Schema.Tuple<readonly [Schema.Literal<"access">]>;
|
|
98
|
+
export declare const Message: Schema.Struct<{
|
|
99
|
+
readonly content: Schema.Struct<{
|
|
100
|
+
readonly assets: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
101
|
+
readonly assetKey: Schema.NonEmptyString;
|
|
102
|
+
readonly mediaType: Schema.NonEmptyString;
|
|
103
|
+
readonly url: Schema.String;
|
|
104
|
+
}>>>;
|
|
105
|
+
readonly mentions: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
|
|
106
|
+
readonly replyToMessageKey: Schema.optionalKey<Schema.NonEmptyString>;
|
|
107
|
+
readonly text: Schema.String;
|
|
108
|
+
}>;
|
|
109
|
+
readonly conversation: Schema.Struct<{
|
|
110
|
+
readonly conversationKey: Schema.NonEmptyString;
|
|
111
|
+
readonly kind: Schema.Literals<readonly ["direct", "group"]>;
|
|
112
|
+
readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
|
|
113
|
+
}>;
|
|
114
|
+
readonly eventKey: Schema.NonEmptyString;
|
|
115
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
116
|
+
readonly kind: Schema.Literal<"message">;
|
|
117
|
+
readonly messageKey: Schema.NonEmptyString;
|
|
118
|
+
readonly respond: Schema.Boolean;
|
|
119
|
+
readonly senderKey: Schema.NonEmptyString;
|
|
120
|
+
readonly timestamp: Schema.String;
|
|
121
|
+
}>;
|
|
122
|
+
export declare const DeliveryUpdate: Schema.Struct<{
|
|
123
|
+
readonly deliveryKey: Schema.NonEmptyString;
|
|
124
|
+
readonly deliveryUpdateKey: Schema.NonEmptyString;
|
|
125
|
+
readonly eventKey: Schema.NonEmptyString;
|
|
126
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
127
|
+
readonly kind: Schema.Literal<"delivery_update">;
|
|
128
|
+
readonly providerDeliveryKey: Schema.NonEmptyString;
|
|
129
|
+
readonly sequence: Schema.Natural;
|
|
130
|
+
readonly status: Schema.Literals<readonly ["succeeded", "failed"]>;
|
|
131
|
+
readonly timestamp: Schema.String;
|
|
132
|
+
}>;
|
|
133
|
+
/** Provider-confirmed own output. No content is accepted or added to conversation history. */
|
|
134
|
+
export declare const Echo: Schema.Struct<{
|
|
135
|
+
readonly conversation: Schema.Struct<{
|
|
136
|
+
readonly conversationKey: Schema.NonEmptyString;
|
|
137
|
+
readonly kind: Schema.Literals<readonly ["direct", "group"]>;
|
|
138
|
+
readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
|
|
139
|
+
}>;
|
|
140
|
+
readonly senderKey: Schema.NonEmptyString;
|
|
141
|
+
readonly eventKey: Schema.NonEmptyString;
|
|
142
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
143
|
+
readonly kind: Schema.Literal<"echo">;
|
|
144
|
+
readonly messageKey: Schema.NonEmptyString;
|
|
145
|
+
readonly timestamp: Schema.String;
|
|
146
|
+
}>;
|
|
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. */
|
|
195
|
+
export declare const Stop: Schema.Struct<{
|
|
196
|
+
readonly conversation: Schema.Struct<{
|
|
197
|
+
readonly conversationKey: Schema.NonEmptyString;
|
|
198
|
+
readonly kind: Schema.Literals<readonly ["direct", "group"]>;
|
|
199
|
+
readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
|
|
200
|
+
}>;
|
|
201
|
+
readonly senderKey: Schema.NonEmptyString;
|
|
202
|
+
readonly eventKey: Schema.NonEmptyString;
|
|
203
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
204
|
+
readonly kind: Schema.Literal<"stop">;
|
|
205
|
+
readonly timestamp: Schema.String;
|
|
206
|
+
}>;
|
|
207
|
+
export declare const EventV2: Schema.Union<readonly [Schema.Struct<{
|
|
208
|
+
readonly content: Schema.Struct<{
|
|
209
|
+
readonly assets: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
210
|
+
readonly assetKey: Schema.NonEmptyString;
|
|
211
|
+
readonly mediaType: Schema.NonEmptyString;
|
|
212
|
+
readonly url: Schema.String;
|
|
213
|
+
}>>>;
|
|
214
|
+
readonly mentions: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
|
|
215
|
+
readonly replyToMessageKey: Schema.optionalKey<Schema.NonEmptyString>;
|
|
216
|
+
readonly text: Schema.String;
|
|
217
|
+
}>;
|
|
218
|
+
readonly conversation: Schema.Struct<{
|
|
219
|
+
readonly conversationKey: Schema.NonEmptyString;
|
|
220
|
+
readonly kind: Schema.Literals<readonly ["direct", "group"]>;
|
|
221
|
+
readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
|
|
222
|
+
}>;
|
|
223
|
+
readonly eventKey: Schema.NonEmptyString;
|
|
224
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
225
|
+
readonly kind: Schema.Literal<"message">;
|
|
226
|
+
readonly messageKey: Schema.NonEmptyString;
|
|
227
|
+
readonly respond: Schema.Boolean;
|
|
228
|
+
readonly senderKey: Schema.NonEmptyString;
|
|
229
|
+
readonly timestamp: Schema.String;
|
|
230
|
+
}>, Schema.Struct<{
|
|
231
|
+
readonly conversation: Schema.Struct<{
|
|
232
|
+
readonly conversationKey: Schema.NonEmptyString;
|
|
233
|
+
readonly kind: Schema.Literals<readonly ["direct", "group"]>;
|
|
234
|
+
readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
|
|
235
|
+
}>;
|
|
236
|
+
readonly senderKey: Schema.NonEmptyString;
|
|
237
|
+
readonly eventKey: Schema.NonEmptyString;
|
|
238
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
239
|
+
readonly kind: Schema.Literal<"echo">;
|
|
240
|
+
readonly messageKey: Schema.NonEmptyString;
|
|
241
|
+
readonly timestamp: Schema.String;
|
|
242
|
+
}>, Schema.Struct<{
|
|
243
|
+
readonly deliveryKey: Schema.NonEmptyString;
|
|
244
|
+
readonly deliveryUpdateKey: Schema.NonEmptyString;
|
|
245
|
+
readonly eventKey: Schema.NonEmptyString;
|
|
246
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
247
|
+
readonly kind: Schema.Literal<"delivery_update">;
|
|
248
|
+
readonly providerDeliveryKey: Schema.NonEmptyString;
|
|
249
|
+
readonly sequence: Schema.Natural;
|
|
250
|
+
readonly status: Schema.Literals<readonly ["succeeded", "failed"]>;
|
|
251
|
+
readonly timestamp: Schema.String;
|
|
252
|
+
}>, Schema.Struct<{
|
|
253
|
+
readonly conversation: Schema.Struct<{
|
|
254
|
+
readonly conversationKey: Schema.NonEmptyString;
|
|
255
|
+
readonly kind: Schema.Literals<readonly ["direct", "group"]>;
|
|
256
|
+
readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
|
|
257
|
+
}>;
|
|
258
|
+
readonly senderKey: Schema.NonEmptyString;
|
|
259
|
+
readonly eventKey: Schema.NonEmptyString;
|
|
260
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
261
|
+
readonly kind: Schema.Literal<"stop">;
|
|
262
|
+
readonly timestamp: Schema.String;
|
|
263
|
+
}>]>;
|
|
264
|
+
export type EventV2 = typeof EventV2.Type;
|
|
265
|
+
/** The reactions every `v2` provider can show. Each provider maps them to its own emoji. */
|
|
266
|
+
export declare const Reaction: Schema.Literals<readonly ["thumbs_up", "thumbs_down", "laugh", "confused", "heart", "hooray", "rocket", "eyes"]>;
|
|
267
|
+
export type Reaction = typeof Reaction.Type;
|
|
268
|
+
export declare const PlanItem: Schema.Struct<{
|
|
269
|
+
readonly itemKey: Schema.NonEmptyString;
|
|
270
|
+
readonly note: Schema.optionalKey<Schema.NonEmptyString>;
|
|
271
|
+
readonly state: Schema.Literals<readonly ["pending", "in_progress", "completed", "failed"]>;
|
|
272
|
+
readonly title: Schema.NonEmptyString;
|
|
273
|
+
}>;
|
|
274
|
+
/** A whole task list, always sent complete. Item keys are unique and stable across revisions. */
|
|
275
|
+
export declare const Plan: Schema.Struct<{
|
|
276
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
277
|
+
readonly itemKey: Schema.NonEmptyString;
|
|
278
|
+
readonly note: Schema.optionalKey<Schema.NonEmptyString>;
|
|
279
|
+
readonly state: Schema.Literals<readonly ["pending", "in_progress", "completed", "failed"]>;
|
|
280
|
+
readonly title: Schema.NonEmptyString;
|
|
281
|
+
}>>;
|
|
282
|
+
readonly title: Schema.optionalKey<Schema.NonEmptyString>;
|
|
283
|
+
}>;
|
|
284
|
+
export type Plan = typeof Plan.Type;
|
|
285
|
+
/**
|
|
286
|
+
* One piece of `v2` output. A `reference` is the `providerDeliveryKey` the provider returned for
|
|
287
|
+
* the message or plan it made; only that provider reads it.
|
|
288
|
+
*/
|
|
289
|
+
export declare const Operation: Schema.Union<readonly [Schema.Struct<{
|
|
290
|
+
readonly kind: Schema.Literal<"present_outcome">;
|
|
291
|
+
readonly options: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
|
|
292
|
+
readonly outcome: Schema.Literals<readonly ["completed", "failed", "awaiting_input"]>;
|
|
293
|
+
readonly text: Schema.String;
|
|
294
|
+
}>, Schema.Struct<{
|
|
295
|
+
readonly kind: Schema.Literal<"create_message">;
|
|
296
|
+
readonly messageKey: Schema.NonEmptyString;
|
|
297
|
+
readonly text: Schema.String;
|
|
298
|
+
}>, Schema.Struct<{
|
|
299
|
+
readonly kind: Schema.Literal<"update_message">;
|
|
300
|
+
readonly messageKey: Schema.NonEmptyString;
|
|
301
|
+
readonly reference: Schema.NonEmptyString;
|
|
302
|
+
readonly text: Schema.String;
|
|
303
|
+
}>, Schema.Struct<{
|
|
304
|
+
readonly kind: Schema.Literal<"delete_message">;
|
|
305
|
+
readonly messageKey: Schema.NonEmptyString;
|
|
306
|
+
readonly reference: Schema.NonEmptyString;
|
|
307
|
+
}>, Schema.Struct<{
|
|
308
|
+
readonly active: Schema.Boolean;
|
|
309
|
+
readonly kind: Schema.Literal<"set_reaction">;
|
|
310
|
+
readonly reaction: Schema.Literals<readonly ["thumbs_up", "thumbs_down", "laugh", "confused", "heart", "hooray", "rocket", "eyes"]>;
|
|
311
|
+
readonly target: Schema.Union<readonly [Schema.Struct<{
|
|
312
|
+
readonly kind: Schema.Literal<"activation">;
|
|
313
|
+
}>, Schema.Struct<{
|
|
314
|
+
readonly kind: Schema.Literal<"message">;
|
|
315
|
+
readonly reference: Schema.NonEmptyString;
|
|
316
|
+
}>]>;
|
|
317
|
+
}>, Schema.Struct<{
|
|
318
|
+
readonly activity: Schema.Union<readonly [Schema.Struct<{
|
|
319
|
+
readonly kind: Schema.Literal<"working">;
|
|
320
|
+
readonly text: Schema.optionalKey<Schema.NonEmptyString>;
|
|
321
|
+
}>, Schema.Struct<{
|
|
322
|
+
readonly kind: Schema.Literal<"idle">;
|
|
323
|
+
}>]>;
|
|
324
|
+
readonly kind: Schema.Literal<"set_activity">;
|
|
325
|
+
}>, Schema.Struct<{
|
|
326
|
+
readonly kind: Schema.Literal<"render_plan">;
|
|
327
|
+
readonly plan: Schema.Struct<{
|
|
328
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
329
|
+
readonly itemKey: Schema.NonEmptyString;
|
|
330
|
+
readonly note: Schema.optionalKey<Schema.NonEmptyString>;
|
|
331
|
+
readonly state: Schema.Literals<readonly ["pending", "in_progress", "completed", "failed"]>;
|
|
332
|
+
readonly title: Schema.NonEmptyString;
|
|
333
|
+
}>>;
|
|
334
|
+
readonly title: Schema.optionalKey<Schema.NonEmptyString>;
|
|
335
|
+
}>;
|
|
336
|
+
readonly reference: Schema.optionalKey<Schema.NonEmptyString>;
|
|
337
|
+
readonly revision: Schema.Int;
|
|
338
|
+
}>]>;
|
|
339
|
+
export type Operation = typeof Operation.Type;
|
|
340
|
+
/** A message read back from the provider's conversation history. */
|
|
341
|
+
export declare const ContextMessage: Schema.Struct<{
|
|
342
|
+
readonly messageKey: Schema.NonEmptyString;
|
|
343
|
+
/** The agent's own message. */
|
|
344
|
+
readonly own: Schema.Boolean;
|
|
345
|
+
readonly senderKey: Schema.NonEmptyString;
|
|
346
|
+
readonly senderName: Schema.optionalKey<Schema.NonEmptyString>;
|
|
347
|
+
readonly text: Schema.String;
|
|
348
|
+
readonly timestamp: Schema.String;
|
|
349
|
+
}>;
|
|
350
|
+
export type ContextMessage = typeof ContextMessage.Type;
|
|
351
|
+
/** Decoded originals are limited separately by the host; ordinary command JSON stays bounded. */
|
|
352
|
+
export declare const AssetFile: Schema.Struct<{
|
|
353
|
+
readonly _tag: Schema.tag<"ToolFile">;
|
|
354
|
+
readonly contentBase64: Schema.String;
|
|
355
|
+
readonly contentType: Schema.NullOr<Schema.String>;
|
|
356
|
+
readonly filename: Schema.NullOr<Schema.String>;
|
|
357
|
+
readonly sizeBytes: Schema.Natural;
|
|
358
|
+
}>;
|
|
359
|
+
/** Closed error vocabulary: provider messages, payloads, and causes never cross this seam. */
|
|
360
|
+
export declare const FailureCode: Schema.Literals<readonly ["rejected", "unauthorized", "rate_limited", "unavailable", "unknown_completion", "window_closed"]>;
|
|
361
|
+
declare const HandlerError_base: Schema.Class<HandlerError, Schema.TaggedStruct<"AgentChannelHandlerError", {
|
|
362
|
+
readonly code: Schema.Literals<readonly ["rejected", "unauthorized", "rate_limited", "unavailable", "unknown_completion", "window_closed"]>;
|
|
363
|
+
}>, import("effect/Cause").YieldableError>;
|
|
364
|
+
export declare class HandlerError extends HandlerError_base {}
|
|
365
|
+
export declare const ErrorCode: Schema.Literals<readonly ["invalid_definition", "not_found", "invalid_input", "invalid_auth", "unsupported_feature", "invalid_result", "handler_unavailable", "provider_failure"]>;
|
|
366
|
+
declare const ChannelError_base: Schema.Class<ChannelError, Schema.TaggedStruct<"AgentChannelError", {
|
|
367
|
+
readonly code: Schema.Literals<readonly ["invalid_definition", "not_found", "invalid_input", "invalid_auth", "unsupported_feature", "invalid_result", "handler_unavailable", "provider_failure"]>;
|
|
368
|
+
readonly providerCode: Schema.optionalKey<Schema.Literals<readonly ["rejected", "unauthorized", "rate_limited", "unavailable", "unknown_completion", "window_closed"]>>;
|
|
369
|
+
}>, import("effect/Cause").YieldableError>;
|
|
370
|
+
export declare class ChannelError extends ChannelError_base {
|
|
371
|
+
get message(): string;
|
|
372
|
+
}
|
|
373
|
+
export declare const commandSchema: <State extends Schema.Top>(state: State) => Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
|
|
374
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
375
|
+
readonly operationKey: Schema.NonEmptyString;
|
|
376
|
+
readonly kind: Schema.Literal<"activate">;
|
|
377
|
+
readonly ingressUrl: Schema.String;
|
|
378
|
+
readonly state: Schema.optionalKey<State>;
|
|
379
|
+
}>, Schema.Struct<{
|
|
380
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
381
|
+
readonly operationKey: Schema.NonEmptyString;
|
|
382
|
+
readonly installationKey: Schema.NonEmptyString;
|
|
383
|
+
readonly state: State;
|
|
384
|
+
readonly kind: Schema.Literal<"deactivate">;
|
|
385
|
+
}>, Schema.Struct<{
|
|
386
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
387
|
+
readonly operationKey: Schema.NonEmptyString;
|
|
388
|
+
readonly installationKey: Schema.NonEmptyString;
|
|
389
|
+
readonly state: State;
|
|
390
|
+
readonly kind: Schema.Literal<"receive">;
|
|
391
|
+
readonly request: Schema.Struct<{
|
|
392
|
+
readonly body: Schema.String;
|
|
393
|
+
readonly headers: Schema.$Record<Schema.NonEmptyString, Schema.String>;
|
|
394
|
+
readonly method: Schema.Literals<readonly ["GET", "POST", "PUT", "PATCH", "DELETE"]>;
|
|
395
|
+
readonly url: Schema.String;
|
|
396
|
+
}>;
|
|
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
|
+
}>, Schema.Struct<{
|
|
573
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
574
|
+
readonly operationKey: Schema.NonEmptyString;
|
|
575
|
+
readonly installationKey: Schema.NonEmptyString;
|
|
576
|
+
readonly state: State;
|
|
577
|
+
readonly kind: Schema.Literal<"deliver">;
|
|
578
|
+
/** The provider message that started the turn, when the host knows it. */
|
|
579
|
+
readonly activationMessageKey: Schema.optionalKey<Schema.NonEmptyString>;
|
|
580
|
+
readonly deliveryKey: Schema.NonEmptyString;
|
|
581
|
+
readonly destination: Schema.Struct<{
|
|
582
|
+
readonly conversationKey: Schema.NonEmptyString;
|
|
583
|
+
readonly kind: Schema.Literals<readonly ["direct", "group"]>;
|
|
584
|
+
readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
|
|
585
|
+
}>;
|
|
586
|
+
readonly operation: Schema.Union<readonly [Schema.Struct<{
|
|
587
|
+
readonly kind: Schema.Literal<"present_outcome">;
|
|
588
|
+
readonly options: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
|
|
589
|
+
readonly outcome: Schema.Literals<readonly ["completed", "failed", "awaiting_input"]>;
|
|
590
|
+
readonly text: Schema.String;
|
|
591
|
+
}>, Schema.Struct<{
|
|
592
|
+
readonly kind: Schema.Literal<"create_message">;
|
|
593
|
+
readonly messageKey: Schema.NonEmptyString;
|
|
594
|
+
readonly text: Schema.String;
|
|
595
|
+
}>, Schema.Struct<{
|
|
596
|
+
readonly kind: Schema.Literal<"update_message">;
|
|
597
|
+
readonly messageKey: Schema.NonEmptyString;
|
|
598
|
+
readonly reference: Schema.NonEmptyString;
|
|
599
|
+
readonly text: Schema.String;
|
|
600
|
+
}>, Schema.Struct<{
|
|
601
|
+
readonly kind: Schema.Literal<"delete_message">;
|
|
602
|
+
readonly messageKey: Schema.NonEmptyString;
|
|
603
|
+
readonly reference: Schema.NonEmptyString;
|
|
604
|
+
}>, Schema.Struct<{
|
|
605
|
+
readonly active: Schema.Boolean;
|
|
606
|
+
readonly kind: Schema.Literal<"set_reaction">;
|
|
607
|
+
readonly reaction: Schema.Literals<readonly ["thumbs_up", "thumbs_down", "laugh", "confused", "heart", "hooray", "rocket", "eyes"]>;
|
|
608
|
+
readonly target: Schema.Union<readonly [Schema.Struct<{
|
|
609
|
+
readonly kind: Schema.Literal<"activation">;
|
|
610
|
+
}>, Schema.Struct<{
|
|
611
|
+
readonly kind: Schema.Literal<"message">;
|
|
612
|
+
readonly reference: Schema.NonEmptyString;
|
|
613
|
+
}>]>;
|
|
614
|
+
}>, Schema.Struct<{
|
|
615
|
+
readonly activity: Schema.Union<readonly [Schema.Struct<{
|
|
616
|
+
readonly kind: Schema.Literal<"working">;
|
|
617
|
+
readonly text: Schema.optionalKey<Schema.NonEmptyString>;
|
|
618
|
+
}>, Schema.Struct<{
|
|
619
|
+
readonly kind: Schema.Literal<"idle">;
|
|
620
|
+
}>]>;
|
|
621
|
+
readonly kind: Schema.Literal<"set_activity">;
|
|
622
|
+
}>, Schema.Struct<{
|
|
623
|
+
readonly kind: Schema.Literal<"render_plan">;
|
|
624
|
+
readonly plan: Schema.Struct<{
|
|
625
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
626
|
+
readonly itemKey: Schema.NonEmptyString;
|
|
627
|
+
readonly note: Schema.optionalKey<Schema.NonEmptyString>;
|
|
628
|
+
readonly state: Schema.Literals<readonly ["pending", "in_progress", "completed", "failed"]>;
|
|
629
|
+
readonly title: Schema.NonEmptyString;
|
|
630
|
+
}>>;
|
|
631
|
+
readonly title: Schema.optionalKey<Schema.NonEmptyString>;
|
|
632
|
+
}>;
|
|
633
|
+
readonly reference: Schema.optionalKey<Schema.NonEmptyString>;
|
|
634
|
+
readonly revision: Schema.Int;
|
|
635
|
+
}>]>;
|
|
636
|
+
/** Original responding input timestamp; retries must preserve this reference. */
|
|
637
|
+
readonly responseToTimestamp: Schema.optionalKey<Schema.String>;
|
|
638
|
+
}>, Schema.Struct<{
|
|
639
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
640
|
+
readonly operationKey: Schema.NonEmptyString;
|
|
641
|
+
readonly installationKey: Schema.NonEmptyString;
|
|
642
|
+
readonly state: State;
|
|
643
|
+
readonly kind: Schema.Literal<"read_context">;
|
|
644
|
+
readonly destination: Schema.Struct<{
|
|
645
|
+
readonly conversationKey: Schema.NonEmptyString;
|
|
646
|
+
readonly kind: Schema.Literals<readonly ["direct", "group"]>;
|
|
647
|
+
readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
|
|
648
|
+
}>;
|
|
649
|
+
readonly limit: Schema.Int;
|
|
650
|
+
}>]>, Schema.Struct<{
|
|
651
|
+
readonly asset: Schema.Struct<{
|
|
652
|
+
readonly assetKey: Schema.NonEmptyString;
|
|
653
|
+
readonly mediaType: Schema.NonEmptyString;
|
|
654
|
+
readonly url: Schema.String;
|
|
655
|
+
}>;
|
|
656
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
657
|
+
readonly identity: Schema.Struct<{
|
|
658
|
+
readonly conversation: Schema.Struct<{
|
|
659
|
+
readonly conversationKey: Schema.NonEmptyString;
|
|
660
|
+
readonly kind: Schema.Literals<readonly ["direct", "group"]>;
|
|
661
|
+
readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
|
|
662
|
+
}>;
|
|
663
|
+
readonly senderKey: Schema.NonEmptyString;
|
|
664
|
+
}>;
|
|
665
|
+
readonly installationKey: Schema.NonEmptyString;
|
|
666
|
+
readonly kind: Schema.Literal<"read_asset">;
|
|
667
|
+
readonly operationKey: Schema.NonEmptyString;
|
|
668
|
+
readonly state: State;
|
|
669
|
+
}>]>;
|
|
670
|
+
export declare const resultSchemaV2: <State extends Schema.Top>(state: State) => Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
|
|
671
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
672
|
+
readonly operationKey: Schema.NonEmptyString;
|
|
673
|
+
readonly kind: Schema.Literal<"activate">;
|
|
674
|
+
readonly installationKey: Schema.NonEmptyString;
|
|
675
|
+
readonly state: State;
|
|
676
|
+
/** Durable read-only provider state that the host must persist before retrying activation. */
|
|
677
|
+
readonly checkpoint: Schema.optionalKey<Schema.Literal<true>>;
|
|
678
|
+
/** The host must observe a verified webhook handshake before cutover. */
|
|
679
|
+
readonly verification: Schema.optionalKey<Schema.Literal<"ingress">>;
|
|
680
|
+
}>, Schema.Struct<{
|
|
681
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
682
|
+
readonly operationKey: Schema.NonEmptyString;
|
|
683
|
+
readonly kind: Schema.Literal<"deactivate">;
|
|
684
|
+
}>, Schema.Struct<{
|
|
685
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
686
|
+
readonly operationKey: Schema.NonEmptyString;
|
|
687
|
+
readonly kind: Schema.Literal<"receive">;
|
|
688
|
+
readonly verified: Schema.Literal<true>;
|
|
689
|
+
readonly deniedEventKeys: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
|
|
690
|
+
readonly events: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
691
|
+
readonly content: Schema.Struct<{
|
|
692
|
+
readonly assets: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
693
|
+
readonly assetKey: Schema.NonEmptyString;
|
|
694
|
+
readonly mediaType: Schema.NonEmptyString;
|
|
695
|
+
readonly url: Schema.String;
|
|
696
|
+
}>>>;
|
|
697
|
+
readonly mentions: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
|
|
698
|
+
readonly replyToMessageKey: Schema.optionalKey<Schema.NonEmptyString>;
|
|
699
|
+
readonly text: Schema.String;
|
|
700
|
+
}>;
|
|
701
|
+
readonly conversation: Schema.Struct<{
|
|
702
|
+
readonly conversationKey: Schema.NonEmptyString;
|
|
703
|
+
readonly kind: Schema.Literals<readonly ["direct", "group"]>;
|
|
704
|
+
readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
|
|
705
|
+
}>;
|
|
706
|
+
readonly eventKey: Schema.NonEmptyString;
|
|
707
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
708
|
+
readonly kind: Schema.Literal<"message">;
|
|
709
|
+
readonly messageKey: Schema.NonEmptyString;
|
|
710
|
+
readonly respond: Schema.Boolean;
|
|
711
|
+
readonly senderKey: Schema.NonEmptyString;
|
|
712
|
+
readonly timestamp: Schema.String;
|
|
713
|
+
}>, Schema.Struct<{
|
|
714
|
+
readonly conversation: Schema.Struct<{
|
|
715
|
+
readonly conversationKey: Schema.NonEmptyString;
|
|
716
|
+
readonly kind: Schema.Literals<readonly ["direct", "group"]>;
|
|
717
|
+
readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
|
|
718
|
+
}>;
|
|
719
|
+
readonly senderKey: Schema.NonEmptyString;
|
|
720
|
+
readonly eventKey: Schema.NonEmptyString;
|
|
721
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
722
|
+
readonly kind: Schema.Literal<"echo">;
|
|
723
|
+
readonly messageKey: Schema.NonEmptyString;
|
|
724
|
+
readonly timestamp: Schema.String;
|
|
725
|
+
}>, Schema.Struct<{
|
|
726
|
+
readonly deliveryKey: Schema.NonEmptyString;
|
|
727
|
+
readonly deliveryUpdateKey: Schema.NonEmptyString;
|
|
728
|
+
readonly eventKey: Schema.NonEmptyString;
|
|
729
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
730
|
+
readonly kind: Schema.Literal<"delivery_update">;
|
|
731
|
+
readonly providerDeliveryKey: Schema.NonEmptyString;
|
|
732
|
+
readonly sequence: Schema.Natural;
|
|
733
|
+
readonly status: Schema.Literals<readonly ["succeeded", "failed"]>;
|
|
734
|
+
readonly timestamp: Schema.String;
|
|
735
|
+
}>, Schema.Struct<{
|
|
736
|
+
readonly conversation: Schema.Struct<{
|
|
737
|
+
readonly conversationKey: Schema.NonEmptyString;
|
|
738
|
+
readonly kind: Schema.Literals<readonly ["direct", "group"]>;
|
|
739
|
+
readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
|
|
740
|
+
}>;
|
|
741
|
+
readonly senderKey: Schema.NonEmptyString;
|
|
742
|
+
readonly eventKey: Schema.NonEmptyString;
|
|
743
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
744
|
+
readonly kind: Schema.Literal<"stop">;
|
|
745
|
+
readonly timestamp: Schema.String;
|
|
746
|
+
}>]>>;
|
|
747
|
+
readonly response: Schema.optionalKey<Schema.Struct<{
|
|
748
|
+
readonly body: Schema.String;
|
|
749
|
+
readonly headers: Schema.optionalKey<Schema.$Record<Schema.NonEmptyString, Schema.String>>;
|
|
750
|
+
readonly status: Schema.Int;
|
|
751
|
+
}>>;
|
|
752
|
+
/** A provider-native setup challenge or ping proved the configured ingress. */
|
|
753
|
+
readonly activationProof: Schema.optionalKey<Schema.Literal<"verified">>;
|
|
754
|
+
}>, Schema.Struct<{
|
|
755
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
756
|
+
readonly operationKey: Schema.NonEmptyString;
|
|
757
|
+
readonly kind: Schema.Literal<"deliver">;
|
|
758
|
+
readonly deliveryKey: Schema.NonEmptyString;
|
|
759
|
+
readonly status: Schema.Literal<"succeeded">;
|
|
760
|
+
readonly providerDeliveryKey: Schema.NonEmptyString;
|
|
761
|
+
}>, Schema.Struct<{
|
|
762
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
763
|
+
readonly operationKey: Schema.NonEmptyString;
|
|
764
|
+
readonly kind: Schema.Literal<"deliver">;
|
|
765
|
+
readonly deliveryKey: Schema.NonEmptyString;
|
|
766
|
+
readonly status: Schema.Literal<"pending">;
|
|
767
|
+
readonly providerDeliveryKey: Schema.NonEmptyString;
|
|
768
|
+
}>, Schema.Struct<{
|
|
769
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
770
|
+
readonly operationKey: Schema.NonEmptyString;
|
|
771
|
+
readonly kind: Schema.Literal<"deliver">;
|
|
772
|
+
readonly deliveryKey: Schema.NonEmptyString;
|
|
773
|
+
readonly status: Schema.Literal<"failed">;
|
|
774
|
+
readonly code: Schema.Literals<readonly ["rejected", "unauthorized", "rate_limited", "unavailable", "window_closed"]>;
|
|
775
|
+
}>, Schema.Struct<{
|
|
776
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
777
|
+
readonly operationKey: Schema.NonEmptyString;
|
|
778
|
+
readonly kind: Schema.Literal<"read_context">;
|
|
779
|
+
readonly messages: Schema.$Array<Schema.Struct<{
|
|
780
|
+
readonly messageKey: Schema.NonEmptyString;
|
|
781
|
+
/** The agent's own message. */
|
|
782
|
+
readonly own: Schema.Boolean;
|
|
783
|
+
readonly senderKey: Schema.NonEmptyString;
|
|
784
|
+
readonly senderName: Schema.optionalKey<Schema.NonEmptyString>;
|
|
785
|
+
readonly text: Schema.String;
|
|
786
|
+
readonly timestamp: Schema.String;
|
|
787
|
+
}>>;
|
|
788
|
+
}>]>, Schema.Struct<{
|
|
789
|
+
readonly assetKey: Schema.NonEmptyString;
|
|
790
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
791
|
+
readonly file: Schema.Struct<{
|
|
792
|
+
readonly _tag: Schema.tag<"ToolFile">;
|
|
793
|
+
readonly contentBase64: Schema.String;
|
|
794
|
+
readonly contentType: Schema.NullOr<Schema.String>;
|
|
795
|
+
readonly filename: Schema.NullOr<Schema.String>;
|
|
796
|
+
readonly sizeBytes: Schema.Natural;
|
|
797
|
+
}>;
|
|
798
|
+
readonly kind: Schema.Literal<"read_asset">;
|
|
799
|
+
readonly operationKey: Schema.NonEmptyString;
|
|
800
|
+
}>]>;
|
|
801
|
+
export type Command<State extends Schema.Top = Schema.Unknown> = ReturnType<typeof commandSchema<State>>["Type"];
|
|
802
|
+
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
|
+
*/
|
|
1479
|
+
export declare const CheckedResult: Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
|
|
1480
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
1481
|
+
readonly operationKey: Schema.NonEmptyString;
|
|
1482
|
+
readonly kind: Schema.Literal<"activate">;
|
|
1483
|
+
readonly installationKey: Schema.NonEmptyString;
|
|
1484
|
+
readonly state: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
1485
|
+
/** Durable read-only provider state that the host must persist before retrying activation. */
|
|
1486
|
+
readonly checkpoint: Schema.optionalKey<Schema.Literal<true>>;
|
|
1487
|
+
/** The host must observe a verified webhook handshake before cutover. */
|
|
1488
|
+
readonly verification: Schema.optionalKey<Schema.Literal<"ingress">>;
|
|
1489
|
+
}>, Schema.Struct<{
|
|
1490
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
1491
|
+
readonly operationKey: Schema.NonEmptyString;
|
|
1492
|
+
readonly kind: Schema.Literal<"deactivate">;
|
|
1493
|
+
}>, Schema.Struct<{
|
|
1494
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
1495
|
+
readonly operationKey: Schema.NonEmptyString;
|
|
1496
|
+
readonly kind: Schema.Literal<"receive">;
|
|
1497
|
+
readonly verified: Schema.Literal<true>;
|
|
1498
|
+
readonly deniedEventKeys: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
|
|
1499
|
+
readonly events: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
1500
|
+
readonly content: Schema.Struct<{
|
|
1501
|
+
readonly assets: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
1502
|
+
readonly assetKey: Schema.NonEmptyString;
|
|
1503
|
+
readonly mediaType: Schema.NonEmptyString;
|
|
1504
|
+
readonly url: Schema.String;
|
|
1505
|
+
}>>>;
|
|
1506
|
+
readonly mentions: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
|
|
1507
|
+
readonly replyToMessageKey: Schema.optionalKey<Schema.NonEmptyString>;
|
|
1508
|
+
readonly text: Schema.String;
|
|
1509
|
+
}>;
|
|
1510
|
+
readonly conversation: Schema.Struct<{
|
|
1511
|
+
readonly conversationKey: Schema.NonEmptyString;
|
|
1512
|
+
readonly kind: Schema.Literals<readonly ["direct", "group"]>;
|
|
1513
|
+
readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
|
|
1514
|
+
}>;
|
|
1515
|
+
readonly eventKey: Schema.NonEmptyString;
|
|
1516
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
1517
|
+
readonly kind: Schema.Literal<"message">;
|
|
1518
|
+
readonly messageKey: Schema.NonEmptyString;
|
|
1519
|
+
readonly respond: Schema.Boolean;
|
|
1520
|
+
readonly senderKey: Schema.NonEmptyString;
|
|
1521
|
+
readonly timestamp: Schema.String;
|
|
1522
|
+
}>, Schema.Struct<{
|
|
1523
|
+
readonly conversation: Schema.Struct<{
|
|
1524
|
+
readonly conversationKey: Schema.NonEmptyString;
|
|
1525
|
+
readonly kind: Schema.Literals<readonly ["direct", "group"]>;
|
|
1526
|
+
readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
|
|
1527
|
+
}>;
|
|
1528
|
+
readonly senderKey: Schema.NonEmptyString;
|
|
1529
|
+
readonly eventKey: Schema.NonEmptyString;
|
|
1530
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
1531
|
+
readonly kind: Schema.Literal<"echo">;
|
|
1532
|
+
readonly messageKey: Schema.NonEmptyString;
|
|
1533
|
+
readonly timestamp: Schema.String;
|
|
1534
|
+
}>, Schema.Struct<{
|
|
1535
|
+
readonly deliveryKey: Schema.NonEmptyString;
|
|
1536
|
+
readonly deliveryUpdateKey: Schema.NonEmptyString;
|
|
1537
|
+
readonly eventKey: Schema.NonEmptyString;
|
|
1538
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
1539
|
+
readonly kind: Schema.Literal<"delivery_update">;
|
|
1540
|
+
readonly providerDeliveryKey: Schema.NonEmptyString;
|
|
1541
|
+
readonly sequence: Schema.Natural;
|
|
1542
|
+
readonly status: Schema.Literals<readonly ["succeeded", "failed"]>;
|
|
1543
|
+
readonly timestamp: Schema.String;
|
|
1544
|
+
}>, Schema.Struct<{
|
|
1545
|
+
readonly conversation: Schema.Struct<{
|
|
1546
|
+
readonly conversationKey: Schema.NonEmptyString;
|
|
1547
|
+
readonly kind: Schema.Literals<readonly ["direct", "group"]>;
|
|
1548
|
+
readonly threadKey: Schema.optionalKey<Schema.NonEmptyString>;
|
|
1549
|
+
}>;
|
|
1550
|
+
readonly senderKey: Schema.NonEmptyString;
|
|
1551
|
+
readonly eventKey: Schema.NonEmptyString;
|
|
1552
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
1553
|
+
readonly kind: Schema.Literal<"stop">;
|
|
1554
|
+
readonly timestamp: Schema.String;
|
|
1555
|
+
}>]>>;
|
|
1556
|
+
readonly response: Schema.optionalKey<Schema.Struct<{
|
|
1557
|
+
readonly body: Schema.String;
|
|
1558
|
+
readonly headers: Schema.optionalKey<Schema.$Record<Schema.NonEmptyString, Schema.String>>;
|
|
1559
|
+
readonly status: Schema.Int;
|
|
1560
|
+
}>>;
|
|
1561
|
+
/** A provider-native setup challenge or ping proved the configured ingress. */
|
|
1562
|
+
readonly activationProof: Schema.optionalKey<Schema.Literal<"verified">>;
|
|
1563
|
+
}>, Schema.Struct<{
|
|
1564
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
1565
|
+
readonly operationKey: Schema.NonEmptyString;
|
|
1566
|
+
readonly kind: Schema.Literal<"deliver">;
|
|
1567
|
+
readonly deliveryKey: Schema.NonEmptyString;
|
|
1568
|
+
readonly status: Schema.Literal<"succeeded">;
|
|
1569
|
+
readonly providerDeliveryKey: Schema.NonEmptyString;
|
|
1570
|
+
}>, Schema.Struct<{
|
|
1571
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
1572
|
+
readonly operationKey: Schema.NonEmptyString;
|
|
1573
|
+
readonly kind: Schema.Literal<"deliver">;
|
|
1574
|
+
readonly deliveryKey: Schema.NonEmptyString;
|
|
1575
|
+
readonly status: Schema.Literal<"pending">;
|
|
1576
|
+
readonly providerDeliveryKey: Schema.NonEmptyString;
|
|
1577
|
+
}>, Schema.Struct<{
|
|
1578
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
1579
|
+
readonly operationKey: Schema.NonEmptyString;
|
|
1580
|
+
readonly kind: Schema.Literal<"deliver">;
|
|
1581
|
+
readonly deliveryKey: Schema.NonEmptyString;
|
|
1582
|
+
readonly status: Schema.Literal<"failed">;
|
|
1583
|
+
readonly code: Schema.Literals<readonly ["rejected", "unauthorized", "rate_limited", "unavailable", "window_closed"]>;
|
|
1584
|
+
}>, Schema.Struct<{
|
|
1585
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
1586
|
+
readonly operationKey: Schema.NonEmptyString;
|
|
1587
|
+
readonly kind: Schema.Literal<"read_context">;
|
|
1588
|
+
readonly messages: Schema.$Array<Schema.Struct<{
|
|
1589
|
+
readonly messageKey: Schema.NonEmptyString;
|
|
1590
|
+
/** The agent's own message. */
|
|
1591
|
+
readonly own: Schema.Boolean;
|
|
1592
|
+
readonly senderKey: Schema.NonEmptyString;
|
|
1593
|
+
readonly senderName: Schema.optionalKey<Schema.NonEmptyString>;
|
|
1594
|
+
readonly text: Schema.String;
|
|
1595
|
+
readonly timestamp: Schema.String;
|
|
1596
|
+
}>>;
|
|
1597
|
+
}>]>, Schema.Struct<{
|
|
1598
|
+
readonly assetKey: Schema.NonEmptyString;
|
|
1599
|
+
readonly extensions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
1600
|
+
readonly file: Schema.Struct<{
|
|
1601
|
+
readonly _tag: Schema.tag<"ToolFile">;
|
|
1602
|
+
readonly contentBase64: Schema.String;
|
|
1603
|
+
readonly contentType: Schema.NullOr<Schema.String>;
|
|
1604
|
+
readonly filename: Schema.NullOr<Schema.String>;
|
|
1605
|
+
readonly sizeBytes: Schema.Natural;
|
|
1606
|
+
}>;
|
|
1607
|
+
readonly kind: Schema.Literal<"read_asset">;
|
|
1608
|
+
readonly operationKey: Schema.NonEmptyString;
|
|
1609
|
+
}>]>;
|
|
1610
|
+
export type CheckedResult = typeof CheckedResult.Type;
|
|
1611
|
+
/** Immutable catalog projection. Live schemas remain the execution validators. */
|
|
1612
|
+
export declare const Contract: Schema.Struct<{
|
|
1613
|
+
readonly definitionSettingsSchemaJson: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
1614
|
+
readonly deploymentSettingsSchemaJson: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
1615
|
+
readonly exposure: Schema.Literals<readonly ["webhook", "host"]>;
|
|
1616
|
+
readonly extensionsSchemaJson: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
1617
|
+
readonly featuresJson: Schema.Struct<{
|
|
1618
|
+
readonly assets: Schema.Boolean;
|
|
1619
|
+
/** Whether replaying one durable delivery key is safe at the provider boundary. */
|
|
1620
|
+
readonly deliveryMode: Schema.Literals<readonly ["idempotent", "at-most-once"]>;
|
|
1621
|
+
readonly deliveryState: Schema.Boolean;
|
|
1622
|
+
readonly directText: Schema.Literal<true>;
|
|
1623
|
+
readonly groups: Schema.Boolean;
|
|
1624
|
+
/** Maximum Unicode code points per physical text message, including server-added prefixes. */
|
|
1625
|
+
readonly maxTextLength: Schema.optionalKey<Schema.Int>;
|
|
1626
|
+
readonly mentions: Schema.Boolean;
|
|
1627
|
+
/** `v2` only: the output operations every destination of this version shows. */
|
|
1628
|
+
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. */
|
|
1630
|
+
readonly readContext: Schema.optionalKey<Schema.Boolean>;
|
|
1631
|
+
readonly replies: Schema.Boolean;
|
|
1632
|
+
/** Maximum age of the original responding input before preparation and delivery. */
|
|
1633
|
+
readonly responseWindowMs: Schema.optionalKey<Schema.Int>;
|
|
1634
|
+
readonly threads: Schema.Boolean;
|
|
1635
|
+
}>;
|
|
1636
|
+
readonly operationInputSchemaJson: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
1637
|
+
readonly operationOutputSchemaJson: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
1638
|
+
readonly protocol: Schema.optionalKey<Schema.Literals<readonly ["v2"]>>;
|
|
1639
|
+
readonly requiredChecks: Schema.Tuple<readonly [Schema.Literal<"access">]>;
|
|
1640
|
+
readonly stateSchemaJson: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
1641
|
+
}>;
|
|
1642
|
+
export type Contract = typeof Contract.Type;
|
|
1643
|
+
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
|
+
readonly definitionSettings: Settings;
|
|
1647
|
+
readonly deploymentSettings: Mappings;
|
|
1648
|
+
readonly state: State;
|
|
1649
|
+
readonly features: Features;
|
|
1650
|
+
readonly exposure: typeof Exposure.Type;
|
|
1651
|
+
readonly requiredChecks: typeof RequiredChecks.Type;
|
|
1652
|
+
/** Explicit subset of the provider's methods; [] means the channel accepts no connection. */
|
|
1653
|
+
readonly authMethods: Methods;
|
|
1654
|
+
/** Each key is provider/name. Values are checked on every command/result/event. */
|
|
1655
|
+
readonly extensions?: Readonly<Record<string, Schema.Top>>;
|
|
1656
|
+
}
|
|
1657
|
+
/** Project the exact declaration once for SDK discovery and server contract comparison. */
|
|
1658
|
+
export declare const projectContract: (definition: Definition, project?: (schema: Schema.Top) => unknown) => Contract;
|
|
1659
|
+
export interface Any extends Pipeable.Pipeable {
|
|
1660
|
+
readonly [TypeId]: TypeId;
|
|
1661
|
+
readonly identifier: string;
|
|
1662
|
+
readonly name: string | undefined;
|
|
1663
|
+
readonly description: string | undefined;
|
|
1664
|
+
readonly definition: Definition;
|
|
1665
|
+
}
|
|
1666
|
+
export interface AgentChannel<out Identifier extends string = string, out D extends Definition = Definition> extends Any {
|
|
1667
|
+
readonly identifier: Identifier;
|
|
1668
|
+
readonly definition: D;
|
|
1669
|
+
}
|
|
1670
|
+
export type ResolvedAuth<Methods extends readonly Any$1[]> = Methods[number] extends (infer M) ? M extends Any$1 ? {
|
|
1671
|
+
readonly methodId: M["identifier"];
|
|
1672
|
+
readonly value: Value<M>;
|
|
1673
|
+
} : never : never;
|
|
1674
|
+
export type HandlerContext<D extends Definition> = {
|
|
1675
|
+
readonly definitionSettings: D["definitionSettings"]["Type"];
|
|
1676
|
+
readonly deploymentSettings: D["deploymentSettings"]["Type"];
|
|
1677
|
+
} & (D["authMethods"] extends readonly [] ? {} : number extends D["authMethods"]["length"] ? {
|
|
1678
|
+
readonly auth?: ResolvedAuth<D["authMethods"]>;
|
|
1679
|
+
} : {
|
|
1680
|
+
readonly auth: ResolvedAuth<D["authMethods"]>;
|
|
1681
|
+
});
|
|
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"]>;
|
|
1690
|
+
export interface RuntimeContract<D extends Definition, R = never> {
|
|
1691
|
+
readonly verify: (request: Request, context: HandlerContext<D>) => Effect.Effect<Verification, HandlerError, R>;
|
|
1692
|
+
readonly checkAccess: (identity: VerifiedIdentity, context: HandlerContext<D>) => Effect.Effect<AccessOutcome, HandlerError, R>;
|
|
1693
|
+
readonly execute: (command: CommandFor<D>, context: HandlerContext<D>) => Effect.Effect<ResultFor<D>, HandlerError, R>;
|
|
1694
|
+
}
|
|
1695
|
+
/** Erased service representation. Input and output are checked by AgentChannelRuntime. */
|
|
1696
|
+
export interface Handler<Id extends string = string> {
|
|
1697
|
+
readonly channelId: Id;
|
|
1698
|
+
readonly context: Context.Context<never>;
|
|
1699
|
+
readonly runtime: {
|
|
1700
|
+
readonly verify: (request: unknown, context: unknown) => Effect.Effect<unknown, unknown, unknown>;
|
|
1701
|
+
readonly checkAccess: (identity: unknown, context: unknown) => Effect.Effect<unknown, unknown, unknown>;
|
|
1702
|
+
readonly execute: (command: unknown, context: unknown) => Effect.Effect<unknown, unknown, unknown>;
|
|
1703
|
+
};
|
|
1704
|
+
}
|
|
1705
|
+
export declare const handlerKey: (channelId: string) => string;
|
|
1706
|
+
/** Validate declarations at registration as well as at builder time. */
|
|
1707
|
+
export declare const validateDefinition: (definition: Definition, providerId?: string, methods?: readonly Any$1[]) => void;
|
|
1708
|
+
export interface ChannelOptions {
|
|
1709
|
+
readonly name?: string;
|
|
1710
|
+
readonly description?: string;
|
|
1711
|
+
}
|
|
1712
|
+
/** Create a Channel from its contract. */
|
|
1713
|
+
export declare const make: <const Id extends string, const O extends Definition & ChannelOptions>(identifier: Id, options: O) => AgentChannel<Id, O>;
|
|
1714
|
+
export declare const isAgentChannel: (value: unknown) => value is Any;
|
|
1715
|
+
//#endregion
|
|
1716
|
+
export { AgentChannel_d_exports };
|
|
1717
|
+
//# sourceMappingURL=AgentChannel.d.ts.map
|