@cloudflare/think 0.24.0 → 0.25.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 +18 -26
- package/dist/{chat-sdk-BEjKXjCm.js → chat-sdk-4Nu96eDX.js} +375 -256
- package/dist/chat-sdk-4Nu96eDX.js.map +1 -0
- package/dist/extensions/index.d.ts +30 -72
- package/dist/extensions/index.js +45 -47
- package/dist/extensions/index.js.map +1 -1
- package/dist/{fetch-DO3uQ9py.js → fetch-BbYxtlff.js} +10 -2
- package/dist/fetch-BbYxtlff.js.map +1 -0
- package/dist/manager-B3rcb_6p.js +493 -0
- package/dist/manager-B3rcb_6p.js.map +1 -0
- package/dist/manager-CWGumyKi.d.ts +3391 -0
- package/dist/messengers/index.d.ts +54 -66
- package/dist/messengers/index.js +2 -2
- package/dist/messengers/telegram.d.ts +4 -4
- package/dist/messengers/telegram.js +1 -1
- package/dist/think.d.ts +2 -2
- package/dist/think.js +8493 -10759
- package/dist/think.js.map +1 -1
- package/dist/tools/extensions.d.ts +1 -1
- package/dist/tools/extensions.js +1 -1
- package/dist/tools/fetch.js +1 -1
- package/dist/workflows.d.ts +5 -2
- package/docs/actions.md +12 -0
- package/docs/channels.md +10 -4
- package/docs/client-tools.md +57 -27
- package/docs/context.md +92 -0
- package/docs/getting-started.md +2 -2
- package/docs/index.md +109 -49
- package/docs/lifecycle-hooks.md +10 -21
- package/docs/multi-chat.md +5 -5
- package/docs/programmatic-submissions.md +28 -10
- package/docs/sub-agents.md +45 -51
- package/docs/tools.md +31 -3
- package/docs/workflows.md +4 -3
- package/package.json +13 -8
- package/dist/chat-sdk-BEjKXjCm.js.map +0 -1
- package/dist/fetch-DO3uQ9py.js.map +0 -1
- package/dist/hook-proxy-DY2sBNa0.js +0 -117
- package/dist/hook-proxy-DY2sBNa0.js.map +0 -1
- package/dist/index-DIQ9oY1t.d.ts +0 -5864
- package/dist/manager-CtXhU1fK.d.ts +0 -243
- package/dist/manager-sfWIcYJT.js +0 -333
- package/dist/manager-sfWIcYJT.js.map +0 -1
|
@@ -1,64 +1,58 @@
|
|
|
1
1
|
import {
|
|
2
|
-
$ as
|
|
3
|
-
|
|
4
|
-
B as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
G as
|
|
10
|
-
H as
|
|
11
|
-
|
|
12
|
-
J as
|
|
13
|
-
K as
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
Q as
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
v as defaultConversationName,
|
|
57
|
-
w as toMessengerMessage,
|
|
58
|
-
x as resolveSelfMention,
|
|
59
|
-
y as idempotencyKeyForEvent,
|
|
60
|
-
z as TextStreamCallbackOptions
|
|
61
|
-
} from "../index-DIQ9oY1t.js";
|
|
2
|
+
$ as ThinkMessengers,
|
|
3
|
+
At as MessengerEvent,
|
|
4
|
+
B as ChatSdkMessengerOptions,
|
|
5
|
+
Ct as messengerReplyRecoveryMode,
|
|
6
|
+
Dt as MessengerAuthor,
|
|
7
|
+
Et as MessengerAttachment,
|
|
8
|
+
Ft as resolveChannelSpeakerLabel,
|
|
9
|
+
G as MessengerConversationTarget,
|
|
10
|
+
H as MessengerConcurrency,
|
|
11
|
+
It as serializableMessengerEvent,
|
|
12
|
+
J as MessengerThinkHost,
|
|
13
|
+
K as MessengerDefinition,
|
|
14
|
+
Lt as toMessengerUserMessage,
|
|
15
|
+
Mt as MessengerMessage,
|
|
16
|
+
Nt as MessengerThread,
|
|
17
|
+
Ot as MessengerCapabilities,
|
|
18
|
+
Pt as messengerContextFromEvent,
|
|
19
|
+
Q as ThinkMessengerStateAgent,
|
|
20
|
+
St as messengerReplyFailureMode,
|
|
21
|
+
Tt as MessengerAction,
|
|
22
|
+
U as MessengerConversationMode,
|
|
23
|
+
V as DEFAULT_MESSENGER_CONCURRENCY,
|
|
24
|
+
W as MessengerConversationResolver,
|
|
25
|
+
X as NormalizedMessengerDefinition,
|
|
26
|
+
Y as MessengerThinkTarget,
|
|
27
|
+
Z as ThinkMessengerRuntime,
|
|
28
|
+
_t as MessengerDeliveryTarget,
|
|
29
|
+
at as resolveSelfMention,
|
|
30
|
+
bt as TextStreamCallbackOptions,
|
|
31
|
+
ct as toMessengerMessage,
|
|
32
|
+
dt as DeliveryKind,
|
|
33
|
+
et as chatSdkMessenger,
|
|
34
|
+
ft as EMPTY_MESSENGER_RESPONSE,
|
|
35
|
+
gt as MessengerDeliverySurface,
|
|
36
|
+
ht as MessengerDeliveryPolicy,
|
|
37
|
+
it as normalizeMessengers,
|
|
38
|
+
jt as MessengerEventKind,
|
|
39
|
+
kt as MessengerContext,
|
|
40
|
+
lt as toMessengerThread,
|
|
41
|
+
mt as INTERRUPTED_MESSENGER_RESPONSE,
|
|
42
|
+
nt as defaultConversationName,
|
|
43
|
+
ot as toMessengerAttachment,
|
|
44
|
+
pt as ERROR_MESSENGER_RESPONSE,
|
|
45
|
+
q as MessengerRespondTo,
|
|
46
|
+
rt as idempotencyKeyForEvent,
|
|
47
|
+
st as toMessengerAuthor,
|
|
48
|
+
tt as defaultChatSdkEvent,
|
|
49
|
+
ut as DeliverMessengerReplyOptions,
|
|
50
|
+
vt as MessengerReplyStage,
|
|
51
|
+
wt as ChannelSpeakerLabel,
|
|
52
|
+
xt as deliverMessengerReply,
|
|
53
|
+
yt as TextStreamCallback,
|
|
54
|
+
z as ChatSdkMessengerEventInput
|
|
55
|
+
} from "../manager-CWGumyKi.js";
|
|
62
56
|
export {
|
|
63
57
|
type ChannelSpeakerLabel,
|
|
64
58
|
type ChatSdkMessengerEventInput,
|
|
@@ -66,11 +60,9 @@ export {
|
|
|
66
60
|
DEFAULT_MESSENGER_CONCURRENCY,
|
|
67
61
|
type DeliverMessengerReplyOptions,
|
|
68
62
|
type DeliveryKind,
|
|
69
|
-
type DeliveryTag,
|
|
70
63
|
EMPTY_MESSENGER_RESPONSE,
|
|
71
64
|
ERROR_MESSENGER_RESPONSE,
|
|
72
65
|
INTERRUPTED_MESSENGER_RESPONSE,
|
|
73
|
-
MESSENGER_REPLY_FIBER_NAME,
|
|
74
66
|
type MessengerAction,
|
|
75
67
|
type MessengerAttachment,
|
|
76
68
|
type MessengerAuthor,
|
|
@@ -87,7 +79,6 @@ export {
|
|
|
87
79
|
type MessengerEvent,
|
|
88
80
|
type MessengerEventKind,
|
|
89
81
|
type MessengerMessage,
|
|
90
|
-
type MessengerReplySnapshot,
|
|
91
82
|
type MessengerReplyStage,
|
|
92
83
|
type MessengerRespondTo,
|
|
93
84
|
type MessengerThinkHost,
|
|
@@ -102,15 +93,12 @@ export {
|
|
|
102
93
|
chatSdkMessenger,
|
|
103
94
|
defaultChatSdkEvent,
|
|
104
95
|
defaultConversationName,
|
|
105
|
-
defaultDeliveryTag,
|
|
106
96
|
deliverMessengerReply,
|
|
107
97
|
idempotencyKeyForEvent,
|
|
108
98
|
messengerContextFromEvent,
|
|
109
99
|
messengerReplyFailureMode,
|
|
110
100
|
messengerReplyRecoveryMode,
|
|
111
|
-
messengerReplySnapshot,
|
|
112
101
|
normalizeMessengers,
|
|
113
|
-
parseMessengerReplySnapshot,
|
|
114
102
|
resolveChannelSpeakerLabel,
|
|
115
103
|
resolveSelfMention,
|
|
116
104
|
serializableMessengerEvent,
|
package/dist/messengers/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { DEFAULT_MESSENGER_CONCURRENCY, EMPTY_MESSENGER_RESPONSE, ERROR_MESSENGER_RESPONSE, INTERRUPTED_MESSENGER_RESPONSE,
|
|
1
|
+
import { A as toMessengerUserMessage, C as deliverMessengerReply, D as messengerContextFromEvent, O as resolveChannelSpeakerLabel, S as TextStreamCallback, T as messengerReplyRecoveryMode, _ as toMessengerThread, b as ERROR_MESSENGER_RESPONSE, f as resolveSelfMention, g as toMessengerMessage, h as toMessengerAuthor, i as chatSdkMessenger, k as serializableMessengerEvent, l as idempotencyKeyForEvent, m as toMessengerAttachment, n as ThinkMessengerRuntime, o as defaultChatSdkEvent, r as ThinkMessengerStateAgent, s as defaultConversationName, t as DEFAULT_MESSENGER_CONCURRENCY, u as normalizeMessengers, w as messengerReplyFailureMode, x as INTERRUPTED_MESSENGER_RESPONSE, y as EMPTY_MESSENGER_RESPONSE } from "../chat-sdk-4Nu96eDX.js";
|
|
2
|
+
export { DEFAULT_MESSENGER_CONCURRENCY, EMPTY_MESSENGER_RESPONSE, ERROR_MESSENGER_RESPONSE, INTERRUPTED_MESSENGER_RESPONSE, TextStreamCallback, ThinkMessengerRuntime, ThinkMessengerStateAgent, chatSdkMessenger, defaultChatSdkEvent, defaultConversationName, deliverMessengerReply, idempotencyKeyForEvent, messengerContextFromEvent, messengerReplyFailureMode, messengerReplyRecoveryMode, normalizeMessengers, resolveChannelSpeakerLabel, resolveSelfMention, serializableMessengerEvent, toMessengerAttachment, toMessengerAuthor, toMessengerMessage, toMessengerThread, toMessengerUserMessage };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from "../
|
|
2
|
+
B as ChatSdkMessengerOptions,
|
|
3
|
+
K as MessengerDefinition,
|
|
4
|
+
yt as TextStreamCallback
|
|
5
|
+
} from "../manager-CWGumyKi.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 { i as chatSdkMessenger } from "../chat-sdk-
|
|
1
|
+
import { i as chatSdkMessenger } from "../chat-sdk-4Nu96eDX.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,3 +1,3 @@
|
|
|
1
|
-
import { $n as
|
|
1
|
+
import { $n as ActionKind, $t as SaveMessagesResult, A as ToolCallDecision, An as ThinkScheduledTaskContext, Bn as ChannelIngress, Bt as ChatRecoveryExhaustedContext, C as StepConfig, Cn as ThinkSubmissionInspection, D as ThinkModel, E as StreamableResult, F as TurnInputMessages, Fn as ChannelCapabilities, Gn as Action, Gt as FiberRecoveryContext, Hn as NormalizedChannelDefinition, Ht as ChatRecoveryProgressContext, I as TurnResult, In as ChannelContext, Jn as ActionAuthorizationContext, Jt as PrepareStepFunction, Kn as ActionApprovalDescriptor, Kt as MessageConcurrency, L as TurnTrigger, Ln as ChannelDefinition, M as TurnConfig, Mn as ThinkScheduledTasks, N as TurnContext, Nn as ThinkTime, O as ThinkModelId, On as ThinkIntervalSchedule, P as TurnInput, Pn as ThinkWallClockSchedule, Qn as ActionIdempotencyKey, Qt as SaveMessagesOptions, R as defaultContextOverflowClassifier, Rn as ChannelDeliveryPolicy, Rt as ChatRecoveryConfig, S as RunTurnWait, Sn as SubmitMessagesResult, T as StreamCallback, Tn as WaitForSubmissionOptions, Un as ThinkChannels, Ut as ChatResponseResult, Vn as ChannelKind, Vt as ChatRecoveryOptions, Wn as messengerChannel, Wt as FiberContext, Xn as ActionConfig, Xt as RejectExecutionOptions, Yn as ActionAuthorizationDecision, Yt as PrepareStepResult, Zn as ActionContext, Zt as ResolvedChatRecoveryConfig, _ as PrepareStepContext, _n as SessionContextOptions, a as ChatErrorClassification, an as SkippedTurnReason, b as RunTurnStream, bn as DeleteSubmissionsOptions, c as ChatOptions, cn as SubmitMessagesOptions, d as ChunkPart, dn as TypedToolCall, dt as DeliveryKind, en as SessionMessage, er as ActionPermissionSpec, f as ContextOverflowConfig, fn as TypedToolResult, g as OnStartDegradation, gn as CompactionErrorHandler, h as MessageMetadataCallback, hn as CompactAfterOptions, i as AddMessagesOptions, in as SkillSource, j as ToolCallResultContext, jn as ThinkScheduledTaskSchedule, k as ToolCallContext, kn as ThinkScheduledTask, l as ChatStartEvent, ln as TextStreamPart, m as ExtensionConfig, mn as MediaEvictionConfig, nn as SkillCatalog, nr as action, o as ChatErrorContext, on as StepResult, p as DeliverNoticeOptions, pn as skills_d_exports, qn as ActionApprovalPolicy, qt as PendingApproval, r as ActiveTurn, rn as SkillRunContext, rr as isAction, s as ChatInterruptedInfo, sn as StopCondition, tn as Skill, tr as ReplyAttachment, u as ChunkContext, un as Think, v as RunTurnBase, vn as ThinkSession, w as StepContext, wn as ThinkSubmissionStatus, x as RunTurnSubmit, xn as ListSubmissionsOptions, y as RunTurnOptions, yn as CancelSubmissionResult, zn as ChannelDeliverySurface, zt as ChatRecoveryContext } from "./manager-CWGumyKi.js";
|
|
2
2
|
import { a as FetchResponseMode, i as FetchRedirectPolicy, l as ThinkWorkspace, n as FetchBindingTarget, o as FetchResult, r as FetchErrorCode, s as FetchToolEvent, t as CreateFetchToolsOptions, u as ThinkWorkspaceFilesystem } from "./fetch-CU2fC7O6.js";
|
|
3
|
-
export { Action, ActionApprovalDescriptor, ActionApprovalPolicy, ActionAuthorizationContext, ActionAuthorizationDecision, ActionConfig, ActionContext, ActionIdempotencyKey, ActionKind, ActionPermissionSpec, ActiveTurn, AddMessagesOptions, CancelSubmissionResult, type ChannelCapabilities, type ChannelContext, type ChannelDefinition, type ChannelDeliveryPolicy, type ChannelDeliverySurface, type ChannelIngress, type ChannelKind, ChatErrorClassification, ChatErrorContext, ChatInterruptedInfo, ChatOptions, type ChatRecoveryConfig, type ChatRecoveryContext, type ChatRecoveryExhaustedContext, type ChatRecoveryOptions, type ChatRecoveryProgressContext, type ChatResponseResult, ChatStartEvent, ChunkContext, ChunkPart, type CompactAfterOptions, type CompactionErrorHandler, ContextOverflowConfig, type CreateFetchToolsOptions, DeleteSubmissionsOptions, DeliverNoticeOptions, type DeliveryKind, type
|
|
3
|
+
export { type Action, type ActionApprovalDescriptor, type ActionApprovalPolicy, type ActionAuthorizationContext, type ActionAuthorizationDecision, type ActionConfig, type ActionContext, type ActionIdempotencyKey, type ActionKind, type ActionPermissionSpec, type ActiveTurn, type AddMessagesOptions, type CancelSubmissionResult, type ChannelCapabilities, type ChannelContext, type ChannelDefinition, type ChannelDeliveryPolicy, type ChannelDeliverySurface, type ChannelIngress, type ChannelKind, type ChatErrorClassification, type ChatErrorContext, type ChatInterruptedInfo, type ChatOptions, type ChatRecoveryConfig, type ChatRecoveryContext, type ChatRecoveryExhaustedContext, type ChatRecoveryOptions, type ChatRecoveryProgressContext, type ChatResponseResult, type ChatStartEvent, type ChunkContext, type ChunkPart, type CompactAfterOptions, type CompactionErrorHandler, type ContextOverflowConfig, type CreateFetchToolsOptions, type DeleteSubmissionsOptions, type DeliverNoticeOptions, type DeliveryKind, type ExtensionConfig, type FetchBindingTarget, type FetchErrorCode, type FetchRedirectPolicy, type FetchResponseMode, type FetchResult, type FetchToolEvent, type FiberContext, type FiberRecoveryContext, type ListSubmissionsOptions, type MediaEvictionConfig, type MessageConcurrency, type MessageMetadataCallback, type NormalizedChannelDefinition, type OnStartDegradation, PendingApproval, type PrepareStepContext, type PrepareStepFunction, type PrepareStepResult, RejectExecutionOptions, type ReplyAttachment, type ResolvedChatRecoveryConfig, type RunTurnBase, type RunTurnOptions, type RunTurnStream, type RunTurnSubmit, type RunTurnWait, type SaveMessagesOptions, type SaveMessagesResult, ThinkSession as Session, ThinkSession, type SessionContextOptions, type SessionMessage, type Skill, type SkillCatalog, type SkillRunContext, type SkillSource, type SkippedTurnReason, type StepConfig, type StepContext, type StepResult, type StopCondition, type StreamCallback, type StreamableResult, SubmitMessagesOptions, type SubmitMessagesResult, type TextStreamPart, Think, type ThinkChannels, type ThinkIntervalSchedule, type ThinkModel, type ThinkModelId, type ThinkScheduledTask, type ThinkScheduledTaskContext, type ThinkScheduledTaskSchedule, type ThinkScheduledTasks, type ThinkSubmissionInspection, type ThinkSubmissionStatus, type ThinkTime, type ThinkWallClockSchedule, type ThinkWorkspace, type ThinkWorkspaceFilesystem, type ToolCallContext, type ToolCallDecision, type ToolCallResultContext, type TurnConfig, type TurnContext, type TurnInput, type TurnInputMessages, type TurnResult, type TurnTrigger, type TypedToolCall, type TypedToolResult, type WaitForSubmissionOptions, action, defaultContextOverflowClassifier, isAction, messengerChannel, skills_d_exports as skills };
|