nolo-cli 0.1.9 → 0.1.11
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 +0 -32
- package/agentRuntimeCommands.ts +3 -3
- package/commandRegistry.ts +2 -2
- package/machineCommands.ts +31 -6
- package/package.json +6 -8
- package/ai/agent/_executeModel.ts +0 -118
- package/ai/agent/agentSlice.ts +0 -525
- package/ai/agent/appWorkingMemory.ts +0 -126
- package/ai/agent/avatarUtils.ts +0 -24
- package/ai/agent/buildEditingContext.ts +0 -373
- package/ai/agent/buildSystemPrompt.ts +0 -532
- package/ai/agent/cleanAgentMessages.ts +0 -140
- package/ai/agent/cliChatClient.ts +0 -119
- package/ai/agent/cliExecutor.ts +0 -733
- package/ai/agent/cliPrompt.ts +0 -10
- package/ai/agent/contextCompiler.ts +0 -107
- package/ai/agent/contextLayerContract.ts +0 -44
- package/ai/agent/createAgentSchema.ts +0 -234
- package/ai/agent/executeToolCall.ts +0 -58
- package/ai/agent/fetchAgentContexts.ts +0 -42
- package/ai/agent/generatePrompt.ts +0 -3
- package/ai/agent/getFullChatContextKeys.ts +0 -168
- package/ai/agent/hooks/fetchPublicAgents.ts +0 -133
- package/ai/agent/hooks/useAgentConfig.ts +0 -61
- package/ai/agent/hooks/useAgentDialog.ts +0 -35
- package/ai/agent/hooks/useAgentFormValidation.ts +0 -202
- package/ai/agent/hooks/usePublicAgents.ts +0 -473
- package/ai/agent/machineRunPermissions.ts +0 -95
- package/ai/agent/persistMessageWithFixedId.ts +0 -37
- package/ai/agent/planSlice.ts +0 -259
- package/ai/agent/referenceUtils.ts +0 -229
- package/ai/agent/runAgentBackground.ts +0 -238
- package/ai/agent/runAgentClientLoop.ts +0 -138
- package/ai/agent/runtimeGuidance.ts +0 -97
- package/ai/agent/runtimeServerBase.ts +0 -37
- package/ai/agent/server/fetchPublicAgents.ts +0 -128
- package/ai/agent/startParallelAgentStreams.ts +0 -424
- package/ai/agent/startupProtocol.ts +0 -53
- package/ai/agent/streamAgentChatTurn.ts +0 -1278
- package/ai/agent/streamAgentChatTurnUtils.ts +0 -738
- package/ai/agent/types.ts +0 -71
- package/ai/agent/utils/imageOutput.ts +0 -33
- package/ai/agent/utils/sortUtils.ts +0 -250
- package/ai/agent/web/referencePickerUtils.ts +0 -146
- package/ai/ai.locale.ts +0 -1075
- package/ai/chat/accumulateToolCallChunks.ts +0 -95
- package/ai/chat/fetchUtils.native.ts +0 -276
- package/ai/chat/fetchUtils.ts +0 -153
- package/ai/chat/parseApiError.ts +0 -64
- package/ai/chat/parseMultilineSSE.ts +0 -95
- package/ai/chat/sendOpenAICompletionsRequest.native.ts +0 -682
- package/ai/chat/sendOpenAICompletionsRequest.ts +0 -703
- package/ai/chat/sendOpenAIResponseRequest.ts +0 -491
- package/ai/chat/shouldUseServerProxy.ts +0 -18
- package/ai/chat/sseClient.native.ts +0 -91
- package/ai/chat/sseClient.ts +0 -67
- package/ai/chat/streamReader.native.ts +0 -31
- package/ai/chat/streamReader.ts +0 -62
- package/ai/chat/updateTotalUsage.ts +0 -72
- package/ai/context/buildReferenceContext.ts +0 -437
- package/ai/context/calculateContextUsage.ts +0 -133
- package/ai/context/retention.ts +0 -165
- package/ai/context/tokenUtils.ts +0 -78
- package/ai/index.ts +0 -1
- package/ai/llm/calculateGeminiImageTokens.ts +0 -57
- package/ai/llm/deepinfra.ts +0 -28
- package/ai/llm/fireworks.ts +0 -50
- package/ai/llm/generateRequestBody.ts +0 -165
- package/ai/llm/getModelContextWindow.ts +0 -84
- package/ai/llm/getNoloKey.ts +0 -31
- package/ai/llm/getPricing.ts +0 -199
- package/ai/llm/hooks/useModelPricing.ts +0 -75
- package/ai/llm/imagePricing.ts +0 -40
- package/ai/llm/isResponseAPIModel.ts +0 -13
- package/ai/llm/mimo.ts +0 -71
- package/ai/llm/mistral.ts +0 -22
- package/ai/llm/modelAvatar.ts +0 -427
- package/ai/llm/models.ts +0 -45
- package/ai/llm/openrouterModels.ts +0 -269
- package/ai/llm/providers.ts +0 -306
- package/ai/llm/reasoningModels.ts +0 -28
- package/ai/llm/types.ts +0 -59
- package/ai/llm/usageRequestOptions.ts +0 -59
- package/ai/memory/capture.ts +0 -148
- package/ai/memory/consolidate.ts +0 -104
- package/ai/memory/delete.ts +0 -147
- package/ai/memory/overlay.ts +0 -84
- package/ai/memory/query.ts +0 -38
- package/ai/memory/queryShared.ts +0 -160
- package/ai/memory/rank.ts +0 -105
- package/ai/memory/recentRelationshipRecap.ts +0 -249
- package/ai/memory/remember.ts +0 -167
- package/ai/memory/runtime.ts +0 -76
- package/ai/memory/store.ts +0 -20
- package/ai/memory/storeShared.ts +0 -76
- package/ai/memory/types.ts +0 -46
- package/ai/memory/understanding.ts +0 -349
- package/ai/memory/understandingGreeting.ts +0 -264
- package/ai/messages/type.ts +0 -20
- package/ai/policy/personalizationDialog.ts +0 -333
- package/ai/policy/runtimePolicy.ts +0 -440
- package/ai/policy/selfUpdateFields.ts +0 -48
- package/ai/policy/types.ts +0 -64
- package/ai/skills/referenceRuntime.ts +0 -274
- package/ai/skills/skillDiagnostics.ts +0 -251
- package/ai/skills/skillDocBuilder.ts +0 -139
- package/ai/skills/skillDocProtocol.ts +0 -434
- package/ai/skills/skillReferenceSummary.ts +0 -63
- package/ai/skills/skillSummaryMarker.ts +0 -26
- package/ai/token/calculatePrice.ts +0 -544
- package/ai/token/db.ts +0 -98
- package/ai/token/externalToolCost.ts +0 -330
- package/ai/token/hooks/useRecords.ts +0 -65
- package/ai/token/missingUsageEstimate.ts +0 -42
- package/ai/token/modelUsageQuery.ts +0 -252
- package/ai/token/normalizeUsage.ts +0 -84
- package/ai/token/openaiImageGenerationUsage.ts +0 -56
- package/ai/token/prepareTokenUsageData.ts +0 -88
- package/ai/token/query.ts +0 -88
- package/ai/token/queryUserTokens.ts +0 -59
- package/ai/token/resolveBillingTarget.ts +0 -52
- package/ai/token/saveTokenRecord.ts +0 -53
- package/ai/token/serverDialogProjection.ts +0 -78
- package/ai/token/serverTokenWriter.ts +0 -143
- package/ai/token/stats.ts +0 -21
- package/ai/token/tokenThunks.ts +0 -24
- package/ai/token/types.ts +0 -93
- package/ai/tools/agent/agentTools.ts +0 -176
- package/ai/tools/agent/agentUpdateShared.ts +0 -311
- package/ai/tools/agent/callAgentTool.ts +0 -139
- package/ai/tools/agent/createAgentTool.ts +0 -512
- package/ai/tools/agent/createDialogTool.ts +0 -69
- package/ai/tools/agent/createSkillAgentTool.ts +0 -62
- package/ai/tools/agent/parallelBudget.ts +0 -221
- package/ai/tools/agent/presets/appBuilderPreset.ts +0 -145
- package/ai/tools/agent/runLlmTool.ts +0 -96
- package/ai/tools/agent/runStreamingAgentTool.ts +0 -73
- package/ai/tools/agent/skillAgentArgs.ts +0 -106
- package/ai/tools/agent/skillAgentPreset.ts +0 -89
- package/ai/tools/agent/streamParallelAgentsTool.ts +0 -122
- package/ai/tools/agent/updateAgentTool.ts +0 -96
- package/ai/tools/agent/updateSelfTool.ts +0 -113
- package/ai/tools/amazonProductScraperTool.ts +0 -86
- package/ai/tools/apifyActorClient.ts +0 -45
- package/ai/tools/appEditGuard.ts +0 -372
- package/ai/tools/appReadSnapshot.ts +0 -153
- package/ai/tools/appTools.ts +0 -1549
- package/ai/tools/applyEditTool.ts +0 -256
- package/ai/tools/applyLineEditsTool.ts +0 -312
- package/ai/tools/browserTools/click.ts +0 -33
- package/ai/tools/browserTools/closeSession.ts +0 -29
- package/ai/tools/browserTools/common.ts +0 -27
- package/ai/tools/browserTools/openSession.ts +0 -48
- package/ai/tools/browserTools/readContent.ts +0 -38
- package/ai/tools/browserTools/selectOption.ts +0 -46
- package/ai/tools/browserTools/typeText.ts +0 -42
- package/ai/tools/category/createCategoryTool.ts +0 -66
- package/ai/tools/category/queryContentsByCategoryTool.ts +0 -69
- package/ai/tools/category/updateContentCategoryTool.ts +0 -75
- package/ai/tools/cfBrowserTools.ts +0 -319
- package/ai/tools/cfSpeechToTextTool.ts +0 -49
- package/ai/tools/checkEnvTool.ts +0 -65
- package/ai/tools/cloudflareCrawlTool.ts +0 -289
- package/ai/tools/codeSearchTool.ts +0 -111
- package/ai/tools/codeTools.ts +0 -101
- package/ai/tools/createDocTool.ts +0 -132
- package/ai/tools/createPlanTool.ts +0 -999
- package/ai/tools/createSkillDocTool.ts +0 -155
- package/ai/tools/createWorkflowTool.ts +0 -154
- package/ai/tools/deepseekOcrTool.ts +0 -34
- package/ai/tools/delayTool.ts +0 -31
- package/ai/tools/deleteSpacesTool.ts +0 -325
- package/ai/tools/deleteSpacesToolModel.ts +0 -159
- package/ai/tools/devReloadUtils.ts +0 -29
- package/ai/tools/dialogMessageSearch.ts +0 -137
- package/ai/tools/doctorSkillTool.ts +0 -72
- package/ai/tools/ecommerceScraperTool.ts +0 -86
- package/ai/tools/emailTools.ts +0 -549
- package/ai/tools/evalSkillTool.ts +0 -92
- package/ai/tools/exaSearchTool.ts +0 -64
- package/ai/tools/execBashTool.ts +0 -379
- package/ai/tools/executeSqlTool.ts +0 -192
- package/ai/tools/fetchWebpageSupport.ts +0 -309
- package/ai/tools/fetchWebpageTool.ts +0 -84
- package/ai/tools/geminiImagePreviewTool.ts +0 -361
- package/ai/tools/generateDocxTool.ts +0 -215
- package/ai/tools/googleSearchScraperTool.ts +0 -106
- package/ai/tools/importDataTool.ts +0 -133
- package/ai/tools/importSkillTool.ts +0 -162
- package/ai/tools/index.ts +0 -1858
- package/ai/tools/listFilesTool.ts +0 -82
- package/ai/tools/listUserSpacesTool.ts +0 -113
- package/ai/tools/modelUsageTools.ts +0 -142
- package/ai/tools/olmOcrTool.ts +0 -34
- package/ai/tools/openaiImageTool.ts +0 -218
- package/ai/tools/paddleOcrTool.ts +0 -34
- package/ai/tools/prepareTools.ts +0 -23
- package/ai/tools/readDocTool.ts +0 -84
- package/ai/tools/readFileTool.ts +0 -211
- package/ai/tools/readTool.ts +0 -163
- package/ai/tools/readXPostTool.ts +0 -233
- package/ai/tools/rememberMemoryTool.ts +0 -84
- package/ai/tools/remotionVideoTool.ts +0 -151
- package/ai/tools/searchDialogMessagesTool.ts +0 -222
- package/ai/tools/searchRepoTool.ts +0 -115
- package/ai/tools/searchWorkspaceTool.ts +0 -259
- package/ai/tools/skillFollowup.ts +0 -86
- package/ai/tools/surfWeatherTool.ts +0 -169
- package/ai/tools/table/addTableRowTool.ts +0 -217
- package/ai/tools/table/createTableTool.ts +0 -315
- package/ai/tools/table/rowTools.ts +0 -366
- package/ai/tools/table/schemaTools.ts +0 -244
- package/ai/tools/table/shareTableTool.ts +0 -148
- package/ai/tools/table/toolShared.ts +0 -129
- package/ai/tools/toolApiClient.ts +0 -198
- package/ai/tools/toolNameAliases.ts +0 -57
- package/ai/tools/toolResultError.ts +0 -42
- package/ai/tools/toolRunSlice.ts +0 -303
- package/ai/tools/toolSchemaCompatibility.ts +0 -53
- package/ai/tools/toolVisibility.ts +0 -4
- package/ai/tools/types.ts +0 -20
- package/ai/tools/uiAskChoiceTool.ts +0 -104
- package/ai/tools/updateContentTitleTool.ts +0 -84
- package/ai/tools/updateDocTool.ts +0 -105
- package/ai/tools/updateUserPreferenceProfileTool.ts +0 -145
- package/ai/tools/whisperTool.ts +0 -77
- package/ai/tools/writeFileTool.ts +0 -210
- package/ai/tools/youtubeScraperTool.ts +0 -116
- package/ai/tools/ziweiChartTool.ts +0 -678
- package/ai/types.ts +0 -55
- package/ai/workflow/workflowExecutor.ts +0 -323
- package/ai/workflow/workflowSlice.ts +0 -73
- package/ai/workflow/workflowTypes.ts +0 -106
- package/client/compactDialog.ts +0 -222
- package/connector-experimental/capabilities.ts +0 -73
- package/connector-experimental/codexBinary.ts +0 -41
- package/connector-experimental/heartbeatLoop.ts +0 -22
- package/connector-experimental/index.ts +0 -5
- package/connector-experimental/machineInfo.ts +0 -46
- package/connector-experimental/protocol.ts +0 -54
|
@@ -1,491 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
addActiveController,
|
|
3
|
-
removeActiveController,
|
|
4
|
-
tokenUsageLiveUpdate,
|
|
5
|
-
} from "chat/dialog/dialogSlice";
|
|
6
|
-
import {
|
|
7
|
-
messageStreaming,
|
|
8
|
-
messageStreamEnd,
|
|
9
|
-
} from "chat/messages/messageSlice";
|
|
10
|
-
import { handleToolCalls } from "chat/messages/toolThunks";
|
|
11
|
-
import type { Message } from "chat/messages/types";
|
|
12
|
-
import { selectRuntimeCurrentServer } from "app/stateViews/runtime";
|
|
13
|
-
import { selectCurrentSpaceId } from "create/space/spaceSlice";
|
|
14
|
-
import { getApiEndpoint } from "ai/llm/providers";
|
|
15
|
-
import { createDialogMessageKeyAndId } from "database/keys";
|
|
16
|
-
import { selectCurrentToken } from "auth/authSlice";
|
|
17
|
-
import { extractCustomId } from "core/prefix";
|
|
18
|
-
import type { RootState } from "app/store";
|
|
19
|
-
import { performFetchRequest } from "./fetchUtils";
|
|
20
|
-
import { createSSEParser } from "./parseMultilineSSE";
|
|
21
|
-
import { parseApiError } from "./parseApiError";
|
|
22
|
-
import { updateTotalUsage } from "./updateTotalUsage";
|
|
23
|
-
import type { CompletionMeta } from "./sendOpenAICompletionsRequest";
|
|
24
|
-
import { prepareTools } from "../tools/prepareTools";
|
|
25
|
-
import {
|
|
26
|
-
extractImagePartsFromResponseOutput,
|
|
27
|
-
extractTextFromResponseOutput,
|
|
28
|
-
toResponsesTools,
|
|
29
|
-
type AssistantToolCall,
|
|
30
|
-
} from "integrations/openai/responsesHelpers";
|
|
31
|
-
import { getModelInfo } from "ai/llm/getModelContextWindow";
|
|
32
|
-
|
|
33
|
-
type Segment = { type: "text"; text: string };
|
|
34
|
-
const seg = (txt: string): Segment[] => [{ type: "text", text: txt ?? "" }];
|
|
35
|
-
|
|
36
|
-
const shouldEnableBuiltInImageGeneration = (agentConfig: any): boolean =>
|
|
37
|
-
String(agentConfig?.provider || "").toLowerCase() === "openai" &&
|
|
38
|
-
!getModelInfo(String(agentConfig?.model || ""))?.hasImageOutput &&
|
|
39
|
-
!!agentConfig?.imageConfig?.enabled;
|
|
40
|
-
|
|
41
|
-
type StreamState = {
|
|
42
|
-
content: string;
|
|
43
|
-
contentBuffer: Array<
|
|
44
|
-
{ type: "text"; text: string } | { type: "image_url"; image_url: { url: string } }
|
|
45
|
-
>;
|
|
46
|
-
reasoning: string;
|
|
47
|
-
usage: any | null;
|
|
48
|
-
assistantToolCalls: AssistantToolCall[];
|
|
49
|
-
completedResponse: any | null;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
const safeCancel = async (
|
|
53
|
-
reader?: ReadableStreamDefaultReader<Uint8Array>
|
|
54
|
-
): Promise<void> => {
|
|
55
|
-
if (!reader) return;
|
|
56
|
-
try {
|
|
57
|
-
await reader.cancel();
|
|
58
|
-
} catch {
|
|
59
|
-
/* noop */
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
const ensureToolCall = (
|
|
64
|
-
state: StreamState,
|
|
65
|
-
key: string,
|
|
66
|
-
partial: Partial<AssistantToolCall>
|
|
67
|
-
) => {
|
|
68
|
-
let toolCall = state.assistantToolCalls.find((call) => call.id === key);
|
|
69
|
-
if (!toolCall) {
|
|
70
|
-
toolCall = {
|
|
71
|
-
id: key,
|
|
72
|
-
type: "function",
|
|
73
|
-
function: { name: "", arguments: "" },
|
|
74
|
-
};
|
|
75
|
-
state.assistantToolCalls.push(toolCall);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (partial.id) toolCall.id = partial.id;
|
|
79
|
-
if (partial.function?.name) toolCall.function.name = partial.function.name;
|
|
80
|
-
if (typeof partial.function?.arguments === "string") {
|
|
81
|
-
toolCall.function.arguments = partial.function.arguments;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return toolCall;
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
const extractTextFromOutputItem = (item: any): string => {
|
|
88
|
-
if (item?.type !== "message" || !Array.isArray(item.content)) return "";
|
|
89
|
-
return item.content
|
|
90
|
-
.filter(
|
|
91
|
-
(content: any) =>
|
|
92
|
-
content?.type === "output_text" && typeof content.text === "string"
|
|
93
|
-
)
|
|
94
|
-
.map((content: any) => content.text)
|
|
95
|
-
.join("");
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
const getStreamErrorMessage = (event: any): string => {
|
|
99
|
-
const directMessage =
|
|
100
|
-
typeof event?.message === "string" && event.message.trim()
|
|
101
|
-
? event.message.trim()
|
|
102
|
-
: null;
|
|
103
|
-
if (directMessage) return directMessage;
|
|
104
|
-
|
|
105
|
-
const nestedMessage =
|
|
106
|
-
typeof event?.error?.message === "string" && event.error.message.trim()
|
|
107
|
-
? event.error.message.trim()
|
|
108
|
-
: typeof event?.error?.msg === "string" && event.error.msg.trim()
|
|
109
|
-
? event.error.msg.trim()
|
|
110
|
-
: null;
|
|
111
|
-
if (nestedMessage) return nestedMessage;
|
|
112
|
-
|
|
113
|
-
const nestedCode =
|
|
114
|
-
typeof event?.error?.code === "string" && event.error.code.trim()
|
|
115
|
-
? event.error.code.trim()
|
|
116
|
-
: typeof event?.code === "string" && event.code.trim()
|
|
117
|
-
? event.code.trim()
|
|
118
|
-
: null;
|
|
119
|
-
if (nestedCode) return nestedCode;
|
|
120
|
-
|
|
121
|
-
const nestedType =
|
|
122
|
-
typeof event?.error?.type === "string" && event.error.type.trim()
|
|
123
|
-
? event.error.type.trim()
|
|
124
|
-
: typeof event?.type === "string" && event.type.trim() && event.type !== "error"
|
|
125
|
-
? event.type.trim()
|
|
126
|
-
: null;
|
|
127
|
-
if (nestedType) return nestedType;
|
|
128
|
-
|
|
129
|
-
return "Unknown error";
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
export const sendOpenAIResponseRequest = async ({
|
|
133
|
-
bodyData,
|
|
134
|
-
agentConfig,
|
|
135
|
-
thunkApi,
|
|
136
|
-
dialogKey,
|
|
137
|
-
parentMessageId,
|
|
138
|
-
messageMetadata,
|
|
139
|
-
}: {
|
|
140
|
-
bodyData: any;
|
|
141
|
-
agentConfig: any;
|
|
142
|
-
thunkApi: any;
|
|
143
|
-
dialogKey: string;
|
|
144
|
-
parentMessageId?: string;
|
|
145
|
-
messageMetadata?: Partial<Message>;
|
|
146
|
-
}): Promise<CompletionMeta> => {
|
|
147
|
-
const { dispatch, getState, signal: thunkSignal } = thunkApi;
|
|
148
|
-
const dialogId = extractCustomId(dialogKey);
|
|
149
|
-
const controller = new AbortController();
|
|
150
|
-
thunkSignal.addEventListener("abort", () => controller.abort());
|
|
151
|
-
const signal = controller.signal;
|
|
152
|
-
const streamSpaceId = selectCurrentSpaceId(getState() as RootState) || undefined;
|
|
153
|
-
|
|
154
|
-
let messageId: string;
|
|
155
|
-
let msgKey: string;
|
|
156
|
-
if (parentMessageId) {
|
|
157
|
-
messageId = parentMessageId;
|
|
158
|
-
msgKey = `msg:${dialogId}:${messageId}`;
|
|
159
|
-
} else {
|
|
160
|
-
const newIds = createDialogMessageKeyAndId(dialogId);
|
|
161
|
-
messageId = newIds.messageId;
|
|
162
|
-
msgKey = newIds.key;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
dispatch(addActiveController({ messageId, controller, dialogKey }));
|
|
166
|
-
|
|
167
|
-
const state: StreamState = {
|
|
168
|
-
content: "",
|
|
169
|
-
contentBuffer: [],
|
|
170
|
-
reasoning: "",
|
|
171
|
-
usage: null,
|
|
172
|
-
assistantToolCalls: [],
|
|
173
|
-
completedResponse: null,
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
const buildMeta = (
|
|
177
|
-
hasPendingInteraction = false,
|
|
178
|
-
hasHandedOff = false,
|
|
179
|
-
finishReason: string | null = null
|
|
180
|
-
): CompletionMeta => ({
|
|
181
|
-
hasToolCalls: state.assistantToolCalls.length > 0,
|
|
182
|
-
hasPendingInteraction,
|
|
183
|
-
hasHandedOff,
|
|
184
|
-
finishReason,
|
|
185
|
-
messageId,
|
|
186
|
-
usage: state.usage ?? undefined,
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
const flush = () =>
|
|
190
|
-
dispatch(
|
|
191
|
-
messageStreaming({
|
|
192
|
-
id: messageId,
|
|
193
|
-
dialogId,
|
|
194
|
-
dbKey: msgKey,
|
|
195
|
-
content: state.contentBuffer,
|
|
196
|
-
thinkContent: state.reasoning,
|
|
197
|
-
role: "assistant",
|
|
198
|
-
agentKey: agentConfig.dbKey,
|
|
199
|
-
cybotKey: agentConfig.dbKey,
|
|
200
|
-
...(typeof agentConfig?.name === "string" && agentConfig.name.trim()
|
|
201
|
-
? { agentName: agentConfig.name.trim() }
|
|
202
|
-
: {}),
|
|
203
|
-
...(messageMetadata ?? {}),
|
|
204
|
-
})
|
|
205
|
-
);
|
|
206
|
-
|
|
207
|
-
const finalize = async () => {
|
|
208
|
-
if (!state.content) {
|
|
209
|
-
const completedText = extractTextFromResponseOutput(state.completedResponse);
|
|
210
|
-
if (completedText) {
|
|
211
|
-
state.content = completedText;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
const completedImages = extractImagePartsFromResponseOutput(state.completedResponse);
|
|
216
|
-
if (state.contentBuffer.length === 0) {
|
|
217
|
-
state.contentBuffer = [
|
|
218
|
-
...(state.content ? seg(state.content) : []),
|
|
219
|
-
...completedImages,
|
|
220
|
-
];
|
|
221
|
-
} else if (
|
|
222
|
-
completedImages.length > 0 &&
|
|
223
|
-
!state.contentBuffer.some((part) => part.type === "image_url")
|
|
224
|
-
) {
|
|
225
|
-
state.contentBuffer = [...state.contentBuffer, ...completedImages];
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
if (state.contentBuffer.length === 0 && state.content) {
|
|
229
|
-
state.contentBuffer = seg(state.content);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
flush();
|
|
233
|
-
await dispatch(
|
|
234
|
-
messageStreamEnd({
|
|
235
|
-
finalContentBuffer: state.contentBuffer,
|
|
236
|
-
totalUsage: state.usage,
|
|
237
|
-
msgKey,
|
|
238
|
-
agentConfig,
|
|
239
|
-
dialogId,
|
|
240
|
-
dialogKey,
|
|
241
|
-
messageId,
|
|
242
|
-
reasoningBuffer: state.reasoning,
|
|
243
|
-
messageMetadata,
|
|
244
|
-
toolCalls: state.assistantToolCalls,
|
|
245
|
-
spaceId: streamSpaceId,
|
|
246
|
-
})
|
|
247
|
-
);
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
const processToolCalls = async () => {
|
|
251
|
-
if (!state.assistantToolCalls.length) {
|
|
252
|
-
await finalize();
|
|
253
|
-
return buildMeta(false, false, null);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
if (state.usage) {
|
|
257
|
-
dispatch(
|
|
258
|
-
tokenUsageLiveUpdate({
|
|
259
|
-
input_tokens: state.usage.prompt_tokens ?? state.usage.input_tokens,
|
|
260
|
-
output_tokens:
|
|
261
|
-
state.usage.completion_tokens ?? state.usage.output_tokens,
|
|
262
|
-
cost: state.usage.cost,
|
|
263
|
-
dialogKey,
|
|
264
|
-
})
|
|
265
|
-
);
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
const result = await dispatch(
|
|
269
|
-
handleToolCalls({
|
|
270
|
-
accumulatedCalls: state.assistantToolCalls,
|
|
271
|
-
currentContentBuffer: state.contentBuffer,
|
|
272
|
-
agentConfig,
|
|
273
|
-
messageId,
|
|
274
|
-
dialogId,
|
|
275
|
-
dialogKey,
|
|
276
|
-
parallelSessionId: messageMetadata?.parallelSessionId,
|
|
277
|
-
parallelBranchId: messageMetadata?.parallelBranchId,
|
|
278
|
-
parallelLabel: messageMetadata?.parallelLabel,
|
|
279
|
-
parallelIndex: messageMetadata?.parallelIndex,
|
|
280
|
-
})
|
|
281
|
-
).unwrap();
|
|
282
|
-
|
|
283
|
-
state.content = Array.isArray(result.finalContentBuffer)
|
|
284
|
-
? result.finalContentBuffer
|
|
285
|
-
.filter((part: any) => part?.type === "text")
|
|
286
|
-
.map((part: any) => part.text ?? "")
|
|
287
|
-
.join("")
|
|
288
|
-
: state.content;
|
|
289
|
-
state.contentBuffer = Array.isArray(result.finalContentBuffer)
|
|
290
|
-
? result.finalContentBuffer
|
|
291
|
-
: state.contentBuffer;
|
|
292
|
-
|
|
293
|
-
await finalize();
|
|
294
|
-
return buildMeta(result.hasPendingInteraction, result.hasHandedOff, null);
|
|
295
|
-
};
|
|
296
|
-
|
|
297
|
-
let reader: ReadableStreamDefaultReader<Uint8Array> | undefined;
|
|
298
|
-
|
|
299
|
-
try {
|
|
300
|
-
if (!parentMessageId) {
|
|
301
|
-
dispatch(
|
|
302
|
-
messageStreaming({
|
|
303
|
-
id: messageId,
|
|
304
|
-
dialogId,
|
|
305
|
-
dbKey: msgKey,
|
|
306
|
-
content: "",
|
|
307
|
-
role: "assistant",
|
|
308
|
-
agentKey: agentConfig.dbKey,
|
|
309
|
-
cybotKey: agentConfig.dbKey,
|
|
310
|
-
...(typeof agentConfig?.name === "string" && agentConfig.name.trim()
|
|
311
|
-
? { agentName: agentConfig.name.trim() }
|
|
312
|
-
: {}),
|
|
313
|
-
...(messageMetadata ?? {}),
|
|
314
|
-
isStreaming: true,
|
|
315
|
-
})
|
|
316
|
-
);
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
const functionTools = getModelInfo(agentConfig.model)?.hasImageOutput
|
|
320
|
-
? []
|
|
321
|
-
: prepareTools(agentConfig.tools ?? [], { provider: agentConfig.provider });
|
|
322
|
-
const tools = [
|
|
323
|
-
...(toResponsesTools(functionTools) ?? []),
|
|
324
|
-
...(shouldEnableBuiltInImageGeneration(agentConfig)
|
|
325
|
-
? [{ type: "image_generation" as const }]
|
|
326
|
-
: []),
|
|
327
|
-
];
|
|
328
|
-
const requestBody = {
|
|
329
|
-
...bodyData,
|
|
330
|
-
...(tools.length ? { tools, tool_choice: bodyData.tool_choice ?? "auto" } : {}),
|
|
331
|
-
stream: true,
|
|
332
|
-
};
|
|
333
|
-
|
|
334
|
-
const api = getApiEndpoint(agentConfig);
|
|
335
|
-
const token = selectCurrentToken(getState() as RootState);
|
|
336
|
-
const response = await performFetchRequest({
|
|
337
|
-
agentConfig,
|
|
338
|
-
api,
|
|
339
|
-
bodyData: requestBody,
|
|
340
|
-
currentServer: selectRuntimeCurrentServer(getState() as RootState),
|
|
341
|
-
signal,
|
|
342
|
-
token,
|
|
343
|
-
});
|
|
344
|
-
|
|
345
|
-
if (!response.ok) {
|
|
346
|
-
const errorMessage = await parseApiError(response);
|
|
347
|
-
state.content = `[错误: ${errorMessage}]`;
|
|
348
|
-
await finalize();
|
|
349
|
-
return buildMeta();
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
reader = response.body?.getReader();
|
|
353
|
-
if (!reader) {
|
|
354
|
-
await finalize();
|
|
355
|
-
return buildMeta();
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
const parseSSE = createSSEParser();
|
|
359
|
-
const decoder = new TextDecoder();
|
|
360
|
-
let finishReason: string | null = null;
|
|
361
|
-
|
|
362
|
-
while (true) {
|
|
363
|
-
const { done, value } = await reader.read();
|
|
364
|
-
if (done) break;
|
|
365
|
-
|
|
366
|
-
const chunk = decoder.decode(value, { stream: true });
|
|
367
|
-
const events = parseSSE(chunk);
|
|
368
|
-
const eventList = Array.isArray(events) ? events : [events];
|
|
369
|
-
|
|
370
|
-
for (const event of eventList) {
|
|
371
|
-
if (event?.usage) {
|
|
372
|
-
state.usage = updateTotalUsage(state.usage, event.usage);
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
if (event?.type === "error" || event?.error) {
|
|
376
|
-
state.content += `\n[Error: ${getStreamErrorMessage(event)}]`;
|
|
377
|
-
await finalize();
|
|
378
|
-
return buildMeta();
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
switch (event?.type) {
|
|
382
|
-
case "response.output_text.delta":
|
|
383
|
-
if (event.delta) {
|
|
384
|
-
state.content += event.delta;
|
|
385
|
-
state.contentBuffer = seg(state.content);
|
|
386
|
-
flush();
|
|
387
|
-
}
|
|
388
|
-
break;
|
|
389
|
-
case "response.reasoning.delta":
|
|
390
|
-
if (event.delta?.text) {
|
|
391
|
-
state.reasoning += event.delta.text;
|
|
392
|
-
flush();
|
|
393
|
-
}
|
|
394
|
-
break;
|
|
395
|
-
case "response.reasoning.done":
|
|
396
|
-
if (event.text) {
|
|
397
|
-
state.reasoning += event.text;
|
|
398
|
-
flush();
|
|
399
|
-
}
|
|
400
|
-
break;
|
|
401
|
-
case "response.output_item.added":
|
|
402
|
-
case "response.output_item.done": {
|
|
403
|
-
const item = event.item;
|
|
404
|
-
if (!state.content) {
|
|
405
|
-
const itemText = extractTextFromOutputItem(item);
|
|
406
|
-
if (itemText) {
|
|
407
|
-
state.content = itemText;
|
|
408
|
-
state.contentBuffer = seg(state.content);
|
|
409
|
-
flush();
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
if (item?.type === "function_call") {
|
|
413
|
-
ensureToolCall(state, item.call_id || item.id, {
|
|
414
|
-
id: item.call_id || item.id,
|
|
415
|
-
function: {
|
|
416
|
-
name: item.name || "",
|
|
417
|
-
arguments:
|
|
418
|
-
typeof item.arguments === "string" ? item.arguments : "",
|
|
419
|
-
},
|
|
420
|
-
});
|
|
421
|
-
}
|
|
422
|
-
break;
|
|
423
|
-
}
|
|
424
|
-
case "response.function_call_arguments.delta": {
|
|
425
|
-
const key = event.call_id || event.item_id || `${event.output_index ?? 0}`;
|
|
426
|
-
const toolCall = ensureToolCall(state, key, {
|
|
427
|
-
id: event.call_id || key,
|
|
428
|
-
function: { name: event.name || "", arguments: "" },
|
|
429
|
-
});
|
|
430
|
-
toolCall.function.arguments += event.delta ?? "";
|
|
431
|
-
break;
|
|
432
|
-
}
|
|
433
|
-
case "response.function_call_arguments.done": {
|
|
434
|
-
const key = event.call_id || event.item_id || `${event.output_index ?? 0}`;
|
|
435
|
-
ensureToolCall(state, key, {
|
|
436
|
-
id: event.call_id || key,
|
|
437
|
-
function: {
|
|
438
|
-
name: event.name || "",
|
|
439
|
-
arguments:
|
|
440
|
-
typeof event.arguments === "string"
|
|
441
|
-
? event.arguments
|
|
442
|
-
: typeof event.output?.arguments === "string"
|
|
443
|
-
? event.output.arguments
|
|
444
|
-
: "",
|
|
445
|
-
},
|
|
446
|
-
});
|
|
447
|
-
break;
|
|
448
|
-
}
|
|
449
|
-
case "response.completed":
|
|
450
|
-
state.completedResponse = event.response ?? null;
|
|
451
|
-
finishReason =
|
|
452
|
-
event.response?.status === "completed"
|
|
453
|
-
? "stop"
|
|
454
|
-
: event.response?.status ?? null;
|
|
455
|
-
if (event.response?.usage) {
|
|
456
|
-
state.usage = updateTotalUsage(state.usage, event.response.usage);
|
|
457
|
-
}
|
|
458
|
-
break;
|
|
459
|
-
case "response.failed":
|
|
460
|
-
state.content += `\n[API Failed: ${event.response?.error?.message || "unknown"}]`;
|
|
461
|
-
finishReason = "error";
|
|
462
|
-
await finalize();
|
|
463
|
-
return buildMeta(false, false, finishReason);
|
|
464
|
-
case "response.incomplete":
|
|
465
|
-
state.content += `\n[Incomplete: ${event.response?.incomplete_details?.reason || "unknown"}]`;
|
|
466
|
-
finishReason = "incomplete";
|
|
467
|
-
await finalize();
|
|
468
|
-
return buildMeta(false, false, finishReason);
|
|
469
|
-
default:
|
|
470
|
-
break;
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
const meta = await processToolCalls();
|
|
476
|
-
return {
|
|
477
|
-
...meta,
|
|
478
|
-
finishReason: meta.finishReason ?? finishReason,
|
|
479
|
-
};
|
|
480
|
-
} catch (error: any) {
|
|
481
|
-
state.content +=
|
|
482
|
-
error?.name === "AbortError"
|
|
483
|
-
? "[用户中断]"
|
|
484
|
-
: `[异常: ${error?.message || "unknown"}]`;
|
|
485
|
-
await finalize();
|
|
486
|
-
return buildMeta(false, false, "error");
|
|
487
|
-
} finally {
|
|
488
|
-
dispatch(removeActiveController({ messageId, dialogKey }));
|
|
489
|
-
await safeCancel(reader);
|
|
490
|
-
}
|
|
491
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Agent } from "app/types";
|
|
2
|
-
|
|
3
|
-
export const shouldUseServerProxy = (
|
|
4
|
-
agentConfig: Pick<Agent, "provider" | "useServerProxy">,
|
|
5
|
-
requestProvider?: string
|
|
6
|
-
): boolean => {
|
|
7
|
-
const effectiveProvider = (requestProvider || agentConfig.provider || "").toLowerCase();
|
|
8
|
-
|
|
9
|
-
// Google requests are forced through the server proxy for now because the
|
|
10
|
-
// native Gemini image bridge, provider fallback, and request translation live
|
|
11
|
-
// on the server. Keep this centralized so we can later add direct/custom-url
|
|
12
|
-
// opt-out for user-managed keys without having to update web/native twice.
|
|
13
|
-
if (effectiveProvider === "google") {
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
return !!agentConfig.useServerProxy;
|
|
18
|
-
};
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
// 文件路径: ai/chat/sseClient.native.ts
|
|
2
|
-
// React Native 版 SSE 客户端实现 - 使用 react-native-sse
|
|
3
|
-
|
|
4
|
-
import EventSource from 'react-native-sse';
|
|
5
|
-
|
|
6
|
-
export interface SSEClientOptions {
|
|
7
|
-
url: string;
|
|
8
|
-
method: 'POST';
|
|
9
|
-
headers: Record<string, string>;
|
|
10
|
-
body: string;
|
|
11
|
-
signal?: AbortSignal;
|
|
12
|
-
onMessage: (data: string) => void;
|
|
13
|
-
onError: (error: Error) => void;
|
|
14
|
-
onComplete: () => void;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* React Native 版 SSE 客户端
|
|
19
|
-
* 使用 react-native-sse 库实现
|
|
20
|
-
*/
|
|
21
|
-
export async function createSSEClient(options: SSEClientOptions): Promise<void> {
|
|
22
|
-
const { url, method, headers, body, signal, onMessage, onError, onComplete } = options;
|
|
23
|
-
|
|
24
|
-
return new Promise<void>((resolve) => {
|
|
25
|
-
const es = new EventSource(url, {
|
|
26
|
-
method,
|
|
27
|
-
headers: {
|
|
28
|
-
...headers,
|
|
29
|
-
'Accept': 'text/event-stream',
|
|
30
|
-
},
|
|
31
|
-
body,
|
|
32
|
-
pollingInterval: 0, // 禁用轮询,使用真正的 SSE
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
let isCompleted = false;
|
|
36
|
-
|
|
37
|
-
const cleanup = () => {
|
|
38
|
-
if (!isCompleted) {
|
|
39
|
-
isCompleted = true;
|
|
40
|
-
es.close();
|
|
41
|
-
resolve();
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
// 处理原始消息事件
|
|
46
|
-
es.addEventListener('message', (event: any) => {
|
|
47
|
-
if (event.data) {
|
|
48
|
-
// react-native-sse 返回的是已解析的单行数据
|
|
49
|
-
// 需要包装成 SSE 格式以便 parseMultilineSSE 处理
|
|
50
|
-
onMessage(`data: ${event.data}\n\n`);
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
// 处理打开事件
|
|
55
|
-
es.addEventListener('open', () => {
|
|
56
|
-
console.log('[SSE Native] Connection opened');
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
// 处理错误
|
|
60
|
-
es.addEventListener('error', (event: any) => {
|
|
61
|
-
console.error('[SSE Native] Error:', event);
|
|
62
|
-
if (!isCompleted) {
|
|
63
|
-
// 检查是否是正常结束
|
|
64
|
-
if (event.message?.includes('DONE') || event.type === 'close') {
|
|
65
|
-
onComplete();
|
|
66
|
-
} else {
|
|
67
|
-
onError(new Error(event.message || 'SSE connection error'));
|
|
68
|
-
}
|
|
69
|
-
cleanup();
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
// 处理关闭事件
|
|
74
|
-
es.addEventListener('close', () => {
|
|
75
|
-
console.log('[SSE Native] Connection closed');
|
|
76
|
-
if (!isCompleted) {
|
|
77
|
-
onComplete();
|
|
78
|
-
cleanup();
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
// 处理 abort signal
|
|
83
|
-
if (signal) {
|
|
84
|
-
signal.addEventListener('abort', () => {
|
|
85
|
-
console.log('[SSE Native] Aborted by signal');
|
|
86
|
-
cleanup();
|
|
87
|
-
onComplete();
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
}
|
package/ai/chat/sseClient.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
// 文件路径: ai/chat/sseClient.ts
|
|
2
|
-
// Web 版 SSE 客户端实现 - 使用 fetch + ReadableStream
|
|
3
|
-
|
|
4
|
-
export interface SSEClientOptions {
|
|
5
|
-
url: string;
|
|
6
|
-
method: 'POST';
|
|
7
|
-
headers: Record<string, string>;
|
|
8
|
-
body: string;
|
|
9
|
-
signal?: AbortSignal;
|
|
10
|
-
onMessage: (data: string) => void;
|
|
11
|
-
onError: (error: Error) => void;
|
|
12
|
-
onComplete: () => void;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Web 版 SSE 客户端
|
|
17
|
-
* 使用 fetch + ReadableStream.getReader() 实现流式读取
|
|
18
|
-
*/
|
|
19
|
-
export async function createSSEClient(options: SSEClientOptions): Promise<void> {
|
|
20
|
-
const { url, method, headers, body, signal, onMessage, onError, onComplete } = options;
|
|
21
|
-
|
|
22
|
-
try {
|
|
23
|
-
const response = await fetch(url, {
|
|
24
|
-
method,
|
|
25
|
-
headers,
|
|
26
|
-
body,
|
|
27
|
-
signal,
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
if (!response.ok) {
|
|
31
|
-
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const reader = response.body?.getReader();
|
|
35
|
-
if (!reader) {
|
|
36
|
-
throw new Error('Response body is not readable');
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const decoder = new TextDecoder();
|
|
40
|
-
|
|
41
|
-
try {
|
|
42
|
-
while (true) {
|
|
43
|
-
const { done, value } = await reader.read();
|
|
44
|
-
|
|
45
|
-
if (done) {
|
|
46
|
-
onComplete();
|
|
47
|
-
break;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const chunk = decoder.decode(value, { stream: true });
|
|
51
|
-
onMessage(chunk);
|
|
52
|
-
}
|
|
53
|
-
} finally {
|
|
54
|
-
try {
|
|
55
|
-
await reader.cancel();
|
|
56
|
-
} catch (_e) {
|
|
57
|
-
// ignore cancel errors
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
} catch (error: any) {
|
|
61
|
-
if (error?.name === 'AbortError') {
|
|
62
|
-
onComplete();
|
|
63
|
-
} else {
|
|
64
|
-
onError(error instanceof Error ? error : new Error(String(error)));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
// 文件路径: ai/chat/streamReader.native.ts
|
|
2
|
-
// React Native 版流式读取器 - 使用 react-native-sse
|
|
3
|
-
|
|
4
|
-
import EventSource from 'react-native-sse';
|
|
5
|
-
|
|
6
|
-
export interface StreamReaderOptions {
|
|
7
|
-
response: Response;
|
|
8
|
-
signal?: AbortSignal;
|
|
9
|
-
onChunk: (chunk: string) => void;
|
|
10
|
-
onError: (error: Error) => void;
|
|
11
|
-
onComplete: () => void;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* React Native 版流式读取器
|
|
16
|
-
* 注意:在 RN 中,我们实际上不使用 Response,而是直接走 SSE
|
|
17
|
-
* 这个文件只是为了类型兼容,实际的 SSE 逻辑在 performFetchRequestNative 中
|
|
18
|
-
*/
|
|
19
|
-
export async function readStream(options: StreamReaderOptions): Promise<void> {
|
|
20
|
-
// 在 React Native 中,这个函数不会被调用
|
|
21
|
-
// SSE 处理在 performFetchRequestNative 中完成
|
|
22
|
-
options.onError(new Error('readStream should not be called in React Native'));
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* 检查当前环境是否支持 ReadableStream
|
|
27
|
-
* React Native 返回 false,需要使用 SSE 方式
|
|
28
|
-
*/
|
|
29
|
-
export function supportsReadableStream(): boolean {
|
|
30
|
-
return false;
|
|
31
|
-
}
|