mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-14 06:56:05 +00:00
refactor(agents): privatize native hook relay internals (#106634)
* refactor(agents): privatize native hook relay internals * chore(ci): shrink dead-export baseline
This commit is contained in:
committed by
GitHub
parent
1644bef790
commit
2b9991c748
@@ -964,15 +964,6 @@ export const KNIP_UNUSED_EXPORT_BASELINE = [
|
||||
"src/agents/fallback-skip-cache.ts: resetFallbackSkipCacheForTest",
|
||||
"src/agents/harness/context-engine-lifecycle.ts: HarnessContextEngine",
|
||||
"src/agents/harness/lifecycle-hook-helpers.ts: clearAgentHarnessFinalizeRetryBudget",
|
||||
"src/agents/harness/native-hook-relay.ts: InvokeNativeHookRelayBridgeParams",
|
||||
"src/agents/harness/native-hook-relay.ts: InvokeNativeHookRelayParams",
|
||||
"src/agents/harness/native-hook-relay.ts: JsonValue",
|
||||
"src/agents/harness/native-hook-relay.ts: NativeHookRelayCommandForEventOptions",
|
||||
"src/agents/harness/native-hook-relay.ts: NativeHookRelayCommandOptions",
|
||||
"src/agents/harness/native-hook-relay.ts: NativeHookRelayDeferredApprovalOutcome",
|
||||
"src/agents/harness/native-hook-relay.ts: NativeHookRelayInvocation",
|
||||
"src/agents/harness/native-hook-relay.ts: NativeHookRelayRegistration",
|
||||
"src/agents/harness/native-hook-relay.ts: RegisterNativeHookRelayParams",
|
||||
"src/agents/harness/types.ts: AgentHarnessSideQuestionPreparedRuntimeAuth",
|
||||
"src/agents/harness/types.ts: ExpectedAgentHarnessRuntimeArtifact",
|
||||
"src/agents/identity-avatar-file.ts: LocalAgentAvatarFailureReason",
|
||||
|
||||
@@ -48,13 +48,7 @@ import { callGatewayTool } from "../tools/gateway.js";
|
||||
import { runAgentHarnessAfterToolCallHook } from "./hook-helpers.js";
|
||||
import { runAgentHarnessBeforeAgentFinalizeHook } from "./lifecycle-hook-helpers.js";
|
||||
|
||||
export type JsonValue =
|
||||
| null
|
||||
| boolean
|
||||
| number
|
||||
| string
|
||||
| JsonValue[]
|
||||
| { [key: string]: JsonValue };
|
||||
type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue };
|
||||
|
||||
const NATIVE_HOOK_RELAY_EVENTS = [
|
||||
"pre_tool_use",
|
||||
@@ -68,7 +62,7 @@ const NATIVE_HOOK_RELAY_PROVIDERS = ["codex"] as const;
|
||||
export type NativeHookRelayEvent = (typeof NATIVE_HOOK_RELAY_EVENTS)[number];
|
||||
export type NativeHookRelayProvider = (typeof NATIVE_HOOK_RELAY_PROVIDERS)[number];
|
||||
|
||||
export type NativeHookRelayInvocation = {
|
||||
type NativeHookRelayInvocation = {
|
||||
provider: NativeHookRelayProvider;
|
||||
relayId: string;
|
||||
event: NativeHookRelayEvent;
|
||||
@@ -97,7 +91,7 @@ export type NativeHookRelayProcessResponse = {
|
||||
failureDisposition?: Exclude<BeforeToolCallFailureDisposition, "blocked">;
|
||||
};
|
||||
|
||||
export type NativeHookRelayRegistration = {
|
||||
type NativeHookRelayRegistration = {
|
||||
relayId: string;
|
||||
provider: NativeHookRelayProvider;
|
||||
generationMismatchGraceExpiresAtMs?: number;
|
||||
@@ -130,7 +124,7 @@ export type NativeHookRelayRegistrationHandle = NativeHookRelayRegistration & {
|
||||
unregister: () => void;
|
||||
};
|
||||
|
||||
export type RegisterNativeHookRelayParams = {
|
||||
type RegisterNativeHookRelayParams = {
|
||||
provider: NativeHookRelayProvider;
|
||||
relayId?: string;
|
||||
generation?: string;
|
||||
@@ -148,18 +142,18 @@ export type RegisterNativeHookRelayParams = {
|
||||
onPreToolUseFailure?: NativeHookRelayRegistration["onPreToolUseFailure"];
|
||||
};
|
||||
|
||||
export type NativeHookRelayCommandOptions = {
|
||||
type NativeHookRelayCommandOptions = {
|
||||
executable?: string;
|
||||
nice?: number | false;
|
||||
nodeExecutable?: string;
|
||||
timeoutMs?: number;
|
||||
};
|
||||
|
||||
export type NativeHookRelayCommandForEventOptions = {
|
||||
type NativeHookRelayCommandForEventOptions = {
|
||||
timeoutMs?: number;
|
||||
};
|
||||
|
||||
export type InvokeNativeHookRelayParams = {
|
||||
type InvokeNativeHookRelayParams = {
|
||||
provider: unknown;
|
||||
relayId: unknown;
|
||||
generation?: unknown;
|
||||
@@ -168,7 +162,7 @@ export type InvokeNativeHookRelayParams = {
|
||||
requireGeneration?: boolean;
|
||||
};
|
||||
|
||||
export type InvokeNativeHookRelayBridgeParams = InvokeNativeHookRelayParams & {
|
||||
type InvokeNativeHookRelayBridgeParams = InvokeNativeHookRelayParams & {
|
||||
registrationTimeoutMs?: number;
|
||||
timeoutMs?: number;
|
||||
};
|
||||
@@ -318,7 +312,7 @@ type NativeHookRelayPreToolUseApproval = {
|
||||
resolutionPromise?: Promise<NativeHookRelayDeferredApprovalOutcome>;
|
||||
};
|
||||
|
||||
export type NativeHookRelayDeferredApprovalOutcome =
|
||||
type NativeHookRelayDeferredApprovalOutcome =
|
||||
| {
|
||||
handled: true;
|
||||
outcome: "approved-once";
|
||||
|
||||
Reference in New Issue
Block a user