@cloudflare/think 0.12.1 → 0.13.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/README.md +9 -8
- package/dist/{chat-sdk-Dm0R3pdR.js → chat-sdk-iuBa-CGM.js} +39 -7
- package/dist/chat-sdk-iuBa-CGM.js.map +1 -0
- package/dist/{index-WF0HQmkk.d.ts → index-Cm0jriTY.d.ts} +216 -137
- package/dist/messengers/index.d.ts +44 -38
- package/dist/messengers/index.js +2 -2
- package/dist/messengers/telegram.d.ts +2 -2
- package/dist/messengers/telegram.js +1 -1
- package/dist/think.d.ts +1 -1
- package/dist/think.js +56 -14
- package/dist/think.js.map +1 -1
- package/dist/workflows.d.ts +1 -1
- package/docs/messengers.md +52 -0
- package/package.json +3 -3
- package/dist/chat-sdk-Dm0R3pdR.js.map +0 -1
|
@@ -309,6 +309,20 @@ interface ChatOptions {
|
|
|
309
309
|
onClientToolCall?: ClientToolExecutor;
|
|
310
310
|
/** Channel id this turn belongs to. See {@link RunTurnBase.channel}. */
|
|
311
311
|
channel?: string;
|
|
312
|
+
/**
|
|
313
|
+
* Server-supplied metadata for this turn. Persisted on the turn's user
|
|
314
|
+
* message alongside {@link ChatOptions.channel} (as `metadata.turnMetadata`)
|
|
315
|
+
* so a recovered/continued turn re-resolves it from durable history, and
|
|
316
|
+
* readable during the turn via {@link Think.activeTurnMetadata}.
|
|
317
|
+
*
|
|
318
|
+
* Trust contract mirrors the channel stamp: only server-side callers can set
|
|
319
|
+
* it — reserved metadata keys on client-supplied messages are stripped at
|
|
320
|
+
* intake. This gives messenger/RPC entry points (e.g.
|
|
321
|
+
* {@link Think.chatWithMessengerContext}) a per-turn, recovery-safe carrier
|
|
322
|
+
* for facts like "which authenticated principal initiated this turn" without
|
|
323
|
+
* resorting to mutable agent-wide state.
|
|
324
|
+
*/
|
|
325
|
+
metadata?: Record<string, unknown>;
|
|
312
326
|
}
|
|
313
327
|
/** Input accepted by {@link Think.runTurn}. */
|
|
314
328
|
type TurnInputMessages =
|
|
@@ -1852,6 +1866,14 @@ declare class Think<
|
|
|
1852
1866
|
* Readable from tools/hooks during a turn (e.g. to branch on `kind`).
|
|
1853
1867
|
*/
|
|
1854
1868
|
get activeChannel(): ChannelContext | undefined;
|
|
1869
|
+
/**
|
|
1870
|
+
* The server-supplied metadata stamped on the active turn's user message
|
|
1871
|
+
* ({@link ChatOptions.metadata}). Like the channel stamp, it is persisted on
|
|
1872
|
+
* the durable user message, so recovered/continued turns re-resolve the same
|
|
1873
|
+
* value; client-supplied message metadata can never populate it (reserved
|
|
1874
|
+
* keys are stripped at intake). `undefined` when the turn carried none.
|
|
1875
|
+
*/
|
|
1876
|
+
get activeTurnMetadata(): Record<string, unknown> | undefined;
|
|
1855
1877
|
/** Resolve a channel id to a turn-scoped {@link ChannelContext}, if registered. */
|
|
1856
1878
|
private _resolveChannelContext;
|
|
1857
1879
|
/**
|
|
@@ -1861,12 +1883,17 @@ declare class Think<
|
|
|
1861
1883
|
*/
|
|
1862
1884
|
private _withChannelContext;
|
|
1863
1885
|
/**
|
|
1864
|
-
* Stamp the channel id
|
|
1865
|
-
* re-resolve
|
|
1886
|
+
* Stamp the channel id — and, when supplied, the caller's turn metadata —
|
|
1887
|
+
* onto user messages so a recovered/continued turn can re-resolve both from
|
|
1888
|
+
* durable history.
|
|
1866
1889
|
*/
|
|
1867
1890
|
private _stampChannel;
|
|
1891
|
+
/** Metadata of the latest user message in the given list, if any. */
|
|
1892
|
+
private _latestUserMessageMetadata;
|
|
1868
1893
|
/** The channel stamped on the latest user message in the given list, if any. */
|
|
1869
1894
|
private _channelFromMessages;
|
|
1895
|
+
/** The turn metadata stamped on the latest user message, if any. */
|
|
1896
|
+
private _turnMetadataFromMessages;
|
|
1870
1897
|
/** Re-resolve the channel for a continuation from the latest user message. */
|
|
1871
1898
|
private _channelFromLatestUserMessage;
|
|
1872
1899
|
/**
|
|
@@ -3113,6 +3140,13 @@ declare class Think<
|
|
|
3113
3140
|
* instead of inserting an orphan duplicate.
|
|
3114
3141
|
*/
|
|
3115
3142
|
private _persistIncomingMessage;
|
|
3143
|
+
/**
|
|
3144
|
+
* Strip {@link RESERVED_MESSAGE_METADATA_KEYS} from a client-supplied message
|
|
3145
|
+
* at intake. Those keys are server-written turn context (stamped by
|
|
3146
|
+
* `_stampChannel`) that hooks and recovery re-resolve and trust, so a client
|
|
3147
|
+
* must never be able to forge them.
|
|
3148
|
+
*/
|
|
3149
|
+
private _stripReservedMessageMetadata;
|
|
3116
3150
|
private _persistClientTools;
|
|
3117
3151
|
private _restoreClientTools;
|
|
3118
3152
|
private _persistBody;
|
|
@@ -3867,7 +3901,23 @@ declare function messengerContextFromEvent(
|
|
|
3867
3901
|
declare function serializableMessengerEvent(
|
|
3868
3902
|
event: MessengerEvent
|
|
3869
3903
|
): MessengerEvent;
|
|
3870
|
-
|
|
3904
|
+
/**
|
|
3905
|
+
* Customizes how channel (non-DM) speaker names are prefixed onto model-facing
|
|
3906
|
+
* text. By default, speaker labels use `fullName || userName || userId`.
|
|
3907
|
+
* Direct messages never get a speaker prefix, regardless of this setting.
|
|
3908
|
+
* Return `null`/empty to suppress the prefix for that author.
|
|
3909
|
+
*/
|
|
3910
|
+
type ChannelSpeakerLabel = (
|
|
3911
|
+
author: MessengerAuthor
|
|
3912
|
+
) => string | null | undefined;
|
|
3913
|
+
declare function resolveChannelSpeakerLabel(
|
|
3914
|
+
author: MessengerAuthor | undefined,
|
|
3915
|
+
channelSpeakerLabel?: ChannelSpeakerLabel
|
|
3916
|
+
): string | undefined;
|
|
3917
|
+
declare function toMessengerUserMessage(
|
|
3918
|
+
event: MessengerEvent,
|
|
3919
|
+
channelSpeakerLabel?: ChannelSpeakerLabel
|
|
3920
|
+
): UIMessage;
|
|
3871
3921
|
//#endregion
|
|
3872
3922
|
//#region src/messengers/delivery.d.ts
|
|
3873
3923
|
declare const MESSENGER_REPLY_FIBER_NAME = "think:messenger-reply";
|
|
@@ -4043,6 +4093,14 @@ interface MessengerDefinition {
|
|
|
4043
4093
|
adapter: Adapter;
|
|
4044
4094
|
adapterName: string;
|
|
4045
4095
|
capabilities?: MessengerCapabilities;
|
|
4096
|
+
/**
|
|
4097
|
+
* Customizes how non-DM channel messages are labelled for the model.
|
|
4098
|
+
*
|
|
4099
|
+
* Channel (group) messages use `fullName || userName || userId` by default and
|
|
4100
|
+
* are rendered as `SpeakerName: text` so the model can attribute multi-user
|
|
4101
|
+
* traffic. Direct messages never get a prefix.
|
|
4102
|
+
*/
|
|
4103
|
+
channelSpeakerLabel?: ChannelSpeakerLabel;
|
|
4046
4104
|
conversation?: MessengerConversationMode | MessengerConversationResolver;
|
|
4047
4105
|
delivery?: MessengerDeliveryPolicy;
|
|
4048
4106
|
keyShard?: ChatSdkStateAdapterOptions["keyShard"];
|
|
@@ -4171,6 +4229,24 @@ declare function defaultChatSdkEvent(
|
|
|
4171
4229
|
definition: NormalizedMessengerDefinition,
|
|
4172
4230
|
input: ChatSdkMessengerEventInput
|
|
4173
4231
|
): MessengerEvent;
|
|
4232
|
+
/**
|
|
4233
|
+
* Rewrite the bot's own unresolved self-mention to `@<userName>`.
|
|
4234
|
+
*
|
|
4235
|
+
* Adapters resolve every user's `<@id>` mention to a readable `@DisplayName`
|
|
4236
|
+
* except the bot's own, which is deliberately left as a raw id token so mention
|
|
4237
|
+
* detection can still find it. That raw id is therefore the only unresolved
|
|
4238
|
+
* mention that can survive in the text, so once it has served its purpose we
|
|
4239
|
+
* replace it with the bot's configured handle before the model sees it —
|
|
4240
|
+
* reconstructing the readable `@handle` the sender originally typed. Handles
|
|
4241
|
+
* both the angle-bracket form (`<@U123>` / `<@!U123>`, Slack/Discord) and the
|
|
4242
|
+
* bare `@U123` form some adapters normalize to. No-op when the adapter does not
|
|
4243
|
+
* expose a `botUserId`.
|
|
4244
|
+
*/
|
|
4245
|
+
declare function resolveSelfMention(
|
|
4246
|
+
text: string,
|
|
4247
|
+
botUserId: string | undefined,
|
|
4248
|
+
userName: string
|
|
4249
|
+
): string;
|
|
4174
4250
|
declare function toMessengerThread(thread: Thread): MessengerThread;
|
|
4175
4251
|
declare function toMessengerMessage(message: Message): MessengerMessage;
|
|
4176
4252
|
declare function toMessengerAuthor(author: Author): MessengerAuthor;
|
|
@@ -4179,156 +4255,159 @@ declare function toMessengerAttachment(
|
|
|
4179
4255
|
): MessengerAttachment;
|
|
4180
4256
|
//#endregion
|
|
4181
4257
|
export {
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4258
|
+
MessengerMessage as $,
|
|
4259
|
+
SkillSource$1 as $t,
|
|
4260
|
+
MESSENGER_REPLY_FIBER_NAME as A,
|
|
4261
|
+
TypedToolResult as An,
|
|
4262
|
+
DeliverNoticeOptions as At,
|
|
4263
|
+
messengerReplyFailureMode as B,
|
|
4264
|
+
ChannelDeliverySurface as Bn,
|
|
4265
|
+
PrepareStepResult$1 as Bt,
|
|
4266
|
+
toMessengerThread as C,
|
|
4267
|
+
ToolCallResultContext as Cn,
|
|
4268
|
+
ChatRecoveryProgressContext as Ct,
|
|
4269
|
+
EMPTY_MESSENGER_RESPONSE as D,
|
|
4270
|
+
TurnInputMessages as Dn,
|
|
4271
|
+
ChunkPart as Dt,
|
|
4272
|
+
DeliveryTag as E,
|
|
4273
|
+
TurnInput as En,
|
|
4274
|
+
ChunkContext as Et,
|
|
4275
|
+
MessengerReplyStage as F,
|
|
4276
|
+
skills as Fn,
|
|
4277
|
+
MessageConcurrency$1 as Ft,
|
|
4278
|
+
ChannelSpeakerLabel as G,
|
|
4279
|
+
messengerChannel as Gn,
|
|
4280
|
+
RunTurnStream as Gt,
|
|
4281
|
+
messengerReplySnapshot as H,
|
|
4282
|
+
ChannelKind as Hn,
|
|
4283
|
+
ResolvedChatRecoveryConfig as Ht,
|
|
4284
|
+
TextStreamCallback as I,
|
|
4285
|
+
ChannelCapabilities as In,
|
|
4286
|
+
OnStartDegradation as It,
|
|
4287
|
+
MessengerAuthor as J,
|
|
4288
|
+
SaveMessagesOptions$1 as Jt,
|
|
4289
|
+
MessengerAction as K,
|
|
4290
|
+
MediaEvictionConfig as Kn,
|
|
4291
|
+
RunTurnSubmit as Kt,
|
|
4292
|
+
TextStreamCallbackOptions as L,
|
|
4293
|
+
ChannelContext as Ln,
|
|
4294
|
+
PendingApproval as Lt,
|
|
4295
|
+
MessengerDeliverySurface as M,
|
|
4296
|
+
action as Mn,
|
|
4297
|
+
FiberContext$1 as Mt,
|
|
4298
|
+
MessengerDeliveryTarget as N,
|
|
4299
|
+
defaultContextOverflowClassifier as Nn,
|
|
4300
|
+
FiberRecoveryContext$1 as Nt,
|
|
4301
|
+
ERROR_MESSENGER_RESPONSE as O,
|
|
4302
|
+
TurnResult as On,
|
|
4303
|
+
ContextOverflowConfig as Ot,
|
|
4304
|
+
MessengerReplySnapshot as P,
|
|
4305
|
+
isAction as Pn,
|
|
4306
|
+
ListSubmissionsOptions as Pt,
|
|
4307
|
+
MessengerEventKind as Q,
|
|
4308
|
+
SkillRunContext as Qt,
|
|
4309
|
+
defaultDeliveryTag as R,
|
|
4310
|
+
ChannelDefinition as Rn,
|
|
4311
|
+
PrepareStepContext as Rt,
|
|
4312
|
+
toMessengerMessage as S,
|
|
4313
|
+
ToolCallDecision as Sn,
|
|
4314
|
+
ChatRecoveryOptions$1 as St,
|
|
4315
|
+
DeliveryKind as T,
|
|
4316
|
+
TurnContext as Tn,
|
|
4317
|
+
ChatStartEvent as Tt,
|
|
4318
|
+
parseMessengerReplySnapshot as U,
|
|
4319
|
+
NormalizedChannelDefinition as Un,
|
|
4320
|
+
RunTurnBase as Ut,
|
|
4321
|
+
messengerReplyRecoveryMode as V,
|
|
4322
|
+
ChannelIngress as Vn,
|
|
4323
|
+
ReplyAttachment as Vt,
|
|
4324
|
+
textDeltaFromStreamChunk as W,
|
|
4325
|
+
ThinkChannels as Wn,
|
|
4326
|
+
RunTurnOptions as Wt,
|
|
4327
|
+
MessengerContext as X,
|
|
4328
|
+
Session$1 as Xt,
|
|
4329
|
+
MessengerCapabilities as Y,
|
|
4330
|
+
SaveMessagesResult$1 as Yt,
|
|
4331
|
+
MessengerEvent as Z,
|
|
4332
|
+
SessionMessage$1 as Zt,
|
|
4254
4333
|
idempotencyKeyForEvent as _,
|
|
4255
|
-
|
|
4256
|
-
|
|
4334
|
+
ThinkSubmissionInspection as _n,
|
|
4335
|
+
ChatErrorContext as _t,
|
|
4257
4336
|
MessengerConversationTarget as a,
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4337
|
+
StreamableResult as an,
|
|
4338
|
+
Action as at,
|
|
4339
|
+
toMessengerAttachment as b,
|
|
4340
|
+
ThinkWallClockSchedule as bn,
|
|
4341
|
+
ChatRecoveryContext$1 as bt,
|
|
4263
4342
|
MessengerThinkHost as c,
|
|
4264
|
-
|
|
4265
|
-
|
|
4343
|
+
TextStreamPart as cn,
|
|
4344
|
+
ActionAuthorizationContext as ct,
|
|
4266
4345
|
ThinkMessengerRuntime as d,
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4346
|
+
ThinkModel as dn,
|
|
4347
|
+
ActionContext as dt,
|
|
4348
|
+
StepConfig as en,
|
|
4349
|
+
MessengerThread as et,
|
|
4271
4350
|
ThinkMessengerStateAgent as f,
|
|
4272
|
-
|
|
4273
|
-
|
|
4351
|
+
ThinkModelId as fn,
|
|
4352
|
+
ActionIdempotencyKey as ft,
|
|
4274
4353
|
defaultConversationName as g,
|
|
4275
|
-
|
|
4276
|
-
|
|
4354
|
+
ThinkScheduledTasks as gn,
|
|
4355
|
+
ChatErrorClassification as gt,
|
|
4277
4356
|
defaultChatSdkEvent as h,
|
|
4278
|
-
|
|
4279
|
-
|
|
4357
|
+
ThinkScheduledTaskSchedule as hn,
|
|
4358
|
+
AddMessagesOptions as ht,
|
|
4280
4359
|
MessengerConversationResolver as i,
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4360
|
+
StreamCallback as in,
|
|
4361
|
+
toMessengerUserMessage as it,
|
|
4362
|
+
MessengerDeliveryPolicy as j,
|
|
4363
|
+
Workspace$1 as jn,
|
|
4364
|
+
ExtensionConfig as jt,
|
|
4365
|
+
INTERRUPTED_MESSENGER_RESPONSE as k,
|
|
4366
|
+
TypedToolCall$1 as kn,
|
|
4367
|
+
DeleteSubmissionsOptions as kt,
|
|
4289
4368
|
MessengerThinkTarget as l,
|
|
4290
|
-
|
|
4291
|
-
|
|
4369
|
+
Think as ln,
|
|
4370
|
+
ActionAuthorizationDecision as lt,
|
|
4292
4371
|
chatSdkMessenger as m,
|
|
4293
|
-
|
|
4294
|
-
|
|
4372
|
+
ThinkScheduledTaskContext as mn,
|
|
4373
|
+
ActionPermissionSpec as mt,
|
|
4295
4374
|
ChatSdkMessengerOptions as n,
|
|
4296
|
-
|
|
4297
|
-
|
|
4375
|
+
StepResult as nn,
|
|
4376
|
+
resolveChannelSpeakerLabel as nt,
|
|
4298
4377
|
MessengerDefinition as o,
|
|
4299
|
-
|
|
4300
|
-
|
|
4378
|
+
SubmitMessagesOptions as on,
|
|
4379
|
+
ActionApprovalDescriptor as ot,
|
|
4301
4380
|
ThinkMessengers as p,
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4381
|
+
ThinkScheduledTask as pn,
|
|
4382
|
+
ActionKind as pt,
|
|
4383
|
+
MessengerAttachment as q,
|
|
4384
|
+
RunTurnWait as qt,
|
|
4306
4385
|
MessengerConversationMode as r,
|
|
4307
|
-
|
|
4308
|
-
|
|
4386
|
+
StopCondition$1 as rn,
|
|
4387
|
+
serializableMessengerEvent as rt,
|
|
4309
4388
|
MessengerRespondTo as s,
|
|
4310
|
-
|
|
4311
|
-
|
|
4389
|
+
SubmitMessagesResult as sn,
|
|
4390
|
+
ActionApprovalPolicy as st,
|
|
4312
4391
|
ChatSdkMessengerEventInput as t,
|
|
4313
|
-
|
|
4314
|
-
|
|
4392
|
+
StepContext as tn,
|
|
4393
|
+
messengerContextFromEvent as tt,
|
|
4315
4394
|
NormalizedMessengerDefinition as u,
|
|
4316
|
-
|
|
4317
|
-
|
|
4395
|
+
ThinkIntervalSchedule as un,
|
|
4396
|
+
ActionConfig as ut,
|
|
4318
4397
|
normalizeMessengers as v,
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4398
|
+
ThinkSubmissionStatus as vn,
|
|
4399
|
+
ChatOptions as vt,
|
|
4400
|
+
DeliverMessengerReplyOptions as w,
|
|
4401
|
+
TurnConfig as wn,
|
|
4402
|
+
ChatResponseResult$1 as wt,
|
|
4403
|
+
toMessengerAuthor as x,
|
|
4404
|
+
ToolCallContext as xn,
|
|
4405
|
+
ChatRecoveryExhaustedContext as xt,
|
|
4406
|
+
resolveSelfMention as y,
|
|
4407
|
+
ThinkTime as yn,
|
|
4408
|
+
ChatRecoveryConfig$1 as yt,
|
|
4409
|
+
deliverMessengerReply as z,
|
|
4410
|
+
ChannelDeliveryPolicy as zn,
|
|
4411
|
+
PrepareStepFunction$1 as zt
|
|
4333
4412
|
};
|
|
4334
|
-
//# sourceMappingURL=index-
|
|
4413
|
+
//# sourceMappingURL=index-Cm0jriTY.d.ts.map
|
|
@@ -1,61 +1,65 @@
|
|
|
1
1
|
import {
|
|
2
|
-
$ as
|
|
3
|
-
A as
|
|
4
|
-
B as
|
|
5
|
-
C as
|
|
6
|
-
D as
|
|
7
|
-
E as
|
|
8
|
-
F as
|
|
9
|
-
G as
|
|
10
|
-
H as
|
|
11
|
-
I as
|
|
12
|
-
J as
|
|
13
|
-
K as
|
|
14
|
-
L as
|
|
15
|
-
M as
|
|
16
|
-
N as
|
|
17
|
-
O as
|
|
18
|
-
P as
|
|
19
|
-
Q as
|
|
20
|
-
R as
|
|
21
|
-
S as
|
|
22
|
-
T as
|
|
23
|
-
U as
|
|
24
|
-
V as
|
|
25
|
-
W as
|
|
26
|
-
X as
|
|
27
|
-
Y as
|
|
28
|
-
Z as
|
|
2
|
+
$ as MessengerMessage,
|
|
3
|
+
A as MESSENGER_REPLY_FIBER_NAME,
|
|
4
|
+
B as messengerReplyFailureMode,
|
|
5
|
+
C as toMessengerThread,
|
|
6
|
+
D as EMPTY_MESSENGER_RESPONSE,
|
|
7
|
+
E as DeliveryTag,
|
|
8
|
+
F as MessengerReplyStage,
|
|
9
|
+
G as ChannelSpeakerLabel,
|
|
10
|
+
H as messengerReplySnapshot,
|
|
11
|
+
I as TextStreamCallback,
|
|
12
|
+
J as MessengerAuthor,
|
|
13
|
+
K as MessengerAction,
|
|
14
|
+
L as TextStreamCallbackOptions,
|
|
15
|
+
M as MessengerDeliverySurface,
|
|
16
|
+
N as MessengerDeliveryTarget,
|
|
17
|
+
O as ERROR_MESSENGER_RESPONSE,
|
|
18
|
+
P as MessengerReplySnapshot,
|
|
19
|
+
Q as MessengerEventKind,
|
|
20
|
+
R as defaultDeliveryTag,
|
|
21
|
+
S as toMessengerMessage,
|
|
22
|
+
T as DeliveryKind,
|
|
23
|
+
U as parseMessengerReplySnapshot,
|
|
24
|
+
V as messengerReplyRecoveryMode,
|
|
25
|
+
W as textDeltaFromStreamChunk,
|
|
26
|
+
X as MessengerContext,
|
|
27
|
+
Y as MessengerCapabilities,
|
|
28
|
+
Z as MessengerEvent,
|
|
29
29
|
_ as idempotencyKeyForEvent,
|
|
30
30
|
a as MessengerConversationTarget,
|
|
31
|
-
b as
|
|
31
|
+
b as toMessengerAttachment,
|
|
32
32
|
c as MessengerThinkHost,
|
|
33
33
|
d as ThinkMessengerRuntime,
|
|
34
|
-
et as
|
|
34
|
+
et as MessengerThread,
|
|
35
35
|
f as ThinkMessengerStateAgent,
|
|
36
36
|
g as defaultConversationName,
|
|
37
37
|
h as defaultChatSdkEvent,
|
|
38
38
|
i as MessengerConversationResolver,
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
it as toMessengerUserMessage,
|
|
40
|
+
j as MessengerDeliveryPolicy,
|
|
41
|
+
k as INTERRUPTED_MESSENGER_RESPONSE,
|
|
41
42
|
l as MessengerThinkTarget,
|
|
42
43
|
m as chatSdkMessenger,
|
|
43
44
|
n as ChatSdkMessengerOptions,
|
|
45
|
+
nt as resolveChannelSpeakerLabel,
|
|
44
46
|
o as MessengerDefinition,
|
|
45
47
|
p as ThinkMessengers,
|
|
46
|
-
q as
|
|
48
|
+
q as MessengerAttachment,
|
|
47
49
|
r as MessengerConversationMode,
|
|
50
|
+
rt as serializableMessengerEvent,
|
|
48
51
|
s as MessengerRespondTo,
|
|
49
52
|
t as ChatSdkMessengerEventInput,
|
|
50
|
-
tt as
|
|
53
|
+
tt as messengerContextFromEvent,
|
|
51
54
|
u as NormalizedMessengerDefinition,
|
|
52
55
|
v as normalizeMessengers,
|
|
53
|
-
w as
|
|
54
|
-
x as
|
|
55
|
-
y as
|
|
56
|
-
z as
|
|
57
|
-
} from "../index-
|
|
56
|
+
w as DeliverMessengerReplyOptions,
|
|
57
|
+
x as toMessengerAuthor,
|
|
58
|
+
y as resolveSelfMention,
|
|
59
|
+
z as deliverMessengerReply
|
|
60
|
+
} from "../index-Cm0jriTY.js";
|
|
58
61
|
export {
|
|
62
|
+
type ChannelSpeakerLabel,
|
|
59
63
|
type ChatSdkMessengerEventInput,
|
|
60
64
|
type ChatSdkMessengerOptions,
|
|
61
65
|
type DeliverMessengerReplyOptions,
|
|
@@ -104,6 +108,8 @@ export {
|
|
|
104
108
|
messengerReplySnapshot,
|
|
105
109
|
normalizeMessengers,
|
|
106
110
|
parseMessengerReplySnapshot,
|
|
111
|
+
resolveChannelSpeakerLabel,
|
|
112
|
+
resolveSelfMention,
|
|
107
113
|
serializableMessengerEvent,
|
|
108
114
|
textDeltaFromStreamChunk,
|
|
109
115
|
toMessengerAttachment,
|
package/dist/messengers/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
export { EMPTY_MESSENGER_RESPONSE, ERROR_MESSENGER_RESPONSE, INTERRUPTED_MESSENGER_RESPONSE, MESSENGER_REPLY_FIBER_NAME, TextStreamCallback, ThinkMessengerRuntime, ThinkMessengerStateAgent, chatSdkMessenger, defaultChatSdkEvent, defaultConversationName, defaultDeliveryTag, deliverMessengerReply, idempotencyKeyForEvent, messengerContextFromEvent, messengerReplyFailureMode, messengerReplyRecoveryMode, messengerReplySnapshot, normalizeMessengers, parseMessengerReplySnapshot, serializableMessengerEvent, textDeltaFromStreamChunk, toMessengerAttachment, toMessengerAuthor, toMessengerMessage, toMessengerThread, toMessengerUserMessage };
|
|
1
|
+
import { C as parseMessengerReplySnapshot, D as serializableMessengerEvent, E as resolveChannelSpeakerLabel, O as toMessengerUserMessage, S as messengerReplySnapshot, T as messengerContextFromEvent, _ as TextStreamCallback, a as defaultConversationName, b as messengerReplyFailureMode, c as resolveSelfMention, d as toMessengerMessage, f as toMessengerThread, g as MESSENGER_REPLY_FIBER_NAME, h as INTERRUPTED_MESSENGER_RESPONSE, i as defaultChatSdkEvent, l as toMessengerAttachment, m as ERROR_MESSENGER_RESPONSE, n as ThinkMessengerStateAgent, o as idempotencyKeyForEvent, p as EMPTY_MESSENGER_RESPONSE, r as chatSdkMessenger, s as normalizeMessengers, t as ThinkMessengerRuntime, u as toMessengerAuthor, v as defaultDeliveryTag, w as textDeltaFromStreamChunk, x as messengerReplyRecoveryMode, y as deliverMessengerReply } from "../chat-sdk-iuBa-CGM.js";
|
|
2
|
+
export { EMPTY_MESSENGER_RESPONSE, ERROR_MESSENGER_RESPONSE, INTERRUPTED_MESSENGER_RESPONSE, MESSENGER_REPLY_FIBER_NAME, TextStreamCallback, ThinkMessengerRuntime, ThinkMessengerStateAgent, chatSdkMessenger, defaultChatSdkEvent, defaultConversationName, defaultDeliveryTag, deliverMessengerReply, idempotencyKeyForEvent, messengerContextFromEvent, messengerReplyFailureMode, messengerReplyRecoveryMode, messengerReplySnapshot, normalizeMessengers, parseMessengerReplySnapshot, resolveChannelSpeakerLabel, resolveSelfMention, serializableMessengerEvent, textDeltaFromStreamChunk, toMessengerAttachment, toMessengerAuthor, toMessengerMessage, toMessengerThread, toMessengerUserMessage };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
I as TextStreamCallback,
|
|
3
3
|
n as ChatSdkMessengerOptions,
|
|
4
4
|
o as MessengerDefinition
|
|
5
|
-
} from "../index-
|
|
5
|
+
} from "../index-Cm0jriTY.js";
|
|
6
6
|
import { TelegramAdapterConfig } from "@chat-adapter/telegram";
|
|
7
7
|
|
|
8
8
|
//#region src/messengers/telegram.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as chatSdkMessenger } from "../chat-sdk-
|
|
1
|
+
import { r as chatSdkMessenger } from "../chat-sdk-iuBa-CGM.js";
|
|
2
2
|
import { createTelegramAdapter } from "@chat-adapter/telegram";
|
|
3
3
|
//#region src/messengers/telegram.ts
|
|
4
4
|
const TELEGRAM_STREAM_SOFT_LIMIT = 3400;
|
package/dist/think.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $t as
|
|
1
|
+
import { $t as SkillSource, An as TypedToolResult, At as DeliverNoticeOptions, Bn as ChannelDeliverySurface, Bt as PrepareStepResult, Cn as ToolCallResultContext, Ct as ChatRecoveryProgressContext, Dn as TurnInputMessages, Dt as ChunkPart, E as DeliveryTag, En as TurnInput, Et as ChunkContext, Fn as skills, Ft as MessageConcurrency, Gn as messengerChannel, Gt as RunTurnStream, Hn as ChannelKind, Ht as ResolvedChatRecoveryConfig, In as ChannelCapabilities, It as OnStartDegradation, Jt as SaveMessagesOptions, Kn as MediaEvictionConfig, Kt as RunTurnSubmit, Ln as ChannelContext, Lt as PendingApproval, Mn as action, Mt as FiberContext, Nn as defaultContextOverflowClassifier, Nt as FiberRecoveryContext, On as TurnResult, Ot as ContextOverflowConfig, Pn as isAction, Pt as ListSubmissionsOptions, Qt as SkillRunContext, Rn as ChannelDefinition, Rt as PrepareStepContext, Sn as ToolCallDecision, St as ChatRecoveryOptions, T as DeliveryKind, Tn as TurnContext, Tt as ChatStartEvent, Un as NormalizedChannelDefinition, Ut as RunTurnBase, Vn as ChannelIngress, Vt as ReplyAttachment, Wn as ThinkChannels, Wt as RunTurnOptions, Xt as Session, Yt as SaveMessagesResult, Zt as SessionMessage, _n as ThinkSubmissionInspection, _t as ChatErrorContext, an as StreamableResult, at as Action, bn as ThinkWallClockSchedule, bt as ChatRecoveryContext, cn as TextStreamPart, ct as ActionAuthorizationContext, dn as ThinkModel, dt as ActionContext, en as StepConfig, fn as ThinkModelId, ft as ActionIdempotencyKey, gn as ThinkScheduledTasks, gt as ChatErrorClassification, hn as ThinkScheduledTaskSchedule, ht as AddMessagesOptions, in as StreamCallback, jn as Workspace, jt as ExtensionConfig, kn as TypedToolCall, kt as DeleteSubmissionsOptions, ln as Think, lt as ActionAuthorizationDecision, mn as ThinkScheduledTaskContext, mt as ActionPermissionSpec, nn as StepResult, on as SubmitMessagesOptions, ot as ActionApprovalDescriptor, pn as ThinkScheduledTask, pt as ActionKind, qt as RunTurnWait, rn as StopCondition, sn as SubmitMessagesResult, st as ActionApprovalPolicy, tn as StepContext, un as ThinkIntervalSchedule, ut as ActionConfig, vn as ThinkSubmissionStatus, vt as ChatOptions, wn as TurnConfig, wt as ChatResponseResult, xn as ToolCallContext, xt as ChatRecoveryExhaustedContext, yn as ThinkTime, yt as ChatRecoveryConfig, zn as ChannelDeliveryPolicy, zt as PrepareStepFunction } from "./index-Cm0jriTY.js";
|
|
2
2
|
import { h as WorkspaceLike } from "./workspace-BZXdZcuw.js";
|
|
3
3
|
import { a as FetchResponseMode, i as FetchRedirectPolicy, n as FetchBindingTarget, o as FetchResult, r as FetchErrorCode, s as FetchToolEvent, t as CreateFetchToolsOptions } from "./fetch-By3eIQ-a.js";
|
|
4
4
|
export { Action, ActionApprovalDescriptor, ActionApprovalPolicy, ActionAuthorizationContext, ActionAuthorizationDecision, ActionConfig, ActionContext, ActionIdempotencyKey, ActionKind, ActionPermissionSpec, AddMessagesOptions, type ChannelCapabilities, type ChannelContext, type ChannelDefinition, type ChannelDeliveryPolicy, type ChannelDeliverySurface, type ChannelIngress, type ChannelKind, ChatErrorClassification, ChatErrorContext, ChatOptions, type ChatRecoveryConfig, type ChatRecoveryContext, type ChatRecoveryExhaustedContext, type ChatRecoveryOptions, type ChatRecoveryProgressContext, type ChatResponseResult, ChatStartEvent, ChunkContext, ChunkPart, ContextOverflowConfig, type CreateFetchToolsOptions, DeleteSubmissionsOptions, DeliverNoticeOptions, type DeliveryKind, type DeliveryTag, ExtensionConfig, type FetchBindingTarget, type FetchErrorCode, type FetchRedirectPolicy, type FetchResponseMode, type FetchResult, type FetchToolEvent, type FiberContext, type FiberRecoveryContext, ListSubmissionsOptions, type MediaEvictionConfig, type MessageConcurrency, type NormalizedChannelDefinition, OnStartDegradation, PendingApproval, PrepareStepContext, type PrepareStepFunction, type PrepareStepResult, ReplyAttachment, type ResolvedChatRecoveryConfig, RunTurnBase, RunTurnOptions, RunTurnStream, RunTurnSubmit, RunTurnWait, type SaveMessagesOptions, type SaveMessagesResult, Session, type SessionMessage, type SkillRunContext, type SkillSource, StepConfig, StepContext, type StepResult, type StopCondition, StreamCallback, StreamableResult, SubmitMessagesOptions, SubmitMessagesResult, type TextStreamPart, Think, type ThinkChannels, ThinkIntervalSchedule, ThinkModel, ThinkModelId, ThinkScheduledTask, ThinkScheduledTaskContext, ThinkScheduledTaskSchedule, ThinkScheduledTasks, ThinkSubmissionInspection, ThinkSubmissionStatus, ThinkTime, ThinkWallClockSchedule, ToolCallContext, ToolCallDecision, ToolCallResultContext, TurnConfig, TurnContext, TurnInput, TurnInputMessages, TurnResult, type TypedToolCall, type TypedToolResult, Workspace, type WorkspaceLike, action, defaultContextOverflowClassifier, isAction, messengerChannel, skills };
|