fix(cycles): split residual shared type seams

This commit is contained in:
Vincent Koc
2026-04-11 00:47:42 +01:00
parent 707cc315cc
commit 95bc417944
81 changed files with 214 additions and 428 deletions

View File

@@ -1,4 +1,4 @@
import type { OpenClawConfig } from "../config/config.js";
import type { OpenClawConfig } from "../config/types.js";
import {
normalizeOptionalLowercaseString,
normalizeOptionalString,

View File

@@ -11,7 +11,7 @@ import {
} from "./dependency-denylist.js";
import { getGlobalHookRunner } from "./hook-runner-global.js";
import { createBeforeInstallHookPayload } from "./install-policy-context.js";
import type { InstallSafetyOverrides } from "./install-security-scan.js";
import type { InstallSafetyOverrides } from "./install-security-scan.types.js";
type InstallScanLogger = {
warn?: (message: string) => void;

View File

@@ -2,9 +2,8 @@ type InstallScanLogger = {
warn?: (message: string) => void;
};
export type InstallSafetyOverrides = {
dangerouslyForceUnsafeInstall?: boolean;
};
export type { InstallSafetyOverrides } from "./install-security-scan.types.js";
import type { InstallSafetyOverrides } from "./install-security-scan.types.js";
export type InstallSecurityScanResult = {
blocked?: {

View File

@@ -0,0 +1,3 @@
export type InstallSafetyOverrides = {
dangerouslyForceUnsafeInstall?: boolean;
};

View File

@@ -1,6 +1,6 @@
import fs from "node:fs";
import path from "node:path";
import type { OpenClawConfig } from "../config/config.js";
import type { OpenClawConfig } from "../config/types.js";
import {
normalizeOptionalLowercaseString,
normalizeOptionalString,

View File

@@ -1,6 +1,6 @@
import type { OpenClawConfig } from "../config/config.js";
import type { SecretInput } from "../config/types.secrets.js";
import type { EmbeddingInput } from "../memory-host-sdk/engine-embeddings.js";
import type { EmbeddingInput } from "../memory-host-sdk/host/embedding-inputs.js";
export type MemoryEmbeddingBatchChunk = {
text: string;

View File

@@ -0,0 +1 @@
export type PluginKind = "memory" | "context-engine";

View File

@@ -1,12 +1,21 @@
import { normalizeProviderId } from "../agents/provider-id.js";
import { getActivePluginRegistry } from "./runtime.js";
import type {
ProviderDefaultThinkingPolicyContext,
ProviderPlugin,
ProviderThinkingPolicyContext,
} from "./types.js";
} from "./provider-thinking.types.js";
import { getActivePluginRegistry } from "./runtime.js";
function matchesProviderId(provider: ProviderPlugin, providerId: string): boolean {
type ThinkingProviderPlugin = {
id: string;
aliases?: string[];
isBinaryThinking?: (ctx: ProviderThinkingPolicyContext) => boolean | undefined;
supportsXHighThinking?: (ctx: ProviderThinkingPolicyContext) => boolean | undefined;
resolveDefaultThinkingLevel?: (
ctx: ProviderDefaultThinkingPolicyContext,
) => "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "adaptive" | null | undefined;
};
function matchesProviderId(provider: ThinkingProviderPlugin, providerId: string): boolean {
const normalized = normalizeProviderId(providerId);
if (!normalized) {
return false;
@@ -17,7 +26,7 @@ function matchesProviderId(provider: ProviderPlugin, providerId: string): boolea
return (provider.aliases ?? []).some((alias) => normalizeProviderId(alias) === normalized);
}
function resolveActiveThinkingProvider(providerId: string): ProviderPlugin | undefined {
function resolveActiveThinkingProvider(providerId: string): ThinkingProviderPlugin | undefined {
return getActivePluginRegistry()?.providers.find((entry) => {
return matchesProviderId(entry.provider, providerId);
})?.provider;

View File

@@ -0,0 +1,22 @@
/**
* Provider-owned thinking policy input.
*
* Used by shared `/think`, ACP controls, and directive parsing to ask a
* provider whether a model supports special reasoning UX such as xhigh or a
* binary on/off toggle.
*/
export type ProviderThinkingPolicyContext = {
provider: string;
modelId: string;
};
/**
* Provider-owned default thinking policy input.
*
* `reasoning` is the merged catalog hint for the selected model when one is
* available. Providers can use it to keep "reasoning model => low" behavior
* without re-reading the catalog themselves.
*/
export type ProviderDefaultThinkingPolicyContext = ProviderThinkingPolicyContext & {
reasoning?: boolean;
};

View File

@@ -1,6 +1,6 @@
import type { AgentHarness } from "../agents/harness/types.js";
import type { ChannelPlugin } from "../channels/plugins/types.js";
import type { OperatorScope } from "../gateway/method-scopes.js";
import type { OperatorScope } from "../gateway/operator-scopes.js";
import type { GatewayRequestHandlers } from "../gateway/server-methods/types.js";
import type { HookEntry } from "../hooks/types.js";
import type { PluginActivationSource } from "./config-state.js";

View File

@@ -7,7 +7,7 @@ import type { AgentHarness } from "../agents/harness/types.js";
import type { AnyAgentTool } from "../agents/tools/common.js";
import type { ChannelPlugin } from "../channels/plugins/types.js";
import { registerContextEngineForOwner } from "../context-engine/registry.js";
import type { OperatorScope } from "../gateway/method-scopes.js";
import type { OperatorScope } from "../gateway/operator-scopes.js";
import type { GatewayRequestHandler } from "../gateway/server-methods/types.js";
import { registerInternalHook, unregisterInternalHook } from "../hooks/internal-hooks.js";
import type { HookEntry } from "../hooks/types.js";

View File

@@ -1,6 +1,6 @@
import type { OpenClawConfig } from "../config/config.js";
import type { OpenClawConfig } from "../config/types.js";
import type { PluginSlotsConfig } from "../config/types.plugins.js";
import type { PluginKind } from "./types.js";
import type { PluginKind } from "./plugin-kind.types.js";
export type PluginSlotKey = keyof PluginSlotsConfig;

View File

@@ -11,7 +11,8 @@ import type {
AuthProfileStore,
} from "../agents/auth-profiles/types.js";
import type { AgentHarness } from "../agents/harness/types.js";
import type { ModelCatalogEntry } from "../agents/model-catalog.js";
import type { ModelCatalogEntry } from "../agents/model-catalog.types.js";
import type { AgentHarness } from "../agents/harness/types.js";
import type { FailoverReason } from "../agents/pi-embedded-helpers/types.js";
import type { ModelProviderRequestTransportOverrides } from "../agents/provider-request-config.js";
import type { ProviderSystemPromptContribution } from "../agents/system-prompt-contribution.js";
@@ -31,7 +32,7 @@ import type {
import type { ModelCompatConfig } from "../config/types.models.js";
import type { OpenClawConfig } from "../config/types.openclaw.js";
import type { TtsAutoMode } from "../config/types.tts.js";
import type { OperatorScope } from "../gateway/method-scopes.js";
import type { OperatorScope } from "../gateway/operator-scopes.js";
import type { GatewayRequestHandler } from "../gateway/server-methods/types.js";
import type { InternalHookHandler } from "../hooks/internal-hooks.js";
import type { HookEntry } from "../hooks/types.js";
@@ -80,8 +81,13 @@ import type {
import type { DeliveryContext } from "../utils/delivery-context.js";
import type { VideoGenerationProvider } from "../video-generation/types.js";
import type { WizardPrompter } from "../wizard/prompts.js";
import type { PluginKind } from "./plugin-kind.types.js";
import type { SecretInputMode } from "./provider-auth-types.js";
import type { createVpsAwareOAuthHandlers } from "./provider-oauth-flow.js";
import type {
ProviderDefaultThinkingPolicyContext,
ProviderThinkingPolicyContext,
} from "./provider-thinking.types.js";
import type { PluginRuntime } from "./runtime/types.js";
export type { PluginRuntime } from "./runtime/types.js";
@@ -112,7 +118,7 @@ export type PluginConfigUiHint = {
placeholder?: string;
};
export type PluginKind = "memory" | "context-engine";
export type { PluginKind } from "./plugin-kind.types.js";
export type PluginConfigValidation =
| { ok: true; value?: unknown }
@@ -901,28 +907,10 @@ export type ProviderBuiltInModelSuppressionResult = {
errorMessage?: string;
};
/**
* Provider-owned thinking policy input.
*
* Used by shared `/think`, ACP controls, and directive parsing to ask a
* provider whether a model supports special reasoning UX such as xhigh or a
* binary on/off toggle.
*/
export type ProviderThinkingPolicyContext = {
provider: string;
modelId: string;
};
/**
* Provider-owned default thinking policy input.
*
* `reasoning` is the merged catalog hint for the selected model when one is
* available. Providers can use it to keep "reasoning model => low" behavior
* without re-reading the catalog themselves.
*/
export type ProviderDefaultThinkingPolicyContext = ProviderThinkingPolicyContext & {
reasoning?: boolean;
};
export type {
ProviderDefaultThinkingPolicyContext,
ProviderThinkingPolicyContext,
} from "./provider-thinking.types.js";
/**
* Provider-owned "modern model" policy input.