@blade-hq/agent-client 2612.0.0-beta.22 → 2612.0.0-beta.24
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 +1 -0
- package/dist/blade-client.d.ts +2 -0
- package/dist/{chunk-C3DI7OI7.js → chunk-VLJNZ6J5.js} +16 -4
- package/dist/chunk-VLJNZ6J5.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/internal.js +3 -1
- package/dist/internal.js.map +1 -1
- package/dist/resources/sandbox.d.ts +19 -0
- package/dist/schemas/session.d.ts +0 -1
- package/package.json +1 -1
- package/public-api.md +25 -3
- package/dist/chunk-C3DI7OI7.js.map +0 -1
package/README.md
CHANGED
|
@@ -742,6 +742,7 @@ chat.renderers = {
|
|
|
742
742
|
- **页面协作**:`CommandHandler`、`BladeChatMountRenderers`、`MountRenderer`、`MountRendererObject`、`MountResult`、`MountHandle`
|
|
743
743
|
- **会话资源(REST)**:`SessionsResource`、`CreateSessionRequest`、`McpSourceConfig`、`PaginatedSessionsResult`、`SessionInfo`、`SessionStatus`、`SessionDetail`、`DEFAULT_REPLAY_SPEED`、`ReplaySpeed`、`ReplayState`、`SessionTurnsPage`、`SessionTurnsQuery`、`FileEntry`、`UploadFileEntry`、`UploadFilesOptions`、`AppCliDefinition`、`AppCliAttachment`
|
|
744
744
|
- **模型目录**:`ModelsResource`、`ModelCatalog`、`ModelOption`
|
|
745
|
+
- **沙盒脚本**:`SandboxResource`、`SandboxScriptRequest`、`SandboxScriptResult`。`client.sandbox.execute({ script, cwd, timeout })` 在当前登录用户的沙盒执行脚本,无需创建智能体会话;`cwd` 使用绝对路径,`timeout` 单位为秒,默认及最大值为 120。结果包含有界输出、可为空的退出码、超时标志和错误信息;无法启动或无法确认停止时应检查 `error`,不能仅凭退出码判断成功。
|
|
745
746
|
- **远程电脑**:`ComputersResource`、`SessionComputer`、`AccountComputer`
|
|
746
747
|
- **Headless**:`HeadlessResource`、`RunOptions`、`RunResult`、`RunTrace`
|
|
747
748
|
- **消息**:`ChatMessage`、`MessageContent`、`MessageContentPart`、`TextContentPart`、`ImageUrlContentPart`、`FileContentPart`、`ToolCallInfo`、`WorkflowStepInfo`(固定流程运行时每步的留档,挂在 `workflow:run` 的 `ToolCallInfo.workflow_steps` 上)、`MemoryRefInfo`、`getTextContent`、`getImageParts`、`getFileParts`、`contentPreview`、`groupMessagesByLoop`、`chatErrorForDisplay`、`transformSlashCommand`、`SkillMentionAvailability`、`userFacingErrorText`
|
package/dist/blade-client.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SandboxResource } from "./resources/sandbox";
|
|
1
2
|
import { ToolProvider, type ToolProviderOptions } from "./tool-provider";
|
|
2
3
|
import { type LoginOptions, type LoginResult, type TokenStorageMode } from "./auth-login";
|
|
3
4
|
import { type BladeFetchInit, type HttpMethod } from "./rest";
|
|
@@ -45,6 +46,7 @@ export declare class BladeClient {
|
|
|
45
46
|
/** login() / setToken() 热挂载的令牌,优先级高于构造参数。 */
|
|
46
47
|
private runtimeToken;
|
|
47
48
|
readonly options: BladeClientOptions;
|
|
49
|
+
readonly sandbox: SandboxResource;
|
|
48
50
|
readonly auth: AuthResource;
|
|
49
51
|
readonly headless: HeadlessResource;
|
|
50
52
|
readonly computers: ComputersResource;
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
// src/resources/sandbox.ts
|
|
2
|
+
var SandboxResource = class {
|
|
3
|
+
constructor(client) {
|
|
4
|
+
this.client = client;
|
|
5
|
+
}
|
|
6
|
+
client;
|
|
7
|
+
execute(input) {
|
|
8
|
+
return this.client.json("POST", "/api/sandbox/execute", input);
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
|
|
1
12
|
// src/rest.ts
|
|
2
13
|
var DOCS_URL = "https://blade-hq.github.io/public-skills/";
|
|
3
14
|
var BladeApiError = class extends Error {
|
|
@@ -213,7 +224,7 @@ var ToolProvider = class {
|
|
|
213
224
|
|
|
214
225
|
// src/version.ts
|
|
215
226
|
var SDK_NAME = "agent-client";
|
|
216
|
-
var SDK_VERSION = true ? "2612.0.0-beta.
|
|
227
|
+
var SDK_VERSION = true ? "2612.0.0-beta.24" : "1.1.1";
|
|
217
228
|
|
|
218
229
|
// src/auth-login.ts
|
|
219
230
|
function isAuthCallbackMessage(value) {
|
|
@@ -3324,7 +3335,6 @@ var SessionInfo = type({
|
|
|
3324
3335
|
"is_persistent?": "boolean",
|
|
3325
3336
|
"initiator?": "'ui' | 'sdk' | 'unknown' | null",
|
|
3326
3337
|
"is_headless?": "boolean",
|
|
3327
|
-
"scheduled_task_id?": "string",
|
|
3328
3338
|
"viewer_role?": "'owner' | 'viewer'",
|
|
3329
3339
|
"model?": "string | null",
|
|
3330
3340
|
"enable_thinking?": "boolean | null",
|
|
@@ -3397,7 +3407,6 @@ var builtinSolutionIds = /* @__PURE__ */ new Set([
|
|
|
3397
3407
|
"app-dev",
|
|
3398
3408
|
"general_chat",
|
|
3399
3409
|
"night_build",
|
|
3400
|
-
"scheduled_tasks",
|
|
3401
3410
|
"skill_editor",
|
|
3402
3411
|
"smart_bid",
|
|
3403
3412
|
"solution_generate"
|
|
@@ -8086,6 +8095,7 @@ var BladeClient = class _BladeClient {
|
|
|
8086
8095
|
/** login() / setToken() 热挂载的令牌,优先级高于构造参数。 */
|
|
8087
8096
|
runtimeToken = void 0;
|
|
8088
8097
|
options;
|
|
8098
|
+
sandbox;
|
|
8089
8099
|
auth;
|
|
8090
8100
|
headless;
|
|
8091
8101
|
computers;
|
|
@@ -8109,6 +8119,7 @@ var BladeClient = class _BladeClient {
|
|
|
8109
8119
|
...options,
|
|
8110
8120
|
baseUrl: normalizeBaseUrl(options.baseUrl)
|
|
8111
8121
|
};
|
|
8122
|
+
this.sandbox = new SandboxResource(this);
|
|
8112
8123
|
this.auth = new AuthResource(this);
|
|
8113
8124
|
this.headless = new HeadlessResource(this);
|
|
8114
8125
|
this.computers = new ComputersResource(this);
|
|
@@ -8540,6 +8551,7 @@ function parseXhrHeaders(rawHeaders) {
|
|
|
8540
8551
|
}
|
|
8541
8552
|
|
|
8542
8553
|
export {
|
|
8554
|
+
SandboxResource,
|
|
8543
8555
|
BladeApiError,
|
|
8544
8556
|
ToolProvider,
|
|
8545
8557
|
SDK_NAME,
|
|
@@ -8628,4 +8640,4 @@ export {
|
|
|
8628
8640
|
createSocket,
|
|
8629
8641
|
BladeClient
|
|
8630
8642
|
};
|
|
8631
|
-
//# sourceMappingURL=chunk-
|
|
8643
|
+
//# sourceMappingURL=chunk-VLJNZ6J5.js.map
|