@botbotgo/agent-harness 0.0.225 → 0.0.227
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 -1
- package/README.zh.md +1 -1
- package/dist/package-version.d.ts +1 -1
- package/dist/package-version.js +1 -1
- package/dist/protocol/a2a/http.js +33 -6
- package/dist/resource/resource-impl.js +6 -6
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1024,7 +1024,7 @@ ACP transport notes:
|
|
|
1024
1024
|
- `serveAcpHttp(runtime)` exposes JSON-RPC over HTTP plus SSE runtime events so remote operator surfaces can connect without importing the runtime in-process.
|
|
1025
1025
|
- ACP transport validation now covers the reference-client core flow: capability discovery, request submit, session lookup, request lookup, invalid-JSON handling, notification calls without response ids, stdio JSON-RPC, and HTTP plus SSE runtime notifications.
|
|
1026
1026
|
- For the thinnest editor or CLI starter, begin with `agent-harness acp serve --workspace . --transport stdio` and mirror the `examples/protocol-hello-world/app/acp-stdio-hello-world.mjs` wire shape. Applications that want an in-process reference client can use `createAcpStdioClient(...)` to issue JSON-RPC requests and route runtime notifications without hand-rolling line parsing.
|
|
1027
|
-
- `serveA2aHttp(runtime)` exposes an A2A-compatible HTTP JSON-RPC bridge plus agent card discovery, mapping both existing methods such as `message/send` and A2A v1.0 PascalCase methods such as `SendMessage`, `SendStreamingMessage`, `GetTask`, `ListTasks`, `CancelTask`, `SubscribeToTask`, `GetExtendedAgentCard`, and task push-notification config methods onto the existing session/request runtime surface. The bridge now advertises both `1.0` and `0.3` JSON-RPC interfaces, sets `capabilities.streaming = true` plus `capabilities.pushNotifications = true`, validates `A2A-Version`, records `A2A-Extensions` into runtime invocation metadata, publishes `TASK_STATE_*` statuses plus the `{ task }` `SendMessage` wrapper, streams task
|
|
1027
|
+
- `serveA2aHttp(runtime)` exposes an A2A-compatible HTTP JSON-RPC bridge plus agent card discovery, mapping both existing methods such as `message/send` and A2A v1.0 PascalCase methods such as `SendMessage`, `SendStreamingMessage`, `GetTask`, `ListTasks`, `CancelTask`, `SubscribeToTask`, `GetExtendedAgentCard`, and task push-notification config methods onto the existing session/request runtime surface. The bridge now advertises both `1.0` and `0.3` JSON-RPC interfaces, sets `capabilities.streaming = true` plus `capabilities.pushNotifications = true`, validates `A2A-Version`, records `A2A-Extensions` into runtime invocation metadata, publishes `TASK_STATE_*` statuses plus the `{ task }` `SendMessage` wrapper, streams an initial `{ task }` snapshot plus later `{ statusUpdate }` payloads over SSE for v1 streaming methods, and can send best-effort webhook task snapshots for configured push notification receivers.
|
|
1028
1028
|
- `serveAgUiHttp(runtime)` exposes an AG-UI-compatible HTTP SSE bridge that projects runtime lifecycle, text output, upstream thinking, step progress, and tool calls onto `RUN_*`, `TEXT_MESSAGE_*`, `THINKING_TEXT_MESSAGE_*`, `STEP_*`, and `TOOL_CALL_*` events for UI clients.
|
|
1029
1029
|
- `createRuntimeMcpServer(runtime)` and `serveRuntimeMcpOverStdio(runtime)` expose the persisted runtime control surface itself as MCP tools, including sessions, requests, approvals, artifacts, events, and package export helpers.
|
|
1030
1030
|
- `listRequestEvents(...)` and `exportRequestPackage(...)` are the request-first inspection helpers.
|
package/README.zh.md
CHANGED
|
@@ -982,7 +982,7 @@ ACP transport 说明:
|
|
|
982
982
|
- `serveAcpHttp(runtime)` 提供基于 HTTP 的 JSON-RPC 与 SSE runtime events,适合远程界面或独立控制面接入。
|
|
983
983
|
- ACP transport 现已覆盖核心参考客户端流程验证:capability discovery、request submit、session lookup、request lookup、invalid JSON 处理、无 id notification 不返回响应,以及 stdio JSON-RPC 与 HTTP + SSE runtime notifications。
|
|
984
984
|
- 如果要从最薄的一层 editor / CLI starter 开始,优先用 `agent-harness acp serve --workspace . --transport stdio`,并直接参考 `examples/protocol-hello-world/app/acp-stdio-hello-world.mjs` 的 wire shape。需要在应用内使用 reference client 时,可直接用 `createAcpStdioClient(...)` 发起 JSON-RPC 请求并分流 runtime notifications,避免每个 sidecar 自己重写 line parsing。
|
|
985
|
-
- `serveA2aHttp(runtime)` 提供 A2A HTTP JSON-RPC bridge 与 agent card discovery,同时兼容 `message/send` 这类旧方法,以及 `SendMessage`、`SendStreamingMessage`、`GetTask`、`ListTasks`、`CancelTask`、`SubscribeToTask`、`GetExtendedAgentCard` 与 task push-notification config 这类 A2A v1.0 方法,并统一映射到现有 session/request 运行记录。bridge 现在会同时声明 `1.0` 与 `0.3` 两个 JSON-RPC interface、把 `capabilities.streaming` 和 `capabilities.pushNotifications` 都设为 `true`、校验 `A2A-Version`、把 `A2A-Extensions` 记录进 runtime invocation metadata、发布 `TASK_STATE_*` 状态与 `SendMessage` 的 `{ task }` wrapper、在 streaming
|
|
985
|
+
- `serveA2aHttp(runtime)` 提供 A2A HTTP JSON-RPC bridge 与 agent card discovery,同时兼容 `message/send` 这类旧方法,以及 `SendMessage`、`SendStreamingMessage`、`GetTask`、`ListTasks`、`CancelTask`、`SubscribeToTask`、`GetExtendedAgentCard` 与 task push-notification config 这类 A2A v1.0 方法,并统一映射到现有 session/request 运行记录。bridge 现在会同时声明 `1.0` 与 `0.3` 两个 JSON-RPC interface、把 `capabilities.streaming` 和 `capabilities.pushNotifications` 都设为 `true`、校验 `A2A-Version`、把 `A2A-Extensions` 记录进 runtime invocation metadata、发布 `TASK_STATE_*` 状态与 `SendMessage` 的 `{ task }` wrapper、在 v1 streaming 方法上先通过 SSE 输出 `{ task }` 初始快照,再输出 `{ statusUpdate }` 增量状态,并可向已配置的 webhook receiver 发送 best-effort task push notifications。
|
|
986
986
|
- `serveAgUiHttp(runtime)` 提供 AG-UI HTTP SSE bridge,把 runtime 生命周期、文本输出、upstream thinking、step 进度与 tool call 投影成 `RUN_*`、`TEXT_MESSAGE_*`、`THINKING_TEXT_MESSAGE_*`、`STEP_*` 与 `TOOL_CALL_*` 事件,便于 UI 客户端直接接入。
|
|
987
987
|
- `createRuntimeMcpServer(runtime)` 与 `serveRuntimeMcpOverStdio(runtime)` 会把持久化 runtime 控制面本身暴露成 MCP tools,包括 sessions、requests、approvals、artifacts、events 与 package export helpers。
|
|
988
988
|
- `listRequestEvents(...)` 与 `exportRequestPackage(...)` 是 request-first 的检查 helper。
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const AGENT_HARNESS_VERSION = "0.0.
|
|
1
|
+
export declare const AGENT_HARNESS_VERSION = "0.0.226";
|
package/dist/package-version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const AGENT_HARNESS_VERSION = "0.0.
|
|
1
|
+
export const AGENT_HARNESS_VERSION = "0.0.226";
|
|
@@ -593,6 +593,30 @@ function toSendMessageResult(method, task) {
|
|
|
593
593
|
}
|
|
594
594
|
return { task };
|
|
595
595
|
}
|
|
596
|
+
function toStatusUpdate(task) {
|
|
597
|
+
return {
|
|
598
|
+
taskId: task.id,
|
|
599
|
+
contextId: task.contextId,
|
|
600
|
+
kind: "status-update",
|
|
601
|
+
status: task.status,
|
|
602
|
+
final: isTerminalTaskState(task.status.state),
|
|
603
|
+
metadata: task.metadata,
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
function toStreamingResult(method, task, mode) {
|
|
607
|
+
if (!task) {
|
|
608
|
+
return null;
|
|
609
|
+
}
|
|
610
|
+
if (!isV1Method(method)) {
|
|
611
|
+
return task;
|
|
612
|
+
}
|
|
613
|
+
if (mode === "status-update") {
|
|
614
|
+
return {
|
|
615
|
+
statusUpdate: toStatusUpdate(task),
|
|
616
|
+
};
|
|
617
|
+
}
|
|
618
|
+
return { task };
|
|
619
|
+
}
|
|
596
620
|
function withStreamingStatusText(task, text) {
|
|
597
621
|
if (!task || typeof text !== "string" || text.length === 0) {
|
|
598
622
|
return task;
|
|
@@ -680,13 +704,14 @@ async function streamTaskUpdates(response, id, method, iterator) {
|
|
|
680
704
|
if (!item.task) {
|
|
681
705
|
continue;
|
|
682
706
|
}
|
|
683
|
-
await writeSseEvent(response, "task-update", toSuccess(id,
|
|
707
|
+
await writeSseEvent(response, "task-update", toSuccess(id, toStreamingResult(method, item.task, item.mode)));
|
|
684
708
|
}
|
|
685
709
|
response.end();
|
|
686
710
|
}
|
|
687
711
|
async function* streamSendMessageTaskUpdates(runtime, options, method) {
|
|
688
712
|
let runId;
|
|
689
713
|
let streamedText = "";
|
|
714
|
+
let emittedInitialTask = false;
|
|
690
715
|
for await (const item of runtime.streamEvents(options)) {
|
|
691
716
|
if (item.type === "event") {
|
|
692
717
|
runId = runId ?? item.event.runId;
|
|
@@ -696,7 +721,8 @@ async function* streamSendMessageTaskUpdates(runtime, options, method) {
|
|
|
696
721
|
if (item.event.eventType === "run.created" || item.event.eventType === "run.state.changed" || item.event.eventType === "output.delta" || item.event.eventType === "approval.requested") {
|
|
697
722
|
const task = withStreamingStatusText(await buildTaskFromRuntime(runtime, item.event.runId), streamedText || undefined);
|
|
698
723
|
if (task) {
|
|
699
|
-
yield { task };
|
|
724
|
+
yield { task, mode: emittedInitialTask ? "status-update" : "task" };
|
|
725
|
+
emittedInitialTask = true;
|
|
700
726
|
}
|
|
701
727
|
}
|
|
702
728
|
continue;
|
|
@@ -704,13 +730,14 @@ async function* streamSendMessageTaskUpdates(runtime, options, method) {
|
|
|
704
730
|
if (item.type === "result") {
|
|
705
731
|
runId = item.result.runId;
|
|
706
732
|
const task = withRunResult(await buildTaskFromRuntime(runtime, item.result.runId), item.result, streamedText || item.result.output);
|
|
707
|
-
yield { task };
|
|
733
|
+
yield { task, mode: emittedInitialTask ? "status-update" : "task" };
|
|
708
734
|
return;
|
|
709
735
|
}
|
|
710
736
|
if (item.type === "upstream-event" && runId) {
|
|
711
737
|
const task = withStreamingStatusText(await buildTaskFromRuntime(runtime, runId), streamedText || undefined);
|
|
712
738
|
if (task) {
|
|
713
|
-
yield { task };
|
|
739
|
+
yield { task, mode: emittedInitialTask ? "status-update" : "task" };
|
|
740
|
+
emittedInitialTask = true;
|
|
714
741
|
}
|
|
715
742
|
}
|
|
716
743
|
}
|
|
@@ -723,7 +750,7 @@ async function streamExistingTaskUpdates(runtime, response, id, method, taskId)
|
|
|
723
750
|
response.end();
|
|
724
751
|
return;
|
|
725
752
|
}
|
|
726
|
-
await writeSseEvent(response, "task-update", toSuccess(id,
|
|
753
|
+
await writeSseEvent(response, "task-update", toSuccess(id, toStreamingResult(method, currentTask, "task")));
|
|
727
754
|
if (isTerminalTaskState(currentTask.status.state)) {
|
|
728
755
|
response.end();
|
|
729
756
|
return;
|
|
@@ -770,7 +797,7 @@ async function streamExistingTaskUpdates(runtime, response, id, method, taskId)
|
|
|
770
797
|
});
|
|
771
798
|
if (fingerprint !== lastFingerprint) {
|
|
772
799
|
lastFingerprint = fingerprint;
|
|
773
|
-
await writeSseEvent(response, "task-update", toSuccess(id,
|
|
800
|
+
await writeSseEvent(response, "task-update", toSuccess(id, toStreamingResult(method, currentTask, isV1Method(method) ? "status-update" : "task")));
|
|
774
801
|
armIdleTimer();
|
|
775
802
|
}
|
|
776
803
|
if (isTerminalTaskState(currentTask.status.state)) {
|
|
@@ -105,8 +105,8 @@ class CompatibleCompositeBackend {
|
|
|
105
105
|
: (command) => this.composite.execute(command);
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
|
|
109
|
-
return this.composite.
|
|
108
|
+
ls(filePath) {
|
|
109
|
+
return this.composite.ls(filePath);
|
|
110
110
|
}
|
|
111
111
|
read(filePath, offset, limit) {
|
|
112
112
|
return this.composite.read(filePath, offset, limit);
|
|
@@ -114,11 +114,11 @@ class CompatibleCompositeBackend {
|
|
|
114
114
|
readRaw(filePath) {
|
|
115
115
|
return this.composite.readRaw(filePath);
|
|
116
116
|
}
|
|
117
|
-
|
|
118
|
-
return this.composite.
|
|
117
|
+
grep(pattern, filePath, glob) {
|
|
118
|
+
return this.composite.grep(pattern, filePath ?? undefined, glob ?? undefined);
|
|
119
119
|
}
|
|
120
|
-
|
|
121
|
-
return this.composite.
|
|
120
|
+
glob(pattern, filePath) {
|
|
121
|
+
return this.composite.glob(pattern, filePath);
|
|
122
122
|
}
|
|
123
123
|
write(filePath, content) {
|
|
124
124
|
return this.composite.write(filePath, content);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botbotgo/agent-harness",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.227",
|
|
4
4
|
"description": "Workspace runtime for multi-agent applications",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
55
55
|
"@qdrant/js-client-rest": "^1.17.0",
|
|
56
56
|
"better-sqlite3": "^12.8.0",
|
|
57
|
-
"deepagents": "1.
|
|
58
|
-
"langchain": "^1.
|
|
57
|
+
"deepagents": "^1.9.0",
|
|
58
|
+
"langchain": "^1.3.1",
|
|
59
59
|
"llamaindex": "^0.12.1",
|
|
60
60
|
"mem0ai": "^2.4.6",
|
|
61
61
|
"mustache": "^4.2.0",
|