@cloudflare/think 0.12.1 → 0.14.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 +29 -14
- 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-CDNxUctz.d.ts} +254 -142
- 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/studio/assets/{angular-html--XgCyfPu.js → angular-html-Dl5doFtz.js} +1 -1
- package/dist/studio/assets/{angular-ts-Dt-feQIe.js → angular-ts-CbN7_mlY.js} +1 -1
- package/dist/studio/assets/{apl-B7ymkyp4.js → apl-CUTyCKtR.js} +1 -1
- package/dist/studio/assets/{astro-Ce5cw2JI.js → astro-4sWs7Jg3.js} +1 -1
- package/dist/studio/assets/{blade-DL-aXwjv.js → blade-NmhW_pJp.js} +1 -1
- package/dist/studio/assets/{c-CFfr09UF.js → c-_ropPcoN.js} +1 -1
- package/dist/studio/assets/{cobol-Ba1f5ZqR.js → cobol-BacpIX4U.js} +1 -1
- package/dist/studio/assets/{coffee-BG2_viYI.js → coffee-DcwgCl9J.js} +1 -1
- package/dist/studio/assets/{cpp-pU5HgBva.js → cpp-BCPbrI0m.js} +1 -1
- package/dist/studio/assets/{crystal-Dlm_uR4r.js → crystal-DZXQ6wBH.js} +1 -1
- package/dist/studio/assets/{css-tUC4TMTn.js → css-BYyCaTYR.js} +1 -1
- package/dist/studio/assets/{edge-CQuSKMUt.js → edge-CVh9HJt8.js} +1 -1
- package/dist/studio/assets/{elixir-BmIB-Wi1.js → elixir-9uvyi7ZY.js} +1 -1
- package/dist/studio/assets/{elm-ByVNCtDB.js → elm-DDSgRIyn.js} +1 -1
- package/dist/studio/assets/{erb-DO4uDxTq.js → erb-DAVyz0cP.js} +1 -1
- package/dist/studio/assets/{git-rebase-CT8LXapC.js → git-rebase-z3txLW9w.js} +1 -1
- package/dist/studio/assets/{glimmer-js-DzIT0v-m.js → glimmer-js-BRADiKXN.js} +1 -1
- package/dist/studio/assets/{glimmer-ts-znG2j9R4.js → glimmer-ts-B6C6vVGo.js} +1 -1
- package/dist/studio/assets/{glsl-C1p8U_gW.js → glsl-34bCtA9U.js} +1 -1
- package/dist/studio/assets/{graphql-CFqegryf.js → graphql-CL83z2DV.js} +1 -1
- package/dist/studio/assets/{hack-BfVsNhqs.js → hack-B9WxPQav.js} +1 -1
- package/dist/studio/assets/{haml-DVcEksY5.js → haml-oavex6g4.js} +1 -1
- package/dist/studio/assets/{handlebars-DSWgWCJ4.js → handlebars-pd64xhEq.js} +1 -1
- package/dist/studio/assets/{highlighted-body-OFNGDK62-BIm4UpTS.js → highlighted-body-OFNGDK62-DB3-I0_d.js} +1 -1
- package/dist/studio/assets/{html-C-lP7-T4.js → html-A_mALprL.js} +1 -1
- package/dist/studio/assets/{html-derivative-ByukJopb.js → html-derivative-CBwZyoIR.js} +1 -1
- package/dist/studio/assets/{http-Bax2fYIk.js → http-Cua_-o-V.js} +1 -1
- package/dist/studio/assets/{hurl-BrI2qfvy.js → hurl-Dpr8mC4K.js} +1 -1
- package/dist/studio/assets/{index-DNSTOyBe.js → index-DmVgVRjr.js} +86 -86
- package/dist/studio/assets/{java-ZiR-uym-.js → java-B1Ptmnmm.js} +1 -1
- package/dist/studio/assets/{javascript-Dhhw85Vr.js → javascript-waNlhfIS.js} +1 -1
- package/dist/studio/assets/{jinja-DqSGkgE4.js → jinja-D06CyNkk.js} +1 -1
- package/dist/studio/assets/{jison-CwQ0BO-q.js → jison-CQo2g2q_.js} +1 -1
- package/dist/studio/assets/{json-Je3YfUTE.js → json-T8-gmbyP.js} +1 -1
- package/dist/studio/assets/{jsx-Da-dLbW1.js → jsx-pi8aEi7y.js} +1 -1
- package/dist/studio/assets/{julia-CBJ0H-0z.js → julia-DQ0CkLQi.js} +1 -1
- package/dist/studio/assets/{just-CnuRC_nd.js → just-BaZbjeHH.js} +1 -1
- package/dist/studio/assets/{latex-gZANCito.js → latex-CKRYEGLe.js} +1 -1
- package/dist/studio/assets/{liquid-0U9aXoFI.js → liquid-KfgQvxVp.js} +1 -1
- package/dist/studio/assets/{lua-CX_TqMxt.js → lua-BDYsw9Eb.js} +1 -1
- package/dist/studio/assets/{marko-StSURz0o.js → marko-BSPq2tuh.js} +1 -1
- package/dist/studio/assets/{mdc-CXZpf9k1.js → mdc-ZTdTy2-Y.js} +1 -1
- package/dist/studio/assets/mermaid-GHXKKRXX-UMXpy7w5.js +1 -0
- package/dist/studio/assets/{nginx-3Q2L4366.js → nginx-BsBsElo9.js} +1 -1
- package/dist/studio/assets/{nim-CqX_5eXP.js → nim-Fud12WJN.js} +1 -1
- package/dist/studio/assets/{perl-CLOu1GnZ.js → perl-BcRrrqpJ.js} +1 -1
- package/dist/studio/assets/{php-C1vkiu4h.js → php-CvBMy7ll.js} +1 -1
- package/dist/studio/assets/{pug-Cg3cFp5y.js → pug-9fn0F-sp.js} +1 -1
- package/dist/studio/assets/{qml-DhKeHMwt.js → qml-DPYDKGeG.js} +1 -1
- package/dist/studio/assets/{r--Lg2-Sir.js → r-B-BlSOk_.js} +1 -1
- package/dist/studio/assets/{razor-Cjptf146.js → razor-BBsuDNIH.js} +1 -1
- package/dist/studio/assets/{regexp-fS0DAwei.js → regexp-siAWelih.js} +1 -1
- package/dist/studio/assets/{rst-BBajBzk-.js → rst-DpBCyEwj.js} +1 -1
- package/dist/studio/assets/{ruby-KvFedogM.js → ruby-BQ1xX5ej.js} +1 -1
- package/dist/studio/assets/{sas-D6p27LWr.js → sas-Dft5mTiQ.js} +1 -1
- package/dist/studio/assets/{scss-6jXfJVsd.js → scss-BFMJsYGZ.js} +1 -1
- package/dist/studio/assets/{shellscript-BK0Qbt1B.js → shellscript-Cncrs_5T.js} +1 -1
- package/dist/studio/assets/{shellsession-BsXmVRU4.js → shellsession-BngbHbQf.js} +1 -1
- package/dist/studio/assets/{soy-BKtGCXkJ.js → soy-BY5W-W7z.js} +1 -1
- package/dist/studio/assets/{sql-vSUKslBj.js → sql-rEN1gzdE.js} +1 -1
- package/dist/studio/assets/{stata-BQ0iXcs9.js → stata-BDRzO3gs.js} +1 -1
- package/dist/studio/assets/{surrealql-v5pXHIwP.js → surrealql-DgF3SPLS.js} +1 -1
- package/dist/studio/assets/{svelte-BMFjqgJb.js → svelte-BsPFEf_A.js} +1 -1
- package/dist/studio/assets/{templ-DYMTOmIJ.js → templ-D4eIDjcz.js} +1 -1
- package/dist/studio/assets/{tex-BoQem9gj.js → tex-hl_BDesm.js} +1 -1
- package/dist/studio/assets/{ts-tags-Kp2pAlsd.js → ts-tags-mYERLvfx.js} +1 -1
- package/dist/studio/assets/{tsx-DaB2J5uo.js → tsx-4zmdohFv.js} +1 -1
- package/dist/studio/assets/{twig-DohCGJPH.js → twig-J6ElH33g.js} +1 -1
- package/dist/studio/assets/{typescript-BGG-5I-T.js → typescript-DaBxXTXh.js} +1 -1
- package/dist/studio/assets/{vue-CCDLUl9R.js → vue-CnJAvLlE.js} +1 -1
- package/dist/studio/assets/{vue-html-et9GYlaF.js → vue-html-5M7J-A2F.js} +1 -1
- package/dist/studio/assets/{vue-vine-C561z6bx.js → vue-vine-BgG3D4Fz.js} +1 -1
- package/dist/studio/assets/{xml-CJBA1ZPm.js → xml-BuA8iyrb.js} +1 -1
- package/dist/studio/assets/{xsl-De-lf9XG.js → xsl-CEhAy4QP.js} +1 -1
- package/dist/studio/assets/{yaml-BcMKxf75.js → yaml-CKMEvlUE.js} +1 -1
- package/dist/studio/index.html +1 -1
- package/dist/think.d.ts +1 -1
- package/dist/think.js +396 -195
- package/dist/think.js.map +1 -1
- package/dist/workflows.d.ts +1 -1
- package/docs/index.md +16 -0
- package/docs/messengers.md +52 -0
- package/docs/tools.md +19 -2
- package/package.json +6 -6
- package/dist/chat-sdk-Dm0R3pdR.js.map +0 -1
- package/dist/studio/assets/mermaid-GHXKKRXX-CqDQH2-r.js +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 =
|
|
@@ -1220,8 +1234,21 @@ declare class Think<
|
|
|
1220
1234
|
private _activeChatRecoveryRootRequestId;
|
|
1221
1235
|
private static readonly CONFIG_KEYS;
|
|
1222
1236
|
/**
|
|
1223
|
-
*
|
|
1224
|
-
*
|
|
1237
|
+
* Whether Think automatically converts connected MCP tools to AI SDK tools
|
|
1238
|
+
* and merges them into each model turn.
|
|
1239
|
+
*
|
|
1240
|
+
* Set this to `false` when MCP tools are exposed through Code Mode or another
|
|
1241
|
+
* mechanism outside Think's automatic tool set. Connections, discovery,
|
|
1242
|
+
* `waitForMcpConnections`, raw tool listing and calls, and explicit
|
|
1243
|
+
* `this.mcp.getAITools()` calls are unaffected.
|
|
1244
|
+
*
|
|
1245
|
+
* @default true
|
|
1246
|
+
*/
|
|
1247
|
+
includeMcpTools: boolean;
|
|
1248
|
+
/**
|
|
1249
|
+
* Wait for MCP server connections to be ready before the inference loop.
|
|
1250
|
+
* When {@link includeMcpTools} is enabled, their tools are then auto-merged
|
|
1251
|
+
* into the tool set.
|
|
1225
1252
|
*
|
|
1226
1253
|
* Set to `true` for a default 10s timeout, or `{ timeout: ms }`
|
|
1227
1254
|
* for a custom timeout. Defaults to `false` (no waiting).
|
|
@@ -1231,6 +1258,10 @@ declare class Think<
|
|
|
1231
1258
|
| {
|
|
1232
1259
|
timeout: number;
|
|
1233
1260
|
};
|
|
1261
|
+
/** Store model input/output on `chat` spans. */
|
|
1262
|
+
storeMessages: boolean;
|
|
1263
|
+
/** Store tool input/output on `execute_tool` spans. */
|
|
1264
|
+
storeTools: boolean;
|
|
1234
1265
|
private _skillRegistry;
|
|
1235
1266
|
private _loggedSkillWarnings;
|
|
1236
1267
|
private _loggedProtocolWarnings;
|
|
@@ -1814,8 +1845,10 @@ declare class Think<
|
|
|
1814
1845
|
*/
|
|
1815
1846
|
resolveModel(model?: ThinkModel): LanguageModel;
|
|
1816
1847
|
/**
|
|
1817
|
-
* Return the system prompt for the assistant.
|
|
1818
|
-
*
|
|
1848
|
+
* Return the fallback system prompt for the assistant.
|
|
1849
|
+
* Ignored when Session context blocks are configured. Use
|
|
1850
|
+
* `configureSession().withContext()` for always-on instructions that should
|
|
1851
|
+
* coexist with context blocks or skills.
|
|
1819
1852
|
*/
|
|
1820
1853
|
getSystemPrompt(): string;
|
|
1821
1854
|
/** Return the tools available to the assistant. */
|
|
@@ -1852,6 +1885,14 @@ declare class Think<
|
|
|
1852
1885
|
* Readable from tools/hooks during a turn (e.g. to branch on `kind`).
|
|
1853
1886
|
*/
|
|
1854
1887
|
get activeChannel(): ChannelContext | undefined;
|
|
1888
|
+
/**
|
|
1889
|
+
* The server-supplied metadata stamped on the active turn's user message
|
|
1890
|
+
* ({@link ChatOptions.metadata}). Like the channel stamp, it is persisted on
|
|
1891
|
+
* the durable user message, so recovered/continued turns re-resolve the same
|
|
1892
|
+
* value; client-supplied message metadata can never populate it (reserved
|
|
1893
|
+
* keys are stripped at intake). `undefined` when the turn carried none.
|
|
1894
|
+
*/
|
|
1895
|
+
get activeTurnMetadata(): Record<string, unknown> | undefined;
|
|
1855
1896
|
/** Resolve a channel id to a turn-scoped {@link ChannelContext}, if registered. */
|
|
1856
1897
|
private _resolveChannelContext;
|
|
1857
1898
|
/**
|
|
@@ -1861,12 +1902,17 @@ declare class Think<
|
|
|
1861
1902
|
*/
|
|
1862
1903
|
private _withChannelContext;
|
|
1863
1904
|
/**
|
|
1864
|
-
* Stamp the channel id
|
|
1865
|
-
* re-resolve
|
|
1905
|
+
* Stamp the channel id — and, when supplied, the caller's turn metadata —
|
|
1906
|
+
* onto user messages so a recovered/continued turn can re-resolve both from
|
|
1907
|
+
* durable history.
|
|
1866
1908
|
*/
|
|
1867
1909
|
private _stampChannel;
|
|
1910
|
+
/** Metadata of the latest user message in the given list, if any. */
|
|
1911
|
+
private _latestUserMessageMetadata;
|
|
1868
1912
|
/** The channel stamped on the latest user message in the given list, if any. */
|
|
1869
1913
|
private _channelFromMessages;
|
|
1914
|
+
/** The turn metadata stamped on the latest user message, if any. */
|
|
1915
|
+
private _turnMetadataFromMessages;
|
|
1870
1916
|
/** Re-resolve the channel for a continuation from the latest user message. */
|
|
1871
1917
|
private _channelFromLatestUserMessage;
|
|
1872
1918
|
/**
|
|
@@ -2379,12 +2425,27 @@ declare class Think<
|
|
|
2379
2425
|
* catch a genuine overflow.
|
|
2380
2426
|
*/
|
|
2381
2427
|
private _maybeProactiveContextCompact;
|
|
2428
|
+
/**
|
|
2429
|
+
* Finalizes the traced inference stream after a drain loop exits: drains the
|
|
2430
|
+
* abandoned tee branch so the operation span closes even on early exits.
|
|
2431
|
+
* Idempotent (the finalizer is removed before it runs); the drain rides
|
|
2432
|
+
* `ctx.waitUntil` so it survives turn completion without blocking it.
|
|
2433
|
+
*/
|
|
2434
|
+
private _drainInferenceStream;
|
|
2435
|
+
/**
|
|
2436
|
+
* Adds default identity and current-turn metadata to the AI SDK telemetry
|
|
2437
|
+
* options. The class identifies the logical agent implementation, the named
|
|
2438
|
+
* instance identifies the agent resource, and the opaque Durable Object id
|
|
2439
|
+
* identifies its one persisted conversation. Caller values override defaults.
|
|
2440
|
+
*/
|
|
2441
|
+
private _turnTelemetry;
|
|
2382
2442
|
/**
|
|
2383
2443
|
* The single convergence point for all chat turn entry paths.
|
|
2384
2444
|
* Merges tools, assembles context, fires lifecycle hooks, wraps tools
|
|
2385
2445
|
* for interception, and calls streamText.
|
|
2386
2446
|
*/
|
|
2387
2447
|
private _runInferenceLoop;
|
|
2448
|
+
private _prepareInferenceInvocation;
|
|
2388
2449
|
/** @internal Test seam — override in test agents to wrap the stream (e.g. error injection). */
|
|
2389
2450
|
protected _transformInferenceResult(
|
|
2390
2451
|
result: StreamableResult
|
|
@@ -2856,7 +2917,6 @@ declare class Think<
|
|
|
2856
2917
|
options?: SubmitMessagesOptions
|
|
2857
2918
|
): Promise<SubmitMessagesResult>;
|
|
2858
2919
|
private _scheduleSubmissionDrain;
|
|
2859
|
-
private _startSubmissionDrain;
|
|
2860
2920
|
private _hasPendingSubmissions;
|
|
2861
2921
|
_drainThinkSubmissions(): Promise<void>;
|
|
2862
2922
|
private _drainSubmissions;
|
|
@@ -3113,6 +3173,13 @@ declare class Think<
|
|
|
3113
3173
|
* instead of inserting an orphan duplicate.
|
|
3114
3174
|
*/
|
|
3115
3175
|
private _persistIncomingMessage;
|
|
3176
|
+
/**
|
|
3177
|
+
* Strip {@link RESERVED_MESSAGE_METADATA_KEYS} from a client-supplied message
|
|
3178
|
+
* at intake. Those keys are server-written turn context (stamped by
|
|
3179
|
+
* `_stampChannel`) that hooks and recovery re-resolve and trust, so a client
|
|
3180
|
+
* must never be able to forge them.
|
|
3181
|
+
*/
|
|
3182
|
+
private _stripReservedMessageMetadata;
|
|
3116
3183
|
private _persistClientTools;
|
|
3117
3184
|
private _restoreClientTools;
|
|
3118
3185
|
private _persistBody;
|
|
@@ -3867,7 +3934,23 @@ declare function messengerContextFromEvent(
|
|
|
3867
3934
|
declare function serializableMessengerEvent(
|
|
3868
3935
|
event: MessengerEvent
|
|
3869
3936
|
): MessengerEvent;
|
|
3870
|
-
|
|
3937
|
+
/**
|
|
3938
|
+
* Customizes how channel (non-DM) speaker names are prefixed onto model-facing
|
|
3939
|
+
* text. By default, speaker labels use `fullName || userName || userId`.
|
|
3940
|
+
* Direct messages never get a speaker prefix, regardless of this setting.
|
|
3941
|
+
* Return `null`/empty to suppress the prefix for that author.
|
|
3942
|
+
*/
|
|
3943
|
+
type ChannelSpeakerLabel = (
|
|
3944
|
+
author: MessengerAuthor
|
|
3945
|
+
) => string | null | undefined;
|
|
3946
|
+
declare function resolveChannelSpeakerLabel(
|
|
3947
|
+
author: MessengerAuthor | undefined,
|
|
3948
|
+
channelSpeakerLabel?: ChannelSpeakerLabel
|
|
3949
|
+
): string | undefined;
|
|
3950
|
+
declare function toMessengerUserMessage(
|
|
3951
|
+
event: MessengerEvent,
|
|
3952
|
+
channelSpeakerLabel?: ChannelSpeakerLabel
|
|
3953
|
+
): UIMessage;
|
|
3871
3954
|
//#endregion
|
|
3872
3955
|
//#region src/messengers/delivery.d.ts
|
|
3873
3956
|
declare const MESSENGER_REPLY_FIBER_NAME = "think:messenger-reply";
|
|
@@ -4043,6 +4126,14 @@ interface MessengerDefinition {
|
|
|
4043
4126
|
adapter: Adapter;
|
|
4044
4127
|
adapterName: string;
|
|
4045
4128
|
capabilities?: MessengerCapabilities;
|
|
4129
|
+
/**
|
|
4130
|
+
* Customizes how non-DM channel messages are labelled for the model.
|
|
4131
|
+
*
|
|
4132
|
+
* Channel (group) messages use `fullName || userName || userId` by default and
|
|
4133
|
+
* are rendered as `SpeakerName: text` so the model can attribute multi-user
|
|
4134
|
+
* traffic. Direct messages never get a prefix.
|
|
4135
|
+
*/
|
|
4136
|
+
channelSpeakerLabel?: ChannelSpeakerLabel;
|
|
4046
4137
|
conversation?: MessengerConversationMode | MessengerConversationResolver;
|
|
4047
4138
|
delivery?: MessengerDeliveryPolicy;
|
|
4048
4139
|
keyShard?: ChatSdkStateAdapterOptions["keyShard"];
|
|
@@ -4171,6 +4262,24 @@ declare function defaultChatSdkEvent(
|
|
|
4171
4262
|
definition: NormalizedMessengerDefinition,
|
|
4172
4263
|
input: ChatSdkMessengerEventInput
|
|
4173
4264
|
): MessengerEvent;
|
|
4265
|
+
/**
|
|
4266
|
+
* Rewrite the bot's own unresolved self-mention to `@<userName>`.
|
|
4267
|
+
*
|
|
4268
|
+
* Adapters resolve every user's `<@id>` mention to a readable `@DisplayName`
|
|
4269
|
+
* except the bot's own, which is deliberately left as a raw id token so mention
|
|
4270
|
+
* detection can still find it. That raw id is therefore the only unresolved
|
|
4271
|
+
* mention that can survive in the text, so once it has served its purpose we
|
|
4272
|
+
* replace it with the bot's configured handle before the model sees it —
|
|
4273
|
+
* reconstructing the readable `@handle` the sender originally typed. Handles
|
|
4274
|
+
* both the angle-bracket form (`<@U123>` / `<@!U123>`, Slack/Discord) and the
|
|
4275
|
+
* bare `@U123` form some adapters normalize to. No-op when the adapter does not
|
|
4276
|
+
* expose a `botUserId`.
|
|
4277
|
+
*/
|
|
4278
|
+
declare function resolveSelfMention(
|
|
4279
|
+
text: string,
|
|
4280
|
+
botUserId: string | undefined,
|
|
4281
|
+
userName: string
|
|
4282
|
+
): string;
|
|
4174
4283
|
declare function toMessengerThread(thread: Thread): MessengerThread;
|
|
4175
4284
|
declare function toMessengerMessage(message: Message): MessengerMessage;
|
|
4176
4285
|
declare function toMessengerAuthor(author: Author): MessengerAuthor;
|
|
@@ -4179,156 +4288,159 @@ declare function toMessengerAttachment(
|
|
|
4179
4288
|
): MessengerAttachment;
|
|
4180
4289
|
//#endregion
|
|
4181
4290
|
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
|
-
|
|
4291
|
+
MessengerMessage as $,
|
|
4292
|
+
SkillSource$1 as $t,
|
|
4293
|
+
MESSENGER_REPLY_FIBER_NAME as A,
|
|
4294
|
+
TypedToolResult as An,
|
|
4295
|
+
DeliverNoticeOptions as At,
|
|
4296
|
+
messengerReplyFailureMode as B,
|
|
4297
|
+
ChannelDeliverySurface as Bn,
|
|
4298
|
+
PrepareStepResult$1 as Bt,
|
|
4299
|
+
toMessengerThread as C,
|
|
4300
|
+
ToolCallResultContext as Cn,
|
|
4301
|
+
ChatRecoveryProgressContext as Ct,
|
|
4302
|
+
EMPTY_MESSENGER_RESPONSE as D,
|
|
4303
|
+
TurnInputMessages as Dn,
|
|
4304
|
+
ChunkPart as Dt,
|
|
4305
|
+
DeliveryTag as E,
|
|
4306
|
+
TurnInput as En,
|
|
4307
|
+
ChunkContext as Et,
|
|
4308
|
+
MessengerReplyStage as F,
|
|
4309
|
+
skills as Fn,
|
|
4310
|
+
MessageConcurrency$1 as Ft,
|
|
4311
|
+
ChannelSpeakerLabel as G,
|
|
4312
|
+
messengerChannel as Gn,
|
|
4313
|
+
RunTurnStream as Gt,
|
|
4314
|
+
messengerReplySnapshot as H,
|
|
4315
|
+
ChannelKind as Hn,
|
|
4316
|
+
ResolvedChatRecoveryConfig as Ht,
|
|
4317
|
+
TextStreamCallback as I,
|
|
4318
|
+
ChannelCapabilities as In,
|
|
4319
|
+
OnStartDegradation as It,
|
|
4320
|
+
MessengerAuthor as J,
|
|
4321
|
+
SaveMessagesOptions$1 as Jt,
|
|
4322
|
+
MessengerAction as K,
|
|
4323
|
+
MediaEvictionConfig as Kn,
|
|
4324
|
+
RunTurnSubmit as Kt,
|
|
4325
|
+
TextStreamCallbackOptions as L,
|
|
4326
|
+
ChannelContext as Ln,
|
|
4327
|
+
PendingApproval as Lt,
|
|
4328
|
+
MessengerDeliverySurface as M,
|
|
4329
|
+
action as Mn,
|
|
4330
|
+
FiberContext$1 as Mt,
|
|
4331
|
+
MessengerDeliveryTarget as N,
|
|
4332
|
+
defaultContextOverflowClassifier as Nn,
|
|
4333
|
+
FiberRecoveryContext$1 as Nt,
|
|
4334
|
+
ERROR_MESSENGER_RESPONSE as O,
|
|
4335
|
+
TurnResult as On,
|
|
4336
|
+
ContextOverflowConfig as Ot,
|
|
4337
|
+
MessengerReplySnapshot as P,
|
|
4338
|
+
isAction as Pn,
|
|
4339
|
+
ListSubmissionsOptions as Pt,
|
|
4340
|
+
MessengerEventKind as Q,
|
|
4341
|
+
SkillRunContext as Qt,
|
|
4342
|
+
defaultDeliveryTag as R,
|
|
4343
|
+
ChannelDefinition as Rn,
|
|
4344
|
+
PrepareStepContext as Rt,
|
|
4345
|
+
toMessengerMessage as S,
|
|
4346
|
+
ToolCallDecision as Sn,
|
|
4347
|
+
ChatRecoveryOptions$1 as St,
|
|
4348
|
+
DeliveryKind as T,
|
|
4349
|
+
TurnContext as Tn,
|
|
4350
|
+
ChatStartEvent as Tt,
|
|
4351
|
+
parseMessengerReplySnapshot as U,
|
|
4352
|
+
NormalizedChannelDefinition as Un,
|
|
4353
|
+
RunTurnBase as Ut,
|
|
4354
|
+
messengerReplyRecoveryMode as V,
|
|
4355
|
+
ChannelIngress as Vn,
|
|
4356
|
+
ReplyAttachment as Vt,
|
|
4357
|
+
textDeltaFromStreamChunk as W,
|
|
4358
|
+
ThinkChannels as Wn,
|
|
4359
|
+
RunTurnOptions as Wt,
|
|
4360
|
+
MessengerContext as X,
|
|
4361
|
+
Session$1 as Xt,
|
|
4362
|
+
MessengerCapabilities as Y,
|
|
4363
|
+
SaveMessagesResult$1 as Yt,
|
|
4364
|
+
MessengerEvent as Z,
|
|
4365
|
+
SessionMessage$1 as Zt,
|
|
4254
4366
|
idempotencyKeyForEvent as _,
|
|
4255
|
-
|
|
4256
|
-
|
|
4367
|
+
ThinkSubmissionInspection as _n,
|
|
4368
|
+
ChatErrorContext as _t,
|
|
4257
4369
|
MessengerConversationTarget as a,
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4370
|
+
StreamableResult as an,
|
|
4371
|
+
Action as at,
|
|
4372
|
+
toMessengerAttachment as b,
|
|
4373
|
+
ThinkWallClockSchedule as bn,
|
|
4374
|
+
ChatRecoveryContext$1 as bt,
|
|
4263
4375
|
MessengerThinkHost as c,
|
|
4264
|
-
|
|
4265
|
-
|
|
4376
|
+
TextStreamPart as cn,
|
|
4377
|
+
ActionAuthorizationContext as ct,
|
|
4266
4378
|
ThinkMessengerRuntime as d,
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4379
|
+
ThinkModel as dn,
|
|
4380
|
+
ActionContext as dt,
|
|
4381
|
+
StepConfig as en,
|
|
4382
|
+
MessengerThread as et,
|
|
4271
4383
|
ThinkMessengerStateAgent as f,
|
|
4272
|
-
|
|
4273
|
-
|
|
4384
|
+
ThinkModelId as fn,
|
|
4385
|
+
ActionIdempotencyKey as ft,
|
|
4274
4386
|
defaultConversationName as g,
|
|
4275
|
-
|
|
4276
|
-
|
|
4387
|
+
ThinkScheduledTasks as gn,
|
|
4388
|
+
ChatErrorClassification as gt,
|
|
4277
4389
|
defaultChatSdkEvent as h,
|
|
4278
|
-
|
|
4279
|
-
|
|
4390
|
+
ThinkScheduledTaskSchedule as hn,
|
|
4391
|
+
AddMessagesOptions as ht,
|
|
4280
4392
|
MessengerConversationResolver as i,
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4393
|
+
StreamCallback as in,
|
|
4394
|
+
toMessengerUserMessage as it,
|
|
4395
|
+
MessengerDeliveryPolicy as j,
|
|
4396
|
+
Workspace$1 as jn,
|
|
4397
|
+
ExtensionConfig as jt,
|
|
4398
|
+
INTERRUPTED_MESSENGER_RESPONSE as k,
|
|
4399
|
+
TypedToolCall$1 as kn,
|
|
4400
|
+
DeleteSubmissionsOptions as kt,
|
|
4289
4401
|
MessengerThinkTarget as l,
|
|
4290
|
-
|
|
4291
|
-
|
|
4402
|
+
Think as ln,
|
|
4403
|
+
ActionAuthorizationDecision as lt,
|
|
4292
4404
|
chatSdkMessenger as m,
|
|
4293
|
-
|
|
4294
|
-
|
|
4405
|
+
ThinkScheduledTaskContext as mn,
|
|
4406
|
+
ActionPermissionSpec as mt,
|
|
4295
4407
|
ChatSdkMessengerOptions as n,
|
|
4296
|
-
|
|
4297
|
-
|
|
4408
|
+
StepResult as nn,
|
|
4409
|
+
resolveChannelSpeakerLabel as nt,
|
|
4298
4410
|
MessengerDefinition as o,
|
|
4299
|
-
|
|
4300
|
-
|
|
4411
|
+
SubmitMessagesOptions as on,
|
|
4412
|
+
ActionApprovalDescriptor as ot,
|
|
4301
4413
|
ThinkMessengers as p,
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4414
|
+
ThinkScheduledTask as pn,
|
|
4415
|
+
ActionKind as pt,
|
|
4416
|
+
MessengerAttachment as q,
|
|
4417
|
+
RunTurnWait as qt,
|
|
4306
4418
|
MessengerConversationMode as r,
|
|
4307
|
-
|
|
4308
|
-
|
|
4419
|
+
StopCondition$1 as rn,
|
|
4420
|
+
serializableMessengerEvent as rt,
|
|
4309
4421
|
MessengerRespondTo as s,
|
|
4310
|
-
|
|
4311
|
-
|
|
4422
|
+
SubmitMessagesResult as sn,
|
|
4423
|
+
ActionApprovalPolicy as st,
|
|
4312
4424
|
ChatSdkMessengerEventInput as t,
|
|
4313
|
-
|
|
4314
|
-
|
|
4425
|
+
StepContext as tn,
|
|
4426
|
+
messengerContextFromEvent as tt,
|
|
4315
4427
|
NormalizedMessengerDefinition as u,
|
|
4316
|
-
|
|
4317
|
-
|
|
4428
|
+
ThinkIntervalSchedule as un,
|
|
4429
|
+
ActionConfig as ut,
|
|
4318
4430
|
normalizeMessengers as v,
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4431
|
+
ThinkSubmissionStatus as vn,
|
|
4432
|
+
ChatOptions as vt,
|
|
4433
|
+
DeliverMessengerReplyOptions as w,
|
|
4434
|
+
TurnConfig as wn,
|
|
4435
|
+
ChatResponseResult$1 as wt,
|
|
4436
|
+
toMessengerAuthor as x,
|
|
4437
|
+
ToolCallContext as xn,
|
|
4438
|
+
ChatRecoveryExhaustedContext as xt,
|
|
4439
|
+
resolveSelfMention as y,
|
|
4440
|
+
ThinkTime as yn,
|
|
4441
|
+
ChatRecoveryConfig$1 as yt,
|
|
4442
|
+
deliverMessengerReply as z,
|
|
4443
|
+
ChannelDeliveryPolicy as zn,
|
|
4444
|
+
PrepareStepFunction$1 as zt
|
|
4333
4445
|
};
|
|
4334
|
-
//# sourceMappingURL=index-
|
|
4446
|
+
//# sourceMappingURL=index-CDNxUctz.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-CDNxUctz.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-CDNxUctz.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;
|