refactor(acp): hide helper types · openclaw/openclaw@f943971
vincentkoc
·
2026-06-17
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -11,7 +11,7 @@ export type BackendAttempt = {
|
11 | 11 | }; |
12 | 12 | |
13 | 13 | /** Ordered backend candidates plus display helper for diagnostics. */ |
14 | | -export type BackendCandidatePlan = { |
| 14 | +type BackendCandidatePlan = { |
15 | 15 | candidateBackends: string[]; |
16 | 16 | describeBackendCandidate: (backend: string) => string; |
17 | 17 | }; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -17,7 +17,7 @@ const ACP_BACKGROUND_TASK_TEXT_MAX_LENGTH = 160;
|
17 | 17 | const ACP_BACKGROUND_TASK_PROGRESS_MAX_LENGTH = 240; |
18 | 18 | |
19 | 19 | /** Context needed to mirror a child ACP turn into the requester task registry. */ |
20 | | -export type BackgroundTaskContext = { |
| 20 | +type BackgroundTaskContext = { |
21 | 21 | requesterSessionKey: string; |
22 | 22 | requesterOrigin?: DeliveryContext; |
23 | 23 | childSessionKey: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -10,12 +10,12 @@ import { normalizeAcpErrorCode } from "./manager.utils.js";
|
10 | 10 | import { normalizeText } from "./runtime-options.js"; |
11 | 11 | |
12 | 12 | /** Mutable gate used to suppress late events after timeout/cancel races. */ |
13 | | -export type AcpTurnEventGate = { |
| 13 | +type AcpTurnEventGate = { |
14 | 14 | open: boolean; |
15 | 15 | }; |
16 | 16 | |
17 | 17 | /** Summary of whether a turn stream emitted user-visible output or terminal events. */ |
18 | | -export type AcpTurnStreamOutcome = { |
| 18 | +type AcpTurnStreamOutcome = { |
19 | 19 | sawOutput: boolean; |
20 | 20 | sawTerminalEvent: boolean; |
21 | 21 | }; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -70,7 +70,7 @@ export type AcpRunTurnInput = {
|
70 | 70 | onEvent?: (event: AcpRuntimeEvent) => Promise<void> | void; |
71 | 71 | }; |
72 | 72 | |
73 | | -export type AcpTurnLifecycleEvent = { |
| 73 | +type AcpTurnLifecycleEvent = { |
74 | 74 | type: "prompt_submitted"; |
75 | 75 | at: number; |
76 | 76 | }; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -23,7 +23,7 @@ type RuntimeCacheEntry = {
|
23 | 23 | }; |
24 | 24 | |
25 | 25 | /** Snapshot entry used for idle eviction and cache diagnostics. */ |
26 | | -export type CachedRuntimeSnapshot = { |
| 26 | +type CachedRuntimeSnapshot = { |
27 | 27 | actorKey: string; |
28 | 28 | state: CachedRuntimeState; |
29 | 29 | lastTouchedAt: number; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -29,7 +29,7 @@ const FILE_LEDGER_LOCK_OPTIONS = {
|
29 | 29 | stale: 15_000, |
30 | 30 | } as const; |
31 | 31 | |
32 | | -export type AcpEventLedgerEntry = { |
| 32 | +type AcpEventLedgerEntry = { |
33 | 33 | seq: number; |
34 | 34 | at: number; |
35 | 35 | sessionId: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -7,7 +7,7 @@ const ACP_DISABLED_MESSAGE = "ACP is disabled by policy (`acp.enabled=false`).";
|
7 | 7 | const ACP_DISPATCH_DISABLED_MESSAGE = |
8 | 8 | "ACP dispatch is disabled by policy (`acp.dispatch.enabled=false`)."; |
9 | 9 | |
10 | | -export type AcpDispatchPolicyState = "enabled" | "acp_disabled" | "dispatch_disabled"; |
| 10 | +type AcpDispatchPolicyState = "enabled" | "acp_disabled" | "dispatch_disabled"; |
11 | 11 | |
12 | 12 | /** Returns whether ACP is globally enabled by config policy. */ |
13 | 13 | export function isAcpEnabledByPolicy(cfg: OpenClawConfig): boolean { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -64,20 +64,20 @@ export type GatewaySessionPresentationRow = Pick<
|
64 | 64 | >; |
65 | 65 | |
66 | 66 | /** ACP session controls and modes shown to the client. */ |
67 | | -export type SessionPresentation = { |
| 67 | +type SessionPresentation = { |
68 | 68 | configOptions: SessionConfigOption[]; |
69 | 69 | modes: SessionModeState; |
70 | 70 | }; |
71 | 71 | |
72 | 72 | /** ACP session metadata plus lineage information. */ |
73 | | -export type SessionMetadata = { |
| 73 | +type SessionMetadata = { |
74 | 74 | title?: string | null; |
75 | 75 | updatedAt?: string | null; |
76 | 76 | _meta?: AcpSessionLineageMeta; |
77 | 77 | }; |
78 | 78 | |
79 | 79 | /** Context/token usage snapshot for ACP clients that expose progress meters. */ |
80 | | -export type SessionUsageSnapshot = { |
| 80 | +type SessionUsageSnapshot = { |
81 | 81 | size: number; |
82 | 82 | used: number; |
83 | 83 | }; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -10,7 +10,7 @@ export type GatewayChatContentBlock = {
|
10 | 10 | thinking?: string; |
11 | 11 | }; |
12 | 12 | |
13 | | -export type ReplayChunk = { |
| 13 | +type ReplayChunk = { |
14 | 14 | sessionUpdate: "user_message_chunk" | "agent_message_chunk" | "agent_thought_chunk"; |
15 | 15 | text: string; |
16 | 16 | }; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -12,7 +12,7 @@ export const ACP_LIST_SESSIONS_MAX_FETCH_LIMIT =
|
12 | 12 | ACP_LIST_SESSIONS_MAX_CURSOR_OFFSET + ACP_LIST_SESSIONS_MAX_PAGE_SIZE + 1; |
13 | 13 | |
14 | 14 | /** Opaque cursor payload used to page ACP session list results. */ |
15 | | -export type ListSessionsCursor = { |
| 15 | +type ListSessionsCursor = { |
16 | 16 | offset: number; |
17 | 17 | cwd?: string; |
18 | 18 | }; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。