@botbotgo/agent-harness 0.0.290 → 0.0.291
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 +20 -20
- package/README.zh.md +14 -14
- package/dist/acp.d.ts +5 -5
- package/dist/acp.js +3 -3
- package/dist/api.d.ts +20 -21
- package/dist/api.js +38 -50
- package/dist/cli.js +47 -43
- package/dist/config/agents/orchestra.yaml +3 -3
- package/dist/config/knowledge/knowledge-runtime.yaml +4 -4
- package/dist/config/runtime/runtime-memory.yaml +7 -7
- package/dist/config/runtime/workspace.yaml +7 -7
- package/dist/contracts/core.d.ts +1 -1
- package/dist/contracts/runtime.d.ts +35 -40
- package/dist/contracts/workspace.d.ts +2 -2
- package/dist/flow/build-flow-graph.js +20 -33
- package/dist/flow/export-sequence-mermaid.js +4 -4
- package/dist/flow/types.d.ts +2 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/init-project.js +10 -10
- package/dist/knowledge/module.js +37 -45
- package/dist/mcp.d.ts +9 -9
- package/dist/mcp.js +6 -6
- package/dist/package-version.d.ts +1 -1
- package/dist/package-version.js +1 -1
- package/dist/persistence/file-store.d.ts +69 -69
- package/dist/persistence/file-store.js +224 -221
- package/dist/persistence/sqlite-request-context-store.d.ts +22 -0
- package/dist/persistence/sqlite-request-context-store.js +64 -0
- package/dist/persistence/sqlite-request-queue-store.d.ts +41 -0
- package/dist/persistence/sqlite-request-queue-store.js +120 -0
- package/dist/persistence/sqlite-store.d.ts +72 -72
- package/dist/persistence/sqlite-store.js +361 -361
- package/dist/persistence/types.d.ts +84 -84
- package/dist/protocol/a2a/http.js +79 -74
- package/dist/protocol/ag-ui/http.d.ts +7 -7
- package/dist/protocol/ag-ui/http.js +20 -20
- package/dist/resource/resource-impl.js +1 -1
- package/dist/runtime/adapter/compat/deepagent-compat.d.ts +2 -2
- package/dist/runtime/adapter/flow/invocation-flow.d.ts +6 -5
- package/dist/runtime/adapter/flow/invocation-flow.js +6 -5
- package/dist/runtime/adapter/flow/stream-runtime.d.ts +3 -3
- package/dist/runtime/adapter/flow/stream-runtime.js +5 -4
- package/dist/runtime/adapter/invocation-result.d.ts +6 -5
- package/dist/runtime/adapter/invocation-result.js +5 -4
- package/dist/runtime/adapter/middleware-assembly.js +3 -2
- package/dist/runtime/adapter/tool/tool-hitl.js +1 -1
- package/dist/runtime/adapter/upstream-configurable-keys.d.ts +2 -0
- package/dist/runtime/adapter/upstream-configurable-keys.js +2 -0
- package/dist/runtime/agent-runtime-adapter.d.ts +11 -8
- package/dist/runtime/agent-runtime-adapter.js +36 -32
- package/dist/runtime/harness/events/events.d.ts +8 -8
- package/dist/runtime/harness/events/events.js +25 -19
- package/dist/runtime/harness/events/listener-runtime.d.ts +5 -4
- package/dist/runtime/harness/events/listener-runtime.js +7 -3
- package/dist/runtime/harness/events/runtime-event-operations.d.ts +7 -7
- package/dist/runtime/harness/events/runtime-event-operations.js +5 -5
- package/dist/runtime/harness/events/streaming.d.ts +8 -7
- package/dist/runtime/harness/events/streaming.js +20 -19
- package/dist/runtime/harness/events/timeline.js +6 -6
- package/dist/runtime/harness/index.d.ts +1 -1
- package/dist/runtime/harness/index.js +1 -1
- package/dist/runtime/harness/run/helpers.d.ts +14 -11
- package/dist/runtime/harness/run/helpers.js +10 -7
- package/dist/runtime/harness/run/inspection.d.ts +3 -2
- package/dist/runtime/harness/run/inspection.js +7 -7
- package/dist/runtime/harness/run/operator-overview.d.ts +2 -2
- package/dist/runtime/harness/run/operator-overview.js +18 -17
- package/dist/runtime/harness/run/queue-diagnostics.js +6 -6
- package/dist/runtime/harness/run/recovery.d.ts +15 -15
- package/dist/runtime/harness/run/recovery.js +53 -50
- package/dist/runtime/harness/run/resources.d.ts +2 -2
- package/dist/runtime/harness/run/resources.js +8 -8
- package/dist/runtime/harness/run/resume.d.ts +3 -3
- package/dist/runtime/harness/run/resume.js +4 -4
- package/dist/runtime/harness/run/routing.d.ts +4 -4
- package/dist/runtime/harness/run/routing.js +8 -8
- package/dist/runtime/harness/run/run-lifecycle.d.ts +12 -12
- package/dist/runtime/harness/run/run-lifecycle.js +26 -26
- package/dist/runtime/harness/run/run-operations.d.ts +45 -45
- package/dist/runtime/harness/run/run-operations.js +79 -78
- package/dist/runtime/harness/run/run-queue.d.ts +8 -8
- package/dist/runtime/harness/run/run-queue.js +16 -16
- package/dist/runtime/harness/run/run-slot-acquisition.d.ts +32 -32
- package/dist/runtime/harness/run/run-slot-acquisition.js +41 -41
- package/dist/runtime/harness/run/{thread-records.d.ts → session-records.d.ts} +6 -13
- package/dist/runtime/harness/run/{thread-records.js → session-records.js} +14 -60
- package/dist/runtime/harness/run/start-run.d.ts +36 -36
- package/dist/runtime/harness/run/start-run.js +55 -36
- package/dist/runtime/harness/run/startup-runtime.d.ts +9 -9
- package/dist/runtime/harness/run/startup-runtime.js +22 -20
- package/dist/runtime/harness/run/stream-run.d.ts +18 -18
- package/dist/runtime/harness/run/stream-run.js +52 -52
- package/dist/runtime/harness/runtime-defaults.d.ts +2 -2
- package/dist/runtime/harness/runtime-defaults.js +7 -7
- package/dist/runtime/harness/system/health-monitor.d.ts +3 -3
- package/dist/runtime/harness/system/health-monitor.js +18 -18
- package/dist/runtime/harness/system/mem0-ingestion-sync.d.ts +6 -6
- package/dist/runtime/harness/system/mem0-ingestion-sync.js +36 -27
- package/dist/runtime/harness/system/runtime-memory-candidates.js +2 -2
- package/dist/runtime/harness/system/runtime-memory-manager.d.ts +13 -13
- package/dist/runtime/harness/system/runtime-memory-manager.js +41 -38
- package/dist/runtime/harness/system/runtime-memory-policy.d.ts +1 -1
- package/dist/runtime/harness/system/runtime-memory-policy.js +1 -1
- package/dist/runtime/harness/system/runtime-memory-records.d.ts +4 -2
- package/dist/runtime/harness/system/runtime-memory-records.js +21 -8
- package/dist/runtime/harness/system/runtime-memory-sync.d.ts +6 -6
- package/dist/runtime/harness/system/runtime-memory-sync.js +47 -44
- package/dist/runtime/harness/system/{thread-memory-sync.d.ts → session-memory-sync.d.ts} +7 -7
- package/dist/runtime/harness/system/{thread-memory-sync.js → session-memory-sync.js} +28 -28
- package/dist/runtime/harness.d.ts +33 -45
- package/dist/runtime/harness.js +273 -291
- package/dist/runtime/maintenance/checkpoint-maintenance.js +2 -2
- package/dist/runtime/maintenance/file-checkpoint-saver.d.ts +1 -1
- package/dist/runtime/maintenance/file-checkpoint-saver.js +6 -6
- package/dist/runtime/maintenance/runtime-record-maintenance.d.ts +1 -1
- package/dist/runtime/maintenance/runtime-record-maintenance.js +33 -33
- package/dist/runtime/maintenance/sqlite-checkpoint-saver.d.ts +1 -1
- package/dist/runtime/maintenance/sqlite-checkpoint-saver.js +30 -10
- package/dist/runtime/support/harness-support.d.ts +2 -2
- package/dist/runtime/support/harness-support.js +7 -7
- package/dist/runtime/support/runtime-adapter-options.d.ts +2 -2
- package/dist/runtime/support/runtime-adapter-options.js +3 -3
- package/dist/runtime/support/runtime-factories.d.ts +2 -2
- package/dist/runtime/support/runtime-factories.js +10 -10
- package/dist/workspace/agent-binding-compiler.js +3 -3
- package/dist/workspace/object-loader.js +1 -1
- package/dist/workspace/support/workspace-ref-utils.d.ts +4 -3
- package/dist/workspace/support/workspace-ref-utils.js +5 -4
- package/package.json +1 -1
- package/dist/persistence/sqlite-run-context-store.d.ts +0 -22
- package/dist/persistence/sqlite-run-context-store.js +0 -64
- package/dist/persistence/sqlite-run-queue-store.d.ts +0 -41
- package/dist/persistence/sqlite-run-queue-store.js +0 -120
package/README.md
CHANGED
|
@@ -162,7 +162,7 @@ What you get on day one:
|
|
|
162
162
|
|
|
163
163
|
- a runtime that keeps `requests`, `sessions`, `approvals`, and `events` as inspectable product records
|
|
164
164
|
- a recovery path that survives interruption, restart, and operator decisions
|
|
165
|
-
- stable
|
|
165
|
+
- stable request correlation and continuity metadata so operators can join one persisted request to logs, traces, and fallback transitions
|
|
166
166
|
- approval defaults for sensitive durable memory writes and write-like MCP calls instead of relying on each tool definition to remember governance
|
|
167
167
|
- one workspace-shaped assembly model instead of app-specific runtime glue
|
|
168
168
|
- one stable runtime contract even when execution backends change underneath
|
|
@@ -291,7 +291,7 @@ Recommended orchestration shape for long-running flows:
|
|
|
291
291
|
These scenarios map most directly to what the runtime is built for:
|
|
292
292
|
|
|
293
293
|
- Enterprise internal agent runtime: approvals, restart-safe recovery, operator evidence, and policy-owned MCP access.
|
|
294
|
-
- Code modernization runtime: long-running coding flows, approval checkpoints, resumable
|
|
294
|
+
- Code modernization runtime: long-running coding flows, approval checkpoints, resumable requests, and exported evidence packages.
|
|
295
295
|
- Agent-ops and remediation workflow runtime: parallel agent attempts, human review gates, durable evidence, and operator visibility for security or maintenance work.
|
|
296
296
|
- Protocol bridge runtime: ACP, A2A, AG-UI, and runtime MCP on one stable control plane instead of bespoke per-surface glue.
|
|
297
297
|
|
|
@@ -426,7 +426,7 @@ import { AgentHarnessRuntime, createAgentHarness } from "@botbotgo/agent-harness
|
|
|
426
426
|
const runtime: AgentHarnessRuntime = await createAgentHarness("/absolute/path/to/workspace");
|
|
427
427
|
```
|
|
428
428
|
|
|
429
|
-
`createAgentHarness(...)` loads the workspace, resolves `resources/`, initializes persistence under `
|
|
429
|
+
`createAgentHarness(...)` loads the workspace, resolves `resources/`, initializes persistence under `runtimeRoot`, and starts runtime maintenance.
|
|
430
430
|
|
|
431
431
|
`runtime.spec.resources` may attach multiple extra resource packages. Each entry may point either to a package root that contains `resources/`, or directly to a resource folder that contains its own `package.json`.
|
|
432
432
|
|
|
@@ -496,7 +496,7 @@ Use `invocation` as the runtime-facing request envelope:
|
|
|
496
496
|
For multimodal chat turns, keep the user-visible content in `input`.
|
|
497
497
|
|
|
498
498
|
- if the product would show the image or text in the chat transcript, it belongs in `input`
|
|
499
|
-
- if the payload is auxiliary
|
|
499
|
+
- if the payload is auxiliary request-scoped data rather than the chat turn itself, it belongs in `invocation.attachments`
|
|
500
500
|
- persistence, replay, and transcript inspection should treat `input` as the source of truth for user-visible multimodal chat content
|
|
501
501
|
|
|
502
502
|
```ts
|
|
@@ -711,7 +711,7 @@ Example workspaces:
|
|
|
711
711
|
- `examples/02_subagent-planning/` is the Subagent Planning Example: a compact planning flow with one subagent, tools, and trace output
|
|
712
712
|
- `examples/03_protocol-surfaces/` is the Protocol Surfaces Example: the same minimal direct agent wired to ACP, ACP stdio, A2A, AG-UI, and runtime MCP
|
|
713
713
|
- `examples/04_local-model-tool-calling/` is the Local Model Tool Calling Example: one local GGUF-backed task loop plus one local tool
|
|
714
|
-
- `examples/05_runtime-trace-export/` is the Runtime Trace Export Example: one real
|
|
714
|
+
- `examples/05_runtime-trace-export/` is the Runtime Trace Export Example: one real request plus Mermaid flow export from runtime and upstream events
|
|
715
715
|
- `examples/06_repository-analysis/` is the Repository Analysis Example: repo analysis around one workspace-local tool plus embedding-backed indexing
|
|
716
716
|
- `examples/07_multi-agent-research/` is the Multi-Agent Research Example: the most complete multi-agent research workspace with reusable backends, skills, and local tools
|
|
717
717
|
- `examples/08_long-term-memory-learning/` is the Long-Term Memory Learning Example: repeated requests that store durable memory, inspect recall, and make later answers more context-aware
|
|
@@ -738,7 +738,7 @@ There are three main configuration layers:
|
|
|
738
738
|
|
|
739
739
|
### Backend Guidance
|
|
740
740
|
|
|
741
|
-
At the moment, the most stable path for complex production-style
|
|
741
|
+
At the moment, the most stable path for complex production-style requests is `backend: deepagent`.
|
|
742
742
|
|
|
743
743
|
Current temporary limits on the `backend: langchain-v1` path are:
|
|
744
744
|
|
|
@@ -764,18 +764,18 @@ Use this file for workspace-wide runtime policy.
|
|
|
764
764
|
|
|
765
765
|
Important fields:
|
|
766
766
|
|
|
767
|
-
- `
|
|
768
|
-
- `concurrency.
|
|
767
|
+
- `runtimeRoot`
|
|
768
|
+
- `concurrency.maxConcurrentRequests`
|
|
769
769
|
- `routing.defaultAgentId`
|
|
770
770
|
- `routing.rules`
|
|
771
771
|
- `toolModuleDiscovery.scope`
|
|
772
772
|
- `maintenance.checkpoints`
|
|
773
773
|
- `maintenance.records`
|
|
774
774
|
- `recovery.enabled`
|
|
775
|
-
- `recovery.
|
|
775
|
+
- `recovery.resumeResumingRequestsOnStartup`
|
|
776
776
|
- `recovery.maxRecoveryAttempts`
|
|
777
777
|
|
|
778
|
-
`recovery.
|
|
778
|
+
`recovery.resumeResumingRequestsOnStartup` keeps checkpoint resume a runtime-owned lifecycle behavior instead of exposing checkpoint orchestration as public API.
|
|
779
779
|
|
|
780
780
|
`maintenance.checkpoints` and `maintenance.records` are separate retention layers:
|
|
781
781
|
|
|
@@ -797,7 +797,7 @@ kind: Runtime
|
|
|
797
797
|
metadata:
|
|
798
798
|
name: default
|
|
799
799
|
spec:
|
|
800
|
-
|
|
800
|
+
runtimeRoot: ./.agent
|
|
801
801
|
toolModuleDiscovery:
|
|
802
802
|
scope: top-level
|
|
803
803
|
concurrency:
|
|
@@ -811,7 +811,7 @@ spec:
|
|
|
811
811
|
enabled: false
|
|
812
812
|
recovery:
|
|
813
813
|
enabled: true
|
|
814
|
-
|
|
814
|
+
resumeResumingRequestsOnStartup: true
|
|
815
815
|
maxRecoveryAttempts: 3
|
|
816
816
|
```
|
|
817
817
|
|
|
@@ -875,7 +875,7 @@ Keep bootstrap context in `config/agent-context.md`. Keep resumable execution st
|
|
|
875
875
|
|
|
876
876
|
- `formation.hotPath` for immediate write-time capture
|
|
877
877
|
- `formation.manager` for rule-driven or model-driven candidate normalization before persistence
|
|
878
|
-
- `formation.background` for reflection after
|
|
878
|
+
- `formation.background` for reflection after request completion or approval resolution
|
|
879
879
|
|
|
880
880
|
### `config/knowledge/knowledge-runtime.yaml`
|
|
881
881
|
|
|
@@ -941,7 +941,7 @@ Agent YAML can live anywhere under `config/`; `config/agents/*.yaml` is the reco
|
|
|
941
941
|
|
|
942
942
|
Use two sections:
|
|
943
943
|
|
|
944
|
-
- `spec.runtime` for harness-owned runtime placement such as `spec.runtime.
|
|
944
|
+
- `spec.runtime` for harness-owned runtime placement such as `spec.runtime.runtimeRoot`
|
|
945
945
|
- top-level `spec` fields for upstream execution semantics and adapter-facing config
|
|
946
946
|
|
|
947
947
|
Example direct host:
|
|
@@ -953,7 +953,7 @@ metadata:
|
|
|
953
953
|
name: direct
|
|
954
954
|
spec:
|
|
955
955
|
runtime:
|
|
956
|
-
|
|
956
|
+
runtimeRoot: ./.agent
|
|
957
957
|
backend: langchain-v1
|
|
958
958
|
modelRef: model/default
|
|
959
959
|
tools:
|
|
@@ -974,7 +974,7 @@ spec:
|
|
|
974
974
|
maxFileSizeMb: 10
|
|
975
975
|
sessionStorage:
|
|
976
976
|
enabled: true
|
|
977
|
-
rootDir: "{
|
|
977
|
+
rootDir: "{runtimeRoot}/sessions/{sessionId}/filesystem"
|
|
978
978
|
middleware: []
|
|
979
979
|
systemPrompt: Answer simple requests directly.
|
|
980
980
|
```
|
|
@@ -990,7 +990,7 @@ metadata:
|
|
|
990
990
|
name: orchestra
|
|
991
991
|
spec:
|
|
992
992
|
runtime:
|
|
993
|
-
|
|
993
|
+
runtimeRoot: ./.agent
|
|
994
994
|
backend: deepagent
|
|
995
995
|
modelRef: model/default
|
|
996
996
|
memory:
|
|
@@ -1019,7 +1019,7 @@ For backend-specific options, prefer the upstream concept directly inside `spec.
|
|
|
1019
1019
|
- the external protocol boundary should strictly conform to `deepagents-acp` instead of a parallel harness-only protocol
|
|
1020
1020
|
- upstream execution-backend concepts should be expressed as directly as possible in YAML
|
|
1021
1021
|
- when a feature can be expressed in YAML, prefer YAML over expanding the public API
|
|
1022
|
-
- recovery, approvals,
|
|
1022
|
+
- recovery, approvals, sessions, requests, and events are runtime concepts, not backend escape hatches
|
|
1023
1023
|
- application task centers should be built on the existing store plus runtime ids instead of expanding the public runtime contract
|
|
1024
1024
|
- new backend-specific config should land in YAML mapping and tests before adding public runtime APIs
|
|
1025
1025
|
|
|
@@ -1069,7 +1069,7 @@ Primary exports:
|
|
|
1069
1069
|
Inspection helpers:
|
|
1070
1070
|
|
|
1071
1071
|
- `createUpstreamTimelineReducer()` reduces raw upstream model/tool/chain events into ordered step-like projections for inspection and visualization.
|
|
1072
|
-
- `listRequestTraceItems(runtime, { sessionId, requestId })` returns the persisted request trace items that back runtime diagrams and post-
|
|
1072
|
+
- `listRequestTraceItems(runtime, { sessionId, requestId })` returns the persisted request trace items that back runtime diagrams and post-request inspection. Each trace item carries the normalized runtime surface record plus the source upstream event.
|
|
1073
1073
|
- `exportFlow(runtime, { sessionId, requestId })` loads one persisted request record from the runtime and renders it as Mermaid flowchart text. It uses the built-in product view defaults for direction, grouping, and visible kinds so callers do not need to carry visualization options in normal product code.
|
|
1074
1074
|
- `exportSequence(runtime, { sessionId, requestId })` loads the same persisted request record and renders it as a Mermaid sequence diagram for the same persisted trace-backed request.
|
|
1075
1075
|
|
|
@@ -1090,5 +1090,5 @@ ACP transport notes:
|
|
|
1090
1090
|
- `runtime/default.governance.remoteMcp` can now deny or allow specific MCP servers, raise approval requirements by transport, and stamp transport-based risk tiers into runtime governance bundles. MCP server catalogs can also declare trust tier, access mode, tenant scope, approval policy, prompt-injection risk, and OAuth scope metadata so governance bundles capture why one remote tool is treated as high-risk. Tool policy overrides can also set `decisionMode: manual | auto-approve | auto-reject | deny-and-continue` so operator evidence and execution behavior stay aligned.
|
|
1091
1091
|
- Protocol responsibilities stay split on purpose: ACP is the primary editor/client runtime boundary, A2A is the streaming-capable agent-platform bridge with polling compatibility, AG-UI is the UI event surface, and runtime MCP is the operator-facing control plane exported as MCP tools.
|
|
1092
1092
|
- `runtime/default.observability.tracing` can now describe exporter metadata such as OTLP endpoints and propagation mode, so frozen runtime snapshots keep trace-correlation plus operator-visible export context without exposing backend-private span internals.
|
|
1093
|
-
- `agent-harness runtime overview`, `agent-harness runtime health`, `agent-harness runtime approvals list|watch`, `agent-harness runtime
|
|
1093
|
+
- `agent-harness runtime overview`, `agent-harness runtime health`, `agent-harness runtime approvals list|watch`, `agent-harness runtime requests list|tail`, and `agent-harness runtime export request|session` provide a thin operator CLI over persisted runtime health, queue pressure, governance risk, approval queues, active request state, and audit-ready evidence packages.
|
|
1094
1094
|
- detailed A2A adapter guidance lives in [`docs/a2a-bridge.md`](docs/a2a-bridge.md)
|
package/README.zh.md
CHANGED
|
@@ -158,7 +158,7 @@ try {
|
|
|
158
158
|
|
|
159
159
|
- 把 `requests`、`sessions`、`approvals`、`events` 作为可查询产品记录保存下来的 runtime
|
|
160
160
|
- 能跨中断、重启和人工决策继续推进的恢复路径
|
|
161
|
-
- 稳定的
|
|
161
|
+
- 稳定的 request 关联与连续性元数据,让一次持久化请求能和日志、trace、fallback 过程对齐
|
|
162
162
|
- 对敏感 durable memory 写入和写类 MCP 调用默认走审批,而不是把治理责任留给每个工具定义自己记住
|
|
163
163
|
- 一个工作区形态的装配模型,而不是每个应用各写一套运行时胶水
|
|
164
164
|
- 即使底层 execution backend 变化,也尽量保持稳定的 runtime 契约
|
|
@@ -287,7 +287,7 @@ AI 让 agent 逻辑、工具调用和工作流代码更容易生成,真正更
|
|
|
287
287
|
下面三类用法与 runtime 的设计目标最直接对应:
|
|
288
288
|
|
|
289
289
|
- 企业内部智能体运行时:审批、重启恢复、运维侧证据链,以及由策略约束的 MCP 访问控制。
|
|
290
|
-
- 代码现代化运行时:长链路 coding flow、审批检查点、可恢复
|
|
290
|
+
- 代码现代化运行时:长链路 coding flow、审批检查点、可恢复 requests,以及可导出的运行证据包。
|
|
291
291
|
- Agent ops 与 remediation workflow runtime:并行 agent 尝试、人工 review gate、持久证据包,以及面向安全或维护任务的 operator visibility。
|
|
292
292
|
- 协议桥接运行时:ACP、A2A、AG-UI 与 runtime MCP 共用一套稳定控制面,而不是为每个对外入口各写一层集成胶水。
|
|
293
293
|
|
|
@@ -421,7 +421,7 @@ import { AgentHarnessRuntime, createAgentHarness } from "@botbotgo/agent-harness
|
|
|
421
421
|
const runtime: AgentHarnessRuntime = await createAgentHarness("/absolute/path/to/workspace");
|
|
422
422
|
```
|
|
423
423
|
|
|
424
|
-
`createAgentHarness(...)` 会加载工作区、解析 `resources/`、在 `
|
|
424
|
+
`createAgentHarness(...)` 会加载工作区、解析 `resources/`、在 `runtimeRoot` 下初始化持久化,并启动运行时维护任务。
|
|
425
425
|
|
|
426
426
|
`runtime.spec.resources` 可以挂载多个额外资源包。每个条目既可以指向“包根目录下带有 `resources/` 的目录”,也可以直接指向“自身带有 `package.json` 的资源目录”。
|
|
427
427
|
|
|
@@ -721,8 +721,8 @@ await stop(runtime);
|
|
|
721
721
|
|
|
722
722
|
重要字段:
|
|
723
723
|
|
|
724
|
-
- `
|
|
725
|
-
- `concurrency.
|
|
724
|
+
- `runtimeRoot`
|
|
725
|
+
- `concurrency.maxConcurrentRequests`
|
|
726
726
|
- `routing.defaultAgentId`
|
|
727
727
|
- `routing.rules`
|
|
728
728
|
- `routing.systemPrompt`
|
|
@@ -730,10 +730,10 @@ await stop(runtime);
|
|
|
730
730
|
- `maintenance.checkpoints`
|
|
731
731
|
- `maintenance.records`
|
|
732
732
|
- `recovery.enabled`
|
|
733
|
-
- `recovery.
|
|
733
|
+
- `recovery.resumeResumingRequestsOnStartup`
|
|
734
734
|
- `recovery.maxRecoveryAttempts`
|
|
735
735
|
|
|
736
|
-
`recovery.
|
|
736
|
+
`recovery.resumeResumingRequestsOnStartup` 将 checkpoint 恢复保持为运行时拥有的生命周期行为,而不是把 checkpoint 编排暴露为主 API。
|
|
737
737
|
|
|
738
738
|
`maintenance.checkpoints` 与 `maintenance.records` 是两层独立的保留策略:
|
|
739
739
|
|
|
@@ -755,7 +755,7 @@ kind: Runtime
|
|
|
755
755
|
metadata:
|
|
756
756
|
name: default
|
|
757
757
|
spec:
|
|
758
|
-
|
|
758
|
+
runtimeRoot: ./.agent
|
|
759
759
|
toolModuleDiscovery:
|
|
760
760
|
scope: top-level
|
|
761
761
|
concurrency:
|
|
@@ -770,7 +770,7 @@ spec:
|
|
|
770
770
|
enabled: false
|
|
771
771
|
recovery:
|
|
772
772
|
enabled: true
|
|
773
|
-
|
|
773
|
+
resumeResumingRequestsOnStartup: true
|
|
774
774
|
maxRecoveryAttempts: 3
|
|
775
775
|
```
|
|
776
776
|
|
|
@@ -898,7 +898,7 @@ Agent YAML 可以放在 `config/` 下任意位置;`config/agents/*.yaml` 是
|
|
|
898
898
|
|
|
899
899
|
两个区块:
|
|
900
900
|
|
|
901
|
-
- `spec.runtime`:harness 侧运行时放置,例如 `spec.runtime.
|
|
901
|
+
- `spec.runtime`:harness 侧运行时放置,例如 `spec.runtime.runtimeRoot`
|
|
902
902
|
- `spec` 顶层字段:上游执行语义与面向适配器的配置
|
|
903
903
|
|
|
904
904
|
direct 主机示例:
|
|
@@ -910,7 +910,7 @@ metadata:
|
|
|
910
910
|
name: direct
|
|
911
911
|
spec:
|
|
912
912
|
runtime:
|
|
913
|
-
|
|
913
|
+
runtimeRoot: ./.agent
|
|
914
914
|
backend: langchain-v1
|
|
915
915
|
modelRef: model/default
|
|
916
916
|
tools:
|
|
@@ -931,7 +931,7 @@ spec:
|
|
|
931
931
|
maxFileSizeMb: 10
|
|
932
932
|
sessionStorage:
|
|
933
933
|
enabled: true
|
|
934
|
-
rootDir: "{
|
|
934
|
+
rootDir: "{runtimeRoot}/sessions/{sessionId}/filesystem"
|
|
935
935
|
middleware: []
|
|
936
936
|
systemPrompt: Answer simple requests directly.
|
|
937
937
|
```
|
|
@@ -947,7 +947,7 @@ metadata:
|
|
|
947
947
|
name: orchestra
|
|
948
948
|
spec:
|
|
949
949
|
runtime:
|
|
950
|
-
|
|
950
|
+
runtimeRoot: ./.agent
|
|
951
951
|
backend: deepagent
|
|
952
952
|
modelRef: model/default
|
|
953
953
|
memory:
|
|
@@ -1047,5 +1047,5 @@ ACP transport 说明:
|
|
|
1047
1047
|
- `runtime/default.governance.remoteMcp` 现在可以按 MCP server 或 transport 做 allow/deny、审批升级,并把 transport 风险等级写进 runtime governance bundles。MCP server catalog 也可以声明 trust tier、access mode、tenant scope、approval policy、prompt-injection risk 与 OAuth scope 元数据,让治理快照能解释为什么某个远端工具被视为高风险。tool policy override 也可以声明 `decisionMode: manual | auto-approve | auto-reject | deny-and-continue`,让治理快照与实际执行路径保持一致。
|
|
1048
1048
|
- 协议分工要继续保持清晰:ACP 是 editor / client 的主运行时边界,A2A 是支持 streaming 且兼容轮询的 agent-platform bridge,AG-UI 是 UI 事件面,runtime MCP 是以 MCP tools 暴露的 operator control plane。
|
|
1049
1049
|
- `runtime/default.observability.tracing` 现在可描述 OTLP endpoint 和 propagation mode 这类 exporter 元数据,使冻结的 runtime snapshot 在保留 trace correlation 的同时,也能保留有用的导出上下文,而不暴露 backend 私有 span 细节。
|
|
1050
|
-
- `agent-harness runtime overview`、`agent-harness runtime health`、`agent-harness runtime approvals list|watch`、`agent-harness runtime
|
|
1050
|
+
- `agent-harness runtime overview`、`agent-harness runtime health`、`agent-harness runtime approvals list|watch`、`agent-harness runtime requests list|tail` 与 `agent-harness runtime export request|session` 提供了一层轻量 CLI,可直接查看 runtime health、queue pressure、governance risk、审批队列、运行状态与可审计证据包。
|
|
1051
1051
|
- 更详细的 A2A 适配层开发说明见 [`docs/a2a-bridge.md`](docs/a2a-bridge.md)
|
package/dist/acp.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ArtifactRecord, HarnessEvent, RequestRecord,
|
|
1
|
+
import type { ArtifactRecord, HarnessEvent, RequestRecord, RequestOptions, SessionRecord } from "./contracts/types.js";
|
|
2
2
|
import type { AgentHarnessRuntime } from "./runtime/harness.js";
|
|
3
|
-
import { getApproval, type
|
|
3
|
+
import { getApproval, type PublicRequestListeners } from "./api.js";
|
|
4
4
|
type JsonRpcId = string | number | null;
|
|
5
5
|
export type AcpJsonRpcRequest = {
|
|
6
6
|
jsonrpc?: "2.0";
|
|
@@ -29,11 +29,11 @@ export type AcpApproval = Awaited<ReturnType<typeof getApproval>> extends infer
|
|
|
29
29
|
export type AcpArtifact = ArtifactRecord & {
|
|
30
30
|
content?: unknown;
|
|
31
31
|
};
|
|
32
|
-
export type
|
|
32
|
+
export type AcpRequestParams = Omit<Extract<RequestOptions, {
|
|
33
33
|
input: unknown;
|
|
34
|
-
}>, "
|
|
34
|
+
}>, "listeners"> & {
|
|
35
35
|
sessionId?: string;
|
|
36
|
-
listeners?:
|
|
36
|
+
listeners?: PublicRequestListeners;
|
|
37
37
|
};
|
|
38
38
|
export type AcpServerCapabilities = {
|
|
39
39
|
sessions: {
|
package/dist/acp.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getApproval, getArtifact, getRequest, getSession, listApprovals,
|
|
1
|
+
import { getApproval, getArtifact, getRequest, getSession, listApprovals, listRequestArtifacts, listRequests, listSessions, request, resolveApproval, } from "./api.js";
|
|
2
2
|
const CAPABILITIES = {
|
|
3
3
|
sessions: { list: true, get: true },
|
|
4
4
|
requests: { submit: true, list: true, get: true },
|
|
@@ -45,7 +45,7 @@ async function readArtifactContent(runtime, params) {
|
|
|
45
45
|
const sessionId = readRequiredString(params.sessionId, "sessionId", method);
|
|
46
46
|
const requestId = readRequiredString(params.requestId, "requestId", method);
|
|
47
47
|
const artifactPath = readRequiredString(params.artifactPath, "artifactPath", method);
|
|
48
|
-
const listing = await
|
|
48
|
+
const listing = await listRequestArtifacts(runtime, { sessionId, requestId });
|
|
49
49
|
const artifact = listing.items.find((item) => item.path === artifactPath);
|
|
50
50
|
if (!artifact) {
|
|
51
51
|
throw new Error(`Artifact not found for ${requestId}: ${artifactPath}`);
|
|
@@ -191,7 +191,7 @@ export class AgentHarnessAcpServer {
|
|
|
191
191
|
}
|
|
192
192
|
case "artifacts.list": {
|
|
193
193
|
const payload = asObject(params, method);
|
|
194
|
-
return
|
|
194
|
+
return listRequestArtifacts(this.runtime, {
|
|
195
195
|
sessionId: readRequiredString(payload.sessionId, "sessionId", method),
|
|
196
196
|
requestId: readRequiredString(payload.requestId, "requestId", method),
|
|
197
197
|
});
|
package/dist/api.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { ArtifactListing, CancelOptions, InvocationEnvelope, ListMemoriesInput, ListMemoriesResult, MemoryRecord, MemorizeInput, MemorizeResult, MessageContent, RecallInput, RecallResult, RemoveMemoryInput,
|
|
1
|
+
import type { ArtifactListing, CancelOptions, InvocationEnvelope, ListMemoriesInput, ListMemoriesResult, MemoryRecord, MemorizeInput, MemorizeResult, MessageContent, RecallInput, RecallResult, RemoveMemoryInput, RequestDecisionOptions, RequestRecord, RequestResult as InternalRequestResult, RequestStartOptions, RequestSummary, RuntimeArtifactWriteInput, ResumeOptions, RequestListeners, RuntimeHealthSnapshot, RuntimeGovernanceEvidence, RuntimeGovernanceDiagnostics, RuntimeOperatorOverview, RuntimeQueueDiagnostics, RuntimeAdapterOptions, RuntimeEvaluationExport, RuntimeEvaluationExportInput, RuntimeEvaluationArtifact, RuntimeEvaluationReplayInput, RuntimeEvaluationReplayResult as InternalRuntimeEvaluationReplayResult, RuntimeSessionPackage, RuntimeSessionPackageInput, SessionListSummary, SessionRecord, SessionSummary, TranscriptMessage, UpdateMemoryInput, WorkspaceLoadOptions } from "./contracts/types.js";
|
|
2
2
|
import { AgentHarnessRuntime } from "./runtime/harness.js";
|
|
3
3
|
import type { InventoryAgentRecord, InventorySkillRecord } from "./runtime/harness/system/inventory.js";
|
|
4
4
|
import type { RequirementAssessmentOptions } from "./runtime/harness/system/skill-requirements.js";
|
|
5
5
|
import type { RuntimeMcpServerOptions, ToolMcpServerOptions } from "./mcp.js";
|
|
6
6
|
export { AgentHarnessAcpServer, createAcpServer } from "./acp.js";
|
|
7
7
|
export { createAcpStdioClient } from "./protocol/acp/client.js";
|
|
8
|
-
export type { AcpApproval, AcpArtifact, AcpEventNotification, AcpJsonRpcError, AcpJsonRpcRequest, AcpJsonRpcResponse, AcpJsonRpcSuccess, AcpRequestRecord,
|
|
8
|
+
export type { AcpApproval, AcpArtifact, AcpEventNotification, AcpJsonRpcError, AcpJsonRpcRequest, AcpJsonRpcResponse, AcpJsonRpcSuccess, AcpRequestRecord, AcpRequestParams, AcpServerCapabilities, AcpSessionRecord, } from "./acp.js";
|
|
9
9
|
export { AgentHarnessRuntime } from "./runtime/harness.js";
|
|
10
10
|
export { createUpstreamTimelineReducer } from "./upstream-events.js";
|
|
11
11
|
export type { ListMemoriesInput, ListMemoriesResult, MemoryDecision, MemoryKind, MemoryRecord, MemoryScope, MemorizeInput, MemorizeResult, RecallInput, RecallResult, RemoveMemoryInput, RuntimeEvaluationExport, RuntimeEvaluationExportInput, RuntimeEvaluationReplayInput, SessionListSummary, RuntimeSessionPackageInput, RuntimeSessionPackage, UpdateMemoryInput, } from "./contracts/types.js";
|
|
@@ -13,10 +13,10 @@ export type { AcpHttpServer, AcpHttpServerOptions } from "./protocol/acp/http.js
|
|
|
13
13
|
export type { AcpStdioClient, AcpStdioClientOptions } from "./protocol/acp/client.js";
|
|
14
14
|
export type { A2aAgentCard, A2aHttpServer, A2aHttpServerOptions, A2aTask, A2aTaskState } from "./protocol/a2a/http.js";
|
|
15
15
|
export type { AcpStdioServer, AcpStdioServerOptions } from "./protocol/acp/stdio.js";
|
|
16
|
-
export type { AgUiEvent, AgUiHttpServer, AgUiHttpServerOptions,
|
|
17
|
-
export type RequestEventType = "request.created" | "request.queued" | "request.dequeued" | "request.state.changed" | "request.resumed" | Exclude<NonNullable<
|
|
16
|
+
export type { AgUiEvent, AgUiHttpServer, AgUiHttpServerOptions, AgUiRequestAgentInput } from "./protocol/ag-ui/http.js";
|
|
17
|
+
export type RequestEventType = "request.created" | "request.queued" | "request.dequeued" | "request.state.changed" | "request.resumed" | Exclude<NonNullable<RequestListeners["onEvent"]> extends (event: infer T) => unknown ? T extends {
|
|
18
18
|
eventType: infer E;
|
|
19
|
-
} ? E : never : never,
|
|
19
|
+
} ? E : never : never, never> | (string & {});
|
|
20
20
|
export type RequestEvent = {
|
|
21
21
|
eventId: string;
|
|
22
22
|
eventType: RequestEventType;
|
|
@@ -37,9 +37,9 @@ export type RequestFlowGraphInput = {
|
|
|
37
37
|
sessionId: string;
|
|
38
38
|
requestId: string;
|
|
39
39
|
};
|
|
40
|
-
export type
|
|
40
|
+
export type PublicRequestListeners = {
|
|
41
41
|
onEvent?: (event: RequestEvent) => void | Promise<void>;
|
|
42
|
-
onUpstreamEvent?:
|
|
42
|
+
onUpstreamEvent?: RequestListeners["onUpstreamEvent"];
|
|
43
43
|
onTraceItem?: (item: RequestTraceItem) => void | Promise<void>;
|
|
44
44
|
};
|
|
45
45
|
export type Approval = {
|
|
@@ -78,14 +78,14 @@ export type RequestPackage = {
|
|
|
78
78
|
};
|
|
79
79
|
export type RecordArtifactInput = RuntimeArtifactWriteInput;
|
|
80
80
|
export type RuntimeEvaluationReplayResult = Omit<InternalRuntimeEvaluationReplayResult, "result"> & {
|
|
81
|
-
result:
|
|
81
|
+
result: PublicRequestResult;
|
|
82
82
|
};
|
|
83
|
-
export type OperatorOverview = Omit<RuntimeOperatorOverview, "approvals" | "
|
|
83
|
+
export type OperatorOverview = Omit<RuntimeOperatorOverview, "approvals" | "requests"> & {
|
|
84
84
|
approvals: {
|
|
85
85
|
total: number;
|
|
86
86
|
items: Approval[];
|
|
87
87
|
};
|
|
88
|
-
|
|
88
|
+
requests: {
|
|
89
89
|
total: number;
|
|
90
90
|
states: Partial<Record<RequestSummary["state"], number>>;
|
|
91
91
|
items: RequestSummary[];
|
|
@@ -98,21 +98,20 @@ type PublicApprovalFilter = {
|
|
|
98
98
|
sessionId?: string;
|
|
99
99
|
requestId?: string;
|
|
100
100
|
};
|
|
101
|
-
type PublicRequestStartOptions = Omit<
|
|
101
|
+
type PublicRequestStartOptions = Omit<RequestStartOptions, "sessionId" | "listeners"> & {
|
|
102
102
|
sessionId?: string;
|
|
103
|
-
listeners?:
|
|
103
|
+
listeners?: PublicRequestListeners;
|
|
104
104
|
};
|
|
105
|
-
type PublicRequestDecisionOptions = Omit<
|
|
105
|
+
type PublicRequestDecisionOptions = Omit<RequestDecisionOptions, "sessionId" | "requestId" | "listeners"> & {
|
|
106
106
|
sessionId: string;
|
|
107
107
|
requestId?: string;
|
|
108
|
-
listeners?:
|
|
108
|
+
listeners?: PublicRequestListeners;
|
|
109
109
|
};
|
|
110
|
-
type PublicRequestOptions = PublicRequestStartOptions | PublicRequestDecisionOptions;
|
|
111
|
-
type PublicRequestResult = Omit<
|
|
110
|
+
export type PublicRequestOptions = PublicRequestStartOptions | PublicRequestDecisionOptions;
|
|
111
|
+
export type PublicRequestResult = Omit<InternalRequestResult, "sessionId" | "requestId"> & {
|
|
112
112
|
sessionId: string;
|
|
113
113
|
requestId: string;
|
|
114
114
|
};
|
|
115
|
-
type PublicRunResult = PublicRequestResult;
|
|
116
115
|
export type RequestResult = PublicRequestResult;
|
|
117
116
|
export type UserChatMessage = {
|
|
118
117
|
role: "user";
|
|
@@ -132,7 +131,7 @@ type CreateAgentHarnessOptions = {
|
|
|
132
131
|
};
|
|
133
132
|
export declare function createAgentHarness(): Promise<AgentHarnessRuntime>;
|
|
134
133
|
export declare function createAgentHarness(workspaceRoot: string, options?: CreateAgentHarnessOptions): Promise<AgentHarnessRuntime>;
|
|
135
|
-
export declare function normalizeUserChatInput(input: UserChatInput, options?: NormalizeUserChatInputOptions): Pick<
|
|
134
|
+
export declare function normalizeUserChatInput(input: UserChatInput, options?: NormalizeUserChatInputOptions): Pick<RequestStartOptions, "input" | "invocation">;
|
|
136
135
|
export declare function request(runtime: AgentHarnessRuntime, options: PublicRequestOptions): Promise<PublicRequestResult>;
|
|
137
136
|
export declare function memorize(runtime: AgentHarnessRuntime, input: MemorizeInput): Promise<MemorizeResult>;
|
|
138
137
|
export declare function recall(runtime: AgentHarnessRuntime, input: RecallInput): Promise<RecallResult>;
|
|
@@ -154,7 +153,7 @@ export declare function exportSequence(runtime: AgentHarnessRuntime, input: Requ
|
|
|
154
153
|
export declare function deleteSession(runtime: AgentHarnessRuntime, sessionId: string): Promise<boolean>;
|
|
155
154
|
export declare function listApprovals(runtime: AgentHarnessRuntime, filter?: PublicApprovalFilter): Promise<Approval[]>;
|
|
156
155
|
export declare function getApproval(runtime: AgentHarnessRuntime, approvalId: string): Promise<Approval | null>;
|
|
157
|
-
export declare function
|
|
156
|
+
export declare function listRequestArtifacts(runtime: AgentHarnessRuntime, input: {
|
|
158
157
|
sessionId: string;
|
|
159
158
|
requestId: string;
|
|
160
159
|
}): Promise<RequestArtifactListing>;
|
|
@@ -190,8 +189,8 @@ export declare function describeInventory(runtime: AgentHarnessRuntime, options?
|
|
|
190
189
|
workspaceRoot: string;
|
|
191
190
|
agents: InventoryAgentRecord[];
|
|
192
191
|
};
|
|
193
|
-
export declare function resolveApproval(runtime: AgentHarnessRuntime, options: ResumeOptions): Promise<
|
|
194
|
-
export declare function
|
|
192
|
+
export declare function resolveApproval(runtime: AgentHarnessRuntime, options: ResumeOptions): Promise<PublicRequestResult>;
|
|
193
|
+
export declare function cancelRequest(runtime: AgentHarnessRuntime, options: CancelOptions): Promise<PublicRequestResult>;
|
|
195
194
|
export declare function stop(runtime: AgentHarnessRuntime): Promise<void>;
|
|
196
195
|
export declare function createToolMcpServer(runtime: AgentHarnessRuntime, options: ToolMcpServerOptions): Promise<import("@modelcontextprotocol/sdk/server/mcp").McpServer>;
|
|
197
196
|
export declare function serveToolsOverStdio(runtime: AgentHarnessRuntime, options: ToolMcpServerOptions): Promise<import("@modelcontextprotocol/sdk/server/mcp").McpServer>;
|
package/dist/api.js
CHANGED
|
@@ -27,20 +27,7 @@ function toApprovalRecord(record) {
|
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
function toPublicEventType(eventType) {
|
|
30
|
-
|
|
31
|
-
case "run.created":
|
|
32
|
-
return "request.created";
|
|
33
|
-
case "run.queued":
|
|
34
|
-
return "request.queued";
|
|
35
|
-
case "run.dequeued":
|
|
36
|
-
return "request.dequeued";
|
|
37
|
-
case "run.state.changed":
|
|
38
|
-
return "request.state.changed";
|
|
39
|
-
case "run.resumed":
|
|
40
|
-
return "request.resumed";
|
|
41
|
-
default:
|
|
42
|
-
return eventType;
|
|
43
|
-
}
|
|
30
|
+
return eventType;
|
|
44
31
|
}
|
|
45
32
|
function toPublicEvent(event) {
|
|
46
33
|
return {
|
|
@@ -68,7 +55,7 @@ function toPublicTraceItem(input) {
|
|
|
68
55
|
event: typed.event,
|
|
69
56
|
};
|
|
70
57
|
}
|
|
71
|
-
function
|
|
58
|
+
function toPublicRequestListeners(listeners) {
|
|
72
59
|
if (!listeners) {
|
|
73
60
|
return undefined;
|
|
74
61
|
}
|
|
@@ -104,7 +91,7 @@ function toRequestPackage(pkg) {
|
|
|
104
91
|
...(pkg.runtimeHealth ? { runtimeHealth: pkg.runtimeHealth } : {}),
|
|
105
92
|
};
|
|
106
93
|
}
|
|
107
|
-
function
|
|
94
|
+
function toPublicRequestResult(result) {
|
|
108
95
|
return {
|
|
109
96
|
sessionId: result.sessionId,
|
|
110
97
|
requestId: result.requestId,
|
|
@@ -123,13 +110,13 @@ function toPublicRunResult(result) {
|
|
|
123
110
|
metadata: result.metadata,
|
|
124
111
|
};
|
|
125
112
|
}
|
|
126
|
-
function
|
|
113
|
+
function toInternalRequestOptions(options) {
|
|
127
114
|
if ("decision" in options) {
|
|
128
115
|
return {
|
|
129
116
|
approvalId: options.approvalId,
|
|
130
117
|
decision: options.decision,
|
|
131
118
|
editedInput: options.editedInput,
|
|
132
|
-
listeners:
|
|
119
|
+
listeners: toPublicRequestListeners(options.listeners),
|
|
133
120
|
requestId: options.requestId,
|
|
134
121
|
sessionId: options.sessionId,
|
|
135
122
|
};
|
|
@@ -138,7 +125,7 @@ function toInternalRunOptions(options) {
|
|
|
138
125
|
agentId: options.agentId,
|
|
139
126
|
input: options.input,
|
|
140
127
|
invocation: options.invocation,
|
|
141
|
-
listeners:
|
|
128
|
+
listeners: toPublicRequestListeners(options.listeners),
|
|
142
129
|
priority: options.priority,
|
|
143
130
|
sessionId: options.sessionId,
|
|
144
131
|
};
|
|
@@ -152,25 +139,25 @@ function toInternalResumeOptions(options) {
|
|
|
152
139
|
sessionId: options.sessionId,
|
|
153
140
|
};
|
|
154
141
|
}
|
|
155
|
-
function toPublicRequestSummary(
|
|
142
|
+
function toPublicRequestSummary(summary) {
|
|
156
143
|
return {
|
|
157
|
-
requestId:
|
|
158
|
-
sessionId:
|
|
159
|
-
agentId:
|
|
160
|
-
|
|
161
|
-
executionMode:
|
|
162
|
-
adapterKind:
|
|
163
|
-
createdAt:
|
|
164
|
-
updatedAt:
|
|
165
|
-
state:
|
|
166
|
-
checkpointRef:
|
|
167
|
-
resumable:
|
|
168
|
-
startedAt:
|
|
169
|
-
endedAt:
|
|
170
|
-
lastActivityAt:
|
|
171
|
-
currentAgentId:
|
|
172
|
-
delegationChain:
|
|
173
|
-
runtimeSnapshot:
|
|
144
|
+
requestId: summary.requestId,
|
|
145
|
+
sessionId: summary.sessionId,
|
|
146
|
+
agentId: summary.agentId,
|
|
147
|
+
parentRequestId: summary.parentRequestId,
|
|
148
|
+
executionMode: summary.executionMode,
|
|
149
|
+
adapterKind: summary.adapterKind,
|
|
150
|
+
createdAt: summary.createdAt,
|
|
151
|
+
updatedAt: summary.updatedAt,
|
|
152
|
+
state: summary.state,
|
|
153
|
+
checkpointRef: summary.checkpointRef,
|
|
154
|
+
resumable: summary.resumable,
|
|
155
|
+
startedAt: summary.startedAt,
|
|
156
|
+
endedAt: summary.endedAt,
|
|
157
|
+
lastActivityAt: summary.lastActivityAt,
|
|
158
|
+
currentAgentId: summary.currentAgentId,
|
|
159
|
+
delegationChain: summary.delegationChain,
|
|
160
|
+
runtimeSnapshot: summary.runtimeSnapshot,
|
|
174
161
|
};
|
|
175
162
|
}
|
|
176
163
|
export async function createAgentHarness(workspaceRoot = process.cwd(), options = {}) {
|
|
@@ -192,7 +179,7 @@ export function normalizeUserChatInput(input, options = {}) {
|
|
|
192
179
|
return options.invocation ? { input: content, invocation: options.invocation } : { input: content };
|
|
193
180
|
}
|
|
194
181
|
export async function request(runtime, options) {
|
|
195
|
-
return
|
|
182
|
+
return toPublicRequestResult(await runtime.run(toInternalRequestOptions(options)));
|
|
196
183
|
}
|
|
197
184
|
export async function memorize(runtime, input) {
|
|
198
185
|
return runtime.memorize(input);
|
|
@@ -279,11 +266,11 @@ export async function getApproval(runtime, approvalId) {
|
|
|
279
266
|
const record = await runtime.getApproval(approvalId);
|
|
280
267
|
return record ? toApprovalRecord(record) : null;
|
|
281
268
|
}
|
|
282
|
-
export async function
|
|
283
|
-
return toRequestArtifactListing(await runtime.
|
|
269
|
+
export async function listRequestArtifacts(runtime, input) {
|
|
270
|
+
return toRequestArtifactListing(await runtime.listRequestArtifacts(input.sessionId, input.requestId));
|
|
284
271
|
}
|
|
285
272
|
export async function getArtifact(runtime, input) {
|
|
286
|
-
return runtime.
|
|
273
|
+
return runtime.readRequestArtifact(input.sessionId, input.requestId, input.artifactPath);
|
|
287
274
|
}
|
|
288
275
|
export async function recordArtifact(runtime, input) {
|
|
289
276
|
return runtime.recordArtifact(input);
|
|
@@ -312,17 +299,18 @@ export async function getHealth(runtime) {
|
|
|
312
299
|
}
|
|
313
300
|
export async function getOperatorOverview(runtime, options) {
|
|
314
301
|
const overview = await runtime.getOperatorOverview(options);
|
|
302
|
+
const requestOverview = {
|
|
303
|
+
total: overview.requests.total,
|
|
304
|
+
states: overview.requests.states,
|
|
305
|
+
items: overview.requests.items.map(toPublicRequestSummary),
|
|
306
|
+
};
|
|
315
307
|
return {
|
|
316
308
|
...overview,
|
|
317
309
|
approvals: {
|
|
318
310
|
total: overview.approvals.total,
|
|
319
311
|
items: overview.approvals.items.map(toApprovalRecord),
|
|
320
312
|
},
|
|
321
|
-
|
|
322
|
-
total: overview.runs.total,
|
|
323
|
-
states: overview.runs.states,
|
|
324
|
-
items: overview.runs.items.map(toPublicRequestSummary),
|
|
325
|
-
},
|
|
313
|
+
requests: requestOverview,
|
|
326
314
|
};
|
|
327
315
|
}
|
|
328
316
|
export async function exportRequestPackage(runtime, input) {
|
|
@@ -338,7 +326,7 @@ export async function replayEvaluationBundle(runtime, input) {
|
|
|
338
326
|
const replayed = await runtime.replayEvaluationBundle(input);
|
|
339
327
|
return {
|
|
340
328
|
...replayed,
|
|
341
|
-
result:
|
|
329
|
+
result: toPublicRequestResult(replayed.result),
|
|
342
330
|
};
|
|
343
331
|
}
|
|
344
332
|
export function serveAcpStdio(runtime, options) {
|
|
@@ -363,10 +351,10 @@ export function describeInventory(runtime, options) {
|
|
|
363
351
|
return runtime.describeWorkspaceInventory(options);
|
|
364
352
|
}
|
|
365
353
|
export async function resolveApproval(runtime, options) {
|
|
366
|
-
return
|
|
354
|
+
return toPublicRequestResult(await runtime.resume(toInternalResumeOptions(options)));
|
|
367
355
|
}
|
|
368
|
-
export async function
|
|
369
|
-
return
|
|
356
|
+
export async function cancelRequest(runtime, options) {
|
|
357
|
+
return toPublicRequestResult(await runtime.cancelRequest(options));
|
|
370
358
|
}
|
|
371
359
|
export async function stop(runtime) {
|
|
372
360
|
return runtime.stop();
|