@blade-hq/agent-client 1.2.1-beta.1 → 1.2.1-beta.3
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/dist/index.js +28 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -977,6 +977,12 @@ var ClientProjectionBuilder = class {
|
|
|
977
977
|
return null;
|
|
978
978
|
}
|
|
979
979
|
switch (event.type) {
|
|
980
|
+
case "llm:stream:reset":
|
|
981
|
+
state.blocks = [];
|
|
982
|
+
state.toolCalls = [];
|
|
983
|
+
state.usage = null;
|
|
984
|
+
state.responseDone = false;
|
|
985
|
+
return this.syncPatch(state);
|
|
980
986
|
case "llm:thinking:delta":
|
|
981
987
|
return this.onDelta(state, "thinking", "", String(payload.content ?? ""));
|
|
982
988
|
case "llm:content:delta":
|
|
@@ -4114,7 +4120,7 @@ function resolveAuthToken(options) {
|
|
|
4114
4120
|
|
|
4115
4121
|
// src/version.ts
|
|
4116
4122
|
var SDK_NAME = "agent-client";
|
|
4117
|
-
var SDK_VERSION = true ? "1.2.1-beta.
|
|
4123
|
+
var SDK_VERSION = true ? "1.2.1-beta.3" : "1.1.1";
|
|
4118
4124
|
|
|
4119
4125
|
// src/socket.ts
|
|
4120
4126
|
function withSdkIdentity(auth) {
|
|
@@ -4462,12 +4468,31 @@ function resolveTokenOption(tokenOption) {
|
|
|
4462
4468
|
const token = typeof tokenOption === "function" ? tokenOption() : tokenOption;
|
|
4463
4469
|
return token ? token : null;
|
|
4464
4470
|
}
|
|
4471
|
+
var SANDBOX_ONLY_HOST = "host.docker.internal";
|
|
4465
4472
|
function normalizeBaseUrl(baseUrl) {
|
|
4466
4473
|
const normalized = baseUrl.trim().replace(/\/+$/, "");
|
|
4467
|
-
if (
|
|
4474
|
+
if (typeof window === "undefined") {
|
|
4468
4475
|
return normalized;
|
|
4469
4476
|
}
|
|
4470
|
-
|
|
4477
|
+
if (!normalized) {
|
|
4478
|
+
return window.location.origin;
|
|
4479
|
+
}
|
|
4480
|
+
assertBrowserReachable(normalized);
|
|
4481
|
+
return normalized;
|
|
4482
|
+
}
|
|
4483
|
+
function assertBrowserReachable(baseUrl) {
|
|
4484
|
+
let hostname;
|
|
4485
|
+
try {
|
|
4486
|
+
hostname = new URL(baseUrl, window.location.href).hostname;
|
|
4487
|
+
} catch {
|
|
4488
|
+
return;
|
|
4489
|
+
}
|
|
4490
|
+
if (hostname !== SANDBOX_ONLY_HOST) {
|
|
4491
|
+
return;
|
|
4492
|
+
}
|
|
4493
|
+
throw new Error(
|
|
4494
|
+
`Blade Agent \u5730\u5740 ${baseUrl} \u53EA\u6709\u6C99\u76D2\u5185\u90E8\u89E3\u6790\u5F97\u5230\uFF0C\u6D4F\u89C8\u5668\u6253\u4E0D\u5F00\u3002\u8BF7\u628A\u5B83\u6539\u6210\u7528\u6237\u6D4F\u89C8\u5668\u80FD\u8BBF\u95EE\u7684\u5730\u5740\uFF08\u901A\u5E38\u662F\u8BBF\u95EE\u8FD9\u4E2A\u5E94\u7528\u65F6\u7528\u7684\u4E3B\u673A\u540D + Blade Server \u7AEF\u53E3\uFF09\u3002`
|
|
4495
|
+
);
|
|
4471
4496
|
}
|
|
4472
4497
|
function isFormData(value) {
|
|
4473
4498
|
return typeof FormData !== "undefined" && value instanceof FormData;
|