refactor(agents): narrow command helper types · openclaw/openclaw@e349bdb
vincentkoc
·
2026-06-17
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -12,7 +12,7 @@ export type AgentAttemptLifecycleState = {
|
12 | 12 | }; |
13 | 13 | |
14 | 14 | /** Event shape emitted by runtimes during an agent attempt. */ |
15 | | -export type AgentAttemptLifecycleEvent = { |
| 15 | +type AgentAttemptLifecycleEvent = { |
16 | 16 | stream: string; |
17 | 17 | data?: Record<string, unknown>; |
18 | 18 | sessionKey?: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -15,7 +15,7 @@ import {
|
15 | 15 | import type { AgentCommandOpts } from "./types.js"; |
16 | 16 | |
17 | 17 | /** Parameters for merging and persisting a session entry update. */ |
18 | | -export type PersistSessionEntryParams = { |
| 18 | +type PersistSessionEntryParams = { |
19 | 19 | sessionStore: Record<string, SessionEntry>; |
20 | 20 | sessionKey: string; |
21 | 21 | storePath: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -66,10 +66,10 @@ function createRestartOnlyAbortSignal(source: AbortSignal | undefined): {
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** Per-payload durable delivery status. */ |
69 | | -export type AgentCommandDeliveryPayloadStatus = "sent" | "suppressed" | "failed"; |
| 69 | +type AgentCommandDeliveryPayloadStatus = "sent" | "suppressed" | "failed"; |
70 | 70 | |
71 | 71 | /** Delivery outcome for one normalized outbound payload. */ |
72 | | -export type AgentCommandDeliveryPayloadOutcome = { |
| 72 | +type AgentCommandDeliveryPayloadOutcome = { |
73 | 73 | index: number; |
74 | 74 | status: AgentCommandDeliveryPayloadStatus; |
75 | 75 | reason?: string; |
@@ -84,7 +84,7 @@ export type AgentCommandDeliveryPayloadOutcome = {
|
84 | 84 | }; |
85 | 85 | |
86 | 86 | /** Aggregate delivery status for an agent command result. */ |
87 | | -export type AgentCommandDeliveryStatus = { |
| 87 | +type AgentCommandDeliveryStatus = { |
88 | 88 | requested: true; |
89 | 89 | attempted: boolean; |
90 | 90 | status: "sent" | "suppressed" | "partial_failed" | "failed"; |
@@ -100,7 +100,7 @@ export type AgentCommandDeliveryStatus = {
|
100 | 100 | }; |
101 | 101 | |
102 | 102 | /** Agent command result after payload normalization and optional delivery. */ |
103 | | -export type AgentCommandDeliveryResult = { |
| 103 | +type AgentCommandDeliveryResult = { |
104 | 104 | payloads: ReturnType<typeof projectOutboundPayloadPlanForJson>; |
105 | 105 | meta: EmbeddedAgentRunMeta & AgentCommandResultMetaOverrides; |
106 | 106 | didSendViaMessagingTool?: boolean; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -41,7 +41,7 @@ import { clearBootstrapSnapshotOnSessionRollover } from "../bootstrap-cache.js";
|
41 | 41 | import { clearAllCliSessions } from "../cli-session.js"; |
42 | 42 | |
43 | 43 | /** Resolved command session identity plus backing store metadata. */ |
44 | | -export type SessionResolution = { |
| 44 | +type SessionResolution = { |
45 | 45 | sessionId: string; |
46 | 46 | sessionKey?: string; |
47 | 47 | sessionEntry?: SessionEntry; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -29,7 +29,7 @@ export type AgentCommandResultMetaOverrides = {
|
29 | 29 | }; |
30 | 30 | |
31 | 31 | /** ACP turn source markers accepted by trusted command callsites. */ |
32 | | -export type AcpTurnSource = "manual_spawn"; |
| 32 | +type AcpTurnSource = "manual_spawn"; |
33 | 33 | |
34 | 34 | /** Channel/account/thread context carried into an agent run. */ |
35 | 35 | export type AgentRunContext = { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。