diff --git a/extensions/browser/src/browser/control-auth.ts b/extensions/browser/src/browser/control-auth.ts index 77dc072705b..cb5751bfa9b 100644 --- a/extensions/browser/src/browser/control-auth.ts +++ b/extensions/browser/src/browser/control-auth.ts @@ -3,8 +3,8 @@ import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, } from "openclaw/plugin-sdk/text-runtime"; -import type { OpenClawConfig } from "../config/config.js"; import { loadConfig, writeConfigFile } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { resolveGatewayAuth } from "../gateway/auth.js"; import { ensureGatewayStartupAuth } from "../gateway/startup-auth.js"; diff --git a/extensions/browser/src/doctor-browser.ts b/extensions/browser/src/doctor-browser.ts index ccef7b6021b..80210c54cb7 100644 --- a/extensions/browser/src/doctor-browser.ts +++ b/extensions/browser/src/doctor-browser.ts @@ -5,7 +5,7 @@ import { readBrowserVersion, resolveGoogleChromeExecutableForPlatform, } from "./browser/chrome.executables.js"; -import type { OpenClawConfig } from "./config/config.js"; +import type { OpenClawConfig } from "./config/types.openclaw.js"; import { asRecord } from "./record-shared.js"; const CHROME_MCP_MIN_MAJOR = 144; diff --git a/src/acp/control-plane/manager.core.ts b/src/acp/control-plane/manager.core.ts index 0ae4c2cae29..2e9c8ac40fe 100644 --- a/src/acp/control-plane/manager.core.ts +++ b/src/acp/control-plane/manager.core.ts @@ -1,5 +1,5 @@ import { resolveAgentTimeoutMs } from "../../agents/timeout.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { logVerbose } from "../../globals.js"; import { formatErrorMessage } from "../../infra/errors.js"; import { normalizeAgentId } from "../../routing/session-key.js"; diff --git a/src/acp/control-plane/manager.identity-reconcile.ts b/src/acp/control-plane/manager.identity-reconcile.ts index 45c9817967b..0e5d8f1794d 100644 --- a/src/acp/control-plane/manager.identity-reconcile.ts +++ b/src/acp/control-plane/manager.identity-reconcile.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { logVerbose } from "../../globals.js"; import { withAcpRuntimeErrorBoundary } from "../runtime/errors.js"; import { diff --git a/src/acp/control-plane/manager.types.ts b/src/acp/control-plane/manager.types.ts index b9fbf87c9db..f1a5550a2db 100644 --- a/src/acp/control-plane/manager.types.ts +++ b/src/acp/control-plane/manager.types.ts @@ -1,10 +1,10 @@ -import type { OpenClawConfig } from "../../config/config.js"; import type { SessionAcpIdentity, AcpSessionRuntimeOptions, SessionAcpMeta, SessionEntry, } from "../../config/sessions/types.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import type { AcpRuntimeError } from "../runtime/errors.js"; import { getAcpRuntimeBackend, requireAcpRuntimeBackend } from "../runtime/registry.js"; import { diff --git a/src/acp/control-plane/manager.utils.ts b/src/acp/control-plane/manager.utils.ts index 502207c39e7..297ebc8ac58 100644 --- a/src/acp/control-plane/manager.utils.ts +++ b/src/acp/control-plane/manager.utils.ts @@ -1,9 +1,9 @@ -import type { OpenClawConfig } from "../../config/config.js"; import { canonicalizeMainSessionAlias, resolveMainSessionKey, } from "../../config/sessions/main-session.js"; import type { SessionAcpMeta } from "../../config/sessions/types.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { normalizeAgentId, normalizeMainKey, diff --git a/src/acp/control-plane/spawn.ts b/src/acp/control-plane/spawn.ts index 5d9790cb5e7..fc769afb285 100644 --- a/src/acp/control-plane/spawn.ts +++ b/src/acp/control-plane/spawn.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { callGateway } from "../../gateway/call.js"; import { logVerbose } from "../../globals.js"; import { getSessionBindingService } from "../../infra/outbound/session-binding-service.js"; diff --git a/src/acp/persistent-bindings.lifecycle.ts b/src/acp/persistent-bindings.lifecycle.ts index 7e031282f97..f2abf5030c8 100644 --- a/src/acp/persistent-bindings.lifecycle.ts +++ b/src/acp/persistent-bindings.lifecycle.ts @@ -1,5 +1,5 @@ -import type { OpenClawConfig } from "../config/config.js"; import type { SessionAcpMeta } from "../config/sessions/types.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { logVerbose } from "../globals.js"; import { formatErrorMessage } from "../infra/errors.js"; import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js"; diff --git a/src/acp/persistent-bindings.resolve.ts b/src/acp/persistent-bindings.resolve.ts index 068b89f8891..2ab4b809c16 100644 --- a/src/acp/persistent-bindings.resolve.ts +++ b/src/acp/persistent-bindings.resolve.ts @@ -3,7 +3,7 @@ import { resolveConfiguredBindingRecordBySessionKey, resolveConfiguredBindingRecordForConversation, } from "../channels/plugins/binding-registry.js"; -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import type { ConversationRef } from "../infra/outbound/session-binding-service.js"; import { resolveConfiguredAcpBindingSpecFromRecord, diff --git a/src/acp/persistent-bindings.types.ts b/src/acp/persistent-bindings.types.ts index 8efc99af63b..da7ec9dab8f 100644 --- a/src/acp/persistent-bindings.types.ts +++ b/src/acp/persistent-bindings.types.ts @@ -1,5 +1,5 @@ import { createHash } from "node:crypto"; -import type { ChannelId } from "../channels/plugins/types.js"; +import type { ChannelId } from "../channels/plugins/types.public.js"; import type { SessionBindingRecord } from "../infra/outbound/session-binding-service.js"; import { normalizeAccountId, resolveAgentIdFromSessionKey } from "../routing/session-key.js"; import { sanitizeAgentId } from "../routing/session-key.js"; diff --git a/src/acp/policy.ts b/src/acp/policy.ts index c752828ffdc..bcbe132ad80 100644 --- a/src/acp/policy.ts +++ b/src/acp/policy.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { normalizeAgentId } from "../routing/session-key.js"; import { AcpRuntimeError } from "./runtime/errors.js"; diff --git a/src/acp/runtime/session-meta.ts b/src/acp/runtime/session-meta.ts index 5d9d21e7bbb..54185a81a13 100644 --- a/src/acp/runtime/session-meta.ts +++ b/src/acp/runtime/session-meta.ts @@ -1,4 +1,3 @@ -import type { OpenClawConfig } from "../../config/config.js"; import { loadConfig } from "../../config/config.js"; import { resolveStorePath } from "../../config/sessions/paths.js"; import { loadSessionStore } from "../../config/sessions/store-load.js"; @@ -8,6 +7,7 @@ import { type SessionAcpMeta, type SessionEntry, } from "../../config/sessions/types.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { parseAgentSessionKey } from "../../routing/session-key.js"; import { normalizeLowercaseStringOrEmpty } from "../../shared/string-coerce.js"; diff --git a/src/agents/acp-spawn.ts b/src/agents/acp-spawn.ts index 2e0a25037fc..a5765626757 100644 --- a/src/agents/acp-spawn.ts +++ b/src/agents/acp-spawn.ts @@ -26,11 +26,11 @@ import { } from "../channels/thread-bindings-policy.js"; import { parseDurationMs } from "../cli/parse-duration.js"; import { loadConfig } from "../config/config.js"; -import type { OpenClawConfig } from "../config/config.js"; import { resolveStorePath } from "../config/sessions/paths.js"; import { loadSessionStore } from "../config/sessions/store.js"; import { resolveSessionTranscriptFile } from "../config/sessions/transcript.js"; import type { SessionEntry } from "../config/sessions/types.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { callGateway } from "../gateway/call.js"; import { areHeartbeatsEnabled } from "../infra/heartbeat-wake.js"; import { resolveConversationIdFromTargets } from "../infra/outbound/conversation-id.js"; diff --git a/src/agents/auth-health.ts b/src/agents/auth-health.ts index b7f1ef76982..7753982650f 100644 --- a/src/agents/auth-health.ts +++ b/src/agents/auth-health.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { type AuthCredentialReasonCode, type AuthProfileCredential, diff --git a/src/agents/auth-profiles.resolve-auth-profile-order.fixtures.ts b/src/agents/auth-profiles.resolve-auth-profile-order.fixtures.ts index 92d7d454768..c59d0493439 100644 --- a/src/agents/auth-profiles.resolve-auth-profile-order.fixtures.ts +++ b/src/agents/auth-profiles.resolve-auth-profile-order.fixtures.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import type { AuthProfileStore } from "./auth-profiles.js"; export const ANTHROPIC_STORE: AuthProfileStore = { diff --git a/src/agents/auth-profiles/display.ts b/src/agents/auth-profiles/display.ts index 876c5ae2678..60314df979e 100644 --- a/src/agents/auth-profiles/display.ts +++ b/src/agents/auth-profiles/display.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { resolveAuthProfileMetadata } from "./identity.js"; import type { AuthProfileStore } from "./types.js"; diff --git a/src/agents/auth-profiles/doctor.ts b/src/agents/auth-profiles/doctor.ts index 27504484a44..2e6fcfd5c56 100644 --- a/src/agents/auth-profiles/doctor.ts +++ b/src/agents/auth-profiles/doctor.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { buildProviderAuthDoctorHintWithPlugin } from "../../plugins/provider-runtime.runtime.js"; import { normalizeProviderId } from "../model-selection-normalize.js"; import type { AuthProfileStore } from "./types.js"; diff --git a/src/agents/auth-profiles/identity.ts b/src/agents/auth-profiles/identity.ts index f58b313d533..fdeee2482c4 100644 --- a/src/agents/auth-profiles/identity.ts +++ b/src/agents/auth-profiles/identity.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { normalizeOptionalString } from "../../shared/string-coerce.js"; import type { AuthProfileStore } from "./types.js"; diff --git a/src/agents/auth-profiles/oauth.ts b/src/agents/auth-profiles/oauth.ts index 6383a06ef81..6ee77f33c89 100644 --- a/src/agents/auth-profiles/oauth.ts +++ b/src/agents/auth-profiles/oauth.ts @@ -4,7 +4,8 @@ import { type OAuthCredentials, type OAuthProvider, } from "@mariozechner/pi-ai/oauth"; -import { loadConfig, type OpenClawConfig } from "../../config/config.js"; +import { loadConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { coerceSecretRef } from "../../config/types.secrets.js"; import { formatErrorMessage } from "../../infra/errors.js"; import { withFileLock } from "../../infra/file-lock.js"; diff --git a/src/agents/auth-profiles/order.ts b/src/agents/auth-profiles/order.ts index bba872dceaa..e6738bca740 100644 --- a/src/agents/auth-profiles/order.ts +++ b/src/agents/auth-profiles/order.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { findNormalizedProviderValue, normalizeProviderId } from "../model-selection.js"; import { resolveProviderIdForAuth } from "../provider-auth-aliases.js"; import { diff --git a/src/agents/auth-profiles/policy.ts b/src/agents/auth-profiles/policy.ts index 174da2e20c1..5fd1114756f 100644 --- a/src/agents/auth-profiles/policy.ts +++ b/src/agents/auth-profiles/policy.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { coerceSecretRef, resolveSecretInputRef } from "../../config/types.secrets.js"; import type { AuthProfileCredential, AuthProfileStore } from "./types.js"; diff --git a/src/agents/auth-profiles/repair.ts b/src/agents/auth-profiles/repair.ts index 262050c7afd..bd25d7096f8 100644 --- a/src/agents/auth-profiles/repair.ts +++ b/src/agents/auth-profiles/repair.ts @@ -1,5 +1,5 @@ -import type { OpenClawConfig } from "../../config/config.js"; import type { AuthProfileConfig } from "../../config/types.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { findNormalizedProviderKey, normalizeProviderId } from "../provider-id.js"; import { resolveAuthProfileMetadata } from "./identity.js"; import { dedupeProfileIds, listProfilesForProvider } from "./profiles.js"; diff --git a/src/agents/auth-profiles/session-override.ts b/src/agents/auth-profiles/session-override.ts index e51af6fda44..28c0b26bdb1 100644 --- a/src/agents/auth-profiles/session-override.ts +++ b/src/agents/auth-profiles/session-override.ts @@ -1,5 +1,5 @@ -import type { OpenClawConfig } from "../../config/config.js"; import type { SessionEntry } from "../../config/sessions/types.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { resolveAuthProfileOrder } from "../auth-profiles/order.js"; import { ensureAuthProfileStore, hasAnyAuthProfileStoreSource } from "../auth-profiles/store.js"; import { isProfileInCooldown } from "../auth-profiles/usage.js"; diff --git a/src/agents/auth-profiles/usage.ts b/src/agents/auth-profiles/usage.ts index ea69f791d66..808951b203f 100644 --- a/src/agents/auth-profiles/usage.ts +++ b/src/agents/auth-profiles/usage.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { normalizeProviderId } from "../model-selection.js"; import { logAuthProfileFailureStateChange } from "./state-observation.js"; import { saveAuthProfileStore, updateAuthProfileStoreWithLock } from "./store.js"; diff --git a/src/agents/bootstrap-files.ts b/src/agents/bootstrap-files.ts index b28e136d2fc..aa77c2bec2b 100644 --- a/src/agents/bootstrap-files.ts +++ b/src/agents/bootstrap-files.ts @@ -1,6 +1,6 @@ import fs from "node:fs/promises"; -import type { OpenClawConfig } from "../config/config.js"; import type { AgentContextInjection } from "../config/types.agent-defaults.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { normalizeOptionalString } from "../shared/string-coerce.js"; import { resolveSessionAgentIds } from "./agent-scope.js"; import { getOrLoadBootstrapFiles } from "./bootstrap-cache.js"; diff --git a/src/agents/bootstrap-hooks.ts b/src/agents/bootstrap-hooks.ts index 69655ae65e7..ccfa9c0523e 100644 --- a/src/agents/bootstrap-hooks.ts +++ b/src/agents/bootstrap-hooks.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import type { AgentBootstrapHookContext } from "../hooks/internal-hooks.js"; import { createInternalHookEvent, triggerInternalHook } from "../hooks/internal-hooks.js"; import { resolveAgentIdFromSessionKey } from "../routing/session-key.js"; diff --git a/src/agents/btw.ts b/src/agents/btw.ts index 91de9702420..b3b2938d121 100644 --- a/src/agents/btw.ts +++ b/src/agents/btw.ts @@ -10,12 +10,12 @@ import { import { SessionManager } from "@mariozechner/pi-coding-agent"; import type { ReasoningLevel, ThinkLevel } from "../auto-reply/thinking.js"; import type { GetReplyOptions, ReplyPayload } from "../auto-reply/types.js"; -import type { OpenClawConfig } from "../config/config.js"; import { resolveSessionFilePath, resolveSessionFilePathOptions, type SessionEntry, } from "../config/sessions.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { diagnosticLogger as diag } from "../logging/diagnostic.js"; import { prepareProviderRuntimeAuth } from "../plugins/provider-runtime.js"; import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js"; diff --git a/src/agents/cache-trace.ts b/src/agents/cache-trace.ts index 74660783488..006d0d52eed 100644 --- a/src/agents/cache-trace.ts +++ b/src/agents/cache-trace.ts @@ -1,8 +1,8 @@ import crypto from "node:crypto"; import path from "node:path"; import type { AgentMessage, StreamFn } from "@mariozechner/pi-agent-core"; -import type { OpenClawConfig } from "../config/config.js"; import { resolveStateDir } from "../config/paths.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { resolveUserPath } from "../utils.js"; import { parseBooleanValue } from "../utils/boolean.js"; import { safeJsonStringify } from "../utils/safe-json.js"; diff --git a/src/agents/channel-tools.ts b/src/agents/channel-tools.ts index ea984ec82eb..5273d8c6e5a 100644 --- a/src/agents/channel-tools.ts +++ b/src/agents/channel-tools.ts @@ -5,9 +5,12 @@ import { resolveMessageActionDiscoveryChannelId, __testing as messageActionTesting, } from "../channels/plugins/message-action-discovery.js"; -import type { ChannelAgentTool, ChannelMessageActionName } from "../channels/plugins/types.js"; +import type { + ChannelAgentTool, + ChannelMessageActionName, +} from "../channels/plugins/types.public.js"; import { normalizeAnyChannelId } from "../channels/registry.js"; -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; type ChannelAgentToolMeta = { channelId: string; diff --git a/src/agents/cli-backends.ts b/src/agents/cli-backends.ts index a8fe8f6e463..45afa1c682e 100644 --- a/src/agents/cli-backends.ts +++ b/src/agents/cli-backends.ts @@ -1,5 +1,5 @@ -import type { OpenClawConfig } from "../config/config.js"; import type { CliBackendConfig } from "../config/types.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { resolveRuntimeCliBackends } from "../plugins/cli-backends.runtime.js"; import { resolvePluginSetupCliBackend } from "../plugins/setup-registry.js"; import { resolveRuntimeTextTransforms } from "../plugins/text-transforms.runtime.js"; diff --git a/src/agents/cli-runner.test-support.ts b/src/agents/cli-runner.test-support.ts index b3c704f586c..36bbb61eaa1 100644 --- a/src/agents/cli-runner.test-support.ts +++ b/src/agents/cli-runner.test-support.ts @@ -1,7 +1,7 @@ import fs from "node:fs/promises"; import type { Mock } from "vitest"; import { beforeEach, vi } from "vitest"; -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import type { requestHeartbeatNow } from "../infra/heartbeat-wake.js"; import type { enqueueSystemEvent } from "../infra/system-events.js"; import type { CliBackendPlugin } from "../plugin-sdk/cli-backend.js"; diff --git a/src/agents/cli-runner/bundle-mcp.ts b/src/agents/cli-runner/bundle-mcp.ts index 43ace46f9c3..06503763fb6 100644 --- a/src/agents/cli-runner/bundle-mcp.ts +++ b/src/agents/cli-runner/bundle-mcp.ts @@ -2,9 +2,9 @@ import crypto from "node:crypto"; import fs from "node:fs/promises"; import os from "node:os"; import path from "node:path"; -import type { OpenClawConfig } from "../../config/config.js"; import { applyMergePatch } from "../../config/merge-patch.js"; import type { CliBackendConfig } from "../../config/types.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { extractMcpServerMap, loadEnabledBundleMcpConfig, diff --git a/src/agents/cli-runner/helpers.ts b/src/agents/cli-runner/helpers.ts index f3444f172d6..ca0c19ae264 100644 --- a/src/agents/cli-runner/helpers.ts +++ b/src/agents/cli-runner/helpers.ts @@ -6,8 +6,8 @@ import type { AgentTool } from "@mariozechner/pi-agent-core"; import type { ImageContent } from "@mariozechner/pi-ai"; import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue"; import type { ThinkLevel } from "../../auto-reply/thinking.js"; -import type { OpenClawConfig } from "../../config/config.js"; import type { CliBackendConfig } from "../../config/types.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { resolvePreferredOpenClawTmpDir } from "../../infra/tmp-openclaw-dir.js"; import { MAX_IMAGE_BYTES } from "../../media/constants.js"; import { extensionForMime } from "../../media/mime.js"; diff --git a/src/agents/cli-runner/types.ts b/src/agents/cli-runner/types.ts index 74003ee1087..4a6dded8b5a 100644 --- a/src/agents/cli-runner/types.ts +++ b/src/agents/cli-runner/types.ts @@ -1,10 +1,10 @@ import type { ImageContent } from "@mariozechner/pi-ai"; import type { ReplyOperation } from "../../auto-reply/reply/reply-run-registry.js"; import type { ThinkLevel } from "../../auto-reply/thinking.js"; -import type { OpenClawConfig } from "../../config/config.js"; import type { CliSessionBinding } from "../../config/sessions.js"; import type { SessionSystemPromptReport } from "../../config/sessions/types.js"; import type { CliBackendConfig } from "../../config/types.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import type { PromptImageOrderEntry } from "../../media/prompt-image-order.js"; import type { ResolvedCliBackend } from "../cli-backends.js"; import type { SkillSnapshot } from "../skills.js"; diff --git a/src/agents/codex-native-web-search.ts b/src/agents/codex-native-web-search.ts index 7926f4d4c61..174f90d419d 100644 --- a/src/agents/codex-native-web-search.ts +++ b/src/agents/codex-native-web-search.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { normalizeOptionalString } from "../shared/string-coerce.js"; import { isRecord } from "../utils.js"; import { ensureAuthProfileStore, listProfilesForProvider } from "./auth-profiles.js"; diff --git a/src/agents/command/attempt-execution.ts b/src/agents/command/attempt-execution.ts index e84daaf153d..69e2c50fbde 100644 --- a/src/agents/command/attempt-execution.ts +++ b/src/agents/command/attempt-execution.ts @@ -10,9 +10,9 @@ import { startsWithSilentToken, stripLeadingSilentToken, } from "../../auto-reply/tokens.js"; -import { loadConfig } from "../../config/config.js"; import { mergeSessionEntry, type SessionEntry, updateSessionStore } from "../../config/sessions.js"; import { resolveSessionTranscriptFile } from "../../config/sessions/transcript.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { emitAgentEvent } from "../../infra/agent-events.js"; import { createSubsystemLogger } from "../../logging/subsystem.js"; import { emitSessionTranscriptUpdate } from "../../sessions/transcript-events.js"; @@ -326,7 +326,7 @@ export async function persistAcpTurnTranscript(params: { export function runAgentAttempt(params: { providerOverride: string; modelOverride: string; - cfg: ReturnType; + cfg: OpenClawConfig; sessionEntry: SessionEntry | undefined; sessionId: string; sessionKey: string | undefined; diff --git a/src/agents/command/delivery.ts b/src/agents/command/delivery.ts index 16919fb3f34..1f8e766a02a 100644 --- a/src/agents/command/delivery.ts +++ b/src/agents/command/delivery.ts @@ -4,8 +4,8 @@ import type { ReplyPayload } from "../../auto-reply/types.js"; import { getChannelPlugin, normalizeChannelId } from "../../channels/plugins/index.js"; import { createReplyPrefixContext } from "../../channels/reply-prefix.js"; import { createOutboundSendDeps, type CliDeps } from "../../cli/outbound-send-deps.js"; -import type { OpenClawConfig } from "../../config/config.js"; import type { SessionEntry } from "../../config/sessions.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { resolveAgentDeliveryPlan, resolveAgentOutboundTarget, diff --git a/src/agents/command/session-store.ts b/src/agents/command/session-store.ts index 23bae15ada1..4d390f8f751 100644 --- a/src/agents/command/session-store.ts +++ b/src/agents/command/session-store.ts @@ -1,10 +1,10 @@ -import type { OpenClawConfig } from "../../config/config.js"; import { mergeSessionEntry, setSessionRuntimeModel, type SessionEntry, updateSessionStore, } from "../../config/sessions.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { estimateUsageCost, resolveModelCostConfig } from "../../utils/usage-format.js"; import { setCliSessionBinding, setCliSessionId } from "../cli-session.js"; import { resolveContextTokensForModel } from "../context.js"; diff --git a/src/agents/command/session.ts b/src/agents/command/session.ts index 0f0c700b573..4ffa5cf4f1f 100644 --- a/src/agents/command/session.ts +++ b/src/agents/command/session.ts @@ -6,7 +6,6 @@ import { type ThinkLevel, type VerboseLevel, } from "../../auto-reply/thinking.js"; -import type { OpenClawConfig } from "../../config/config.js"; import { evaluateSessionFreshness, loadSessionStore, @@ -19,6 +18,7 @@ import { resolveStorePath, type SessionEntry, } from "../../config/sessions.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { normalizeAgentId, normalizeMainKey } from "../../routing/session-key.js"; import { resolveSessionIdMatchSelection } from "../../sessions/session-id-resolution.js"; import { listAgentIds } from "../agent-scope.js"; diff --git a/src/agents/command/types.ts b/src/agents/command/types.ts index fd63f06ff73..b051800f807 100644 --- a/src/agents/command/types.ts +++ b/src/agents/command/types.ts @@ -1,6 +1,6 @@ import type { AgentInternalEvent } from "../../agents/internal-events.js"; import type { SpawnedRunMetadata } from "../../agents/spawned-context.js"; -import type { ChannelOutboundTargetMode } from "../../channels/plugins/types.js"; +import type { ChannelOutboundTargetMode } from "../../channels/plugins/types.public.js"; import type { PromptImageOrderEntry } from "../../media/prompt-image-order.js"; import type { InputProvenance } from "../../sessions/input-provenance.js"; import type { AgentStreamParams, ClientToolDefinition } from "./shared-types.js"; diff --git a/src/agents/context-runtime-state.ts b/src/agents/context-runtime-state.ts index 9991917d3bf..a02ac5e72ee 100644 --- a/src/agents/context-runtime-state.ts +++ b/src/agents/context-runtime-state.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { MODEL_CONTEXT_TOKEN_CACHE } from "./context-cache.js"; const CONTEXT_WINDOW_RUNTIME_STATE_KEY = Symbol.for("openclaw.contextWindowRuntimeState"); diff --git a/src/agents/context-window-guard.ts b/src/agents/context-window-guard.ts index bd213bb2877..3221b7e758c 100644 --- a/src/agents/context-window-guard.ts +++ b/src/agents/context-window-guard.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { findNormalizedProviderValue } from "./provider-id.js"; export const CONTEXT_WINDOW_HARD_MIN_TOKENS = 16_000; diff --git a/src/agents/context.ts b/src/agents/context.ts index 176e0ef20bc..44b734a7ac6 100644 --- a/src/agents/context.ts +++ b/src/agents/context.ts @@ -3,7 +3,7 @@ import path from "node:path"; import { loadConfig } from "../config/config.js"; -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { computeBackoff, type BackoffPolicy } from "../infra/backoff.js"; import { consumeRootOptionToken, FLAG_TERMINATOR } from "../infra/cli-root-options.js"; import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js"; diff --git a/src/agents/embedded-pi-lsp.ts b/src/agents/embedded-pi-lsp.ts index b660dd1de15..66405d940bd 100644 --- a/src/agents/embedded-pi-lsp.ts +++ b/src/agents/embedded-pi-lsp.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import type { BundleLspServerConfig } from "../plugins/bundle-lsp.js"; import { loadEnabledBundleLspConfig } from "../plugins/bundle-lsp.js"; diff --git a/src/agents/embedded-pi-mcp.ts b/src/agents/embedded-pi-mcp.ts index 82d4d0e486c..326fe538ce1 100644 --- a/src/agents/embedded-pi-mcp.ts +++ b/src/agents/embedded-pi-mcp.ts @@ -1,5 +1,5 @@ -import type { OpenClawConfig } from "../config/config.js"; import { normalizeConfiguredMcpServers } from "../config/mcp-config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import type { BundleMcpDiagnostic, BundleMcpServerConfig } from "../plugins/bundle-mcp.js"; import { loadEnabledBundleMcpConfig } from "../plugins/bundle-mcp.js"; diff --git a/src/agents/exec-defaults.ts b/src/agents/exec-defaults.ts index 01358e5bfb0..b8ee1fa1da4 100644 --- a/src/agents/exec-defaults.ts +++ b/src/agents/exec-defaults.ts @@ -1,5 +1,5 @@ -import type { OpenClawConfig } from "../config/config.js"; import type { SessionEntry } from "../config/sessions.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { loadExecApprovals, type ExecAsk, diff --git a/src/agents/execution-contract.ts b/src/agents/execution-contract.ts index 0680462cf9f..9ab7023a18f 100644 --- a/src/agents/execution-contract.ts +++ b/src/agents/execution-contract.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js"; import { resolveAgentExecutionContract, resolveSessionAgentIds } from "./agent-scope.js"; diff --git a/src/agents/fast-mode.ts b/src/agents/fast-mode.ts index 4b238e088bd..97253d6b090 100644 --- a/src/agents/fast-mode.ts +++ b/src/agents/fast-mode.ts @@ -1,6 +1,6 @@ import { normalizeFastMode } from "../auto-reply/thinking.shared.js"; -import type { OpenClawConfig } from "../config/config.js"; import type { SessionEntry } from "../config/sessions.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { resolveAgentConfig } from "./agent-scope.js"; export type FastModeState = { diff --git a/src/agents/harness/selection.ts b/src/agents/harness/selection.ts index 66feb898126..464f2759ca1 100644 --- a/src/agents/harness/selection.ts +++ b/src/agents/harness/selection.ts @@ -1,5 +1,5 @@ -import type { OpenClawConfig } from "../../config/config.js"; import type { AgentEmbeddedHarnessConfig } from "../../config/types.agents-shared.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { createSubsystemLogger } from "../../logging/subsystem.js"; import { normalizeAgentId } from "../../routing/session-key.js"; import { listAgentEntries, resolveSessionAgentIds } from "../agent-scope.js"; diff --git a/src/agents/heartbeat-system-prompt.ts b/src/agents/heartbeat-system-prompt.ts index 5b69bfebb7c..b65c721eeec 100644 --- a/src/agents/heartbeat-system-prompt.ts +++ b/src/agents/heartbeat-system-prompt.ts @@ -3,8 +3,8 @@ import { resolveHeartbeatPrompt as resolveHeartbeatPromptText, } from "../auto-reply/heartbeat.js"; import { parseDurationMs } from "../cli/parse-duration.js"; -import type { OpenClawConfig } from "../config/config.js"; import type { AgentDefaultsConfig } from "../config/types.agent-defaults.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { normalizeAgentId } from "../routing/session-key.js"; import { normalizeOptionalString } from "../shared/string-coerce.js"; import { listAgentEntries, resolveAgentConfig, resolveDefaultAgentId } from "./agent-scope.js"; diff --git a/src/agents/identity-avatar.ts b/src/agents/identity-avatar.ts index 49f633154f0..2960c8ba6ec 100644 --- a/src/agents/identity-avatar.ts +++ b/src/agents/identity-avatar.ts @@ -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.openclaw.js"; import { AVATAR_MAX_BYTES, isAvatarDataUrl, diff --git a/src/agents/identity.ts b/src/agents/identity.ts index 8500a35775d..9bafd5ed52b 100644 --- a/src/agents/identity.ts +++ b/src/agents/identity.ts @@ -1,4 +1,5 @@ -import type { OpenClawConfig, HumanDelayConfig, IdentityConfig } from "../config/config.js"; +import type { HumanDelayConfig, IdentityConfig } from "../config/types.base.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { resolveAgentConfig } from "./agent-scope.js"; const DEFAULT_ACK_REACTION = "👀"; diff --git a/src/agents/image-sanitization.ts b/src/agents/image-sanitization.ts index 0c40972671a..5fec82be5d8 100644 --- a/src/agents/image-sanitization.ts +++ b/src/agents/image-sanitization.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; export type ImageSanitizationLimits = { maxDimensionPx?: number; diff --git a/src/agents/live-target-matcher.ts b/src/agents/live-target-matcher.ts index 41ac4a28b66..fb1c909ae5b 100644 --- a/src/agents/live-target-matcher.ts +++ b/src/agents/live-target-matcher.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { resolveOwningPluginIdsForProvider } from "../plugins/providers.js"; import { normalizeLowercaseStringOrEmpty, diff --git a/src/agents/model-alias-lines.ts b/src/agents/model-alias-lines.ts index 35142ba2b3b..0f8c56d5be5 100644 --- a/src/agents/model-alias-lines.ts +++ b/src/agents/model-alias-lines.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { normalizeOptionalString } from "../shared/string-coerce.js"; export function buildModelAliasLines(cfg?: OpenClawConfig) { diff --git a/src/agents/model-auth-label.ts b/src/agents/model-auth-label.ts index 77118c3e7bb..187c4a61615 100644 --- a/src/agents/model-auth-label.ts +++ b/src/agents/model-auth-label.ts @@ -1,5 +1,5 @@ -import type { OpenClawConfig } from "../config/config.js"; import type { SessionEntry } from "../config/sessions.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { ensureAuthProfileStore, resolveAuthProfileDisplayLabel, diff --git a/src/agents/model-auth.ts b/src/agents/model-auth.ts index 35eb1e9e8d8..d293affaaa0 100644 --- a/src/agents/model-auth.ts +++ b/src/agents/model-auth.ts @@ -1,8 +1,9 @@ import path from "node:path"; import { type Api, type Model } from "@mariozechner/pi-ai"; import { formatCliCommand } from "../cli/command-format.js"; -import { getRuntimeConfigSnapshot, type OpenClawConfig } from "../config/config.js"; +import { getRuntimeConfigSnapshot } from "../config/config.js"; import type { ModelProviderAuthMode, ModelProviderConfig } from "../config/types.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { coerceSecretRef } from "../config/types.secrets.js"; import { getShellEnvAppliedKeys } from "../infra/shell-env.js"; import { createSubsystemLogger } from "../logging/subsystem.js"; diff --git a/src/agents/model-catalog.ts b/src/agents/model-catalog.ts index 67811e9a690..e9ffbff06ae 100644 --- a/src/agents/model-catalog.ts +++ b/src/agents/model-catalog.ts @@ -1,4 +1,5 @@ -import { type OpenClawConfig, loadConfig } from "../config/config.js"; +import { loadConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { createSubsystemLogger } from "../logging/subsystem.js"; import { augmentModelCatalogWithProviderPlugins } from "../plugins/provider-runtime.runtime.js"; import { diff --git a/src/agents/model-fallback.ts b/src/agents/model-fallback.ts index 0322b893641..e094983f00d 100644 --- a/src/agents/model-fallback.ts +++ b/src/agents/model-fallback.ts @@ -1,8 +1,8 @@ -import type { OpenClawConfig } from "../config/config.js"; import { resolveAgentModelFallbackValues, resolveAgentModelPrimaryValue, } from "../config/model-input.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { formatErrorMessage } from "../infra/errors.js"; import { createSubsystemLogger } from "../logging/subsystem.js"; import { normalizeOptionalString } from "../shared/string-coerce.js"; diff --git a/src/agents/model-selection.ts b/src/agents/model-selection.ts index 49b514065e2..77c0f2da8e6 100644 --- a/src/agents/model-selection.ts +++ b/src/agents/model-selection.ts @@ -1,10 +1,10 @@ import { resolveThinkingDefaultForModel } from "../auto-reply/thinking.shared.js"; -import type { OpenClawConfig } from "../config/config.js"; import { resolveAgentModelFallbackValues, resolveAgentModelPrimaryValue, toAgentModelListLike, } from "../config/model-input.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { createSubsystemLogger } from "../logging/subsystem.js"; import { resolveRuntimeCliBackends } from "../plugins/cli-backends.runtime.js"; import { resolvePluginSetupCliBackendRuntime } from "../plugins/setup-registry.runtime.js"; diff --git a/src/agents/model-suppression.ts b/src/agents/model-suppression.ts index bcbeeeddce9..fee88c4fc60 100644 --- a/src/agents/model-suppression.ts +++ b/src/agents/model-suppression.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { resolveProviderBuiltInModelSuppression } from "../plugins/provider-runtime.js"; import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js"; import { normalizeProviderId } from "./provider-id.js"; diff --git a/src/agents/models-config.e2e-harness.ts b/src/agents/models-config.e2e-harness.ts index e367135f4c2..965c4043390 100644 --- a/src/agents/models-config.e2e-harness.ts +++ b/src/agents/models-config.e2e-harness.ts @@ -2,8 +2,8 @@ import fs from "node:fs/promises"; import path from "node:path"; import { afterEach, beforeEach, vi } from "vitest"; import { withTempHome as withTempHomeBase } from "../../test/helpers/temp-home.js"; -import type { OpenClawConfig } from "../config/config.js"; import { clearConfigCache, clearRuntimeConfigSnapshot } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { resolveBundledPluginsDir } from "../plugins/bundled-dir.js"; import { resetPluginLoaderTestStateForTest } from "../plugins/loader.test-fixtures.js"; import { resetProviderRuntimeHookCacheForTest } from "../plugins/provider-runtime.js"; diff --git a/src/agents/models-config.plan.ts b/src/agents/models-config.plan.ts index 9f44f454522..81c9bf26910 100644 --- a/src/agents/models-config.plan.ts +++ b/src/agents/models-config.plan.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { isRecord } from "../utils.js"; import { mergeProviders, diff --git a/src/agents/models-config.providers.implicit.ts b/src/agents/models-config.providers.implicit.ts index 73f6843953e..3ff12cca7fc 100644 --- a/src/agents/models-config.providers.implicit.ts +++ b/src/agents/models-config.providers.implicit.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { formatErrorMessage } from "../infra/errors.js"; import { createSubsystemLogger } from "../logging/subsystem.js"; import { diff --git a/src/agents/models-config.providers.normalize.ts b/src/agents/models-config.providers.normalize.ts index c3fa2b97987..48478286bb9 100644 --- a/src/agents/models-config.providers.normalize.ts +++ b/src/agents/models-config.providers.normalize.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { ensureAuthProfileStore } from "./auth-profiles/store.js"; import { normalizeProviderSpecificConfig, diff --git a/src/agents/models-config.providers.secrets.ts b/src/agents/models-config.providers.secrets.ts index 4146c6567a6..f2efb75529e 100644 --- a/src/agents/models-config.providers.secrets.ts +++ b/src/agents/models-config.providers.secrets.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { coerceSecretRef, resolveSecretInputRef } from "../config/types.secrets.js"; import { resolveProviderSyntheticAuthWithPlugin } from "../plugins/provider-runtime.js"; import { normalizeOptionalString } from "../shared/string-coerce.js"; diff --git a/src/agents/models-config.providers.source-managed.ts b/src/agents/models-config.providers.source-managed.ts index 48a0d1100de..69a085c0346 100644 --- a/src/agents/models-config.providers.source-managed.ts +++ b/src/agents/models-config.providers.source-managed.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { resolveSecretInputRef } from "../config/types.secrets.js"; import { isRecord } from "../utils.js"; import { diff --git a/src/agents/openclaw-plugin-tools.ts b/src/agents/openclaw-plugin-tools.ts index 760de775cca..2078356303e 100644 --- a/src/agents/openclaw-plugin-tools.ts +++ b/src/agents/openclaw-plugin-tools.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { resolvePluginTools } from "../plugins/tools.js"; import { getActiveSecretsRuntimeSnapshot } from "../secrets/runtime.js"; import { normalizeDeliveryContext } from "../utils/delivery-context.js"; diff --git a/src/agents/openclaw-tools.plugin-context.ts b/src/agents/openclaw-tools.plugin-context.ts index 7b7f2326a54..902ef14e731 100644 --- a/src/agents/openclaw-tools.plugin-context.ts +++ b/src/agents/openclaw-tools.plugin-context.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { normalizeDeliveryContext } from "../utils/delivery-context.js"; import type { GatewayMessageChannel } from "../utils/message-channel.js"; import { resolveAgentWorkspaceDir, resolveSessionAgentId } from "./agent-scope.js"; diff --git a/src/agents/openclaw-tools.registration.ts b/src/agents/openclaw-tools.registration.ts index e0ac0d4f9ea..6bd46e1a0a9 100644 --- a/src/agents/openclaw-tools.registration.ts +++ b/src/agents/openclaw-tools.registration.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { isStrictAgenticExecutionContractActive } from "./execution-contract.js"; import type { AnyAgentTool } from "./tools/common.js"; diff --git a/src/agents/openclaw-tools.ts b/src/agents/openclaw-tools.ts index 140bcafc873..cd547a19d8b 100644 --- a/src/agents/openclaw-tools.ts +++ b/src/agents/openclaw-tools.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { callGateway } from "../gateway/call.js"; import { getActiveRuntimeWebToolsMetadata } from "../secrets/runtime.js"; import { normalizeDeliveryContext } from "../utils/delivery-context.js"; diff --git a/src/agents/pi-bundle-lsp-runtime.ts b/src/agents/pi-bundle-lsp-runtime.ts index a468823dc7a..cd8b7cb0069 100644 --- a/src/agents/pi-bundle-lsp-runtime.ts +++ b/src/agents/pi-bundle-lsp-runtime.ts @@ -1,6 +1,6 @@ import { spawn, type ChildProcess } from "node:child_process"; import type { AgentToolResult } from "@mariozechner/pi-agent-core"; -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { logDebug, logWarn } from "../logger.js"; import { normalizeOptionalLowercaseString } from "../shared/string-coerce.js"; import { loadEmbeddedPiLspConfig } from "./embedded-pi-lsp.js"; diff --git a/src/agents/pi-bundle-mcp-materialize.ts b/src/agents/pi-bundle-mcp-materialize.ts index 8f085b23fb3..8cf6eccf077 100644 --- a/src/agents/pi-bundle-mcp-materialize.ts +++ b/src/agents/pi-bundle-mcp-materialize.ts @@ -1,7 +1,7 @@ import crypto from "node:crypto"; import type { AgentToolResult } from "@mariozechner/pi-agent-core"; import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { logWarn } from "../logger.js"; import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js"; import { diff --git a/src/agents/pi-bundle-mcp-runtime.ts b/src/agents/pi-bundle-mcp-runtime.ts index 68aed4502db..dcf116f7e45 100644 --- a/src/agents/pi-bundle-mcp-runtime.ts +++ b/src/agents/pi-bundle-mcp-runtime.ts @@ -3,7 +3,7 @@ import { Client } from "@modelcontextprotocol/sdk/client/index.js"; import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"; import type { Transport } from "@modelcontextprotocol/sdk/shared/transport.js"; import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { logWarn } from "../logger.js"; import { resolveGlobalSingleton } from "../shared/global-singleton.js"; import { redactSensitiveUrlLikeString } from "../shared/net/redact-sensitive-url.js"; diff --git a/src/agents/pi-bundle-mcp-types.ts b/src/agents/pi-bundle-mcp-types.ts index b998d6343b0..13865bfaf10 100644 --- a/src/agents/pi-bundle-mcp-types.ts +++ b/src/agents/pi-bundle-mcp-types.ts @@ -1,5 +1,5 @@ import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import type { AnyAgentTool } from "./tools/common.js"; export type BundleMcpToolRuntime = { diff --git a/src/agents/pi-embedded-helpers/bootstrap.ts b/src/agents/pi-embedded-helpers/bootstrap.ts index 2dac5b1d810..2bd63eab842 100644 --- a/src/agents/pi-embedded-helpers/bootstrap.ts +++ b/src/agents/pi-embedded-helpers/bootstrap.ts @@ -1,7 +1,7 @@ import fs from "node:fs/promises"; import path from "node:path"; import type { AgentMessage } from "@mariozechner/pi-agent-core"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { normalizeOptionalString } from "../../shared/string-coerce.js"; import { truncateUtf16Safe } from "../../utils.js"; import type { WorkspaceBootstrapFile } from "../workspace.js"; diff --git a/src/agents/pi-embedded-helpers/errors.ts b/src/agents/pi-embedded-helpers/errors.ts index 65fee6a0ccd..a4484c99247 100644 --- a/src/agents/pi-embedded-helpers/errors.ts +++ b/src/agents/pi-embedded-helpers/errors.ts @@ -1,5 +1,5 @@ import type { AssistantMessage } from "@mariozechner/pi-ai"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { createSubsystemLogger } from "../../logging/subsystem.js"; import { extractLeadingHttpStatus, diff --git a/src/agents/pi-embedded-runner/compact.ts b/src/agents/pi-embedded-runner/compact.ts index d175dc4f8c7..58fe882461e 100644 --- a/src/agents/pi-embedded-runner/compact.ts +++ b/src/agents/pi-embedded-runner/compact.ts @@ -9,7 +9,7 @@ import { } from "@mariozechner/pi-coding-agent"; import type { ThinkLevel } from "../../auto-reply/thinking.js"; import { resolveChannelCapabilities } from "../../config/channel-capabilities.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { ensureContextEnginesInitialized } from "../../context-engine/init.js"; import { resolveContextEngine } from "../../context-engine/registry.js"; import { diff --git a/src/agents/pi-embedded-runner/compact.types.ts b/src/agents/pi-embedded-runner/compact.types.ts index d82671301db..a615050f7f0 100644 --- a/src/agents/pi-embedded-runner/compact.types.ts +++ b/src/agents/pi-embedded-runner/compact.types.ts @@ -1,5 +1,5 @@ import type { ReasoningLevel, ThinkLevel } from "../../auto-reply/thinking.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import type { enqueueCommand } from "../../process/command-queue.js"; import type { ExecElevatedDefaults } from "../bash-tools.js"; import type { SkillSnapshot } from "../skills.js"; diff --git a/src/agents/pi-embedded-runner/compaction-hooks.ts b/src/agents/pi-embedded-runner/compaction-hooks.ts index bed1d1d2f6b..318b785d9aa 100644 --- a/src/agents/pi-embedded-runner/compaction-hooks.ts +++ b/src/agents/pi-embedded-runner/compaction-hooks.ts @@ -1,5 +1,5 @@ import type { AgentMessage } from "@mariozechner/pi-agent-core"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { createInternalHookEvent, triggerInternalHook } from "../../hooks/internal-hooks.js"; import { formatErrorMessage } from "../../infra/errors.js"; import { getGlobalHookRunner } from "../../plugins/hook-runner-global.js"; diff --git a/src/agents/pi-embedded-runner/compaction-runtime-context.ts b/src/agents/pi-embedded-runner/compaction-runtime-context.ts index 86b9722e18c..4fb3858d49f 100644 --- a/src/agents/pi-embedded-runner/compaction-runtime-context.ts +++ b/src/agents/pi-embedded-runner/compaction-runtime-context.ts @@ -1,5 +1,5 @@ import type { ReasoningLevel, ThinkLevel } from "../../auto-reply/thinking.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import type { ExecElevatedDefaults } from "../bash-tools.js"; import type { SkillSnapshot } from "../skills.js"; diff --git a/src/agents/pi-embedded-runner/compaction-safety-timeout.ts b/src/agents/pi-embedded-runner/compaction-safety-timeout.ts index bd15368ee2a..cbdfc49658f 100644 --- a/src/agents/pi-embedded-runner/compaction-safety-timeout.ts +++ b/src/agents/pi-embedded-runner/compaction-safety-timeout.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { withTimeout } from "../../node-host/with-timeout.js"; export const EMBEDDED_COMPACTION_TIMEOUT_MS = 900_000; diff --git a/src/agents/pi-embedded-runner/extensions.ts b/src/agents/pi-embedded-runner/extensions.ts index 5f0adac4515..943438e56a0 100644 --- a/src/agents/pi-embedded-runner/extensions.ts +++ b/src/agents/pi-embedded-runner/extensions.ts @@ -1,5 +1,5 @@ import type { ExtensionFactory, SessionManager } from "@mariozechner/pi-coding-agent"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import type { ProviderRuntimeModel } from "../../plugins/types.js"; import { resolveContextWindowInfo } from "../context-window-guard.js"; import { DEFAULT_CONTEXT_TOKENS } from "../defaults.js"; diff --git a/src/agents/pi-embedded-runner/extra-params.test-support.ts b/src/agents/pi-embedded-runner/extra-params.test-support.ts index 0c1540b9c5c..93a82e6ea86 100644 --- a/src/agents/pi-embedded-runner/extra-params.test-support.ts +++ b/src/agents/pi-embedded-runner/extra-params.test-support.ts @@ -1,7 +1,7 @@ import type { StreamFn } from "@mariozechner/pi-agent-core"; import type { Context, Model, SimpleStreamOptions } from "@mariozechner/pi-ai"; import type { ThinkLevel } from "../../auto-reply/thinking.shared.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { __testing as extraParamsTesting, applyExtraParamsToAgent } from "./extra-params.js"; export type ExtraParamsCapture> = { diff --git a/src/agents/pi-embedded-runner/extra-params.ts b/src/agents/pi-embedded-runner/extra-params.ts index c4f15f3af68..7f12edd0b49 100644 --- a/src/agents/pi-embedded-runner/extra-params.ts +++ b/src/agents/pi-embedded-runner/extra-params.ts @@ -3,7 +3,7 @@ import type { SimpleStreamOptions } from "@mariozechner/pi-ai"; import { streamSimple } from "@mariozechner/pi-ai"; import type { SettingsManager } from "@mariozechner/pi-coding-agent"; import type { ThinkLevel } from "../../auto-reply/thinking.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { prepareProviderExtraParams as prepareProviderExtraParamsRuntime, wrapProviderStreamFn as wrapProviderStreamFnRuntime, diff --git a/src/agents/pi-embedded-runner/history.ts b/src/agents/pi-embedded-runner/history.ts index 7b763251e0f..ec797f54650 100644 --- a/src/agents/pi-embedded-runner/history.ts +++ b/src/agents/pi-embedded-runner/history.ts @@ -1,5 +1,5 @@ import type { AgentMessage } from "@mariozechner/pi-agent-core"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { normalizeOptionalLowercaseString } from "../../shared/string-coerce.js"; import { normalizeProviderId } from "../provider-id.js"; diff --git a/src/agents/pi-embedded-runner/message-action-discovery-input.ts b/src/agents/pi-embedded-runner/message-action-discovery-input.ts index 07c25d885e7..dff8098f010 100644 --- a/src/agents/pi-embedded-runner/message-action-discovery-input.ts +++ b/src/agents/pi-embedded-runner/message-action-discovery-input.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; export function buildEmbeddedMessageActionDiscoveryInput(params: { cfg?: OpenClawConfig; diff --git a/src/agents/pi-embedded-runner/model.ts b/src/agents/pi-embedded-runner/model.ts index 9b34f69763c..360b8f7b274 100644 --- a/src/agents/pi-embedded-runner/model.ts +++ b/src/agents/pi-embedded-runner/model.ts @@ -1,6 +1,6 @@ import type { Api, Model } from "@mariozechner/pi-ai"; import type { AuthStorage, ModelRegistry } from "@mariozechner/pi-coding-agent"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { applyProviderResolvedModelCompatWithPlugins, applyProviderResolvedTransportWithPlugin, diff --git a/src/agents/pi-embedded-runner/openai-stream-wrappers.ts b/src/agents/pi-embedded-runner/openai-stream-wrappers.ts index d8bb736ecf1..6971bf21b19 100644 --- a/src/agents/pi-embedded-runner/openai-stream-wrappers.ts +++ b/src/agents/pi-embedded-runner/openai-stream-wrappers.ts @@ -1,7 +1,7 @@ import type { StreamFn } from "@mariozechner/pi-agent-core"; import type { SimpleStreamOptions } from "@mariozechner/pi-ai"; import { streamSimple } from "@mariozechner/pi-ai"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { normalizeOptionalLowercaseString, readStringValue } from "../../shared/string-coerce.js"; import { patchCodexNativeWebSearchPayload, diff --git a/src/agents/pi-embedded-runner/replay-history.ts b/src/agents/pi-embedded-runner/replay-history.ts index 5afbeff6bab..4a7a3ac74e0 100644 --- a/src/agents/pi-embedded-runner/replay-history.ts +++ b/src/agents/pi-embedded-runner/replay-history.ts @@ -1,6 +1,6 @@ import type { AgentMessage } from "@mariozechner/pi-agent-core"; import type { SessionManager } from "@mariozechner/pi-coding-agent"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { sanitizeProviderReplayHistoryWithPlugin, validateProviderReplayTurnsWithPlugin, diff --git a/src/agents/pi-embedded-runner/run/assistant-failover.ts b/src/agents/pi-embedded-runner/run/assistant-failover.ts index fcce8709d14..bebfc1c82a1 100644 --- a/src/agents/pi-embedded-runner/run/assistant-failover.ts +++ b/src/agents/pi-embedded-runner/run/assistant-failover.ts @@ -1,5 +1,5 @@ import type { AssistantMessage } from "@mariozechner/pi-ai"; -import type { OpenClawConfig } from "../../../config/config.js"; +import type { OpenClawConfig } from "../../../config/types.openclaw.js"; import { sanitizeForLog } from "../../../terminal/ansi.js"; import type { AuthProfileFailureReason } from "../../auth-profiles.js"; import { FailoverError, resolveFailoverStatus } from "../../failover-error.js"; diff --git a/src/agents/pi-embedded-runner/run/attempt.prompt-helpers.ts b/src/agents/pi-embedded-runner/run/attempt.prompt-helpers.ts index faff1116b5d..40c0c1d6981 100644 --- a/src/agents/pi-embedded-runner/run/attempt.prompt-helpers.ts +++ b/src/agents/pi-embedded-runner/run/attempt.prompt-helpers.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../../config/config.js"; +import type { OpenClawConfig } from "../../../config/types.openclaw.js"; import type { ContextEnginePromptCacheInfo, ContextEngineRuntimeContext, diff --git a/src/agents/pi-embedded-runner/run/attempt.thread-helpers.ts b/src/agents/pi-embedded-runner/run/attempt.thread-helpers.ts index f75bc3836b9..ef48ce83ec3 100644 --- a/src/agents/pi-embedded-runner/run/attempt.thread-helpers.ts +++ b/src/agents/pi-embedded-runner/run/attempt.thread-helpers.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../../config/config.js"; +import type { OpenClawConfig } from "../../../config/types.openclaw.js"; import { joinPresentTextSegments } from "../../../shared/text/join-segments.js"; import { normalizeStructuredPromptSection } from "../../prompt-cache-stability.js"; diff --git a/src/agents/pi-embedded-runner/run/helpers.ts b/src/agents/pi-embedded-runner/run/helpers.ts index 2eb7982367d..c55fcdc04e2 100644 --- a/src/agents/pi-embedded-runner/run/helpers.ts +++ b/src/agents/pi-embedded-runner/run/helpers.ts @@ -1,5 +1,5 @@ import type { AssistantMessage } from "@mariozechner/pi-ai"; -import type { OpenClawConfig } from "../../../config/config.js"; +import type { OpenClawConfig } from "../../../config/types.openclaw.js"; import { generateSecureToken } from "../../../infra/secure-random.js"; import { extractAssistantVisibleText } from "../../pi-embedded-utils.js"; import { derivePromptTokens, normalizeUsage } from "../../usage.js"; diff --git a/src/agents/pi-embedded-runner/run/llm-idle-timeout.ts b/src/agents/pi-embedded-runner/run/llm-idle-timeout.ts index fec7c8ef1e6..546844473a8 100644 --- a/src/agents/pi-embedded-runner/run/llm-idle-timeout.ts +++ b/src/agents/pi-embedded-runner/run/llm-idle-timeout.ts @@ -1,7 +1,7 @@ import type { StreamFn } from "@mariozechner/pi-agent-core"; import { streamSimple } from "@mariozechner/pi-ai"; import { DEFAULT_LLM_IDLE_TIMEOUT_SECONDS } from "../../../config/agent-timeout-defaults.js"; -import type { OpenClawConfig } from "../../../config/config.js"; +import type { OpenClawConfig } from "../../../config/types.openclaw.js"; import type { EmbeddedRunTrigger } from "./params.js"; /** diff --git a/src/agents/pi-embedded-runner/run/params.ts b/src/agents/pi-embedded-runner/run/params.ts index 2417dea7a92..db98c4672e3 100644 --- a/src/agents/pi-embedded-runner/run/params.ts +++ b/src/agents/pi-embedded-runner/run/params.ts @@ -2,7 +2,7 @@ import type { ImageContent } from "@mariozechner/pi-ai"; import type { ReplyOperation } from "../../../auto-reply/reply/reply-run-registry.js"; import type { ReasoningLevel, ThinkLevel, VerboseLevel } from "../../../auto-reply/thinking.js"; import type { ReplyPayload } from "../../../auto-reply/types.js"; -import type { OpenClawConfig } from "../../../config/config.js"; +import type { OpenClawConfig } from "../../../config/types.openclaw.js"; import type { PromptImageOrderEntry } from "../../../media/prompt-image-order.js"; import type { enqueueCommand } from "../../../process/command-queue.js"; import type { InputProvenance } from "../../../sessions/input-provenance.js"; diff --git a/src/agents/pi-embedded-runner/run/payloads.ts b/src/agents/pi-embedded-runner/run/payloads.ts index abdb7c2ff7d..196f34f231c 100644 --- a/src/agents/pi-embedded-runner/run/payloads.ts +++ b/src/agents/pi-embedded-runner/run/payloads.ts @@ -4,7 +4,7 @@ import { parseReplyDirectives } from "../../../auto-reply/reply/reply-directives import type { ReasoningLevel, VerboseLevel } from "../../../auto-reply/thinking.js"; import { isSilentReplyPayloadText, SILENT_REPLY_TOKEN } from "../../../auto-reply/tokens.js"; import { formatToolAggregate } from "../../../auto-reply/tool-meta.js"; -import type { OpenClawConfig } from "../../../config/config.js"; +import type { OpenClawConfig } from "../../../config/types.openclaw.js"; import { isCronSessionKey } from "../../../routing/session-key.js"; import { normalizeOptionalLowercaseString, diff --git a/src/agents/pi-embedded-runner/run/setup.ts b/src/agents/pi-embedded-runner/run/setup.ts index 2f4eeec0698..f9e9c03f9b8 100644 --- a/src/agents/pi-embedded-runner/run/setup.ts +++ b/src/agents/pi-embedded-runner/run/setup.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../../config/config.js"; +import type { OpenClawConfig } from "../../../config/types.openclaw.js"; import type { PluginHookBeforeAgentStartResult, ProviderRuntimeModel, diff --git a/src/agents/pi-embedded-runner/skills-runtime.ts b/src/agents/pi-embedded-runner/skills-runtime.ts index 6cadf851c7d..f93ef00f6f1 100644 --- a/src/agents/pi-embedded-runner/skills-runtime.ts +++ b/src/agents/pi-embedded-runner/skills-runtime.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { loadWorkspaceSkillEntries, type SkillEntry, type SkillSnapshot } from "../skills.js"; import { resolveSkillRuntimeConfig } from "../skills/runtime-config.js"; diff --git a/src/agents/pi-embedded-runner/system-prompt.ts b/src/agents/pi-embedded-runner/system-prompt.ts index d7d9acd18fa..3435b7a605a 100644 --- a/src/agents/pi-embedded-runner/system-prompt.ts +++ b/src/agents/pi-embedded-runner/system-prompt.ts @@ -4,7 +4,8 @@ import type { MemoryCitationsMode } from "../../config/types.memory.js"; import type { ResolvedTimeFormat } from "../date-time.js"; import type { EmbeddedContextFile } from "../pi-embedded-helpers.js"; import type { ProviderSystemPromptContribution } from "../system-prompt-contribution.js"; -import { buildAgentSystemPrompt, type PromptMode } from "../system-prompt.js"; +import { buildAgentSystemPrompt } from "../system-prompt.js"; +import type { PromptMode } from "../system-prompt.types.js"; import type { EmbeddedSandboxInfo } from "./types.js"; import type { ReasoningLevel, ThinkLevel } from "./utils.js"; diff --git a/src/agents/pi-embedded-runner/tool-schema-runtime.ts b/src/agents/pi-embedded-runner/tool-schema-runtime.ts index fa655cd773e..99b21617796 100644 --- a/src/agents/pi-embedded-runner/tool-schema-runtime.ts +++ b/src/agents/pi-embedded-runner/tool-schema-runtime.ts @@ -1,6 +1,6 @@ import type { AgentTool } from "@mariozechner/pi-agent-core"; import type { TSchema } from "@sinclair/typebox"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { inspectProviderToolSchemasWithPlugin, normalizeProviderToolSchemasWithPlugin, diff --git a/src/agents/pi-project-settings.ts b/src/agents/pi-project-settings.ts index f8f237bc14c..de5c83fdf54 100644 --- a/src/agents/pi-project-settings.ts +++ b/src/agents/pi-project-settings.ts @@ -1,8 +1,8 @@ import fs from "node:fs"; import path from "node:path"; import { SettingsManager } from "@mariozechner/pi-coding-agent"; -import type { OpenClawConfig } from "../config/config.js"; import { applyMergePatch } from "../config/merge-patch.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { openBoundaryFileSync } from "../infra/boundary-file-read.js"; import { createSubsystemLogger } from "../logging/subsystem.js"; import type { BundleMcpServerConfig } from "../plugins/bundle-mcp.js"; diff --git a/src/agents/pi-settings.ts b/src/agents/pi-settings.ts index f1b66c6ea61..d7820606b30 100644 --- a/src/agents/pi-settings.ts +++ b/src/agents/pi-settings.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import type { ContextEngineInfo } from "../context-engine/types.js"; export const DEFAULT_PI_COMPACTION_RESERVE_TOKENS_FLOOR = 20_000; diff --git a/src/agents/pi-tools.policy.ts b/src/agents/pi-tools.policy.ts index 91b986734cf..2d57a8ab527 100644 --- a/src/agents/pi-tools.policy.ts +++ b/src/agents/pi-tools.policy.ts @@ -1,8 +1,8 @@ import { getChannelPlugin } from "../channels/plugins/index.js"; import { resolveSessionConversation } from "../channels/plugins/session-conversation.js"; import { DEFAULT_SUBAGENT_MAX_SPAWN_DEPTH } from "../config/agent-limits.js"; -import type { OpenClawConfig } from "../config/config.js"; import { resolveChannelGroupToolsPolicy } from "../config/group-policy.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import type { AgentToolsConfig } from "../config/types.tools.js"; import { normalizeAgentId } from "../routing/session-key.js"; import { diff --git a/src/agents/pi-tools.ts b/src/agents/pi-tools.ts index b64f35770f1..f6a2815ec85 100644 --- a/src/agents/pi-tools.ts +++ b/src/agents/pi-tools.ts @@ -1,6 +1,6 @@ import { codingTools, createReadTool, readTool } from "@mariozechner/pi-coding-agent"; -import type { OpenClawConfig } from "../config/config.js"; import type { ModelCompatConfig } from "../config/types.models.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import type { ToolLoopDetectionConfig } from "../config/types.tools.js"; import { resolveMergedSafeBinProfileFixtures } from "../infra/exec-safe-bin-runtime-policy.js"; import { logWarn } from "../logger.js"; diff --git a/src/agents/provider-stream.ts b/src/agents/provider-stream.ts index 420af2bff28..3b5b253861a 100644 --- a/src/agents/provider-stream.ts +++ b/src/agents/provider-stream.ts @@ -1,6 +1,6 @@ import type { StreamFn } from "@mariozechner/pi-agent-core"; import type { Api, Model } from "@mariozechner/pi-ai"; -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { resolveProviderStreamFn } from "../plugins/provider-runtime.js"; import { ensureCustomApiRegistered } from "./custom-api-registry.js"; import { createTransportAwareStreamFnForModel } from "./provider-transport-stream.js"; diff --git a/src/agents/runtime-plugins.ts b/src/agents/runtime-plugins.ts index 09957d7fb30..751046c9190 100644 --- a/src/agents/runtime-plugins.ts +++ b/src/agents/runtime-plugins.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { resolveRuntimePluginRegistry } from "../plugins/loader.js"; import { resolveUserPath } from "../utils.js"; diff --git a/src/agents/sandbox/backend.types.ts b/src/agents/sandbox/backend.types.ts index 734480713c4..97600786476 100644 --- a/src/agents/sandbox/backend.types.ts +++ b/src/agents/sandbox/backend.types.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import type { SandboxBackendHandle, SandboxBackendId } from "./backend-handle.types.js"; import type { SandboxRegistryEntry } from "./registry.js"; import type { SandboxConfig } from "./types.js"; diff --git a/src/agents/sandbox/config.ts b/src/agents/sandbox/config.ts index f94189e6ad0..54a4c36aae3 100644 --- a/src/agents/sandbox/config.ts +++ b/src/agents/sandbox/config.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import type { SandboxSshSettings } from "../../config/types.sandbox.js"; import { normalizeSecretInputString } from "../../config/types.secrets.js"; import { normalizeOptionalString } from "../../shared/string-coerce.js"; diff --git a/src/agents/sandbox/context.ts b/src/agents/sandbox/context.ts index 21398a4cc8b..361618c7fbc 100644 --- a/src/agents/sandbox/context.ts +++ b/src/agents/sandbox/context.ts @@ -1,6 +1,6 @@ import fs from "node:fs/promises"; -import type { OpenClawConfig } from "../../config/config.js"; import { loadConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { getRemoteSkillEligibility } from "../../infra/skills-remote.js"; import { ensureBrowserControlAuth, diff --git a/src/agents/sandbox/runtime-status.ts b/src/agents/sandbox/runtime-status.ts index 7c7fdd7521d..e5411a09154 100644 --- a/src/agents/sandbox/runtime-status.ts +++ b/src/agents/sandbox/runtime-status.ts @@ -1,9 +1,9 @@ import { formatCliCommand } from "../../cli/command-format.js"; -import type { OpenClawConfig } from "../../config/config.js"; import { canonicalizeMainSessionAlias, resolveAgentMainSessionKey, } from "../../config/sessions/main-session.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { normalizeOptionalLowercaseString } from "../../shared/string-coerce.js"; import { resolveSessionAgentId } from "../agent-scope.js"; import { resolveSandboxConfigForAgent } from "./config.js"; diff --git a/src/agents/sandbox/tool-policy.ts b/src/agents/sandbox/tool-policy.ts index 43ed1a77f23..784c7239f13 100644 --- a/src/agents/sandbox/tool-policy.ts +++ b/src/agents/sandbox/tool-policy.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { normalizeLowercaseStringOrEmpty } from "../../shared/string-coerce.js"; import { resolveAgentConfig } from "../agent-scope.js"; import { compileGlobPatterns, matchesAnyGlobPattern } from "../glob-pattern.js"; diff --git a/src/agents/simple-completion-runtime.ts b/src/agents/simple-completion-runtime.ts index d7bb4bd2c2e..050a52b9f9c 100644 --- a/src/agents/simple-completion-runtime.ts +++ b/src/agents/simple-completion-runtime.ts @@ -1,5 +1,5 @@ import { complete, type Api, type Model } from "@mariozechner/pi-ai"; -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { formatErrorMessage } from "../infra/errors.js"; import { resolveAgentDir, resolveAgentEffectiveModelPrimary } from "./agent-scope.js"; import { DEFAULT_PROVIDER } from "./defaults.js"; diff --git a/src/agents/simple-completion-transport.ts b/src/agents/simple-completion-transport.ts index f920a597831..d9467a31fb9 100644 --- a/src/agents/simple-completion-transport.ts +++ b/src/agents/simple-completion-transport.ts @@ -1,5 +1,5 @@ import { getApiProvider, type Api, type Model } from "@mariozechner/pi-ai"; -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { createAnthropicVertexStreamFnForModel } from "./anthropic-vertex-stream.js"; import { ensureCustomApiRegistered } from "./custom-api-registry.js"; import { registerProviderStreamForModel } from "./provider-stream.js"; diff --git a/src/agents/skills-install.ts b/src/agents/skills-install.ts index f507af02533..8bcad459a1c 100644 --- a/src/agents/skills-install.ts +++ b/src/agents/skills-install.ts @@ -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.openclaw.js"; import { resolveBrewExecutable } from "../infra/brew.js"; import { formatErrorMessage } from "../infra/errors.js"; import { diff --git a/src/agents/skills-status.ts b/src/agents/skills-status.ts index 70d2919a04b..fb839f56d60 100644 --- a/src/agents/skills-status.ts +++ b/src/agents/skills-status.ts @@ -1,5 +1,5 @@ import path from "node:path"; -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { evaluateEntryRequirementsForCurrentPlatform } from "../shared/entry-status.js"; import type { RequirementConfigCheck, Requirements } from "../shared/requirements.js"; import { CONFIG_DIR } from "../utils.js"; diff --git a/src/agents/skills.ts b/src/agents/skills.ts index efa5cd945b9..4309236590d 100644 --- a/src/agents/skills.ts +++ b/src/agents/skills.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, diff --git a/src/agents/skills/command-specs.ts b/src/agents/skills/command-specs.ts index 5e994ac1584..948c923e5e1 100644 --- a/src/agents/skills/command-specs.ts +++ b/src/agents/skills/command-specs.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { createSubsystemLogger } from "../../logging/subsystem.js"; import { loadEnabledClaudeBundleCommands } from "../../plugins/bundle-commands.js"; import { diff --git a/src/agents/skills/env-overrides.ts b/src/agents/skills/env-overrides.ts index 277877bb812..5f164079e32 100644 --- a/src/agents/skills/env-overrides.ts +++ b/src/agents/skills/env-overrides.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { normalizeResolvedSecretInputString } from "../../config/types.secrets.js"; import { isDangerousHostEnvOverrideVarName, diff --git a/src/agents/skills/plugin-skills.ts b/src/agents/skills/plugin-skills.ts index c773ab3cb63..fe29644bbf3 100644 --- a/src/agents/skills/plugin-skills.ts +++ b/src/agents/skills/plugin-skills.ts @@ -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.openclaw.js"; import { createSubsystemLogger } from "../../logging/subsystem.js"; import { normalizePluginsConfigWithResolver, diff --git a/src/agents/skills/refresh.ts b/src/agents/skills/refresh.ts index e8e571e01ad..ab16db8e9ac 100644 --- a/src/agents/skills/refresh.ts +++ b/src/agents/skills/refresh.ts @@ -1,7 +1,7 @@ import os from "node:os"; import path from "node:path"; import chokidar, { type FSWatcher } from "chokidar"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { createSubsystemLogger } from "../../logging/subsystem.js"; import { normalizeOptionalString } from "../../shared/string-coerce.js"; import { CONFIG_DIR, resolveUserPath } from "../../utils.js"; diff --git a/src/agents/skills/runtime-config.ts b/src/agents/skills/runtime-config.ts index afee2a6ac7b..3620c5f3338 100644 --- a/src/agents/skills/runtime-config.ts +++ b/src/agents/skills/runtime-config.ts @@ -1,4 +1,5 @@ -import { getRuntimeConfigSnapshot, type OpenClawConfig } from "../../config/config.js"; +import { getRuntimeConfigSnapshot } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { coerceSecretRef } from "../../config/types.secrets.js"; function hasConfiguredSkillApiKeyRef(config?: OpenClawConfig): boolean { diff --git a/src/agents/skills/workspace.ts b/src/agents/skills/workspace.ts index 935bb22c52e..383f560a801 100644 --- a/src/agents/skills/workspace.ts +++ b/src/agents/skills/workspace.ts @@ -1,7 +1,7 @@ import fs from "node:fs"; import os from "node:os"; import path from "node:path"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { isPathInside } from "../../infra/path-guards.js"; import { createSubsystemLogger } from "../../logging/subsystem.js"; import { normalizeOptionalString } from "../../shared/string-coerce.js"; diff --git a/src/agents/spawned-context.ts b/src/agents/spawned-context.ts index 2832939e0cb..7d40382a0d9 100644 --- a/src/agents/spawned-context.ts +++ b/src/agents/spawned-context.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { normalizeAgentId, parseAgentSessionKey } from "../routing/session-key.js"; import { normalizeOptionalString } from "../shared/string-coerce.js"; import { resolveAgentWorkspaceDir } from "./agent-scope.js"; diff --git a/src/agents/subagent-announce-delivery.ts b/src/agents/subagent-announce-delivery.ts index 56cc7cab5dc..7ce75de28ce 100644 --- a/src/agents/subagent-announce-delivery.ts +++ b/src/agents/subagent-announce-delivery.ts @@ -1,3 +1,4 @@ +import type { OpenClawConfig } from "../config/types.openclaw.js"; import type { ConversationRef } from "../infra/outbound/session-binding-service.js"; import { normalizeAccountId } from "../routing/session-key.js"; import { defaultRuntime } from "../runtime.js"; @@ -64,7 +65,7 @@ function resolveDirectAnnounceTransientRetryDelaysMs() { : ([5_000, 10_000, 20_000] as const); } -export function resolveSubagentAnnounceTimeoutMs(cfg: ReturnType): number { +export function resolveSubagentAnnounceTimeoutMs(cfg: OpenClawConfig): number { const configured = cfg.agents?.defaults?.subagents?.announceTimeoutMs; if (typeof configured !== "number" || !Number.isFinite(configured)) { return DEFAULT_SUBAGENT_ANNOUNCE_TIMEOUT_MS; diff --git a/src/agents/subagent-announce.test-support.ts b/src/agents/subagent-announce.test-support.ts index a299e5eee96..a7163f177e2 100644 --- a/src/agents/subagent-announce.test-support.ts +++ b/src/agents/subagent-announce.test-support.ts @@ -1,9 +1,9 @@ -import type { loadConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import type { callGateway } from "../gateway/call.js"; type DeliveryRuntimeMockOptions = { callGateway: (request: unknown) => Promise; - loadConfig: () => ReturnType; + loadConfig: () => OpenClawConfig; loadSessionStore: (storePath: string) => unknown; resolveAgentIdFromSessionKey: (sessionKey: string) => string; resolveMainSessionKey: (cfg: unknown) => string; diff --git a/src/agents/subagent-attachments.ts b/src/agents/subagent-attachments.ts index b50fb741f41..d1b44924a46 100644 --- a/src/agents/subagent-attachments.ts +++ b/src/agents/subagent-attachments.ts @@ -1,7 +1,7 @@ import crypto from "node:crypto"; import { promises as fs } from "node:fs"; import path from "node:path"; -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { normalizeOptionalString } from "../shared/string-coerce.js"; import { resolveAgentWorkspaceDir } from "./agent-scope.js"; diff --git a/src/agents/subagent-capabilities.ts b/src/agents/subagent-capabilities.ts index 1da0f799222..ffc6a4e9c98 100644 --- a/src/agents/subagent-capabilities.ts +++ b/src/agents/subagent-capabilities.ts @@ -1,6 +1,6 @@ import { DEFAULT_SUBAGENT_MAX_SPAWN_DEPTH } from "../config/agent-limits.js"; -import type { OpenClawConfig } from "../config/config.js"; import { loadSessionStore, resolveStorePath } from "../config/sessions.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { isSubagentSessionKey, parseAgentSessionKey } from "../routing/session-key.js"; import { normalizeOptionalLowercaseString } from "../shared/string-coerce.js"; import { getSubagentDepthFromSessionStore } from "./subagent-depth.js"; diff --git a/src/agents/subagent-control.ts b/src/agents/subagent-control.ts index eeaed507010..62bd74b79d5 100644 --- a/src/agents/subagent-control.ts +++ b/src/agents/subagent-control.ts @@ -6,9 +6,9 @@ import { sortSubagentRuns, type SubagentTargetResolution, } from "../auto-reply/reply/subagents-utils.js"; -import type { OpenClawConfig } from "../config/config.js"; import type { SessionEntry } from "../config/sessions.js"; import { loadSessionStore, resolveStorePath, updateSessionStore } from "../config/sessions.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { callGateway } from "../gateway/call.js"; import { logVerbose } from "../globals.js"; import { formatErrorMessage } from "../infra/errors.js"; diff --git a/src/agents/subagent-depth.ts b/src/agents/subagent-depth.ts index 17817cb8944..038d85d0245 100644 --- a/src/agents/subagent-depth.ts +++ b/src/agents/subagent-depth.ts @@ -1,6 +1,6 @@ import fs from "node:fs"; -import type { OpenClawConfig } from "../config/config.js"; import { resolveStorePath } from "../config/sessions/paths.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { getSubagentDepth, parseAgentSessionKey } from "../sessions/session-key-utils.js"; import { parseJsonWithJson5Fallback } from "../utils/parse-json-compat.js"; import { resolveDefaultAgentId } from "./agent-scope.js"; diff --git a/src/agents/subagent-list.ts b/src/agents/subagent-list.ts index 97193e9edbc..0543b1115a2 100644 --- a/src/agents/subagent-list.ts +++ b/src/agents/subagent-list.ts @@ -1,8 +1,8 @@ import { resolveSubagentLabel, sortSubagentRuns } from "../auto-reply/reply/subagents-utils.js"; -import type { OpenClawConfig } from "../config/config.js"; import { resolveStorePath } from "../config/sessions/paths.js"; import { loadSessionStore } from "../config/sessions/store-load.js"; import type { SessionEntry } from "../config/sessions/types.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { parseAgentSessionKey, type ParsedAgentSessionKey } from "../routing/session-key.js"; import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js"; import { diff --git a/src/agents/subagent-registry-completion.ts b/src/agents/subagent-registry-completion.ts index bcf74314698..c3c7e02b507 100644 --- a/src/agents/subagent-registry-completion.ts +++ b/src/agents/subagent-registry-completion.ts @@ -1,5 +1,5 @@ import { getGlobalHookRunner } from "../plugins/hook-runner-global.js"; -import type { SubagentRunOutcome } from "./subagent-announce.js"; +import type { SubagentRunOutcome } from "./subagent-announce-output.js"; import { SUBAGENT_ENDED_OUTCOME_ERROR, SUBAGENT_ENDED_OUTCOME_OK, diff --git a/src/agents/subagent-registry-helpers.ts b/src/agents/subagent-registry-helpers.ts index b65e061616c..cd45e87c682 100644 --- a/src/agents/subagent-registry-helpers.ts +++ b/src/agents/subagent-registry-helpers.ts @@ -8,9 +8,10 @@ import { updateSessionStore, type SessionEntry, } from "../config/sessions.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { defaultRuntime } from "../runtime.js"; import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js"; -import { type SubagentRunOutcome } from "./subagent-announce.js"; +import { type SubagentRunOutcome } from "./subagent-announce-output.js"; import { SUBAGENT_ENDED_REASON_ERROR } from "./subagent-lifecycle-events.js"; import { runOutcomesEqual } from "./subagent-registry-completion.js"; import type { SubagentRunRecord } from "./subagent-registry.types.js"; @@ -284,7 +285,7 @@ export function reconcileOrphanedRestoredRuns(params: { return changed; } -export function resolveArchiveAfterMs(cfg?: ReturnType) { +export function resolveArchiveAfterMs(cfg?: OpenClawConfig) { const config = cfg ?? loadConfig(); const minutes = config.agents?.defaults?.subagents?.archiveAfterMinutes ?? 60; if (!Number.isFinite(minutes) || minutes < 0) { diff --git a/src/agents/subagent-registry-run-manager.ts b/src/agents/subagent-registry-run-manager.ts index 8185c124a2c..df196fcc829 100644 --- a/src/agents/subagent-registry-run-manager.ts +++ b/src/agents/subagent-registry-run-manager.ts @@ -1,11 +1,12 @@ import { loadConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { callGateway } from "../gateway/call.js"; import { createSubsystemLogger } from "../logging/subsystem.js"; import { createRunningTaskRun } from "../tasks/task-executor.js"; import { type DeliveryContext, normalizeDeliveryContext } from "../utils/delivery-context.js"; import { waitForAgentRun } from "./run-wait.js"; import type { ensureRuntimePluginsLoaded as ensureRuntimePluginsLoadedFn } from "./runtime-plugins.js"; -import type { SubagentRunOutcome } from "./subagent-announce.js"; +import type { SubagentRunOutcome } from "./subagent-announce-output.js"; import { SUBAGENT_ENDED_OUTCOME_KILLED, SUBAGENT_ENDED_REASON_COMPLETE, @@ -39,7 +40,7 @@ export function createSubagentRunManager(params: { ensureRuntimePluginsLoaded: | typeof ensureRuntimePluginsLoadedFn | ((args: { - config: ReturnType; + config: OpenClawConfig; workspaceDir?: string; allowGatewaySubagentBinding?: boolean; }) => void | Promise); @@ -48,10 +49,7 @@ export function createSubagentRunManager(params: { stopSweeper(): void; resumeSubagentRun(runId: string): void; clearPendingLifecycleError(runId: string): void; - resolveSubagentWaitTimeoutMs( - cfg: ReturnType, - runTimeoutSeconds?: number, - ): number; + resolveSubagentWaitTimeoutMs(cfg: OpenClawConfig, runTimeoutSeconds?: number): number; notifyContextEngineSubagentEnded(args: { childSessionKey: string; reason: "completed" | "deleted" | "released"; diff --git a/src/agents/subagent-registry.ts b/src/agents/subagent-registry.ts index 1c9b18a5d93..4e1dfe4c31a 100644 --- a/src/agents/subagent-registry.ts +++ b/src/agents/subagent-registry.ts @@ -1,5 +1,6 @@ import { cleanupBrowserSessionsForLifecycleEnd } from "../browser-lifecycle-cleanup.js"; import { loadConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import type { ensureContextEnginesInitialized as ensureContextEnginesInitializedFn } from "../context-engine/init.js"; import type { resolveContextEngine as resolveContextEngineFn } from "../context-engine/registry.js"; import type { SubagentEndReason } from "../context-engine/types.js"; @@ -8,9 +9,9 @@ import { onAgentEvent } from "../infra/agent-events.js"; import { createSubsystemLogger } from "../logging/subsystem.js"; import { type DeliveryContext, normalizeDeliveryContext } from "../utils/delivery-context.js"; import type { ensureRuntimePluginsLoaded as ensureRuntimePluginsLoadedFn } from "./runtime-plugins.js"; +import type { SubagentRunOutcome } from "./subagent-announce-output.js"; import { resetAnnounceQueuesForTests } from "./subagent-announce-queue.js"; import * as subagentAnnounceModule from "./subagent-announce.js"; -import type { SubagentRunOutcome } from "./subagent-announce.js"; import { SUBAGENT_ENDED_REASON_COMPLETE, SUBAGENT_ENDED_REASON_ERROR, @@ -124,7 +125,7 @@ function loadSubagentRegistryRuntime() { } async function ensureSubagentRegistryPluginRuntimeLoaded(params: { - config: ReturnType; + config: OpenClawConfig; workspaceDir?: string; allowGatewaySubagentBinding?: boolean; }) { @@ -137,7 +138,7 @@ async function ensureSubagentRegistryPluginRuntimeLoaded(params: { runtime.ensureRuntimePluginsLoaded(params); } -async function resolveSubagentRegistryContextEngine(cfg: ReturnType) { +async function resolveSubagentRegistryContextEngine(cfg: OpenClawConfig) { const runtime = await loadSubagentRegistryRuntime(); const ensureContextEnginesInitialized = subagentRegistryDeps.ensureContextEnginesInitialized ?? runtime.ensureContextEnginesInitialized; @@ -457,10 +458,7 @@ function restoreSubagentRunsOnce() { } } -function resolveSubagentWaitTimeoutMs( - cfg: ReturnType, - runTimeoutSeconds?: number, -) { +function resolveSubagentWaitTimeoutMs(cfg: OpenClawConfig, runTimeoutSeconds?: number) { return subagentRegistryDeps.resolveAgentTimeoutMs({ cfg, overrideSeconds: runTimeoutSeconds ?? 0, @@ -636,7 +634,7 @@ const subagentRunManager = createSubagentRunManager({ callGateway: (request) => subagentRegistryDeps.callGateway(request), loadConfig: () => subagentRegistryDeps.loadConfig(), ensureRuntimePluginsLoaded: (args: { - config: ReturnType; + config: OpenClawConfig; workspaceDir?: string; allowGatewaySubagentBinding?: boolean; }) => ensureSubagentRegistryPluginRuntimeLoaded(args), diff --git a/src/agents/subagent-registry.types.ts b/src/agents/subagent-registry.types.ts index 113e2c799cd..82cdf73d1a1 100644 --- a/src/agents/subagent-registry.types.ts +++ b/src/agents/subagent-registry.types.ts @@ -1,5 +1,5 @@ import type { DeliveryContext } from "../utils/delivery-context.js"; -import type { SubagentRunOutcome } from "./subagent-announce.js"; +import type { SubagentRunOutcome } from "./subagent-announce-output.js"; import type { SubagentLifecycleEndedReason } from "./subagent-lifecycle-events.js"; import type { SpawnSubagentMode } from "./subagent-spawn.types.js"; diff --git a/src/agents/subagent-spawn-plan.ts b/src/agents/subagent-spawn-plan.ts index 2a85448fd04..f644bd3a2d9 100644 --- a/src/agents/subagent-spawn-plan.ts +++ b/src/agents/subagent-spawn-plan.ts @@ -1,5 +1,5 @@ import { formatThinkingLevels } from "../auto-reply/thinking.js"; -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { resolveSubagentSpawnModelSelection } from "./model-selection.js"; import { resolveSubagentThinkingOverride } from "./subagent-spawn-thinking.js"; diff --git a/src/agents/subagent-spawn-thinking.ts b/src/agents/subagent-spawn-thinking.ts index 663637ab762..73b36f4a80f 100644 --- a/src/agents/subagent-spawn-thinking.ts +++ b/src/agents/subagent-spawn-thinking.ts @@ -1,5 +1,5 @@ import { normalizeThinkLevel } from "../auto-reply/thinking.shared.js"; -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; function asRecord(value: unknown): Record | undefined { return value && typeof value === "object" ? (value as Record) : undefined; diff --git a/src/agents/subagent-spawn.ts b/src/agents/subagent-spawn.ts index f7ca83329bd..8a450706399 100644 --- a/src/agents/subagent-spawn.ts +++ b/src/agents/subagent-spawn.ts @@ -1,5 +1,6 @@ import crypto from "node:crypto"; import { promises as fs } from "node:fs"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import type { SubagentLifecycleHookRunner } from "../plugins/hooks.js"; import { isValidAgentId, normalizeAgentId, parseAgentSessionKey } from "../routing/session-key.js"; import { @@ -173,7 +174,7 @@ function loadSubagentConfig() { } async function persistInitialChildSessionRuntimeModel(params: { - cfg: ReturnType; + cfg: OpenClawConfig; childSessionKey: string; resolvedModel?: string; }): Promise { diff --git a/src/agents/system-prompt-override.ts b/src/agents/system-prompt-override.ts index 28f52dad636..0b9da24bc5d 100644 --- a/src/agents/system-prompt-override.ts +++ b/src/agents/system-prompt-override.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { resolveAgentConfig } from "./agent-scope.js"; function trimNonEmpty(value: unknown): string | undefined { diff --git a/src/agents/system-prompt-params.ts b/src/agents/system-prompt-params.ts index 8aca020420f..f5ac80c11a3 100644 --- a/src/agents/system-prompt-params.ts +++ b/src/agents/system-prompt-params.ts @@ -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.openclaw.js"; import { findGitRoot } from "../infra/git-root.js"; import { formatUserTime, diff --git a/src/agents/system-prompt.ts b/src/agents/system-prompt.ts index 3bdbce25226..a68949bb262 100644 --- a/src/agents/system-prompt.ts +++ b/src/agents/system-prompt.ts @@ -26,6 +26,7 @@ import type { ProviderSystemPromptContribution, ProviderSystemPromptSectionId, } from "./system-prompt-contribution.js"; +import type { PromptMode } from "./system-prompt.types.js"; /** * Controls which hardcoded sections are included in the system prompt. @@ -33,7 +34,6 @@ import type { * - "minimal": Reduced sections (Tooling, Workspace, Runtime) - used for subagents * - "none": Just basic identity line, no sections */ -export type PromptMode = "full" | "minimal" | "none"; type OwnerIdDisplay = "raw" | "hash"; const CONTEXT_FILE_ORDER = new Map([ diff --git a/src/agents/system-prompt.types.ts b/src/agents/system-prompt.types.ts new file mode 100644 index 00000000000..331832c02f9 --- /dev/null +++ b/src/agents/system-prompt.types.ts @@ -0,0 +1 @@ +export type PromptMode = "full" | "minimal" | "none"; diff --git a/src/agents/test-helpers/model-fallback-config-fixture.ts b/src/agents/test-helpers/model-fallback-config-fixture.ts index 3b259c0d798..af236cce8df 100644 --- a/src/agents/test-helpers/model-fallback-config-fixture.ts +++ b/src/agents/test-helpers/model-fallback-config-fixture.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; export function makeModelFallbackCfg(overrides: Partial = {}): OpenClawConfig { return { diff --git a/src/agents/test-helpers/pi-embedded-runner-e2e-fixtures.ts b/src/agents/test-helpers/pi-embedded-runner-e2e-fixtures.ts index 47ec0f0ed2e..fedbbf459d1 100644 --- a/src/agents/test-helpers/pi-embedded-runner-e2e-fixtures.ts +++ b/src/agents/test-helpers/pi-embedded-runner-e2e-fixtures.ts @@ -2,7 +2,7 @@ import fs from "node:fs/promises"; import os from "node:os"; import path from "node:path"; import type { AssistantMessage } from "@mariozechner/pi-ai"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { buildAttemptReplayMetadata } from "../pi-embedded-runner/run/incomplete-turn.js"; import type { EmbeddedRunAttemptResult } from "../pi-embedded-runner/run/types.js"; diff --git a/src/agents/test-helpers/sandbox-agent-config-fixtures.ts b/src/agents/test-helpers/sandbox-agent-config-fixtures.ts index fbe768c60a3..6562255dd23 100644 --- a/src/agents/test-helpers/sandbox-agent-config-fixtures.ts +++ b/src/agents/test-helpers/sandbox-agent-config-fixtures.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; type AgentToolsConfig = NonNullable["list"]>[number]["tools"]; type SandboxToolsConfig = { diff --git a/src/agents/test-helpers/session-config.ts b/src/agents/test-helpers/session-config.ts index 6017e01d0e0..51e00448c95 100644 --- a/src/agents/test-helpers/session-config.ts +++ b/src/agents/test-helpers/session-config.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; export function createPerSenderSessionConfig( overrides: Partial> = {}, diff --git a/src/agents/timeout.ts b/src/agents/timeout.ts index 9743b449109..f8ef8cef2e5 100644 --- a/src/agents/timeout.ts +++ b/src/agents/timeout.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; const DEFAULT_AGENT_TIMEOUT_SECONDS = 48 * 60 * 60; const MAX_SAFE_TIMEOUT_MS = 2_147_000_000; diff --git a/src/agents/tool-fs-policy.ts b/src/agents/tool-fs-policy.ts index cdaba44fc1f..42e90ce7ff9 100644 --- a/src/agents/tool-fs-policy.ts +++ b/src/agents/tool-fs-policy.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { resolveAgentConfig } from "./agent-scope.js"; import { pickSandboxToolPolicy } from "./sandbox-tool-policy.js"; import { isToolAllowedByPolicies } from "./tool-policy-match.js"; diff --git a/src/agents/tools-effective-inventory.ts b/src/agents/tools-effective-inventory.ts index 22ca48dcdce..406e02feed5 100644 --- a/src/agents/tools-effective-inventory.ts +++ b/src/agents/tools-effective-inventory.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { getPluginToolMeta } from "../plugins/tools.js"; import { normalizeLowercaseStringOrEmpty, diff --git a/src/agents/tools/canvas-tool.ts b/src/agents/tools/canvas-tool.ts index 58482171094..2a503b76a6a 100644 --- a/src/agents/tools/canvas-tool.ts +++ b/src/agents/tools/canvas-tool.ts @@ -4,7 +4,7 @@ import path from "node:path"; import { Type } from "@sinclair/typebox"; import { writeBase64ToFile } from "../../cli/nodes-camera.js"; import { canvasSnapshotTempPath, parseCanvasSnapshotPayload } from "../../cli/nodes-canvas.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { logVerbose, shouldLogVerbose } from "../../globals.js"; import { isInboundPathAllowed } from "../../media/inbound-path-policy.js"; import { getDefaultMediaLocalRoots } from "../../media/local-roots.js"; diff --git a/src/agents/tools/gateway-tool.ts b/src/agents/tools/gateway-tool.ts index 777b2e42096..035fb5a62ca 100644 --- a/src/agents/tools/gateway-tool.ts +++ b/src/agents/tools/gateway-tool.ts @@ -1,10 +1,10 @@ import { isDeepStrictEqual } from "node:util"; import { Type } from "@sinclair/typebox"; import { isRestartEnabled } from "../../config/commands.js"; -import type { OpenClawConfig } from "../../config/config.js"; import { parseConfigJson5, resolveConfigSnapshotHash } from "../../config/io.js"; import { applyMergePatch } from "../../config/merge-patch.js"; import { extractDeliveryInfo } from "../../config/sessions.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { formatDoctorNonInteractiveHint, type RestartSentinelPayload, diff --git a/src/agents/tools/gateway.ts b/src/agents/tools/gateway.ts index 7fb752f4694..6acbda3eb80 100644 --- a/src/agents/tools/gateway.ts +++ b/src/agents/tools/gateway.ts @@ -1,4 +1,5 @@ import { loadConfig, resolveGatewayPort } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { callGateway } from "../../gateway/call.js"; import { resolveGatewayCredentialsFromConfig, trimToUndefined } from "../../gateway/credentials.js"; import { @@ -62,7 +63,7 @@ function canonicalizeToolGatewayWsUrl(raw: string): { origin: string; key: strin } function validateGatewayUrlOverrideForAgentTools(params: { - cfg: ReturnType; + cfg: OpenClawConfig; urlOverride: string; }): { url: string; target: GatewayOverrideTarget } { const { cfg } = params; @@ -104,7 +105,7 @@ function validateGatewayUrlOverrideForAgentTools(params: { } function resolveGatewayOverrideToken(params: { - cfg: ReturnType; + cfg: OpenClawConfig; target: GatewayOverrideTarget; explicitToken?: string; }): string | undefined { diff --git a/src/agents/tools/image-generate-tool.ts b/src/agents/tools/image-generate-tool.ts index 8ee8faf6e4c..8e8e78df252 100644 --- a/src/agents/tools/image-generate-tool.ts +++ b/src/agents/tools/image-generate-tool.ts @@ -1,6 +1,6 @@ import { Type } from "@sinclair/typebox"; -import type { OpenClawConfig } from "../../config/config.js"; import { loadConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { parseImageGenerationModelRef } from "../../image-generation/model-ref.js"; import { generateImage, diff --git a/src/agents/tools/image-tool.helpers.ts b/src/agents/tools/image-tool.helpers.ts index 7ae8ec275ec..1cee912b11c 100644 --- a/src/agents/tools/image-tool.helpers.ts +++ b/src/agents/tools/image-tool.helpers.ts @@ -1,5 +1,5 @@ import type { AssistantMessage } from "@mariozechner/pi-ai"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { estimateBase64DecodedBytes } from "../../media/base64.js"; import { normalizeLowercaseStringOrEmpty } from "../../shared/string-coerce.js"; import { findNormalizedProviderValue } from "../model-selection.js"; diff --git a/src/agents/tools/image-tool.ts b/src/agents/tools/image-tool.ts index 6016f793aa6..168c1d60174 100644 --- a/src/agents/tools/image-tool.ts +++ b/src/agents/tools/image-tool.ts @@ -1,6 +1,6 @@ import { resolve, isAbsolute } from "node:path"; import { Type } from "@sinclair/typebox"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { resolveAutoMediaKeyProviders, resolveDefaultMediaModel, diff --git a/src/agents/tools/media-generate-background-shared.ts b/src/agents/tools/media-generate-background-shared.ts index 327cada2c56..b48b91c7a24 100644 --- a/src/agents/tools/media-generate-background-shared.ts +++ b/src/agents/tools/media-generate-background-shared.ts @@ -1,7 +1,7 @@ import crypto from "node:crypto"; import { parseReplyDirectives } from "../../auto-reply/reply/reply-directives.js"; import { SILENT_REPLY_TOKEN } from "../../auto-reply/tokens.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { formatErrorMessage } from "../../infra/errors.js"; import { createSubsystemLogger } from "../../logging/subsystem.js"; import { parseAgentSessionKey } from "../../sessions/session-key-utils.js"; diff --git a/src/agents/tools/media-tool-shared.ts b/src/agents/tools/media-tool-shared.ts index f755438e654..cc4709db424 100644 --- a/src/agents/tools/media-tool-shared.ts +++ b/src/agents/tools/media-tool-shared.ts @@ -1,6 +1,6 @@ import { type Api, type Model } from "@mariozechner/pi-ai"; -import type { OpenClawConfig } from "../../config/config.js"; import type { AgentModelConfig } from "../../config/types.agents-shared.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { getDefaultLocalRoots } from "../../media/web-media.js"; import { readSnakeCaseParamRaw } from "../../param-key.js"; import { diff --git a/src/agents/tools/message-tool.ts b/src/agents/tools/message-tool.ts index 3a52f9fb620..143e8c14756 100644 --- a/src/agents/tools/message-tool.ts +++ b/src/agents/tools/message-tool.ts @@ -10,12 +10,12 @@ import type { ChannelMessageCapability } from "../../channels/plugins/message-ca import { CHANNEL_MESSAGE_ACTION_NAMES, type ChannelMessageActionName, -} from "../../channels/plugins/types.js"; +} from "../../channels/plugins/types.public.js"; import { resolveCommandSecretRefsViaGateway } from "../../cli/command-secret-gateway.js"; import { getScopedChannelsCommandSecretTargets } from "../../cli/command-secret-targets.js"; import { resolveMessageSecretScope } from "../../cli/message-secret-scope.js"; -import type { OpenClawConfig } from "../../config/config.js"; import { loadConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { GATEWAY_CLIENT_IDS, GATEWAY_CLIENT_MODES } from "../../gateway/protocol/client-info.js"; import { getToolResult, runMessageAction } from "../../infra/outbound/message-action-runner.js"; import { POLL_CREATION_PARAM_DEFS, SHARED_POLL_CREATION_PARAM_NAMES } from "../../poll-params.js"; diff --git a/src/agents/tools/model-config.helpers.ts b/src/agents/tools/model-config.helpers.ts index b1ad3068028..a3121e32c43 100644 --- a/src/agents/tools/model-config.helpers.ts +++ b/src/agents/tools/model-config.helpers.ts @@ -1,9 +1,9 @@ -import type { OpenClawConfig } from "../../config/config.js"; import { resolveAgentModelFallbackValues, resolveAgentModelPrimaryValue, } from "../../config/model-input.js"; import type { AgentModelConfig } from "../../config/types.agents-shared.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { ensureAuthProfileStore, hasAnyAuthProfileStoreSource, diff --git a/src/agents/tools/music-generate-background.ts b/src/agents/tools/music-generate-background.ts index 832cb09a777..9c07bd0c71e 100644 --- a/src/agents/tools/music-generate-background.ts +++ b/src/agents/tools/music-generate-background.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { MUSIC_GENERATION_TASK_KIND } from "../music-generation-task-status.js"; import { createMediaGenerationTaskLifecycle, diff --git a/src/agents/tools/music-generate-tool.actions.ts b/src/agents/tools/music-generate-tool.actions.ts index beaf938c1a1..ab16ca6aebb 100644 --- a/src/agents/tools/music-generate-tool.actions.ts +++ b/src/agents/tools/music-generate-tool.actions.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { listSupportedMusicGenerationModes } from "../../music-generation/capabilities.js"; import { listRuntimeMusicGenerationProviders } from "../../music-generation/runtime.js"; import { diff --git a/src/agents/tools/music-generate-tool.ts b/src/agents/tools/music-generate-tool.ts index 82e77149ab5..c1c92a1d28f 100644 --- a/src/agents/tools/music-generate-tool.ts +++ b/src/agents/tools/music-generate-tool.ts @@ -1,6 +1,6 @@ import { Type } from "@sinclair/typebox"; -import type { OpenClawConfig } from "../../config/config.js"; import { loadConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { formatErrorMessage } from "../../infra/errors.js"; import { createSubsystemLogger } from "../../logging/subsystem.js"; import { saveMediaBuffer } from "../../media/store.js"; diff --git a/src/agents/tools/nodes-tool.ts b/src/agents/tools/nodes-tool.ts index d9fdf856180..d020d233d3b 100644 --- a/src/agents/tools/nodes-tool.ts +++ b/src/agents/tools/nodes-tool.ts @@ -1,6 +1,6 @@ import crypto from "node:crypto"; import { Type } from "@sinclair/typebox"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import type { OperatorScope } from "../../gateway/method-scopes.js"; import { formatErrorMessage } from "../../infra/errors.js"; import { resolveNodePairApprovalScopes } from "../../infra/node-pairing-authz.js"; diff --git a/src/agents/tools/pdf-tool.helpers.ts b/src/agents/tools/pdf-tool.helpers.ts index b01db06e53e..d7c0e8bbbb3 100644 --- a/src/agents/tools/pdf-tool.helpers.ts +++ b/src/agents/tools/pdf-tool.helpers.ts @@ -1,9 +1,9 @@ import type { AssistantMessage } from "@mariozechner/pi-ai"; -import type { OpenClawConfig } from "../../config/config.js"; import { resolveAgentModelFallbackValues, resolveAgentModelPrimaryValue, } from "../../config/model-input.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { bundledProviderSupportsNativePdfDocument } from "../../media-understanding/bundled-defaults.js"; import { extractAssistantText } from "../pi-embedded-utils.js"; diff --git a/src/agents/tools/pdf-tool.model-config.ts b/src/agents/tools/pdf-tool.model-config.ts index 8fac2890aa8..51b1ffad473 100644 --- a/src/agents/tools/pdf-tool.model-config.ts +++ b/src/agents/tools/pdf-tool.model-config.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { bundledProviderSupportsNativePdfDocument, resolveBundledAutoMediaKeyProviders, diff --git a/src/agents/tools/pdf-tool.ts b/src/agents/tools/pdf-tool.ts index 2e7b023b8b5..c0873805eab 100644 --- a/src/agents/tools/pdf-tool.ts +++ b/src/agents/tools/pdf-tool.ts @@ -1,6 +1,6 @@ import { type Context, complete } from "@mariozechner/pi-ai"; import { Type } from "@sinclair/typebox"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { extractPdfContent, type PdfExtractedContent } from "../../media/pdf-extract.js"; import { loadWebMediaRaw } from "../../media/web-media.js"; import { diff --git a/src/agents/tools/session-status-tool.ts b/src/agents/tools/session-status-tool.ts index 9f6d7e98ee5..15a52c819b5 100644 --- a/src/agents/tools/session-status-tool.ts +++ b/src/agents/tools/session-status-tool.ts @@ -5,7 +5,6 @@ import type { ThinkLevel, VerboseLevel, } from "../../auto-reply/thinking.js"; -import type { OpenClawConfig } from "../../config/config.js"; import { loadConfig } from "../../config/config.js"; import { loadSessionStore, @@ -13,6 +12,7 @@ import { type SessionEntry, updateSessionStore, } from "../../config/sessions.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { resolveSessionModelIdentityRef } from "../../gateway/session-utils.js"; import { buildAgentMainSessionKey, diff --git a/src/agents/tools/sessions-access.ts b/src/agents/tools/sessions-access.ts index d22579393ee..3dfd052a736 100644 --- a/src/agents/tools/sessions-access.ts +++ b/src/agents/tools/sessions-access.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { isSubagentSessionKey, resolveAgentIdFromSessionKey } from "../../routing/session-key.js"; import { normalizeLowercaseStringOrEmpty, diff --git a/src/agents/tools/sessions-helpers.ts b/src/agents/tools/sessions-helpers.ts index d03360218ab..372dcad20c7 100644 --- a/src/agents/tools/sessions-helpers.ts +++ b/src/agents/tools/sessions-helpers.ts @@ -33,7 +33,8 @@ export { sanitizeTextContent, stripToolMessages, } from "./chat-history-text.js"; -import { type OpenClawConfig, loadConfig } from "../../config/config.js"; +import { loadConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { normalizeOptionalString } from "../../shared/string-coerce.js"; export type SessionKind = "main" | "group" | "cron" | "hook" | "node" | "other"; diff --git a/src/agents/tools/sessions-history-tool.ts b/src/agents/tools/sessions-history-tool.ts index 73b474036ac..393421b9057 100644 --- a/src/agents/tools/sessions-history-tool.ts +++ b/src/agents/tools/sessions-history-tool.ts @@ -1,5 +1,6 @@ import { Type } from "@sinclair/typebox"; -import { type OpenClawConfig, loadConfig } from "../../config/config.js"; +import { loadConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { callGateway } from "../../gateway/call.js"; import { capArrayByJsonBytes } from "../../gateway/session-utils.fs.js"; import { jsonUtf8Bytes } from "../../infra/json-utf8-bytes.js"; diff --git a/src/agents/tools/sessions-list-tool.ts b/src/agents/tools/sessions-list-tool.ts index 833bd8d6b77..cf1aa2285cf 100644 --- a/src/agents/tools/sessions-list-tool.ts +++ b/src/agents/tools/sessions-list-tool.ts @@ -1,11 +1,12 @@ import path from "node:path"; import { Type } from "@sinclair/typebox"; -import { type OpenClawConfig, loadConfig } from "../../config/config.js"; +import { loadConfig } from "../../config/config.js"; import { resolveSessionFilePath, resolveSessionFilePathOptions, resolveStorePath, } from "../../config/sessions.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { callGateway } from "../../gateway/call.js"; import { resolveAgentIdFromSessionKey } from "../../routing/session-key.js"; import { normalizeOptionalLowercaseString, readStringValue } from "../../shared/string-coerce.js"; diff --git a/src/agents/tools/sessions-resolution.ts b/src/agents/tools/sessions-resolution.ts index 8a8f19cd3cf..6d463c541fe 100644 --- a/src/agents/tools/sessions-resolution.ts +++ b/src/agents/tools/sessions-resolution.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { callGateway } from "../../gateway/call.js"; import { formatErrorMessage } from "../../infra/errors.js"; import { isAcpSessionKey, normalizeMainKey } from "../../routing/session-key.js"; diff --git a/src/agents/tools/sessions-send-helpers.ts b/src/agents/tools/sessions-send-helpers.ts index 062fd731a9b..78a1d6f0ccc 100644 --- a/src/agents/tools/sessions-send-helpers.ts +++ b/src/agents/tools/sessions-send-helpers.ts @@ -4,7 +4,7 @@ import { } from "../../channels/plugins/index.js"; import { resolveSessionConversationRef } from "../../channels/plugins/session-conversation.js"; import { normalizeChannelId as normalizeChatChannelId } from "../../channels/registry.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { ANNOUNCE_SKIP_TOKEN, REPLY_SKIP_TOKEN } from "./sessions-send-tokens.js"; export { ANNOUNCE_SKIP_TOKEN, diff --git a/src/agents/tools/sessions-send-tool.ts b/src/agents/tools/sessions-send-tool.ts index cc09c415b3a..2be2ef5ed89 100644 --- a/src/agents/tools/sessions-send-tool.ts +++ b/src/agents/tools/sessions-send-tool.ts @@ -1,6 +1,6 @@ import crypto from "node:crypto"; import { Type } from "@sinclair/typebox"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { callGateway } from "../../gateway/call.js"; import { formatErrorMessage } from "../../infra/errors.js"; import { normalizeAgentId, resolveAgentIdFromSessionKey } from "../../routing/session-key.js"; diff --git a/src/agents/tools/tts-tool.ts b/src/agents/tools/tts-tool.ts index 5696f8c873e..38ac7b4e65f 100644 --- a/src/agents/tools/tts-tool.ts +++ b/src/agents/tools/tts-tool.ts @@ -1,7 +1,7 @@ import { Type } from "@sinclair/typebox"; import { SILENT_REPLY_TOKEN } from "../../auto-reply/tokens.js"; -import type { OpenClawConfig } from "../../config/config.js"; import { loadConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { textToSpeech } from "../../tts/tts.js"; import type { GatewayMessageChannel } from "../../utils/message-channel.js"; import type { AnyAgentTool } from "./common.js"; diff --git a/src/agents/tools/video-generate-background.ts b/src/agents/tools/video-generate-background.ts index c0aea01b042..3c61fc08223 100644 --- a/src/agents/tools/video-generate-background.ts +++ b/src/agents/tools/video-generate-background.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { VIDEO_GENERATION_TASK_KIND } from "../video-generation-task-status.js"; import { createMediaGenerationTaskLifecycle, diff --git a/src/agents/tools/video-generate-tool.actions.ts b/src/agents/tools/video-generate-tool.actions.ts index a5e2e8d7605..70cbc31dcbe 100644 --- a/src/agents/tools/video-generate-tool.actions.ts +++ b/src/agents/tools/video-generate-tool.actions.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { listSupportedVideoGenerationModes } from "../../video-generation/capabilities.js"; import { listRuntimeVideoGenerationProviders } from "../../video-generation/runtime.js"; import { diff --git a/src/agents/tools/video-generate-tool.ts b/src/agents/tools/video-generate-tool.ts index 6d35a16c08e..d1c136c561c 100644 --- a/src/agents/tools/video-generate-tool.ts +++ b/src/agents/tools/video-generate-tool.ts @@ -1,6 +1,6 @@ import { Type } from "@sinclair/typebox"; -import type { OpenClawConfig } from "../../config/config.js"; import { loadConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { formatErrorMessage } from "../../infra/errors.js"; import { createSubsystemLogger } from "../../logging/subsystem.js"; import { saveMediaBuffer } from "../../media/store.js"; diff --git a/src/agents/tools/web-fetch.ts b/src/agents/tools/web-fetch.ts index 8409564997c..676726a5541 100644 --- a/src/agents/tools/web-fetch.ts +++ b/src/agents/tools/web-fetch.ts @@ -1,5 +1,5 @@ import { Type } from "@sinclair/typebox"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { SsrFBlockedError, type LookupFn } from "../../infra/net/ssrf.js"; import { logDebug } from "../../logger.js"; import type { RuntimeWebFetchMetadata } from "../../secrets/runtime-web-tools.types.js"; diff --git a/src/agents/tools/web-search-provider-common.ts b/src/agents/tools/web-search-provider-common.ts index 8bc23ea9933..7141c39b27f 100644 --- a/src/agents/tools/web-search-provider-common.ts +++ b/src/agents/tools/web-search-provider-common.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { normalizeResolvedSecretInputString } from "../../config/types.secrets.js"; import { normalizeLowercaseStringOrEmpty } from "../../shared/string-coerce.js"; import { normalizeSecretInput } from "../../utils/normalize-secret-input.js"; diff --git a/src/agents/tools/web-search-provider-config.ts b/src/agents/tools/web-search-provider-config.ts index b0e5fc304f1..276dee6963b 100644 --- a/src/agents/tools/web-search-provider-config.ts +++ b/src/agents/tools/web-search-provider-config.ts @@ -1,5 +1,5 @@ -import type { OpenClawConfig } from "../../config/config.js"; import { resolvePluginWebSearchConfig } from "../../config/plugin-web-search-config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; type ConfiguredWebSearchProvider = NonNullable< NonNullable["web"]>["search"] diff --git a/src/agents/tools/web-search.ts b/src/agents/tools/web-search.ts index 1cd107c9a07..5f49da37ffa 100644 --- a/src/agents/tools/web-search.ts +++ b/src/agents/tools/web-search.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { resolveManifestContractOwnerPluginId } from "../../plugins/manifest-registry.js"; import type { RuntimeWebSearchMetadata } from "../../secrets/runtime-web-tools.types.js"; import { diff --git a/src/agents/transcript-policy.ts b/src/agents/transcript-policy.ts index 3d55cdd234c..2c88b93e7da 100644 --- a/src/agents/transcript-policy.ts +++ b/src/agents/transcript-policy.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { shouldPreserveThinkingBlocks } from "../plugins/provider-replay-helpers.js"; import { resolveProviderRuntimePlugin } from "../plugins/provider-runtime.js"; import type { ProviderReplayPolicy, ProviderRuntimeModel } from "../plugins/types.js"; diff --git a/src/agents/workspace-dirs.ts b/src/agents/workspace-dirs.ts index 62adbddd471..3bd2a854833 100644 --- a/src/agents/workspace-dirs.ts +++ b/src/agents/workspace-dirs.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { resolveAgentWorkspaceDir, resolveDefaultAgentId } from "./agent-scope.js"; export function listAgentWorkspaceDirs(cfg: OpenClawConfig): string[] { diff --git a/src/agents/workspace-run.ts b/src/agents/workspace-run.ts index 8ba281c485d..c3648c41f0a 100644 --- a/src/agents/workspace-run.ts +++ b/src/agents/workspace-run.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { logWarn } from "../logger.js"; import { redactIdentifier } from "../logging/redact-identifier.js"; import { diff --git a/src/auto-reply/command-auth.ts b/src/auto-reply/command-auth.ts index 4632dfb731e..8a0b216811b 100644 --- a/src/auto-reply/command-auth.ts +++ b/src/auto-reply/command-auth.ts @@ -1,7 +1,8 @@ import { getChannelPlugin, listChannelPlugins } from "../channels/plugins/index.js"; -import type { ChannelId, ChannelPlugin } from "../channels/plugins/types.js"; +import type { ChannelPlugin } from "../channels/plugins/types.plugin.js"; +import type { ChannelId } from "../channels/plugins/types.public.js"; import { normalizeAnyChannelId } from "../channels/registry.js"; -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, diff --git a/src/auto-reply/command-status-builders.ts b/src/auto-reply/command-status-builders.ts index 9de52b70469..e07d079036b 100644 --- a/src/auto-reply/command-status-builders.ts +++ b/src/auto-reply/command-status-builders.ts @@ -1,7 +1,7 @@ import type { SkillCommandSpec } from "../agents/skills.js"; import { getChannelPlugin } from "../channels/plugins/index.js"; import { isCommandFlagEnabled } from "../config/commands.js"; -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { listPluginCommands } from "../plugins/commands.js"; import { normalizeLowercaseStringOrEmpty, diff --git a/src/auto-reply/dispatch.ts b/src/auto-reply/dispatch.ts index a062a9c5231..c1eaf989d1e 100644 --- a/src/auto-reply/dispatch.ts +++ b/src/auto-reply/dispatch.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { dispatchReplyFromConfig } from "./reply/dispatch-from-config.js"; import type { DispatchFromConfigResult } from "./reply/dispatch-from-config.types.js"; import { finalizeInboundContext } from "./reply/inbound-context.js"; diff --git a/src/auto-reply/envelope.ts b/src/auto-reply/envelope.ts index 727e409f40c..74c47b79ec0 100644 --- a/src/auto-reply/envelope.ts +++ b/src/auto-reply/envelope.ts @@ -1,7 +1,7 @@ import { resolveUserTimezone } from "../agents/date-time.js"; import { normalizeChatType } from "../channels/chat-type.js"; import { resolveSenderLabel, type SenderLabelParams } from "../channels/sender-label.js"; -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { resolveTimezone, formatUtcTimestamp, diff --git a/src/auto-reply/inbound-debounce.ts b/src/auto-reply/inbound-debounce.ts index 3b9dad7e784..194dee6f0c2 100644 --- a/src/auto-reply/inbound-debounce.ts +++ b/src/auto-reply/inbound-debounce.ts @@ -1,5 +1,5 @@ -import type { OpenClawConfig } from "../config/config.js"; import type { InboundDebounceByProvider } from "../config/types.messages.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; const resolveMs = (value: unknown): number | undefined => { if (typeof value !== "number" || !Number.isFinite(value)) { diff --git a/src/auto-reply/reply.triggers.trigger-handling.test-harness.ts b/src/auto-reply/reply.triggers.trigger-handling.test-harness.ts index e1b151edb58..29fa05d48fd 100644 --- a/src/auto-reply/reply.triggers.trigger-handling.test-harness.ts +++ b/src/auto-reply/reply.triggers.trigger-handling.test-harness.ts @@ -4,7 +4,7 @@ import os from "node:os"; import { join } from "node:path"; import { afterAll, afterEach, beforeAll, expect, vi } from "vitest"; import { clearRuntimeAuthProfileStoreSnapshots } from "../agents/auth-profiles.js"; -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { resetProviderRuntimeHookCacheForTest } from "../plugins/provider-runtime.js"; import { resolveRelativeBundledPluginPublicModuleId } from "../test-utils/bundled-plugin-public-surface.js"; import { withFastReplyConfig } from "./reply/get-reply-fast-path.js"; diff --git a/src/auto-reply/reply/abort.ts b/src/auto-reply/reply/abort.ts index 2f80f1889d0..61ea9997f29 100644 --- a/src/auto-reply/reply/abort.ts +++ b/src/auto-reply/reply/abort.ts @@ -11,7 +11,6 @@ import { resolveInternalSessionKey, resolveMainSessionAlias, } from "../../agents/tools/sessions-helpers.js"; -import type { OpenClawConfig } from "../../config/config.js"; import { loadSessionStore, resolveSessionStoreEntry, @@ -19,6 +18,7 @@ import { type SessionEntry, updateSessionStore, } from "../../config/sessions.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { logVerbose } from "../../globals.js"; import { formatErrorMessage } from "../../infra/errors.js"; import { parseAgentSessionKey } from "../../routing/session-key.js"; diff --git a/src/auto-reply/reply/acp-projector.ts b/src/auto-reply/reply/acp-projector.ts index 0c3b33b7d23..4dbf4e6997e 100644 --- a/src/auto-reply/reply/acp-projector.ts +++ b/src/auto-reply/reply/acp-projector.ts @@ -1,7 +1,7 @@ import type { AcpRuntimeEvent, AcpSessionUpdateTag } from "../../acp/runtime/types.js"; import { EmbeddedBlockChunker } from "../../agents/pi-embedded-block-chunker.js"; import { formatToolSummary, resolveToolDisplay } from "../../agents/tool-display.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { prefixSystemMessage } from "../../infra/system-message.js"; import { normalizeOptionalLowercaseString, diff --git a/src/auto-reply/reply/acp-reset-target.ts b/src/auto-reply/reply/acp-reset-target.ts index 85b0235e8e0..715d7a4cbc6 100644 --- a/src/auto-reply/reply/acp-reset-target.ts +++ b/src/auto-reply/reply/acp-reset-target.ts @@ -5,7 +5,7 @@ import { } from "../../acp/persistent-bindings.types.js"; import { resolveConfiguredBindingRecord } from "../../channels/plugins/binding-registry.js"; import { listAcpBindings } from "../../config/bindings.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { getSessionBindingService } from "../../infra/outbound/session-binding-service.js"; import { DEFAULT_ACCOUNT_ID, isAcpSessionKey } from "../../routing/session-key.js"; import { diff --git a/src/auto-reply/reply/acp-stream-settings.ts b/src/auto-reply/reply/acp-stream-settings.ts index 4c01c6b5851..ad99e4623cb 100644 --- a/src/auto-reply/reply/acp-stream-settings.ts +++ b/src/auto-reply/reply/acp-stream-settings.ts @@ -1,5 +1,5 @@ import type { AcpSessionUpdateTag } from "../../acp/runtime/types.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { clampPositiveInteger, resolveEffectiveBlockStreamingConfig } from "./block-streaming.js"; const DEFAULT_ACP_STREAM_COALESCE_IDLE_MS = 350; diff --git a/src/auto-reply/reply/agent-runner-memory.ts b/src/auto-reply/reply/agent-runner-memory.ts index fe819953f7f..56e155233ee 100644 --- a/src/auto-reply/reply/agent-runner-memory.ts +++ b/src/auto-reply/reply/agent-runner-memory.ts @@ -13,7 +13,6 @@ import { normalizeUsage, type UsageLike, } from "../../agents/usage.js"; -import type { OpenClawConfig } from "../../config/config.js"; import { resolveAgentIdFromSessionKey, resolveFreshSessionTotalTokens, @@ -22,6 +21,7 @@ import { type SessionEntry, updateSessionStoreEntry, } from "../../config/sessions.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { readSessionMessages } from "../../gateway/session-utils.fs.js"; import { logVerbose } from "../../globals.js"; import { registerAgentRunContext } from "../../infra/agent-events.js"; diff --git a/src/auto-reply/reply/agent-runner-utils.ts b/src/auto-reply/reply/agent-runner-utils.ts index 187b4d8bec7..5697ec7baaa 100644 --- a/src/auto-reply/reply/agent-runner-utils.ts +++ b/src/auto-reply/reply/agent-runner-utils.ts @@ -1,6 +1,9 @@ import { resolveRunModelFallbacksOverride } from "../../agents/agent-scope.js"; import { getChannelPlugin } from "../../channels/plugins/index.js"; -import type { ChannelId, ChannelThreadingToolContext } from "../../channels/plugins/types.js"; +import type { + ChannelId, + ChannelThreadingToolContext, +} from "../../channels/plugins/types.public.js"; import { normalizeAnyChannelId, normalizeChannelId } from "../../channels/registry.js"; import { resolveCommandSecretRefsViaGateway } from "../../cli/command-secret-gateway.js"; import { getAgentRuntimeCommandSecretTargetIds } from "../../cli/command-secret-targets.js"; diff --git a/src/auto-reply/reply/bash-command.ts b/src/auto-reply/reply/bash-command.ts index 0d9fb93e99d..977d707208d 100644 --- a/src/auto-reply/reply/bash-command.ts +++ b/src/auto-reply/reply/bash-command.ts @@ -3,7 +3,7 @@ import { getFinishedSession, getSession } from "../../agents/bash-process-regist import { createExecTool } from "../../agents/bash-tools.js"; import { resolveSandboxRuntimeStatus } from "../../agents/sandbox.js"; import { isCommandFlagEnabled } from "../../config/commands.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { logVerbose } from "../../globals.js"; import { formatErrorMessage } from "../../infra/errors.js"; import { diff --git a/src/auto-reply/reply/block-streaming.ts b/src/auto-reply/reply/block-streaming.ts index 686c0fa724d..bbe8c199932 100644 --- a/src/auto-reply/reply/block-streaming.ts +++ b/src/auto-reply/reply/block-streaming.ts @@ -1,6 +1,6 @@ import { getChannelPlugin, normalizeChannelId } from "../../channels/plugins/index.js"; -import type { OpenClawConfig } from "../../config/config.js"; import type { BlockStreamingCoalesceConfig } from "../../config/types.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { resolveChannelStreamingBlockCoalesce } from "../../plugin-sdk/channel-streaming.js"; import { resolveAccountEntry } from "../../routing/account-lookup.js"; import { normalizeAccountId } from "../../routing/session-key.js"; diff --git a/src/auto-reply/reply/channel-context.ts b/src/auto-reply/reply/channel-context.ts index d0f5a88d00e..fd0a80558c0 100644 --- a/src/auto-reply/reply/channel-context.ts +++ b/src/auto-reply/reply/channel-context.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { getActivePluginChannelRegistry } from "../../plugins/runtime.js"; import { normalizeOptionalLowercaseString, diff --git a/src/auto-reply/reply/commands-acp/install-hints.ts b/src/auto-reply/reply/commands-acp/install-hints.ts index e3ad52996f5..35bda19bc60 100644 --- a/src/auto-reply/reply/commands-acp/install-hints.ts +++ b/src/auto-reply/reply/commands-acp/install-hints.ts @@ -1,6 +1,6 @@ import { existsSync } from "node:fs"; import path from "node:path"; -import type { OpenClawConfig } from "../../../config/config.js"; +import type { OpenClawConfig } from "../../../config/types.openclaw.js"; import { resolveBundledPluginWorkspaceSourcePath } from "../../../plugins/bundled-plugin-metadata.js"; import { resolveBundledPluginInstallCommandHint } from "../../../plugins/bundled-sources.js"; import { diff --git a/src/auto-reply/reply/commands-acp/lifecycle.ts b/src/auto-reply/reply/commands-acp/lifecycle.ts index a51e1cc3e3a..6037f0244cb 100644 --- a/src/auto-reply/reply/commands-acp/lifecycle.ts +++ b/src/auto-reply/reply/commands-acp/lifecycle.ts @@ -30,9 +30,9 @@ import { resolveThreadBindingPlacementForCurrentContext, resolveThreadBindingSpawnPolicy, } from "../../../channels/thread-bindings-policy.js"; -import type { OpenClawConfig } from "../../../config/config.js"; import { updateSessionStore } from "../../../config/sessions.js"; import type { SessionAcpMeta } from "../../../config/sessions/types.js"; +import type { OpenClawConfig } from "../../../config/types.openclaw.js"; import { formatErrorMessage } from "../../../infra/errors.js"; import { normalizeConversationRef } from "../../../infra/outbound/session-binding-normalization.js"; import { diff --git a/src/auto-reply/reply/commands-allowlist.ts b/src/auto-reply/reply/commands-allowlist.ts index 76fa089b801..9dfe2162910 100644 --- a/src/auto-reply/reply/commands-allowlist.ts +++ b/src/auto-reply/reply/commands-allowlist.ts @@ -1,12 +1,12 @@ import { getChannelPlugin } from "../../channels/plugins/index.js"; -import type { ChannelId } from "../../channels/plugins/types.js"; +import type { ChannelId } from "../../channels/plugins/types.public.js"; import { normalizeChannelId } from "../../channels/registry.js"; -import type { OpenClawConfig } from "../../config/config.js"; import { readConfigFileSnapshot, validateConfigObjectWithPlugins, writeConfigFile, } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { addChannelAllowFromStoreEntry, readChannelAllowFromStore, diff --git a/src/auto-reply/reply/commands-compact.ts b/src/auto-reply/reply/commands-compact.ts index b4cf4f1b3e1..7ef32650c8e 100644 --- a/src/auto-reply/reply/commands-compact.ts +++ b/src/auto-reply/reply/commands-compact.ts @@ -1,5 +1,5 @@ import { resolveAgentDir, resolveSessionAgentId } from "../../agents/agent-scope.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { logVerbose } from "../../globals.js"; import { normalizeLowercaseStringOrEmpty, diff --git a/src/auto-reply/reply/commands-context.ts b/src/auto-reply/reply/commands-context.ts index 72e28338aa9..326704afd2c 100644 --- a/src/auto-reply/reply/commands-context.ts +++ b/src/auto-reply/reply/commands-context.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { normalizeLowercaseStringOrEmpty } from "../../shared/string-coerce.js"; import { resolveCommandAuthorization } from "../command-auth.js"; import { normalizeCommandBody } from "../commands-registry-normalize.js"; diff --git a/src/auto-reply/reply/commands-models.ts b/src/auto-reply/reply/commands-models.ts index 6695396692d..96ac8e7456e 100644 --- a/src/auto-reply/reply/commands-models.ts +++ b/src/auto-reply/reply/commands-models.ts @@ -9,8 +9,8 @@ import { resolveModelRefFromString, } from "../../agents/model-selection.js"; import { getChannelPlugin } from "../../channels/plugins/index.js"; -import type { OpenClawConfig } from "../../config/config.js"; import type { SessionEntry } from "../../config/sessions.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, diff --git a/src/auto-reply/reply/commands-plugins.ts b/src/auto-reply/reply/commands-plugins.ts index d484d7ae3d1..2b75ddf424e 100644 --- a/src/auto-reply/reply/commands-plugins.ts +++ b/src/auto-reply/reply/commands-plugins.ts @@ -12,7 +12,7 @@ import { validateConfigObjectWithPlugins, writeConfigFile, } from "../../config/config.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import type { PluginInstallRecord } from "../../config/types.plugins.js"; import { resolveArchiveKind } from "../../infra/archive.js"; import { parseClawHubPluginSpec } from "../../infra/clawhub.js"; diff --git a/src/auto-reply/reply/commands-spawn.test-harness.ts b/src/auto-reply/reply/commands-spawn.test-harness.ts index 72c78d3606a..99c14a861d6 100644 --- a/src/auto-reply/reply/commands-spawn.test-harness.ts +++ b/src/auto-reply/reply/commands-spawn.test-harness.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import type { MsgContext } from "../templating.js"; import { buildCommandTestParams as buildBaseCommandTestParams } from "./commands.test-harness.js"; diff --git a/src/auto-reply/reply/commands-status.ts b/src/auto-reply/reply/commands-status.ts index f027b4cce37..7ac0edac40a 100644 --- a/src/auto-reply/reply/commands-status.ts +++ b/src/auto-reply/reply/commands-status.ts @@ -13,9 +13,9 @@ import { resolveInternalSessionKey, resolveMainSessionAlias, } from "../../agents/tools/sessions-helpers.js"; -import type { OpenClawConfig } from "../../config/config.js"; import { toAgentModelListLike } from "../../config/model-input.js"; import type { SessionEntry, SessionScope } from "../../config/sessions.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { logVerbose } from "../../globals.js"; import { formatUsageWindowSummary, diff --git a/src/auto-reply/reply/commands-subagents.test-helpers.ts b/src/auto-reply/reply/commands-subagents.test-helpers.ts index 2b693d6fade..cf0756125bf 100644 --- a/src/auto-reply/reply/commands-subagents.test-helpers.ts +++ b/src/auto-reply/reply/commands-subagents.test-helpers.ts @@ -1,5 +1,5 @@ import type { SubagentRunRecord } from "../../agents/subagent-registry.types.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import type { handleSubagentsSendAction } from "./commands-subagents/action-send.js"; export function buildSubagentRun(): SubagentRunRecord { diff --git a/src/auto-reply/reply/commands-types.ts b/src/auto-reply/reply/commands-types.ts index 02b7b8e8770..b5344ded545 100644 --- a/src/auto-reply/reply/commands-types.ts +++ b/src/auto-reply/reply/commands-types.ts @@ -1,8 +1,8 @@ import type { BlockReplyChunking } from "../../agents/pi-embedded-block-chunker.js"; import type { SkillCommandSpec } from "../../agents/skills.js"; -import type { ChannelId } from "../../channels/plugins/types.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { ChannelId } from "../../channels/plugins/types.public.js"; import type { SessionEntry, SessionScope } from "../../config/sessions.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import type { MsgContext } from "../templating.js"; import type { ElevatedLevel, ReasoningLevel, ThinkLevel, VerboseLevel } from "../thinking.js"; import type { GetReplyOptions, ReplyPayload } from "../types.js"; diff --git a/src/auto-reply/reply/commands.test-harness.ts b/src/auto-reply/reply/commands.test-harness.ts index 1818e3b87dd..29b36297659 100644 --- a/src/auto-reply/reply/commands.test-harness.ts +++ b/src/auto-reply/reply/commands.test-harness.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import type { MsgContext } from "../templating.js"; import { buildCommandContext } from "./commands-context.js"; import type { HandleCommandsParams } from "./commands-types.js"; diff --git a/src/auto-reply/reply/config-write-authorization.ts b/src/auto-reply/reply/config-write-authorization.ts index a2c2142709f..be31230bf01 100644 --- a/src/auto-reply/reply/config-write-authorization.ts +++ b/src/auto-reply/reply/config-write-authorization.ts @@ -3,8 +3,8 @@ import { canBypassConfigWritePolicy, formatConfigWriteDeniedMessage, } from "../../channels/plugins/config-writes.js"; -import type { ChannelId } from "../../channels/plugins/types.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { ChannelId } from "../../channels/plugins/types.public.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; export function resolveConfigWriteDeniedText(params: { cfg: OpenClawConfig; diff --git a/src/auto-reply/reply/conversation-binding-input.ts b/src/auto-reply/reply/conversation-binding-input.ts index bf55dbd8b65..5f99c42da7c 100644 --- a/src/auto-reply/reply/conversation-binding-input.ts +++ b/src/auto-reply/reply/conversation-binding-input.ts @@ -1,6 +1,6 @@ import { normalizeConversationText } from "../../acp/conversation-id.js"; import { resolveConversationBindingContext } from "../../channels/conversation-binding-context.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { getActivePluginChannelRegistry } from "../../plugins/runtime.js"; import { normalizeLowercaseStringOrEmpty } from "../../shared/string-coerce.js"; import type { MsgContext } from "../templating.js"; diff --git a/src/auto-reply/reply/conversation-label-generator.ts b/src/auto-reply/reply/conversation-label-generator.ts index 4ac37ce00d4..b127bcd9aef 100644 --- a/src/auto-reply/reply/conversation-label-generator.ts +++ b/src/auto-reply/reply/conversation-label-generator.ts @@ -3,7 +3,7 @@ import { getApiKeyForModel, requireApiKey } from "../../agents/model-auth.js"; import { resolveDefaultModelForAgent } from "../../agents/model-selection.js"; import { resolveModelAsync } from "../../agents/pi-embedded-runner/model.js"; import { prepareModelForSimpleCompletion } from "../../agents/simple-completion-transport.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { logVerbose } from "../../globals.js"; const DEFAULT_MAX_LABEL_LENGTH = 128; diff --git a/src/auto-reply/reply/directive-handling.auth-profile.ts b/src/auto-reply/reply/directive-handling.auth-profile.ts index 5d75411bbf9..78107478df2 100644 --- a/src/auto-reply/reply/directive-handling.auth-profile.ts +++ b/src/auto-reply/reply/directive-handling.auth-profile.ts @@ -1,5 +1,5 @@ import { ensureAuthProfileStore } from "../../agents/auth-profiles.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { normalizeOptionalString } from "../../shared/string-coerce.js"; export function resolveProfileOverride(params: { diff --git a/src/auto-reply/reply/directive-handling.auth.ts b/src/auto-reply/reply/directive-handling.auth.ts index 96b2bc9cab3..4b5cd11da7d 100644 --- a/src/auto-reply/reply/directive-handling.auth.ts +++ b/src/auto-reply/reply/directive-handling.auth.ts @@ -11,7 +11,7 @@ import { resolveUsableCustomProviderApiKey, } from "../../agents/model-auth.js"; import { findNormalizedProviderValue, normalizeProviderId } from "../../agents/model-selection.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { coerceSecretRef } from "../../config/types.secrets.js"; import { normalizeLowercaseStringOrEmpty } from "../../shared/string-coerce.js"; import { shortenHomePath } from "../../utils.js"; diff --git a/src/auto-reply/reply/directive-handling.defaults.ts b/src/auto-reply/reply/directive-handling.defaults.ts index 8cea7cbb8bf..2781492d5ff 100644 --- a/src/auto-reply/reply/directive-handling.defaults.ts +++ b/src/auto-reply/reply/directive-handling.defaults.ts @@ -3,7 +3,7 @@ import { type ModelAliasIndex, resolveDefaultModelForAgent, } from "../../agents/model-selection.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; export function resolveDefaultModel(params: { cfg: OpenClawConfig; agentId?: string }): { defaultProvider: string; diff --git a/src/auto-reply/reply/directive-handling.directive-only.ts b/src/auto-reply/reply/directive-handling.directive-only.ts index 333402de4f4..f10627dbe90 100644 --- a/src/auto-reply/reply/directive-handling.directive-only.ts +++ b/src/auto-reply/reply/directive-handling.directive-only.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import type { MsgContext } from "../templating.js"; import type { InlineDirectives } from "./directive-handling.parse.js"; import { stripMentions, stripStructuralPrefixes } from "./mentions.js"; diff --git a/src/auto-reply/reply/directive-handling.model-picker.ts b/src/auto-reply/reply/directive-handling.model-picker.ts index d2075f6340d..5382b113cbb 100644 --- a/src/auto-reply/reply/directive-handling.model-picker.ts +++ b/src/auto-reply/reply/directive-handling.model-picker.ts @@ -3,7 +3,7 @@ import { type ModelRef, normalizeProviderId, } from "../../agents/model-selection.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, diff --git a/src/auto-reply/reply/directive-handling.model-selection.ts b/src/auto-reply/reply/directive-handling.model-selection.ts index db4eba5f708..33cfbe9d7f6 100644 --- a/src/auto-reply/reply/directive-handling.model-selection.ts +++ b/src/auto-reply/reply/directive-handling.model-selection.ts @@ -5,7 +5,7 @@ import { resolveModelRefFromString, } from "../../agents/model-selection.js"; import { resolveProviderIdForAuth } from "../../agents/provider-auth-aliases.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { resolveProfileOverride } from "./directive-handling.auth-profile.js"; import type { InlineDirectives } from "./directive-handling.parse.js"; import { type ModelDirectiveSelection, resolveModelDirectiveSelection } from "./model-selection.js"; diff --git a/src/auto-reply/reply/directive-handling.model.ts b/src/auto-reply/reply/directive-handling.model.ts index 14a5874f57c..e99e484e0e5 100644 --- a/src/auto-reply/reply/directive-handling.model.ts +++ b/src/auto-reply/reply/directive-handling.model.ts @@ -7,8 +7,8 @@ import { resolveModelRefFromString, } from "../../agents/model-selection.js"; import { getChannelPlugin } from "../../channels/plugins/index.js"; -import type { OpenClawConfig } from "../../config/config.js"; import type { SessionEntry } from "../../config/sessions.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, diff --git a/src/auto-reply/reply/directive-handling.params.ts b/src/auto-reply/reply/directive-handling.params.ts index dcbf47a9093..c18815d7087 100644 --- a/src/auto-reply/reply/directive-handling.params.ts +++ b/src/auto-reply/reply/directive-handling.params.ts @@ -1,6 +1,6 @@ import type { ModelAliasIndex } from "../../agents/model-selection.js"; -import type { OpenClawConfig } from "../../config/config.js"; import type { SessionEntry } from "../../config/sessions.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import type { MsgContext } from "../templating.js"; import type { InlineDirectives } from "./directive-handling.parse.js"; import type { ElevatedLevel, ReasoningLevel, ThinkLevel, VerboseLevel } from "./directives.js"; diff --git a/src/auto-reply/reply/directive-handling.persist.ts b/src/auto-reply/reply/directive-handling.persist.ts index 15c2e6c1f2e..cb68972ee8a 100644 --- a/src/auto-reply/reply/directive-handling.persist.ts +++ b/src/auto-reply/reply/directive-handling.persist.ts @@ -6,9 +6,9 @@ import { import { resolveContextTokensForModel } from "../../agents/context.js"; import { DEFAULT_CONTEXT_TOKENS } from "../../agents/defaults.js"; import type { ModelAliasIndex } from "../../agents/model-selection.js"; -import type { OpenClawConfig } from "../../config/config.js"; import { updateSessionStore } from "../../config/sessions/store.js"; import type { SessionEntry } from "../../config/sessions/types.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { enqueueSystemEvent } from "../../infra/system-events.js"; import { applyVerboseOverride } from "../../sessions/level-overrides.js"; import { applyModelOverrideToSessionEntry } from "../../sessions/model-overrides.js"; diff --git a/src/auto-reply/reply/directive-handling.queue-validation.ts b/src/auto-reply/reply/directive-handling.queue-validation.ts index 5c8b0811b80..4f3e11a416a 100644 --- a/src/auto-reply/reply/directive-handling.queue-validation.ts +++ b/src/auto-reply/reply/directive-handling.queue-validation.ts @@ -1,5 +1,5 @@ -import type { OpenClawConfig } from "../../config/config.js"; import type { SessionEntry } from "../../config/sessions.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import type { ReplyPayload } from "../types.js"; import type { InlineDirectives } from "./directive-handling.parse.js"; import { withOptions } from "./directive-handling.shared.js"; diff --git a/src/auto-reply/reply/dispatch-acp-attachments.ts b/src/auto-reply/reply/dispatch-acp-attachments.ts index ec44f29e20d..8ec8f382673 100644 --- a/src/auto-reply/reply/dispatch-acp-attachments.ts +++ b/src/auto-reply/reply/dispatch-acp-attachments.ts @@ -1,5 +1,5 @@ import type { AcpTurnAttachment } from "../../acp/control-plane/manager.types.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { logVerbose } from "../../globals.js"; import { normalizeOptionalString } from "../../shared/string-coerce.js"; import type { FinalizedMsgContext } from "../templating.js"; diff --git a/src/auto-reply/reply/dispatch-acp-command-bypass.ts b/src/auto-reply/reply/dispatch-acp-command-bypass.ts index 02f9fba2094..62c045d8bfd 100644 --- a/src/auto-reply/reply/dispatch-acp-command-bypass.ts +++ b/src/auto-reply/reply/dispatch-acp-command-bypass.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { isCommandEnabled, maybeResolveTextAlias, diff --git a/src/auto-reply/reply/dispatch-acp-delivery.ts b/src/auto-reply/reply/dispatch-acp-delivery.ts index bd97da78014..61a72b07129 100644 --- a/src/auto-reply/reply/dispatch-acp-delivery.ts +++ b/src/auto-reply/reply/dispatch-acp-delivery.ts @@ -1,5 +1,5 @@ import { hasOutboundReplyContent } from "openclaw/plugin-sdk/reply-payload"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import type { TtsAutoMode } from "../../config/types.tts.js"; import { logVerbose } from "../../globals.js"; import { formatErrorMessage } from "../../infra/errors.js"; diff --git a/src/auto-reply/reply/dispatch-acp.ts b/src/auto-reply/reply/dispatch-acp.ts index 71b6d43349c..f79afd74827 100644 --- a/src/auto-reply/reply/dispatch-acp.ts +++ b/src/auto-reply/reply/dispatch-acp.ts @@ -6,7 +6,7 @@ import { isSessionIdentityPending, resolveSessionIdentityFromMeta, } from "../../acp/runtime/session-identity.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import type { TtsAutoMode } from "../../config/types.tts.js"; import { logVerbose } from "../../globals.js"; import { emitAgentEvent } from "../../infra/agent-events.js"; diff --git a/src/auto-reply/reply/dispatch-from-config.shared.test-harness.ts b/src/auto-reply/reply/dispatch-from-config.shared.test-harness.ts index e37f0485904..697ec4d8b9d 100644 --- a/src/auto-reply/reply/dispatch-from-config.shared.test-harness.ts +++ b/src/auto-reply/reply/dispatch-from-config.shared.test-harness.ts @@ -1,5 +1,5 @@ import { vi } from "vitest"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import type { SessionBindingRecord } from "../../infra/outbound/session-binding-service.js"; import type { PluginHookBeforeDispatchResult, diff --git a/src/auto-reply/reply/dispatch-from-config.ts b/src/auto-reply/reply/dispatch-from-config.ts index 8d3e245dc5a..d37d3a095f2 100644 --- a/src/auto-reply/reply/dispatch-from-config.ts +++ b/src/auto-reply/reply/dispatch-from-config.ts @@ -6,9 +6,9 @@ import { touchConversationBindingRecord, } from "../../bindings/records.js"; import { shouldSuppressLocalExecApprovalPrompt } from "../../channels/plugins/exec-approval-local.js"; -import type { OpenClawConfig } from "../../config/config.js"; import { parseSessionThreadInfoFast } from "../../config/sessions/thread-info.js"; import type { SessionEntry } from "../../config/sessions/types.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { logVerbose } from "../../globals.js"; import { fireAndForgetHook } from "../../hooks/fire-and-forget.js"; import { diff --git a/src/auto-reply/reply/followup-delivery.ts b/src/auto-reply/reply/followup-delivery.ts index d387ddcf271..0100335fe99 100644 --- a/src/auto-reply/reply/followup-delivery.ts +++ b/src/auto-reply/reply/followup-delivery.ts @@ -1,5 +1,5 @@ import type { MessagingToolSend } from "../../agents/pi-embedded-runner.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { stripHeartbeatToken } from "../heartbeat.js"; import type { OriginatingChannelType } from "../templating.js"; import type { ReplyPayload } from "../types.js"; diff --git a/src/auto-reply/reply/get-reply-directive-aliases.ts b/src/auto-reply/reply/get-reply-directive-aliases.ts index e403e8682bf..2b00423b4c1 100644 --- a/src/auto-reply/reply/get-reply-directive-aliases.ts +++ b/src/auto-reply/reply/get-reply-directive-aliases.ts @@ -1,5 +1,5 @@ import type { SkillCommandSpec } from "../../agents/skills.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, diff --git a/src/auto-reply/reply/get-reply-directives-apply.ts b/src/auto-reply/reply/get-reply-directives-apply.ts index 568e035abe2..4a7c975166e 100644 --- a/src/auto-reply/reply/get-reply-directives-apply.ts +++ b/src/auto-reply/reply/get-reply-directives-apply.ts @@ -1,5 +1,5 @@ -import type { OpenClawConfig } from "../../config/config.js"; import type { SessionEntry, SessionScope } from "../../config/sessions/types.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { enqueueSystemEvent } from "../../infra/system-events.js"; import type { MsgContext } from "../templating.js"; import type { ElevatedLevel } from "../thinking.js"; diff --git a/src/auto-reply/reply/get-reply-directives.ts b/src/auto-reply/reply/get-reply-directives.ts index 433bf5037b8..80b934778de 100644 --- a/src/auto-reply/reply/get-reply-directives.ts +++ b/src/auto-reply/reply/get-reply-directives.ts @@ -4,8 +4,8 @@ import { resolveFastModeState } from "../../agents/fast-mode.js"; import type { ModelAliasIndex } from "../../agents/model-selection.js"; import { resolveSandboxRuntimeStatus } from "../../agents/sandbox/runtime-status.js"; import type { SkillCommandSpec } from "../../agents/skills.js"; -import type { OpenClawConfig } from "../../config/config.js"; import type { SessionEntry } from "../../config/sessions.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { normalizeAgentId } from "../../routing/session-key.js"; import { normalizeLowercaseStringOrEmpty, diff --git a/src/auto-reply/reply/get-reply-fast-path.ts b/src/auto-reply/reply/get-reply-fast-path.ts index df680e4aca6..24f8615132c 100644 --- a/src/auto-reply/reply/get-reply-fast-path.ts +++ b/src/auto-reply/reply/get-reply-fast-path.ts @@ -2,9 +2,9 @@ import crypto from "node:crypto"; import path from "node:path"; import { normalizeChatType } from "../../channels/chat-type.js"; import { normalizeAnyChannelId } from "../../channels/registry.js"; -import type { OpenClawConfig } from "../../config/config.js"; import { applyMergePatch } from "../../config/merge-patch.js"; import type { SessionEntry } from "../../config/sessions/types.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { normalizeOptionalLowercaseString, normalizeOptionalString, diff --git a/src/auto-reply/reply/get-reply-inline-actions.ts b/src/auto-reply/reply/get-reply-inline-actions.ts index c36c152fbc7..3d9412e302a 100644 --- a/src/auto-reply/reply/get-reply-inline-actions.ts +++ b/src/auto-reply/reply/get-reply-inline-actions.ts @@ -3,8 +3,8 @@ import type { BlockReplyChunking } from "../../agents/pi-embedded-block-chunker. import type { SkillCommandSpec } from "../../agents/skills.js"; import { applyOwnerOnlyToolPolicy } from "../../agents/tool-policy.js"; import { getChannelPlugin } from "../../channels/plugins/index.js"; -import type { OpenClawConfig } from "../../config/config.js"; import type { SessionEntry } from "../../config/sessions.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { logVerbose } from "../../globals.js"; import { formatErrorMessage } from "../../infra/errors.js"; import { generateSecureToken } from "../../infra/secure-random.js"; diff --git a/src/auto-reply/reply/get-reply-run.ts b/src/auto-reply/reply/get-reply-run.ts index ade35b333a7..5a4686fd171 100644 --- a/src/auto-reply/reply/get-reply-run.ts +++ b/src/auto-reply/reply/get-reply-run.ts @@ -4,7 +4,6 @@ import type { ExecToolDefaults } from "../../agents/bash-tools.js"; import { resolveFastModeState } from "../../agents/fast-mode.js"; import { resolveEmbeddedFullAccessState } from "../../agents/pi-embedded-runner/sandbox-info.js"; import type { EmbeddedFullAccessBlockedReason } from "../../agents/pi-embedded-runner/types.js"; -import type { OpenClawConfig } from "../../config/config.js"; import { resolveGroupSessionKey } from "../../config/sessions/group.js"; import { resolveSessionFilePath, @@ -12,6 +11,7 @@ import { } from "../../config/sessions/paths.js"; import { resolveSessionStoreEntry } from "../../config/sessions/store.js"; import type { SessionEntry } from "../../config/sessions/types.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { logVerbose } from "../../globals.js"; import { clearCommandLane, getQueueSize } from "../../process/command-queue.js"; import { normalizeMainKey } from "../../routing/session-key.js"; diff --git a/src/auto-reply/reply/groups.ts b/src/auto-reply/reply/groups.ts index 0b4f082168b..c2e434384b6 100644 --- a/src/auto-reply/reply/groups.ts +++ b/src/auto-reply/reply/groups.ts @@ -1,6 +1,6 @@ -import type { OpenClawConfig } from "../../config/config.js"; import { resolveChannelGroupRequireMention } from "../../config/group-policy.js"; import type { GroupKeyResolution, SessionEntry } from "../../config/sessions.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { normalizeOptionalLowercaseString, normalizeOptionalString, diff --git a/src/auto-reply/reply/memory-flush.ts b/src/auto-reply/reply/memory-flush.ts index 83e04973d3e..76c5714c199 100644 --- a/src/auto-reply/reply/memory-flush.ts +++ b/src/auto-reply/reply/memory-flush.ts @@ -1,8 +1,8 @@ import crypto from "node:crypto"; import { resolveContextTokensForModel } from "../../agents/context.js"; import { DEFAULT_CONTEXT_TOKENS } from "../../agents/defaults.js"; -import type { OpenClawConfig } from "../../config/config.js"; import { resolveFreshSessionTotalTokens, type SessionEntry } from "../../config/sessions.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; export function resolveMemoryFlushContextWindowTokens(params: { modelId?: string; diff --git a/src/auto-reply/reply/mentions.ts b/src/auto-reply/reply/mentions.ts index c1da0c274b6..814e12e811d 100644 --- a/src/auto-reply/reply/mentions.ts +++ b/src/auto-reply/reply/mentions.ts @@ -1,7 +1,7 @@ import { resolveAgentConfig } from "../../agents/agent-scope.js"; import type { ChannelId } from "../../channels/plugins/channel-id.types.js"; import { getChannelPlugin, normalizeChannelId } from "../../channels/plugins/index.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { createSubsystemLogger } from "../../logging/subsystem.js"; import { compileConfigRegexes, type ConfigRegexRejectReason } from "../../security/config-regex.js"; import { diff --git a/src/auto-reply/reply/message-preprocess-hooks.ts b/src/auto-reply/reply/message-preprocess-hooks.ts index fd643a55c54..34a84ddea53 100644 --- a/src/auto-reply/reply/message-preprocess-hooks.ts +++ b/src/auto-reply/reply/message-preprocess-hooks.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { fireAndForgetHook } from "../../hooks/fire-and-forget.js"; import { createInternalHookEvent, triggerInternalHook } from "../../hooks/internal-hooks.js"; import { diff --git a/src/auto-reply/reply/model-selection.ts b/src/auto-reply/reply/model-selection.ts index 4b78329a461..0f38f243154 100644 --- a/src/auto-reply/reply/model-selection.ts +++ b/src/auto-reply/reply/model-selection.ts @@ -15,8 +15,8 @@ import { resolveReasoningDefault, resolveThinkingDefault, } from "../../agents/model-selection.js"; -import type { OpenClawConfig } from "../../config/config.js"; import type { SessionEntry } from "../../config/sessions/types.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { applyModelOverrideToSessionEntry } from "../../sessions/model-overrides.js"; import { normalizeLowercaseStringOrEmpty } from "../../shared/string-coerce.js"; import type { ThinkLevel } from "./directives.js"; diff --git a/src/auto-reply/reply/post-compaction-context.ts b/src/auto-reply/reply/post-compaction-context.ts index 4be225c90fd..9f53216225c 100644 --- a/src/auto-reply/reply/post-compaction-context.ts +++ b/src/auto-reply/reply/post-compaction-context.ts @@ -2,7 +2,7 @@ import fs from "node:fs"; import path from "node:path"; import { resolveCronStyleNow } from "../../agents/current-time.js"; import { resolveUserTimezone } from "../../agents/date-time.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { openBoundaryFile } from "../../infra/boundary-file-read.js"; import { normalizeLowercaseStringOrEmpty } from "../../shared/string-coerce.js"; diff --git a/src/auto-reply/reply/provider-dispatcher.ts b/src/auto-reply/reply/provider-dispatcher.ts index 2819e51f9ff..f92504e1721 100644 --- a/src/auto-reply/reply/provider-dispatcher.ts +++ b/src/auto-reply/reply/provider-dispatcher.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import type { DispatchInboundResult } from "../dispatch.js"; import { dispatchInboundMessageWithBufferedDispatcher, diff --git a/src/auto-reply/reply/queue.test-helpers.ts b/src/auto-reply/reply/queue.test-helpers.ts index 8a24f21a772..0b17cce4499 100644 --- a/src/auto-reply/reply/queue.test-helpers.ts +++ b/src/auto-reply/reply/queue.test-helpers.ts @@ -1,5 +1,5 @@ import { afterAll, beforeAll } from "vitest"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { defaultRuntime } from "../../runtime.js"; import type { FollowupRun } from "./queue.js"; diff --git a/src/auto-reply/reply/queue/types.ts b/src/auto-reply/reply/queue/types.ts index ab28f5e9930..98b43ae916c 100644 --- a/src/auto-reply/reply/queue/types.ts +++ b/src/auto-reply/reply/queue/types.ts @@ -1,7 +1,7 @@ import type { ExecToolDefaults } from "../../../agents/bash-tools.js"; import type { SkillSnapshot } from "../../../agents/skills.js"; -import type { OpenClawConfig } from "../../../config/config.js"; import type { SessionEntry } from "../../../config/sessions.js"; +import type { OpenClawConfig } from "../../../config/types.openclaw.js"; import type { InputProvenance } from "../../../sessions/input-provenance.js"; import type { OriginatingChannelType } from "../../templating.js"; import type { ElevatedLevel, ReasoningLevel, ThinkLevel, VerboseLevel } from "../directives.js"; diff --git a/src/auto-reply/reply/reply-media-paths.ts b/src/auto-reply/reply/reply-media-paths.ts index 3576af67e96..8fc57b9698c 100644 --- a/src/auto-reply/reply/reply-media-paths.ts +++ b/src/auto-reply/reply/reply-media-paths.ts @@ -5,7 +5,7 @@ import { resolvePathFromInput } from "../../agents/path-policy.js"; import { assertMediaNotDataUrl, resolveSandboxedMediaSource } from "../../agents/sandbox-paths.js"; import { ensureSandboxWorkspaceForSession } from "../../agents/sandbox.js"; import { resolveEffectiveToolFsWorkspaceOnly } from "../../agents/tool-fs-policy.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { logVerbose } from "../../globals.js"; import { saveMediaSource } from "../../media/store.js"; import { resolveConfigDir } from "../../utils.js"; diff --git a/src/auto-reply/reply/reply-threading.ts b/src/auto-reply/reply/reply-threading.ts index 78c97d198e8..e894cec1fa5 100644 --- a/src/auto-reply/reply/reply-threading.ts +++ b/src/auto-reply/reply/reply-threading.ts @@ -1,7 +1,7 @@ import type { ChannelThreadingAdapter } from "../../channels/plugins/types.core.js"; import { normalizeAnyChannelId } from "../../channels/registry.js"; -import type { OpenClawConfig } from "../../config/config.js"; import type { ReplyToMode } from "../../config/types.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { normalizeOptionalLowercaseString } from "../../shared/string-coerce.js"; import type { OriginatingChannelType } from "../templating.js"; import type { ReplyPayload, ReplyThreadingPolicy } from "../types.js"; diff --git a/src/auto-reply/reply/route-reply.ts b/src/auto-reply/reply/route-reply.ts index ccdae636dc7..f8c50343d03 100644 --- a/src/auto-reply/reply/route-reply.ts +++ b/src/auto-reply/reply/route-reply.ts @@ -12,7 +12,7 @@ import { resolveEffectiveMessagesConfig } from "../../agents/identity.js"; import { getBundledChannelPlugin } from "../../channels/plugins/bundled.js"; import { getLoadedChannelPlugin, normalizeChannelId } from "../../channels/plugins/index.js"; import { normalizeChatChannelId } from "../../channels/registry.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { formatErrorMessage } from "../../infra/errors.js"; import { buildOutboundSessionContext } from "../../infra/outbound/session-context.js"; import { hasReplyPayloadContent } from "../../interactive/payload.js"; diff --git a/src/auto-reply/reply/session-fork.ts b/src/auto-reply/reply/session-fork.ts index 49d592970ef..fafcd5dc6fe 100644 --- a/src/auto-reply/reply/session-fork.ts +++ b/src/auto-reply/reply/session-fork.ts @@ -1,5 +1,5 @@ -import type { OpenClawConfig } from "../../config/config.js"; import type { SessionEntry } from "../../config/sessions/types.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; /** * Default max parent token count beyond which thread/session parent forking is skipped. diff --git a/src/auto-reply/reply/session-hooks.ts b/src/auto-reply/reply/session-hooks.ts index 312ff36867d..ccefa529a9d 100644 --- a/src/auto-reply/reply/session-hooks.ts +++ b/src/auto-reply/reply/session-hooks.ts @@ -1,5 +1,5 @@ import { resolveSessionAgentId } from "../../agents/agent-scope.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import type { PluginHookSessionEndEvent, PluginHookSessionEndReason, diff --git a/src/auto-reply/reply/session-reset-model.ts b/src/auto-reply/reply/session-reset-model.ts index 580ebb7627a..8151961fb38 100644 --- a/src/auto-reply/reply/session-reset-model.ts +++ b/src/auto-reply/reply/session-reset-model.ts @@ -6,9 +6,9 @@ import { resolveModelRefFromString, type ModelAliasIndex, } from "../../agents/model-selection.js"; -import type { OpenClawConfig } from "../../config/config.js"; import type { SessionEntry } from "../../config/sessions.js"; import { updateSessionStore } from "../../config/sessions.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { applyModelOverrideToSessionEntry } from "../../sessions/model-overrides.js"; import { normalizeOptionalString } from "../../shared/string-coerce.js"; import type { MsgContext, TemplateContext } from "../templating.js"; diff --git a/src/auto-reply/reply/session-reset-prompt.ts b/src/auto-reply/reply/session-reset-prompt.ts index c903e3a688a..d5e5ee224b4 100644 --- a/src/auto-reply/reply/session-reset-prompt.ts +++ b/src/auto-reply/reply/session-reset-prompt.ts @@ -1,5 +1,5 @@ import { appendCronStyleCurrentTimeLine } from "../../agents/current-time.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; const BARE_SESSION_RESET_PROMPT_BASE = "A new session was started via /new or /reset. Run your Session Startup sequence - read the required files before responding to the user. Then greet the user in your configured persona, if one is provided. Be yourself - use your defined voice, mannerisms, and mood. Keep it to 1-3 sentences and ask what they want to do. If the runtime model differs from default_model in the system prompt, mention the default model. Do not mention internal steps, files, tools, or reasoning."; diff --git a/src/auto-reply/reply/session-run-accounting.ts b/src/auto-reply/reply/session-run-accounting.ts index 6e7ba2590c5..78566dd4a36 100644 --- a/src/auto-reply/reply/session-run-accounting.ts +++ b/src/auto-reply/reply/session-run-accounting.ts @@ -1,5 +1,5 @@ import { deriveSessionTotalTokens, type NormalizedUsage } from "../../agents/usage.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { incrementCompactionCount } from "./session-updates.js"; import { persistSessionUsageUpdate } from "./session-usage.js"; diff --git a/src/auto-reply/reply/session-system-events.ts b/src/auto-reply/reply/session-system-events.ts index e5bb9a772b4..132de4f14a9 100644 --- a/src/auto-reply/reply/session-system-events.ts +++ b/src/auto-reply/reply/session-system-events.ts @@ -1,5 +1,5 @@ import { resolveUserTimezone } from "../../agents/date-time.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { buildChannelSummary } from "../../infra/channel-summary.js"; import { formatUtcTimestamp, diff --git a/src/auto-reply/reply/session-updates.ts b/src/auto-reply/reply/session-updates.ts index 0a3d61d65ab..b930a67cccd 100644 --- a/src/auto-reply/reply/session-updates.ts +++ b/src/auto-reply/reply/session-updates.ts @@ -10,13 +10,13 @@ import { getSkillsSnapshotVersion, shouldRefreshSnapshotForVersion, } from "../../agents/skills/refresh.js"; -import type { OpenClawConfig } from "../../config/config.js"; import { resolveSessionFilePath, resolveSessionFilePathOptions, type SessionEntry, updateSessionStore, } from "../../config/sessions.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { resolveStableSessionEndTranscript } from "../../gateway/session-transcript-files.fs.js"; import { logVerbose } from "../../globals.js"; import { getRemoteSkillEligibility } from "../../infra/skills-remote.js"; diff --git a/src/auto-reply/reply/session-usage.ts b/src/auto-reply/reply/session-usage.ts index ddd768b7eb1..0afd394bc22 100644 --- a/src/auto-reply/reply/session-usage.ts +++ b/src/auto-reply/reply/session-usage.ts @@ -4,13 +4,13 @@ import { hasNonzeroUsage, type NormalizedUsage, } from "../../agents/usage.js"; -import type { OpenClawConfig } from "../../config/config.js"; import { loadConfig } from "../../config/config.js"; import { type SessionSystemPromptReport, type SessionEntry, updateSessionStoreEntry, } from "../../config/sessions.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { logVerbose } from "../../globals.js"; import { estimateUsageCost, resolveModelCostConfig } from "../../utils/usage-format.js"; diff --git a/src/auto-reply/reply/session.ts b/src/auto-reply/reply/session.ts index deca24c6e0f..b4f4d78b20d 100644 --- a/src/auto-reply/reply/session.ts +++ b/src/auto-reply/reply/session.ts @@ -5,7 +5,6 @@ import { clearBootstrapSnapshotOnSessionRollover } from "../../agents/bootstrap- import { resetRegisteredAgentHarnessSessions } from "../../agents/harness/registry.js"; import { disposeSessionMcpRuntime } from "../../agents/pi-bundle-mcp-tools.js"; import { normalizeChatType } from "../../channels/chat-type.js"; -import type { OpenClawConfig } from "../../config/config.js"; import { resolveGroupSessionKey } from "../../config/sessions/group.js"; import { canonicalizeMainSessionAlias } from "../../config/sessions/main-session.js"; import { deriveSessionMetaPatch } from "../../config/sessions/metadata.js"; @@ -27,6 +26,7 @@ import { type SessionEntry, type SessionScope, } from "../../config/sessions/types.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import type { TtsAutoMode } from "../../config/types.tts.js"; import { getSessionBindingService } from "../../infra/outbound/session-binding-service.js"; import { deliverSessionMaintenanceWarning } from "../../infra/session-maintenance-warning.js"; diff --git a/src/auto-reply/reply/stage-sandbox-media.ts b/src/auto-reply/reply/stage-sandbox-media.ts index 0325666e3d7..46e4980427f 100644 --- a/src/auto-reply/reply/stage-sandbox-media.ts +++ b/src/auto-reply/reply/stage-sandbox-media.ts @@ -4,7 +4,7 @@ import path from "node:path"; import { fileURLToPath } from "node:url"; import { assertSandboxPath } from "../../agents/sandbox-paths.js"; import { ensureSandboxWorkspaceForSession } from "../../agents/sandbox.js"; -import type { OpenClawConfig } from "../../config/config.js"; +import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { logVerbose } from "../../globals.js"; import { copyFileWithinRoot, SafeOpenError } from "../../infra/fs-safe.js"; import { normalizeScpRemoteHost, normalizeScpRemotePath } from "../../infra/scp-host.js"; diff --git a/src/auto-reply/reply/test-fixtures/acp-runtime.ts b/src/auto-reply/reply/test-fixtures/acp-runtime.ts index 4e4e034a0fa..d4687af7133 100644 --- a/src/auto-reply/reply/test-fixtures/acp-runtime.ts +++ b/src/auto-reply/reply/test-fixtures/acp-runtime.ts @@ -1,5 +1,5 @@ -import type { OpenClawConfig } from "../../../config/config.js"; import type { SessionAcpMeta } from "../../../config/sessions/types.js"; +import type { OpenClawConfig } from "../../../config/types.openclaw.js"; export function createAcpTestConfig(overrides?: Partial): OpenClawConfig { return { diff --git a/src/auto-reply/skill-commands.ts b/src/auto-reply/skill-commands.ts index ce96de1044e..0f302f6af37 100644 --- a/src/auto-reply/skill-commands.ts +++ b/src/auto-reply/skill-commands.ts @@ -6,7 +6,7 @@ import { } from "../agents/agent-scope.js"; import { canExecRequestNode } from "../agents/exec-defaults.js"; import { buildWorkspaceSkillCommandSpecs, type SkillCommandSpec } from "../agents/skills.js"; -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { logVerbose } from "../globals.js"; import { getRemoteSkillEligibility } from "../infra/skills-remote.js"; import { diff --git a/src/auto-reply/stage-sandbox-media.test-harness.ts b/src/auto-reply/stage-sandbox-media.test-harness.ts index fd31bd0f068..f9c36364cb2 100644 --- a/src/auto-reply/stage-sandbox-media.test-harness.ts +++ b/src/auto-reply/stage-sandbox-media.test-harness.ts @@ -1,6 +1,6 @@ import { join } from "node:path"; import { withTempHome as withTempHomeBase } from "../../test/helpers/temp-home.js"; -import type { OpenClawConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import type { MsgContext, TemplateContext } from "./templating.js"; export async function withSandboxMediaTempHome( diff --git a/src/auto-reply/status.ts b/src/auto-reply/status.ts index aa4d5788e66..2518c636dfa 100644 --- a/src/auto-reply/status.ts +++ b/src/auto-reply/status.ts @@ -14,7 +14,6 @@ import { describeToolForVerbose } from "../agents/tool-description-summary.js"; import { normalizeToolName } from "../agents/tool-policy-shared.js"; import type { EffectiveToolInventoryResult } from "../agents/tools-effective-inventory.js"; import { resolveChannelModelOverride } from "../channels/model-overrides.js"; -import type { OpenClawConfig } from "../config/config.js"; import { resolveMainSessionKey, resolveSessionPluginDebugLines, @@ -23,6 +22,7 @@ import { type SessionEntry, type SessionScope, } from "../config/sessions.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { readLatestSessionUsageFromTranscript } from "../gateway/session-utils.fs.js"; import { formatTimeAgo } from "../infra/format-time/format-relative.ts"; import { resolveCommitHash } from "../infra/git-commit.js"; diff --git a/src/canvas-host/a2ui/.bundle.hash b/src/canvas-host/a2ui/.bundle.hash new file mode 100644 index 00000000000..b9f77500071 --- /dev/null +++ b/src/canvas-host/a2ui/.bundle.hash @@ -0,0 +1 @@ +78fcff41deec232e0668483595012918e8b4b760cbe08ee754520920252cb669 diff --git a/src/canvas-host/a2ui/a2ui.bundle.js b/src/canvas-host/a2ui/a2ui.bundle.js new file mode 100644 index 00000000000..84abe173f59 --- /dev/null +++ b/src/canvas-host/a2ui/a2ui.bundle.js @@ -0,0 +1,17183 @@ +var __defProp$1 = Object.defineProperty; +var __exportAll = (all, no_symbols) => { + let target = {}; + for (var name in all) + __defProp$1(target, name, { + get: all[name], + enumerable: true, + }); + if (!no_symbols) __defProp$1(target, Symbol.toStringTag, { value: "Module" }); + return target; +}; +/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const t$6 = globalThis, + e$13 = + t$6.ShadowRoot && + (void 0 === t$6.ShadyCSS || t$6.ShadyCSS.nativeShadow) && + "adoptedStyleSheets" in Document.prototype && + "replace" in CSSStyleSheet.prototype, + s$8 = Symbol(), + o$14 = /* @__PURE__ */ new WeakMap(); +var n$12 = class { + constructor(t, e, o) { + if (((this._$cssResult$ = !0), o !== s$8)) + throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); + ((this.cssText = t), (this.t = e)); + } + get styleSheet() { + let t = this.o; + const s = this.t; + if (e$13 && void 0 === t) { + const e = void 0 !== s && 1 === s.length; + (e && (t = o$14.get(s)), + void 0 === t && + ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), e && o$14.set(s, t))); + } + return t; + } + toString() { + return this.cssText; + } +}; +const r$11 = (t) => new n$12("string" == typeof t ? t : t + "", void 0, s$8), + i$9 = (t, ...e) => { + return new n$12( + 1 === t.length + ? t[0] + : e.reduce( + (e, s, o) => + e + + ((t) => { + if (!0 === t._$cssResult$) return t.cssText; + if ("number" == typeof t) return t; + throw Error( + "Value passed to 'css' function must be a 'css' function result: " + + t + + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.", + ); + })(s) + + t[o + 1], + t[0], + ), + t, + s$8, + ); + }, + S$1 = (s, o) => { + if (e$13) s.adoptedStyleSheets = o.map((t) => (t instanceof CSSStyleSheet ? t : t.styleSheet)); + else + for (const e of o) { + const o = document.createElement("style"), + n = t$6.litNonce; + (void 0 !== n && o.setAttribute("nonce", n), (o.textContent = e.cssText), s.appendChild(o)); + } + }, + c$6 = e$13 + ? (t) => t + : (t) => + t instanceof CSSStyleSheet + ? ((t) => { + let e = ""; + for (const s of t.cssRules) e += s.cssText; + return r$11(e); + })(t) + : t; +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ const { + is: i$8, + defineProperty: e$12, + getOwnPropertyDescriptor: h$6, + getOwnPropertyNames: r$10, + getOwnPropertySymbols: o$13, + getPrototypeOf: n$11, + } = Object, + a$1 = globalThis, + c$5 = a$1.trustedTypes, + l$4 = c$5 ? c$5.emptyScript : "", + p$2 = a$1.reactiveElementPolyfillSupport, + d$2 = (t, s) => t, + u$3 = { + toAttribute(t, s) { + switch (s) { + case Boolean: + t = t ? l$4 : null; + break; + case Object: + case Array: + t = null == t ? t : JSON.stringify(t); + } + return t; + }, + fromAttribute(t, s) { + let i = t; + switch (s) { + case Boolean: + i = null !== t; + break; + case Number: + i = null === t ? null : Number(t); + break; + case Object: + case Array: + try { + i = JSON.parse(t); + } catch (t) { + i = null; + } + } + return i; + }, + }, + f$3 = (t, s) => !i$8(t, s), + b$1 = { + attribute: !0, + type: String, + converter: u$3, + reflect: !1, + useDefault: !1, + hasChanged: f$3, + }; +((Symbol.metadata ??= Symbol("metadata")), + (a$1.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap())); +var y$1 = class extends HTMLElement { + static addInitializer(t) { + (this._$Ei(), (this.l ??= []).push(t)); + } + static get observedAttributes() { + return (this.finalize(), this._$Eh && [...this._$Eh.keys()]); + } + static createProperty(t, s = b$1) { + if ( + (s.state && (s.attribute = !1), + this._$Ei(), + this.prototype.hasOwnProperty(t) && ((s = Object.create(s)).wrapped = !0), + this.elementProperties.set(t, s), + !s.noAccessor) + ) { + const i = Symbol(), + h = this.getPropertyDescriptor(t, i, s); + void 0 !== h && e$12(this.prototype, t, h); + } + } + static getPropertyDescriptor(t, s, i) { + const { get: e, set: r } = h$6(this.prototype, t) ?? { + get() { + return this[s]; + }, + set(t) { + this[s] = t; + }, + }; + return { + get: e, + set(s) { + const h = e?.call(this); + (r?.call(this, s), this.requestUpdate(t, h, i)); + }, + configurable: !0, + enumerable: !0, + }; + } + static getPropertyOptions(t) { + return this.elementProperties.get(t) ?? b$1; + } + static _$Ei() { + if (this.hasOwnProperty(d$2("elementProperties"))) return; + const t = n$11(this); + (t.finalize(), + void 0 !== t.l && (this.l = [...t.l]), + (this.elementProperties = new Map(t.elementProperties))); + } + static finalize() { + if (this.hasOwnProperty(d$2("finalized"))) return; + if (((this.finalized = !0), this._$Ei(), this.hasOwnProperty(d$2("properties")))) { + const t = this.properties, + s = [...r$10(t), ...o$13(t)]; + for (const i of s) this.createProperty(i, t[i]); + } + const t = this[Symbol.metadata]; + if (null !== t) { + const s = litPropertyMetadata.get(t); + if (void 0 !== s) for (const [t, i] of s) this.elementProperties.set(t, i); + } + this._$Eh = /* @__PURE__ */ new Map(); + for (const [t, s] of this.elementProperties) { + const i = this._$Eu(t, s); + void 0 !== i && this._$Eh.set(i, t); + } + this.elementStyles = this.finalizeStyles(this.styles); + } + static finalizeStyles(s) { + const i = []; + if (Array.isArray(s)) { + const e = new Set(s.flat(Infinity).reverse()); + for (const s of e) i.unshift(c$6(s)); + } else void 0 !== s && i.push(c$6(s)); + return i; + } + static _$Eu(t, s) { + const i = s.attribute; + return !1 === i + ? void 0 + : "string" == typeof i + ? i + : "string" == typeof t + ? t.toLowerCase() + : void 0; + } + constructor() { + (super(), + (this._$Ep = void 0), + (this.isUpdatePending = !1), + (this.hasUpdated = !1), + (this._$Em = null), + this._$Ev()); + } + _$Ev() { + ((this._$ES = new Promise((t) => (this.enableUpdating = t))), + (this._$AL = /* @__PURE__ */ new Map()), + this._$E_(), + this.requestUpdate(), + this.constructor.l?.forEach((t) => t(this))); + } + addController(t) { + ((this._$EO ??= /* @__PURE__ */ new Set()).add(t), + void 0 !== this.renderRoot && this.isConnected && t.hostConnected?.()); + } + removeController(t) { + this._$EO?.delete(t); + } + _$E_() { + const t = /* @__PURE__ */ new Map(), + s = this.constructor.elementProperties; + for (const i of s.keys()) this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]); + t.size > 0 && (this._$Ep = t); + } + createRenderRoot() { + const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); + return (S$1(t, this.constructor.elementStyles), t); + } + connectedCallback() { + ((this.renderRoot ??= this.createRenderRoot()), + this.enableUpdating(!0), + this._$EO?.forEach((t) => t.hostConnected?.())); + } + enableUpdating(t) {} + disconnectedCallback() { + this._$EO?.forEach((t) => t.hostDisconnected?.()); + } + attributeChangedCallback(t, s, i) { + this._$AK(t, i); + } + _$ET(t, s) { + const i = this.constructor.elementProperties.get(t), + e = this.constructor._$Eu(t, i); + if (void 0 !== e && !0 === i.reflect) { + const h = (void 0 !== i.converter?.toAttribute ? i.converter : u$3).toAttribute(s, i.type); + ((this._$Em = t), + null == h ? this.removeAttribute(e) : this.setAttribute(e, h), + (this._$Em = null)); + } + } + _$AK(t, s) { + const i = this.constructor, + e = i._$Eh.get(t); + if (void 0 !== e && this._$Em !== e) { + const t = i.getPropertyOptions(e), + h = + "function" == typeof t.converter + ? { fromAttribute: t.converter } + : void 0 !== t.converter?.fromAttribute + ? t.converter + : u$3; + this._$Em = e; + const r = h.fromAttribute(s, t.type); + ((this[e] = r ?? this._$Ej?.get(e) ?? r), (this._$Em = null)); + } + } + requestUpdate(t, s, i, e = !1, h) { + if (void 0 !== t) { + const r = this.constructor; + if ( + (!1 === e && (h = this[t]), + (i ??= r.getPropertyOptions(t)), + !( + (i.hasChanged ?? f$3)(h, s) || + (i.useDefault && i.reflect && h === this._$Ej?.get(t) && !this.hasAttribute(r._$Eu(t, i))) + )) + ) + return; + this.C(t, s, i); + } + !1 === this.isUpdatePending && (this._$ES = this._$EP()); + } + C(t, s, { useDefault: i, reflect: e, wrapped: h }, r) { + (i && + !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && + (this._$Ej.set(t, r ?? s ?? this[t]), !0 !== h || void 0 !== r)) || + (this._$AL.has(t) || (this.hasUpdated || i || (s = void 0), this._$AL.set(t, s)), + !0 === e && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t)); + } + async _$EP() { + this.isUpdatePending = !0; + try { + await this._$ES; + } catch (t) { + Promise.reject(t); + } + const t = this.scheduleUpdate(); + return (null != t && (await t), !this.isUpdatePending); + } + scheduleUpdate() { + return this.performUpdate(); + } + performUpdate() { + if (!this.isUpdatePending) return; + if (!this.hasUpdated) { + if (((this.renderRoot ??= this.createRenderRoot()), this._$Ep)) { + for (const [t, s] of this._$Ep) this[t] = s; + this._$Ep = void 0; + } + const t = this.constructor.elementProperties; + if (t.size > 0) + for (const [s, i] of t) { + const { wrapped: t } = i, + e = this[s]; + !0 !== t || this._$AL.has(s) || void 0 === e || this.C(s, void 0, i, e); + } + } + let t = !1; + const s = this._$AL; + try { + ((t = this.shouldUpdate(s)), + t + ? (this.willUpdate(s), this._$EO?.forEach((t) => t.hostUpdate?.()), this.update(s)) + : this._$EM()); + } catch (s) { + throw ((t = !1), this._$EM(), s); + } + t && this._$AE(s); + } + willUpdate(t) {} + _$AE(t) { + (this._$EO?.forEach((t) => t.hostUpdated?.()), + this.hasUpdated || ((this.hasUpdated = !0), this.firstUpdated(t)), + this.updated(t)); + } + _$EM() { + ((this._$AL = /* @__PURE__ */ new Map()), (this.isUpdatePending = !1)); + } + get updateComplete() { + return this.getUpdateComplete(); + } + getUpdateComplete() { + return this._$ES; + } + shouldUpdate(t) { + return !0; + } + update(t) { + ((this._$Eq &&= this._$Eq.forEach((t) => this._$ET(t, this[t]))), this._$EM()); + } + updated(t) {} + firstUpdated(t) {} +}; +((y$1.elementStyles = []), + (y$1.shadowRootOptions = { mode: "open" }), + (y$1[d$2("elementProperties")] = /* @__PURE__ */ new Map()), + (y$1[d$2("finalized")] = /* @__PURE__ */ new Map()), + p$2?.({ ReactiveElement: y$1 }), + (a$1.reactiveElementVersions ??= []).push("2.1.2")); +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const t$5 = globalThis, + i$7 = (t) => t, + s$7 = t$5.trustedTypes, + e$11 = s$7 ? s$7.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, + h$5 = "$lit$", + o$12 = `lit$${Math.random().toFixed(9).slice(2)}$`, + n$10 = "?" + o$12, + r$9 = `<${n$10}>`, + l$3 = document, + c$4 = () => l$3.createComment(""), + a = (t) => null === t || ("object" != typeof t && "function" != typeof t), + u$2 = Array.isArray, + d$1 = (t) => u$2(t) || "function" == typeof t?.[Symbol.iterator], + f$2 = "[ \n\f\r]", + v$1 = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, + _ = /-->/g, + m$2 = />/g, + p$1 = RegExp(`>|${f$2}(?:([^\\s"'>=/]+)(${f$2}*=${f$2}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`, "g"), + g = /'/g, + $ = /"/g, + y = /^(?:script|style|textarea|title)$/i, + x = + (t) => + (i, ...s) => ({ + _$litType$: t, + strings: i, + values: s, + }), + b = x(1), + w = x(2); +x(3); +const E = Symbol.for("lit-noChange"), + A = Symbol.for("lit-nothing"), + C = /* @__PURE__ */ new WeakMap(), + P = l$3.createTreeWalker(l$3, 129); +function V(t, i) { + if (!u$2(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array"); + return void 0 !== e$11 ? e$11.createHTML(i) : i; +} +const N = (t, i) => { + const s = t.length - 1, + e = []; + let n, + l = 2 === i ? "" : 3 === i ? "" : "", + c = v$1; + for (let i = 0; i < s; i++) { + const s = t[i]; + let a, + u, + d = -1, + f = 0; + for (; f < s.length && ((c.lastIndex = f), (u = c.exec(s)), null !== u); ) + ((f = c.lastIndex), + c === v$1 + ? "!--" === u[1] + ? (c = _) + : void 0 !== u[1] + ? (c = m$2) + : void 0 !== u[2] + ? (y.test(u[2]) && (n = RegExp("" === u[0] + ? ((c = n ?? v$1), (d = -1)) + : void 0 === u[1] + ? (d = -2) + : ((d = c.lastIndex - u[2].length), + (a = u[1]), + (c = void 0 === u[3] ? p$1 : '"' === u[3] ? $ : g)) + : c === $ || c === g + ? (c = p$1) + : c === _ || c === m$2 + ? (c = v$1) + : ((c = p$1), (n = void 0))); + const x = c === p$1 && t[i + 1].startsWith("/>") ? " " : ""; + l += + c === v$1 + ? s + r$9 + : d >= 0 + ? (e.push(a), s.slice(0, d) + h$5 + s.slice(d) + o$12 + x) + : s + o$12 + (-2 === d ? i : x); + } + return [V(t, l + (t[s] || "") + (2 === i ? "" : 3 === i ? "" : "")), e]; +}; +var S = class S { + constructor({ strings: t, _$litType$: i }, e) { + let r; + this.parts = []; + let l = 0, + a = 0; + const u = t.length - 1, + d = this.parts, + [f, v] = N(t, i); + if ( + ((this.el = S.createElement(f, e)), (P.currentNode = this.el.content), 2 === i || 3 === i) + ) { + const t = this.el.content.firstChild; + t.replaceWith(...t.childNodes); + } + for (; null !== (r = P.nextNode()) && d.length < u; ) { + if (1 === r.nodeType) { + if (r.hasAttributes()) + for (const t of r.getAttributeNames()) + if (t.endsWith(h$5)) { + const i = v[a++], + s = r.getAttribute(t).split(o$12), + e = /([.?@])?(.*)/.exec(i); + (d.push({ + type: 1, + index: l, + name: e[2], + strings: s, + ctor: "." === e[1] ? I : "?" === e[1] ? L : "@" === e[1] ? z : H, + }), + r.removeAttribute(t)); + } else + t.startsWith(o$12) && + (d.push({ + type: 6, + index: l, + }), + r.removeAttribute(t)); + if (y.test(r.tagName)) { + const t = r.textContent.split(o$12), + i = t.length - 1; + if (i > 0) { + r.textContent = s$7 ? s$7.emptyScript : ""; + for (let s = 0; s < i; s++) + (r.append(t[s], c$4()), + P.nextNode(), + d.push({ + type: 2, + index: ++l, + })); + r.append(t[i], c$4()); + } + } + } else if (8 === r.nodeType) + if (r.data === n$10) + d.push({ + type: 2, + index: l, + }); + else { + let t = -1; + for (; -1 !== (t = r.data.indexOf(o$12, t + 1)); ) + (d.push({ + type: 7, + index: l, + }), + (t += o$12.length - 1)); + } + l++; + } + } + static createElement(t, i) { + const s = l$3.createElement("template"); + return ((s.innerHTML = t), s); + } +}; +function M$1(t, i, s = t, e) { + if (i === E) return i; + let h = void 0 !== e ? s._$Co?.[e] : s._$Cl; + const o = a(i) ? void 0 : i._$litDirective$; + return ( + h?.constructor !== o && + (h?._$AO?.(!1), + void 0 === o ? (h = void 0) : ((h = new o(t)), h._$AT(t, s, e)), + void 0 !== e ? ((s._$Co ??= [])[e] = h) : (s._$Cl = h)), + void 0 !== h && (i = M$1(t, h._$AS(t, i.values), h, e)), + i + ); +} +var R = class { + constructor(t, i) { + ((this._$AV = []), (this._$AN = void 0), (this._$AD = t), (this._$AM = i)); + } + get parentNode() { + return this._$AM.parentNode; + } + get _$AU() { + return this._$AM._$AU; + } + u(t) { + const { + el: { content: i }, + parts: s, + } = this._$AD, + e = (t?.creationScope ?? l$3).importNode(i, !0); + P.currentNode = e; + let h = P.nextNode(), + o = 0, + n = 0, + r = s[0]; + for (; void 0 !== r; ) { + if (o === r.index) { + let i; + (2 === r.type + ? (i = new k(h, h.nextSibling, this, t)) + : 1 === r.type + ? (i = new r.ctor(h, r.name, r.strings, this, t)) + : 6 === r.type && (i = new Z(h, this, t)), + this._$AV.push(i), + (r = s[++n])); + } + o !== r?.index && ((h = P.nextNode()), o++); + } + return ((P.currentNode = l$3), e); + } + p(t) { + let i = 0; + for (const s of this._$AV) + (void 0 !== s && + (void 0 !== s.strings ? (s._$AI(t, s, i), (i += s.strings.length - 2)) : s._$AI(t[i])), + i++); + } +}; +var k = class k { + get _$AU() { + return this._$AM?._$AU ?? this._$Cv; + } + constructor(t, i, s, e) { + ((this.type = 2), + (this._$AH = A), + (this._$AN = void 0), + (this._$AA = t), + (this._$AB = i), + (this._$AM = s), + (this.options = e), + (this._$Cv = e?.isConnected ?? !0)); + } + get parentNode() { + let t = this._$AA.parentNode; + const i = this._$AM; + return (void 0 !== i && 11 === t?.nodeType && (t = i.parentNode), t); + } + get startNode() { + return this._$AA; + } + get endNode() { + return this._$AB; + } + _$AI(t, i = this) { + ((t = M$1(this, t, i)), + a(t) + ? t === A || null == t || "" === t + ? (this._$AH !== A && this._$AR(), (this._$AH = A)) + : t !== this._$AH && t !== E && this._(t) + : void 0 !== t._$litType$ + ? this.$(t) + : void 0 !== t.nodeType + ? this.T(t) + : d$1(t) + ? this.k(t) + : this._(t)); + } + O(t) { + return this._$AA.parentNode.insertBefore(t, this._$AB); + } + T(t) { + this._$AH !== t && (this._$AR(), (this._$AH = this.O(t))); + } + _(t) { + (this._$AH !== A && a(this._$AH) + ? (this._$AA.nextSibling.data = t) + : this.T(l$3.createTextNode(t)), + (this._$AH = t)); + } + $(t) { + const { values: i, _$litType$: s } = t, + e = + "number" == typeof s + ? this._$AC(t) + : (void 0 === s.el && (s.el = S.createElement(V(s.h, s.h[0]), this.options)), s); + if (this._$AH?._$AD === e) this._$AH.p(i); + else { + const t = new R(e, this), + s = t.u(this.options); + (t.p(i), this.T(s), (this._$AH = t)); + } + } + _$AC(t) { + let i = C.get(t.strings); + return (void 0 === i && C.set(t.strings, (i = new S(t))), i); + } + k(t) { + u$2(this._$AH) || ((this._$AH = []), this._$AR()); + const i = this._$AH; + let s, + e = 0; + for (const h of t) + (e === i.length + ? i.push((s = new k(this.O(c$4()), this.O(c$4()), this, this.options))) + : (s = i[e]), + s._$AI(h), + e++); + e < i.length && (this._$AR(s && s._$AB.nextSibling, e), (i.length = e)); + } + _$AR(t = this._$AA.nextSibling, s) { + for (this._$AP?.(!1, !0, s); t !== this._$AB; ) { + const s = i$7(t).nextSibling; + (i$7(t).remove(), (t = s)); + } + } + setConnected(t) { + void 0 === this._$AM && ((this._$Cv = t), this._$AP?.(t)); + } +}; +var H = class { + get tagName() { + return this.element.tagName; + } + get _$AU() { + return this._$AM._$AU; + } + constructor(t, i, s, e, h) { + ((this.type = 1), + (this._$AH = A), + (this._$AN = void 0), + (this.element = t), + (this.name = i), + (this._$AM = e), + (this.options = h), + s.length > 2 || "" !== s[0] || "" !== s[1] + ? ((this._$AH = Array(s.length - 1).fill(/* @__PURE__ */ new String())), (this.strings = s)) + : (this._$AH = A)); + } + _$AI(t, i = this, s, e) { + const h = this.strings; + let o = !1; + if (void 0 === h) + ((t = M$1(this, t, i, 0)), (o = !a(t) || (t !== this._$AH && t !== E)), o && (this._$AH = t)); + else { + const e = t; + let n, r; + for (t = h[0], n = 0; n < h.length - 1; n++) + ((r = M$1(this, e[s + n], i, n)), + r === E && (r = this._$AH[n]), + (o ||= !a(r) || r !== this._$AH[n]), + r === A ? (t = A) : t !== A && (t += (r ?? "") + h[n + 1]), + (this._$AH[n] = r)); + } + o && !e && this.j(t); + } + j(t) { + t === A + ? this.element.removeAttribute(this.name) + : this.element.setAttribute(this.name, t ?? ""); + } +}; +var I = class extends H { + constructor() { + (super(...arguments), (this.type = 3)); + } + j(t) { + this.element[this.name] = t === A ? void 0 : t; + } +}; +var L = class extends H { + constructor() { + (super(...arguments), (this.type = 4)); + } + j(t) { + this.element.toggleAttribute(this.name, !!t && t !== A); + } +}; +var z = class extends H { + constructor(t, i, s, e, h) { + (super(t, i, s, e, h), (this.type = 5)); + } + _$AI(t, i = this) { + if ((t = M$1(this, t, i, 0) ?? A) === E) return; + const s = this._$AH, + e = + (t === A && s !== A) || + t.capture !== s.capture || + t.once !== s.once || + t.passive !== s.passive, + h = t !== A && (s === A || e); + (e && this.element.removeEventListener(this.name, this, s), + h && this.element.addEventListener(this.name, this, t), + (this._$AH = t)); + } + handleEvent(t) { + "function" == typeof this._$AH + ? this._$AH.call(this.options?.host ?? this.element, t) + : this._$AH.handleEvent(t); + } +}; +var Z = class { + constructor(t, i, s) { + ((this.element = t), + (this.type = 6), + (this._$AN = void 0), + (this._$AM = i), + (this.options = s)); + } + get _$AU() { + return this._$AM._$AU; + } + _$AI(t) { + M$1(this, t); + } +}; +const j$1 = { + M: h$5, + P: o$12, + A: n$10, + C: 1, + L: N, + R, + D: d$1, + V: M$1, + I: k, + H, + N: L, + U: z, + B: I, + F: Z, + }, + B = t$5.litHtmlPolyfillSupport; +(B?.(S, k), (t$5.litHtmlVersions ??= []).push("3.3.2")); +const D = (t, i, s) => { + const e = s?.renderBefore ?? i; + let h = e._$litPart$; + if (void 0 === h) { + const t = s?.renderBefore ?? null; + e._$litPart$ = h = new k(i.insertBefore(c$4(), t), t, void 0, s ?? {}); + } + return (h._$AI(t), h); +}; +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ const s$6 = globalThis; +var i$6 = class extends y$1 { + constructor() { + (super(...arguments), (this.renderOptions = { host: this }), (this._$Do = void 0)); + } + createRenderRoot() { + const t = super.createRenderRoot(); + return ((this.renderOptions.renderBefore ??= t.firstChild), t); + } + update(t) { + const r = this.render(); + (this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), + super.update(t), + (this._$Do = D(r, this.renderRoot, this.renderOptions))); + } + connectedCallback() { + (super.connectedCallback(), this._$Do?.setConnected(!0)); + } + disconnectedCallback() { + (super.disconnectedCallback(), this._$Do?.setConnected(!1)); + } + render() { + return E; + } +}; +((i$6._$litElement$ = !0), + (i$6["finalized"] = !0), + s$6.litElementHydrateSupport?.({ LitElement: i$6 })); +const o$11 = s$6.litElementPolyfillSupport; +o$11?.({ LitElement: i$6 }); +(s$6.litElementVersions ??= []).push("4.2.2"); +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const t$4 = { + ATTRIBUTE: 1, + CHILD: 2, + PROPERTY: 3, + BOOLEAN_ATTRIBUTE: 4, + EVENT: 5, + ELEMENT: 6, + }, + e$10 = + (t) => + (...e) => ({ + _$litDirective$: t, + values: e, + }); +var i$5 = class { + constructor(t) {} + get _$AU() { + return this._$AM._$AU; + } + _$AT(t, e, i) { + ((this._$Ct = t), (this._$AM = e), (this._$Ci = i)); + } + _$AS(t, e) { + return this.update(t, e); + } + update(t, e) { + return this.render(...e); + } +}; +/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ const { I: t$3 } = j$1, + i$4 = (o) => o, + r$8 = (o) => void 0 === o.strings, + s$5 = () => document.createComment(""), + v = (o, n, e) => { + const l = o._$AA.parentNode, + d = void 0 === n ? o._$AB : n._$AA; + if (void 0 === e) e = new t$3(l.insertBefore(s$5(), d), l.insertBefore(s$5(), d), o, o.options); + else { + const t = e._$AB.nextSibling, + n = e._$AM, + c = n !== o; + if (c) { + let t; + (e._$AQ?.(o), (e._$AM = o), void 0 !== e._$AP && (t = o._$AU) !== n._$AU && e._$AP(t)); + } + if (t !== d || c) { + let o = e._$AA; + for (; o !== t; ) { + const t = i$4(o).nextSibling; + (i$4(l).insertBefore(o, d), (o = t)); + } + } + } + return e; + }, + u$1 = (o, t, i = o) => (o._$AI(t, i), o), + m$1 = {}, + p = (o, t = m$1) => (o._$AH = t), + M = (o) => o._$AH, + h$4 = (o) => { + (o._$AR(), o._$AA.remove()); + }; +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const u = (e, s, t) => { + const r = /* @__PURE__ */ new Map(); + for (let l = s; l <= t; l++) r.set(e[l], l); + return r; + }, + c$2 = e$10( + class extends i$5 { + constructor(e) { + if ((super(e), e.type !== t$4.CHILD)) + throw Error("repeat() can only be used in text expressions"); + } + dt(e, s, t) { + let r; + void 0 === t ? (t = s) : void 0 !== s && (r = s); + const l = [], + o = []; + let i = 0; + for (const s of e) ((l[i] = r ? r(s, i) : i), (o[i] = t(s, i)), i++); + return { + values: o, + keys: l, + }; + } + render(e, s, t) { + return this.dt(e, s, t).values; + } + update(s, [t, r, c]) { + const d = M(s), + { values: p$3, keys: a } = this.dt(t, r, c); + if (!Array.isArray(d)) return ((this.ut = a), p$3); + const h = (this.ut ??= []), + v$2 = []; + let m, + y, + x = 0, + j = d.length - 1, + k = 0, + w = p$3.length - 1; + for (; x <= j && k <= w; ) + if (null === d[x]) x++; + else if (null === d[j]) j--; + else if (h[x] === a[k]) ((v$2[k] = u$1(d[x], p$3[k])), x++, k++); + else if (h[j] === a[w]) ((v$2[w] = u$1(d[j], p$3[w])), j--, w--); + else if (h[x] === a[w]) ((v$2[w] = u$1(d[x], p$3[w])), v(s, v$2[w + 1], d[x]), x++, w--); + else if (h[j] === a[k]) ((v$2[k] = u$1(d[j], p$3[k])), v(s, d[x], d[j]), j--, k++); + else if ((void 0 === m && ((m = u(a, k, w)), (y = u(h, x, j))), m.has(h[x]))) + if (m.has(h[j])) { + const e = y.get(a[k]), + t = void 0 !== e ? d[e] : null; + if (null === t) { + const e = v(s, d[x]); + (u$1(e, p$3[k]), (v$2[k] = e)); + } else ((v$2[k] = u$1(t, p$3[k])), v(s, d[x], t), (d[e] = null)); + k++; + } else (h$4(d[j]), j--); + else (h$4(d[x]), x++); + for (; k <= w; ) { + const e = v(s, v$2[w + 1]); + (u$1(e, p$3[k]), (v$2[k++] = e)); + } + for (; x <= j; ) { + const e = d[x++]; + null !== e && h$4(e); + } + return ((this.ut = a), p(s, v$2), E); + } + }, + ); +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +var s$4 = class extends Event { + constructor(s, t, e, o) { + (super("context-request", { + bubbles: !0, + composed: !0, + }), + (this.context = s), + (this.contextTarget = t), + (this.callback = e), + (this.subscribe = o ?? !1)); + } +}; +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +function n$7(n) { + return n; +} +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ var s$3 = class { + constructor(t, s, i, h) { + if ( + ((this.subscribe = !1), + (this.provided = !1), + (this.value = void 0), + (this.t = (t, s) => { + (this.unsubscribe && + (this.unsubscribe !== s && ((this.provided = !1), this.unsubscribe()), + this.subscribe || this.unsubscribe()), + (this.value = t), + this.host.requestUpdate(), + (this.provided && !this.subscribe) || + ((this.provided = !0), this.callback && this.callback(t, s)), + (this.unsubscribe = s)); + }), + (this.host = t), + void 0 !== s.context) + ) { + const t = s; + ((this.context = t.context), + (this.callback = t.callback), + (this.subscribe = t.subscribe ?? !1)); + } else ((this.context = s), (this.callback = i), (this.subscribe = h ?? !1)); + this.host.addController(this); + } + hostConnected() { + this.dispatchRequest(); + } + hostDisconnected() { + this.unsubscribe && (this.unsubscribe(), (this.unsubscribe = void 0)); + } + dispatchRequest() { + this.host.dispatchEvent(new s$4(this.context, this.host, this.t, this.subscribe)); + } +}; +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +var s$2 = class { + get value() { + return this.o; + } + set value(s) { + this.setValue(s); + } + setValue(s, t = !1) { + const i = t || !Object.is(s, this.o); + ((this.o = s), i && this.updateObservers()); + } + constructor(s) { + ((this.subscriptions = /* @__PURE__ */ new Map()), + (this.updateObservers = () => { + for (const [s, { disposer: t }] of this.subscriptions) s(this.o, t); + }), + void 0 !== s && (this.value = s)); + } + addCallback(s, t, i) { + if (!i) return void s(this.value); + this.subscriptions.has(s) || + this.subscriptions.set(s, { + disposer: () => { + this.subscriptions.delete(s); + }, + consumerHost: t, + }); + const { disposer: h } = this.subscriptions.get(s); + s(this.value, h); + } + clearCallbacks() { + this.subscriptions.clear(); + } +}; +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ var e$8 = class extends Event { + constructor(t, s) { + (super("context-provider", { + bubbles: !0, + composed: !0, + }), + (this.context = t), + (this.contextTarget = s)); + } +}; +var i$3 = class extends s$2 { + constructor(s, e, i) { + (super(void 0 !== e.context ? e.initialValue : i), + (this.onContextRequest = (t) => { + if (t.context !== this.context) return; + const s = t.contextTarget ?? t.composedPath()[0]; + s !== this.host && (t.stopPropagation(), this.addCallback(t.callback, s, t.subscribe)); + }), + (this.onProviderRequest = (s) => { + if (s.context !== this.context) return; + if ((s.contextTarget ?? s.composedPath()[0]) === this.host) return; + const e = /* @__PURE__ */ new Set(); + for (const [s, { consumerHost: i }] of this.subscriptions) + e.has(s) || (e.add(s), i.dispatchEvent(new s$4(this.context, i, s, !0))); + s.stopPropagation(); + }), + (this.host = s), + void 0 !== e.context ? (this.context = e.context) : (this.context = e), + this.attachListeners(), + this.host.addController?.(this)); + } + attachListeners() { + (this.host.addEventListener("context-request", this.onContextRequest), + this.host.addEventListener("context-provider", this.onProviderRequest)); + } + hostConnected() { + this.host.dispatchEvent(new e$8(this.context, this.host)); + } +}; +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ function c$1({ context: c, subscribe: e }) { + return (o, n) => { + "object" == typeof n + ? n.addInitializer(function () { + new s$3(this, { + context: c, + callback: (t) => { + o.set.call(this, t); + }, + subscribe: e, + }); + }) + : o.constructor.addInitializer((o) => { + new s$3(o, { + context: c, + callback: (t) => { + o[n] = t; + }, + subscribe: e, + }); + }); + }; +} +const eventInit = { + bubbles: true, + cancelable: true, + composed: true, +}; +var StateEvent = class StateEvent extends CustomEvent { + static { + this.eventName = "a2uiaction"; + } + constructor(payload) { + super(StateEvent.eventName, { + detail: payload, + ...eventInit, + }); + this.payload = payload; + } +}; +const opacityBehavior = ` + &:not([disabled]) { + cursor: pointer; + opacity: var(--opacity, 0); + transition: opacity var(--speed, 0.2s) cubic-bezier(0, 0, 0.3, 1); + + &:hover, + &:focus { + opacity: 1; + } + }`; +const behavior = ` + ${new Array(21) + .fill(0) + .map((_, idx) => { + return `.behavior-ho-${idx * 5} { + --opacity: ${idx / 20}; + ${opacityBehavior} + }`; + }) + .join("\n")} + + .behavior-o-s { + overflow: scroll; + } + + .behavior-o-a { + overflow: auto; + } + + .behavior-o-h { + overflow: hidden; + } + + .behavior-sw-n { + scrollbar-width: none; + } +`; +const border = ` + ${new Array(25) + .fill(0) + .map((_, idx) => { + return ` + .border-bw-${idx} { border-width: ${idx}px; } + .border-btw-${idx} { border-top-width: ${idx}px; } + .border-bbw-${idx} { border-bottom-width: ${idx}px; } + .border-blw-${idx} { border-left-width: ${idx}px; } + .border-brw-${idx} { border-right-width: ${idx}px; } + + .border-ow-${idx} { outline-width: ${idx}px; } + .border-br-${idx} { border-radius: ${idx * 4}px; overflow: hidden;}`; + }) + .join("\n")} + + .border-br-50pc { + border-radius: 50%; + } + + .border-bs-s { + border-style: solid; + } +`; +const shades = [0, 5, 10, 15, 20, 25, 30, 35, 40, 50, 60, 70, 80, 90, 95, 98, 99, 100]; +function merge(...classes) { + const styles = {}; + for (const clazz of classes) + for (const [key, val] of Object.entries(clazz)) { + const prefix = key.split("-").with(-1, "").join("-"); + const existingKeys = Object.keys(styles).filter((key) => key.startsWith(prefix)); + for (const existingKey of existingKeys) delete styles[existingKey]; + styles[key] = val; + } + return styles; +} +function appendToAll(target, exclusions, ...classes) { + const updatedTarget = structuredClone(target); + for (const clazz of classes) + for (const key of Object.keys(clazz)) { + const prefix = key.split("-").with(-1, "").join("-"); + for (const [tagName, classesToAdd] of Object.entries(updatedTarget)) { + if (exclusions.includes(tagName)) continue; + let found = false; + for (let t = 0; t < classesToAdd.length; t++) + if (classesToAdd[t].startsWith(prefix)) { + found = true; + classesToAdd[t] = key; + } + if (!found) classesToAdd.push(key); + } + } + return updatedTarget; +} +function toProp(key) { + if (key.startsWith("nv")) return `--nv-${key.slice(2)}`; + return `--${key[0]}-${key.slice(1)}`; +} +const color = (src) => ` + ${src + .map((key) => { + const inverseKey = getInverseKey(key); + return `.color-bc-${key} { border-color: light-dark(var(${toProp(key)}), var(${toProp(inverseKey)})); }`; + }) + .join("\n")} + + ${src + .map((key) => { + const inverseKey = getInverseKey(key); + const vals = [ + `.color-bgc-${key} { background-color: light-dark(var(${toProp(key)}), var(${toProp(inverseKey)})); }`, + `.color-bbgc-${key}::backdrop { background-color: light-dark(var(${toProp(key)}), var(${toProp(inverseKey)})); }`, + ]; + for (let o = 0.1; o < 1; o += 0.1) + vals.push(`.color-bbgc-${key}_${(o * 100).toFixed(0)}::backdrop { + background-color: light-dark(oklch(from var(${toProp(key)}) l c h / calc(alpha * ${o.toFixed(1)})), oklch(from var(${toProp(inverseKey)}) l c h / calc(alpha * ${o.toFixed(1)})) ); + } + `); + return vals.join("\n"); + }) + .join("\n")} + + ${src + .map((key) => { + const inverseKey = getInverseKey(key); + return `.color-c-${key} { color: light-dark(var(${toProp(key)}), var(${toProp(inverseKey)})); }`; + }) + .join("\n")} + `; +const getInverseKey = (key) => { + const match = key.match(/^([a-z]+)(\d+)$/); + if (!match) return key; + const [, prefix, shadeStr] = match; + const target = 100 - parseInt(shadeStr, 10); + return `${prefix}${shades.reduce((prev, curr) => (Math.abs(curr - target) < Math.abs(prev - target) ? curr : prev))}`; +}; +const keyFactory = (prefix) => { + return shades.map((v) => `${prefix}${v}`); +}; +const structuralStyles$1 = [ + behavior, + border, + [ + color(keyFactory("p")), + color(keyFactory("s")), + color(keyFactory("t")), + color(keyFactory("n")), + color(keyFactory("nv")), + color(keyFactory("e")), + ` + .color-bgc-transparent { + background-color: transparent; + } + + :host { + color-scheme: var(--color-scheme); + } + `, + ], + ` + .g-icon { + font-family: "Material Symbols Outlined", "Google Symbols"; + font-weight: normal; + font-style: normal; + font-display: optional; + font-size: 20px; + width: 1em; + height: 1em; + user-select: none; + line-height: 1; + letter-spacing: normal; + text-transform: none; + display: inline-block; + white-space: nowrap; + word-wrap: normal; + direction: ltr; + -webkit-font-feature-settings: "liga"; + -webkit-font-smoothing: antialiased; + overflow: hidden; + + font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 48, + "ROND" 100; + + &.filled { + font-variation-settings: "FILL" 1, "wght" 300, "GRAD" 0, "opsz" 48, + "ROND" 100; + } + + &.filled-heavy { + font-variation-settings: "FILL" 1, "wght" 700, "GRAD" 0, "opsz" 48, + "ROND" 100; + } + } +`, + ` + :host { + ${new Array(16) + .fill(0) + .map((_, idx) => { + return `--g-${idx + 1}: ${(idx + 1) * 4}px;`; + }) + .join("\n")} + } + + ${new Array(49) + .fill(0) + .map((_, index) => { + const idx = index - 24; + const lbl = idx < 0 ? `n${Math.abs(idx)}` : idx.toString(); + return ` + .layout-p-${lbl} { --padding: ${idx * 4}px; padding: var(--padding); } + .layout-pt-${lbl} { padding-top: ${idx * 4}px; } + .layout-pr-${lbl} { padding-right: ${idx * 4}px; } + .layout-pb-${lbl} { padding-bottom: ${idx * 4}px; } + .layout-pl-${lbl} { padding-left: ${idx * 4}px; } + + .layout-m-${lbl} { --margin: ${idx * 4}px; margin: var(--margin); } + .layout-mt-${lbl} { margin-top: ${idx * 4}px; } + .layout-mr-${lbl} { margin-right: ${idx * 4}px; } + .layout-mb-${lbl} { margin-bottom: ${idx * 4}px; } + .layout-ml-${lbl} { margin-left: ${idx * 4}px; } + + .layout-t-${lbl} { top: ${idx * 4}px; } + .layout-r-${lbl} { right: ${idx * 4}px; } + .layout-b-${lbl} { bottom: ${idx * 4}px; } + .layout-l-${lbl} { left: ${idx * 4}px; }`; + }) + .join("\n")} + + ${new Array(25) + .fill(0) + .map((_, idx) => { + return ` + .layout-g-${idx} { gap: ${idx * 4}px; }`; + }) + .join("\n")} + + ${new Array(8) + .fill(0) + .map((_, idx) => { + return ` + .layout-grd-col${idx + 1} { grid-template-columns: ${"1fr ".repeat(idx + 1).trim()}; }`; + }) + .join("\n")} + + .layout-pos-a { + position: absolute; + } + + .layout-pos-rel { + position: relative; + } + + .layout-dsp-none { + display: none; + } + + .layout-dsp-block { + display: block; + } + + .layout-dsp-grid { + display: grid; + } + + .layout-dsp-iflex { + display: inline-flex; + } + + .layout-dsp-flexvert { + display: flex; + flex-direction: column; + } + + .layout-dsp-flexhor { + display: flex; + flex-direction: row; + } + + .layout-fw-w { + flex-wrap: wrap; + } + + .layout-al-fs { + align-items: start; + } + + .layout-al-fe { + align-items: end; + } + + .layout-al-c { + align-items: center; + } + + .layout-as-n { + align-self: normal; + } + + .layout-js-c { + justify-self: center; + } + + .layout-sp-c { + justify-content: center; + } + + .layout-sp-ev { + justify-content: space-evenly; + } + + .layout-sp-bt { + justify-content: space-between; + } + + .layout-sp-s { + justify-content: start; + } + + .layout-sp-e { + justify-content: end; + } + + .layout-ji-e { + justify-items: end; + } + + .layout-r-none { + resize: none; + } + + .layout-fs-c { + field-sizing: content; + } + + .layout-fs-n { + field-sizing: none; + } + + .layout-flx-0 { + flex: 0 0 auto; + } + + .layout-flx-1 { + flex: 1 0 auto; + } + + .layout-c-s { + contain: strict; + } + + /** Widths **/ + + ${new Array(10) + .fill(0) + .map((_, idx) => { + const weight = (idx + 1) * 10; + return `.layout-w-${weight} { width: ${weight}%; max-width: ${weight}%; }`; + }) + .join("\n")} + + ${new Array(16) + .fill(0) + .map((_, idx) => { + return `.layout-wp-${idx} { width: ${idx * 4}px; }`; + }) + .join("\n")} + + /** Heights **/ + + ${new Array(10) + .fill(0) + .map((_, idx) => { + const height = (idx + 1) * 10; + return `.layout-h-${height} { height: ${height}%; }`; + }) + .join("\n")} + + ${new Array(16) + .fill(0) + .map((_, idx) => { + return `.layout-hp-${idx} { height: ${idx * 4}px; }`; + }) + .join("\n")} + + .layout-el-cv { + & img, + & video { + width: 100%; + height: 100%; + object-fit: cover; + margin: 0; + } + } + + .layout-ar-sq { + aspect-ratio: 1 / 1; + } + + .layout-ex-fb { + margin: calc(var(--padding) * -1) 0 0 calc(var(--padding) * -1); + width: calc(100% + var(--padding) * 2); + height: calc(100% + var(--padding) * 2); + } +`, + ` + ${new Array(21) + .fill(0) + .map((_, idx) => { + return `.opacity-el-${idx * 5} { opacity: ${idx / 20}; }`; + }) + .join("\n")} +`, + ` + :host { + --default-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + --default-font-family-mono: "Courier New", Courier, monospace; + } + + .typography-f-s { + font-family: var(--font-family, var(--default-font-family)); + font-optical-sizing: auto; + font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0; + } + + .typography-f-sf { + font-family: var(--font-family-flex, var(--default-font-family)); + font-optical-sizing: auto; + } + + .typography-f-c { + font-family: var(--font-family-mono, var(--default-font-family)); + font-optical-sizing: auto; + font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0; + } + + .typography-v-r { + font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0, "ROND" 100; + } + + .typography-ta-s { + text-align: start; + } + + .typography-ta-c { + text-align: center; + } + + .typography-fs-n { + font-style: normal; + } + + .typography-fs-i { + font-style: italic; + } + + .typography-sz-ls { + font-size: 11px; + line-height: 16px; + } + + .typography-sz-lm { + font-size: 12px; + line-height: 16px; + } + + .typography-sz-ll { + font-size: 14px; + line-height: 20px; + } + + .typography-sz-bs { + font-size: 12px; + line-height: 16px; + } + + .typography-sz-bm { + font-size: 14px; + line-height: 20px; + } + + .typography-sz-bl { + font-size: 16px; + line-height: 24px; + } + + .typography-sz-ts { + font-size: 14px; + line-height: 20px; + } + + .typography-sz-tm { + font-size: 16px; + line-height: 24px; + } + + .typography-sz-tl { + font-size: 22px; + line-height: 28px; + } + + .typography-sz-hs { + font-size: 24px; + line-height: 32px; + } + + .typography-sz-hm { + font-size: 28px; + line-height: 36px; + } + + .typography-sz-hl { + font-size: 32px; + line-height: 40px; + } + + .typography-sz-ds { + font-size: 36px; + line-height: 44px; + } + + .typography-sz-dm { + font-size: 45px; + line-height: 52px; + } + + .typography-sz-dl { + font-size: 57px; + line-height: 64px; + } + + .typography-ws-p { + white-space: pre-line; + } + + .typography-ws-nw { + white-space: nowrap; + } + + .typography-td-none { + text-decoration: none; + } + + /** Weights **/ + + ${new Array(9) + .fill(0) + .map((_, idx) => { + const weight = (idx + 1) * 100; + return `.typography-w-${weight} { font-weight: ${weight}; }`; + }) + .join("\n")} +`, +] + .flat(Infinity) + .join("\n"); +var guards_exports = /* @__PURE__ */ __exportAll({ + isComponentArrayReference: () => isComponentArrayReference, + isObject: () => isObject$1, + isPath: () => isPath, + isResolvedAudioPlayer: () => isResolvedAudioPlayer, + isResolvedButton: () => isResolvedButton, + isResolvedCard: () => isResolvedCard, + isResolvedCheckbox: () => isResolvedCheckbox, + isResolvedColumn: () => isResolvedColumn, + isResolvedDateTimeInput: () => isResolvedDateTimeInput, + isResolvedDivider: () => isResolvedDivider, + isResolvedIcon: () => isResolvedIcon, + isResolvedImage: () => isResolvedImage, + isResolvedList: () => isResolvedList, + isResolvedModal: () => isResolvedModal, + isResolvedMultipleChoice: () => isResolvedMultipleChoice, + isResolvedRow: () => isResolvedRow, + isResolvedSlider: () => isResolvedSlider, + isResolvedTabs: () => isResolvedTabs, + isResolvedText: () => isResolvedText, + isResolvedTextField: () => isResolvedTextField, + isResolvedVideo: () => isResolvedVideo, + isValueMap: () => isValueMap, +}); +function isValueMap(value) { + return isObject$1(value) && "key" in value; +} +function isPath(key, value) { + return key === "path" && typeof value === "string"; +} +function isObject$1(value) { + return typeof value === "object" && value !== null && !Array.isArray(value); +} +function isComponentArrayReference(value) { + if (!isObject$1(value)) return false; + return "explicitList" in value || "template" in value; +} +function isStringValue(value) { + return ( + isObject$1(value) && + ("path" in value || + ("literal" in value && typeof value.literal === "string") || + "literalString" in value) + ); +} +function isNumberValue(value) { + return ( + isObject$1(value) && + ("path" in value || + ("literal" in value && typeof value.literal === "number") || + "literalNumber" in value) + ); +} +function isBooleanValue(value) { + return ( + isObject$1(value) && + ("path" in value || + ("literal" in value && typeof value.literal === "boolean") || + "literalBoolean" in value) + ); +} +function isAnyComponentNode(value) { + if (!isObject$1(value)) return false; + if (!("id" in value && "type" in value && "properties" in value)) return false; + return true; +} +function isResolvedAudioPlayer(props) { + return isObject$1(props) && "url" in props && isStringValue(props.url); +} +function isResolvedButton(props) { + return ( + isObject$1(props) && "child" in props && isAnyComponentNode(props.child) && "action" in props + ); +} +function isResolvedCard(props) { + if (!isObject$1(props)) return false; + if (!("child" in props)) + if (!("children" in props)) return false; + else return Array.isArray(props.children) && props.children.every(isAnyComponentNode); + return isAnyComponentNode(props.child); +} +function isResolvedCheckbox(props) { + return ( + isObject$1(props) && + "label" in props && + isStringValue(props.label) && + "value" in props && + isBooleanValue(props.value) + ); +} +function isResolvedColumn(props) { + return ( + isObject$1(props) && + "children" in props && + Array.isArray(props.children) && + props.children.every(isAnyComponentNode) + ); +} +function isResolvedDateTimeInput(props) { + return isObject$1(props) && "value" in props && isStringValue(props.value); +} +function isResolvedDivider(props) { + return isObject$1(props); +} +function isResolvedImage(props) { + return isObject$1(props) && "url" in props && isStringValue(props.url); +} +function isResolvedIcon(props) { + return isObject$1(props) && "name" in props && isStringValue(props.name); +} +function isResolvedList(props) { + return ( + isObject$1(props) && + "children" in props && + Array.isArray(props.children) && + props.children.every(isAnyComponentNode) + ); +} +function isResolvedModal(props) { + return ( + isObject$1(props) && + "entryPointChild" in props && + isAnyComponentNode(props.entryPointChild) && + "contentChild" in props && + isAnyComponentNode(props.contentChild) + ); +} +function isResolvedMultipleChoice(props) { + return isObject$1(props) && "selections" in props; +} +function isResolvedRow(props) { + return ( + isObject$1(props) && + "children" in props && + Array.isArray(props.children) && + props.children.every(isAnyComponentNode) + ); +} +function isResolvedSlider(props) { + return isObject$1(props) && "value" in props && isNumberValue(props.value); +} +function isResolvedTabItem(item) { + return ( + isObject$1(item) && + "title" in item && + isStringValue(item.title) && + "child" in item && + isAnyComponentNode(item.child) + ); +} +function isResolvedTabs(props) { + return ( + isObject$1(props) && + "tabItems" in props && + Array.isArray(props.tabItems) && + props.tabItems.every(isResolvedTabItem) + ); +} +function isResolvedText(props) { + return isObject$1(props) && "text" in props && isStringValue(props.text); +} +function isResolvedTextField(props) { + return isObject$1(props) && "label" in props && isStringValue(props.label); +} +function isResolvedVideo(props) { + return isObject$1(props) && "url" in props && isStringValue(props.url); +} +/** + * Processes and consolidates A2UIProtocolMessage objects into a structured, + * hierarchical model of UI surfaces. + */ +var A2uiMessageProcessor = class A2uiMessageProcessor { + static { + this.DEFAULT_SURFACE_ID = "@default"; + } + #mapCtor = Map; + #arrayCtor = Array; + #setCtor = Set; + #objCtor = Object; + #surfaces; + constructor( + opts = { + mapCtor: Map, + arrayCtor: Array, + setCtor: Set, + objCtor: Object, + }, + ) { + this.opts = opts; + this.#arrayCtor = opts.arrayCtor; + this.#mapCtor = opts.mapCtor; + this.#setCtor = opts.setCtor; + this.#objCtor = opts.objCtor; + this.#surfaces = new opts.mapCtor(); + } + getSurfaces() { + return this.#surfaces; + } + clearSurfaces() { + this.#surfaces.clear(); + } + processMessages(messages) { + for (const message of messages) { + if (message.beginRendering) + this.#handleBeginRendering(message.beginRendering, message.beginRendering.surfaceId); + if (message.surfaceUpdate) + this.#handleSurfaceUpdate(message.surfaceUpdate, message.surfaceUpdate.surfaceId); + if (message.dataModelUpdate) + this.#handleDataModelUpdate(message.dataModelUpdate, message.dataModelUpdate.surfaceId); + if (message.deleteSurface) this.#handleDeleteSurface(message.deleteSurface); + } + } + /** + * Retrieves the data for a given component node and a relative path string. + * This correctly handles the special `.` path, which refers to the node's + * own data context. + */ + getData(node, relativePath, surfaceId = A2uiMessageProcessor.DEFAULT_SURFACE_ID) { + const surface = this.#getOrCreateSurface(surfaceId); + if (!surface) return null; + let finalPath; + if (relativePath === "." || relativePath === "") finalPath = node.dataContextPath ?? "/"; + else finalPath = this.resolvePath(relativePath, node.dataContextPath); + return this.#getDataByPath(surface.dataModel, finalPath); + } + setData(node, relativePath, value, surfaceId = A2uiMessageProcessor.DEFAULT_SURFACE_ID) { + if (!node) { + console.warn("No component node set"); + return; + } + const surface = this.#getOrCreateSurface(surfaceId); + if (!surface) return; + let finalPath; + if (relativePath === "." || relativePath === "") finalPath = node.dataContextPath ?? "/"; + else finalPath = this.resolvePath(relativePath, node.dataContextPath); + this.#setDataByPath(surface.dataModel, finalPath, value); + } + resolvePath(path, dataContextPath) { + if (path.startsWith("/")) return path; + if (dataContextPath && dataContextPath !== "/") + return dataContextPath.endsWith("/") + ? `${dataContextPath}${path}` + : `${dataContextPath}/${path}`; + return `/${path}`; + } + #parseIfJsonString(value) { + if (typeof value !== "string") return value; + const trimmedValue = value.trim(); + if ( + (trimmedValue.startsWith("{") && trimmedValue.endsWith("}")) || + (trimmedValue.startsWith("[") && trimmedValue.endsWith("]")) + ) + try { + return JSON.parse(value); + } catch (e) { + console.warn(`Failed to parse potential JSON string: "${value.substring(0, 50)}..."`, e); + return value; + } + return value; + } + /** + * Converts a specific array format [{key: "...", value_string: "..."}, ...] + * into a standard Map. It also attempts to parse any string values that + * appear to be stringified JSON. + */ + #convertKeyValueArrayToMap(arr) { + const map = new this.#mapCtor(); + for (const item of arr) { + if (!isObject$1(item) || !("key" in item)) continue; + const key = item.key; + const valueKey = this.#findValueKey(item); + if (!valueKey) continue; + let value = item[valueKey]; + if (valueKey === "valueMap" && Array.isArray(value)) + value = this.#convertKeyValueArrayToMap(value); + else if (typeof value === "string") value = this.#parseIfJsonString(value); + this.#setDataByPath(map, key, value); + } + return map; + } + #setDataByPath(root, path, value) { + if (Array.isArray(value) && (value.length === 0 || (isObject$1(value[0]) && "key" in value[0]))) + if (value.length === 1 && isObject$1(value[0]) && value[0].key === ".") { + const item = value[0]; + const valueKey = this.#findValueKey(item); + if (valueKey) { + value = item[valueKey]; + if (valueKey === "valueMap" && Array.isArray(value)) + value = this.#convertKeyValueArrayToMap(value); + else if (typeof value === "string") value = this.#parseIfJsonString(value); + } else value = this.#convertKeyValueArrayToMap(value); + } else value = this.#convertKeyValueArrayToMap(value); + const segments = this.#normalizePath(path) + .split("/") + .filter((s) => s); + if (segments.length === 0) { + if (value instanceof Map || isObject$1(value)) { + if (!(value instanceof Map) && isObject$1(value)) + value = new this.#mapCtor(Object.entries(value)); + root.clear(); + for (const [key, v] of value.entries()) root.set(key, v); + } else console.error("Cannot set root of DataModel to a non-Map value."); + return; + } + let current = root; + for (let i = 0; i < segments.length - 1; i++) { + const segment = segments[i]; + let target; + if (current instanceof Map) target = current.get(segment); + else if (Array.isArray(current) && /^\d+$/.test(segment)) + target = current[parseInt(segment, 10)]; + if (target === void 0 || typeof target !== "object" || target === null) { + target = new this.#mapCtor(); + if (current instanceof this.#mapCtor) current.set(segment, target); + else if (Array.isArray(current)) current[parseInt(segment, 10)] = target; + } + current = target; + } + const finalSegment = segments[segments.length - 1]; + const storedValue = value; + if (current instanceof this.#mapCtor) current.set(finalSegment, storedValue); + else if (Array.isArray(current) && /^\d+$/.test(finalSegment)) + current[parseInt(finalSegment, 10)] = storedValue; + } + /** + * Normalizes a path string into a consistent, slash-delimited format. + * Converts bracket notation and dot notation in a two-pass. + * e.g., "bookRecommendations[0].title" -> "/bookRecommendations/0/title" + * e.g., "book.0.title" -> "/book/0/title" + */ + #normalizePath(path) { + return ( + "/" + + path + .replace(/\[(\d+)\]/g, ".$1") + .split(".") + .filter((s) => s.length > 0) + .join("/") + ); + } + #getDataByPath(root, path) { + const segments = this.#normalizePath(path) + .split("/") + .filter((s) => s); + let current = root; + for (const segment of segments) { + if (current === void 0 || current === null) return null; + if (current instanceof Map) current = current.get(segment); + else if (Array.isArray(current) && /^\d+$/.test(segment)) + current = current[parseInt(segment, 10)]; + else if (isObject$1(current)) current = current[segment]; + else return null; + } + return current; + } + #getOrCreateSurface(surfaceId) { + let surface = this.#surfaces.get(surfaceId); + if (!surface) { + surface = new this.#objCtor({ + rootComponentId: null, + componentTree: null, + dataModel: new this.#mapCtor(), + components: new this.#mapCtor(), + styles: new this.#objCtor(), + }); + this.#surfaces.set(surfaceId, surface); + } + return surface; + } + #handleBeginRendering(message, surfaceId) { + const surface = this.#getOrCreateSurface(surfaceId); + surface.rootComponentId = message.root; + surface.styles = message.styles ?? {}; + this.#rebuildComponentTree(surface); + } + #handleSurfaceUpdate(message, surfaceId) { + const surface = this.#getOrCreateSurface(surfaceId); + for (const component of message.components) surface.components.set(component.id, component); + this.#rebuildComponentTree(surface); + } + #handleDataModelUpdate(message, surfaceId) { + const surface = this.#getOrCreateSurface(surfaceId); + const path = message.path ?? "/"; + this.#setDataByPath(surface.dataModel, path, message.contents); + this.#rebuildComponentTree(surface); + } + #handleDeleteSurface(message) { + this.#surfaces.delete(message.surfaceId); + } + /** + * Starts at the root component of the surface and builds out the tree + * recursively. This process involves resolving all properties of the child + * components, and expanding on any explicit children lists or templates + * found in the structure. + * + * @param surface The surface to be built. + */ + #rebuildComponentTree(surface) { + if (!surface.rootComponentId) { + surface.componentTree = null; + return; + } + const visited = new this.#setCtor(); + surface.componentTree = this.#buildNodeRecursive( + surface.rootComponentId, + surface, + visited, + "/", + "", + ); + } + /** Finds a value key in a map. */ + #findValueKey(value) { + return Object.keys(value).find((k) => k.startsWith("value")); + } + /** + * Builds out the nodes recursively. + */ + #buildNodeRecursive(baseComponentId, surface, visited, dataContextPath, idSuffix = "") { + const fullId = `${baseComponentId}${idSuffix}`; + const { components } = surface; + if (!components.has(baseComponentId)) return null; + if (visited.has(fullId)) throw new Error(`Circular dependency for component "${fullId}".`); + visited.add(fullId); + const componentData = components.get(baseComponentId); + const componentProps = componentData.component ?? {}; + const componentType = Object.keys(componentProps)[0]; + const unresolvedProperties = componentProps[componentType]; + const resolvedProperties = new this.#objCtor(); + if (isObject$1(unresolvedProperties)) + for (const [key, value] of Object.entries(unresolvedProperties)) + resolvedProperties[key] = this.#resolvePropertyValue( + value, + surface, + visited, + dataContextPath, + idSuffix, + key, + ); + visited.delete(fullId); + const baseNode = { + id: fullId, + dataContextPath, + weight: componentData.weight ?? "initial", + }; + switch (componentType) { + case "Text": + if (!isResolvedText(resolvedProperties)) + throw new Error(`Invalid data; expected ${componentType}`); + return new this.#objCtor({ + ...baseNode, + type: "Text", + properties: resolvedProperties, + }); + case "Image": + if (!isResolvedImage(resolvedProperties)) + throw new Error(`Invalid data; expected ${componentType}`); + return new this.#objCtor({ + ...baseNode, + type: "Image", + properties: resolvedProperties, + }); + case "Icon": + if (!isResolvedIcon(resolvedProperties)) + throw new Error(`Invalid data; expected ${componentType}`); + return new this.#objCtor({ + ...baseNode, + type: "Icon", + properties: resolvedProperties, + }); + case "Video": + if (!isResolvedVideo(resolvedProperties)) + throw new Error(`Invalid data; expected ${componentType}`); + return new this.#objCtor({ + ...baseNode, + type: "Video", + properties: resolvedProperties, + }); + case "AudioPlayer": + if (!isResolvedAudioPlayer(resolvedProperties)) + throw new Error(`Invalid data; expected ${componentType}`); + return new this.#objCtor({ + ...baseNode, + type: "AudioPlayer", + properties: resolvedProperties, + }); + case "Row": + if (!isResolvedRow(resolvedProperties)) + throw new Error(`Invalid data; expected ${componentType}`); + return new this.#objCtor({ + ...baseNode, + type: "Row", + properties: resolvedProperties, + }); + case "Column": + if (!isResolvedColumn(resolvedProperties)) + throw new Error(`Invalid data; expected ${componentType}`); + return new this.#objCtor({ + ...baseNode, + type: "Column", + properties: resolvedProperties, + }); + case "List": + if (!isResolvedList(resolvedProperties)) + throw new Error(`Invalid data; expected ${componentType}`); + return new this.#objCtor({ + ...baseNode, + type: "List", + properties: resolvedProperties, + }); + case "Card": + if (!isResolvedCard(resolvedProperties)) + throw new Error(`Invalid data; expected ${componentType}`); + return new this.#objCtor({ + ...baseNode, + type: "Card", + properties: resolvedProperties, + }); + case "Tabs": + if (!isResolvedTabs(resolvedProperties)) + throw new Error(`Invalid data; expected ${componentType}`); + return new this.#objCtor({ + ...baseNode, + type: "Tabs", + properties: resolvedProperties, + }); + case "Divider": + if (!isResolvedDivider(resolvedProperties)) + throw new Error(`Invalid data; expected ${componentType}`); + return new this.#objCtor({ + ...baseNode, + type: "Divider", + properties: resolvedProperties, + }); + case "Modal": + if (!isResolvedModal(resolvedProperties)) + throw new Error(`Invalid data; expected ${componentType}`); + return new this.#objCtor({ + ...baseNode, + type: "Modal", + properties: resolvedProperties, + }); + case "Button": + if (!isResolvedButton(resolvedProperties)) + throw new Error(`Invalid data; expected ${componentType}`); + return new this.#objCtor({ + ...baseNode, + type: "Button", + properties: resolvedProperties, + }); + case "CheckBox": + if (!isResolvedCheckbox(resolvedProperties)) + throw new Error(`Invalid data; expected ${componentType}`); + return new this.#objCtor({ + ...baseNode, + type: "CheckBox", + properties: resolvedProperties, + }); + case "TextField": + if (!isResolvedTextField(resolvedProperties)) + throw new Error(`Invalid data; expected ${componentType}`); + return new this.#objCtor({ + ...baseNode, + type: "TextField", + properties: resolvedProperties, + }); + case "DateTimeInput": + if (!isResolvedDateTimeInput(resolvedProperties)) + throw new Error(`Invalid data; expected ${componentType}`); + return new this.#objCtor({ + ...baseNode, + type: "DateTimeInput", + properties: resolvedProperties, + }); + case "MultipleChoice": + if (!isResolvedMultipleChoice(resolvedProperties)) + throw new Error(`Invalid data; expected ${componentType}`); + return new this.#objCtor({ + ...baseNode, + type: "MultipleChoice", + properties: resolvedProperties, + }); + case "Slider": + if (!isResolvedSlider(resolvedProperties)) + throw new Error(`Invalid data; expected ${componentType}`); + return new this.#objCtor({ + ...baseNode, + type: "Slider", + properties: resolvedProperties, + }); + default: + return new this.#objCtor({ + ...baseNode, + type: componentType, + properties: resolvedProperties, + }); + } + } + /** + * Recursively resolves an individual property value. If a property indicates + * a child node (a string that matches a component ID), an explicitList of + * children, or a template, these will be built out here. + */ + #resolvePropertyValue( + value, + surface, + visited, + dataContextPath, + idSuffix = "", + propertyKey = null, + ) { + const isComponentIdReferenceKey = (key) => key === "child" || key.endsWith("Child"); + if ( + typeof value === "string" && + propertyKey && + isComponentIdReferenceKey(propertyKey) && + surface.components.has(value) + ) + return this.#buildNodeRecursive(value, surface, visited, dataContextPath, idSuffix); + if (isComponentArrayReference(value)) { + if (value.explicitList) + return value.explicitList.map((id) => + this.#buildNodeRecursive(id, surface, visited, dataContextPath, idSuffix), + ); + if (value.template) { + const fullDataPath = this.resolvePath(value.template.dataBinding, dataContextPath); + const data = this.#getDataByPath(surface.dataModel, fullDataPath); + const template = value.template; + if (Array.isArray(data)) + return data.map((_, index) => { + const newSuffix = `:${[...dataContextPath.split("/").filter((segment) => /^\d+$/.test(segment)), index].join(":")}`; + const childDataContextPath = `${fullDataPath}/${index}`; + return this.#buildNodeRecursive( + template.componentId, + surface, + visited, + childDataContextPath, + newSuffix, + ); + }); + if (data instanceof this.#mapCtor) + return Array.from(data.keys(), (key) => { + const newSuffix = `:${key}`; + const childDataContextPath = `${fullDataPath}/${key}`; + return this.#buildNodeRecursive( + template.componentId, + surface, + visited, + childDataContextPath, + newSuffix, + ); + }); + return new this.#arrayCtor(); + } + } + if (Array.isArray(value)) + return value.map((item) => + this.#resolvePropertyValue(item, surface, visited, dataContextPath, idSuffix, propertyKey), + ); + if (isObject$1(value)) { + const newObj = new this.#objCtor(); + for (const [key, propValue] of Object.entries(value)) { + let propertyValue = propValue; + if (isPath(key, propValue) && dataContextPath !== "/") { + propertyValue = propValue + .replace(/^\.?\/item/, "") + .replace(/^\.?\/text/, "") + .replace(/^\.?\/label/, "") + .replace(/^\.?\//, ""); + newObj[key] = propertyValue; + continue; + } + newObj[key] = this.#resolvePropertyValue( + propertyValue, + surface, + visited, + dataContextPath, + idSuffix, + key, + ); + } + return newObj; + } + return value; + } +}; +var __defProp = Object.defineProperty; +var __defNormalProp = (obj, key, value) => + key in obj + ? __defProp(obj, key, { + enumerable: true, + configurable: true, + writable: true, + value, + }) + : (obj[key] = value); +var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; +}; +var __accessCheck = (obj, member, msg) => { + if (!member.has(obj)) throw TypeError("Cannot " + msg); +}; +var __privateIn = (member, obj) => { + if (Object(obj) !== obj) throw TypeError('Cannot use the "in" operator on this value'); + return member.has(obj); +}; +var __privateAdd = (obj, member, value) => { + if (member.has(obj)) throw TypeError("Cannot add the same private member more than once"); + member instanceof WeakSet ? member.add(obj) : member.set(obj, value); +}; +var __privateMethod = (obj, member, method) => { + __accessCheck(obj, member, "access private method"); + return method; +}; +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +function defaultEquals(a, b) { + return Object.is(a, b); +} +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +let activeConsumer = null; +let inNotificationPhase = false; +let epoch = 1; +const SIGNAL = /* @__PURE__ */ Symbol("SIGNAL"); +function setActiveConsumer(consumer) { + const prev = activeConsumer; + activeConsumer = consumer; + return prev; +} +function getActiveConsumer() { + return activeConsumer; +} +function isInNotificationPhase() { + return inNotificationPhase; +} +const REACTIVE_NODE = { + version: 0, + lastCleanEpoch: 0, + dirty: false, + producerNode: void 0, + producerLastReadVersion: void 0, + producerIndexOfThis: void 0, + nextProducerIndex: 0, + liveConsumerNode: void 0, + liveConsumerIndexOfThis: void 0, + consumerAllowSignalWrites: false, + consumerIsAlwaysLive: false, + producerMustRecompute: () => false, + producerRecomputeValue: () => {}, + consumerMarkedDirty: () => {}, + consumerOnSignalRead: () => {}, +}; +function producerAccessed(node) { + if (inNotificationPhase) + throw new Error( + typeof ngDevMode !== "undefined" && ngDevMode + ? `Assertion error: signal read during notification phase` + : "", + ); + if (activeConsumer === null) return; + activeConsumer.consumerOnSignalRead(node); + const idx = activeConsumer.nextProducerIndex++; + assertConsumerNode(activeConsumer); + if (idx < activeConsumer.producerNode.length && activeConsumer.producerNode[idx] !== node) { + if (consumerIsLive(activeConsumer)) { + const staleProducer = activeConsumer.producerNode[idx]; + producerRemoveLiveConsumerAtIndex(staleProducer, activeConsumer.producerIndexOfThis[idx]); + } + } + if (activeConsumer.producerNode[idx] !== node) { + activeConsumer.producerNode[idx] = node; + activeConsumer.producerIndexOfThis[idx] = consumerIsLive(activeConsumer) + ? producerAddLiveConsumer(node, activeConsumer, idx) + : 0; + } + activeConsumer.producerLastReadVersion[idx] = node.version; +} +function producerIncrementEpoch() { + epoch++; +} +function producerUpdateValueVersion(node) { + if (!node.dirty && node.lastCleanEpoch === epoch) return; + if (!node.producerMustRecompute(node) && !consumerPollProducersForChange(node)) { + node.dirty = false; + node.lastCleanEpoch = epoch; + return; + } + node.producerRecomputeValue(node); + node.dirty = false; + node.lastCleanEpoch = epoch; +} +function producerNotifyConsumers(node) { + if (node.liveConsumerNode === void 0) return; + const prev = inNotificationPhase; + inNotificationPhase = true; + try { + for (const consumer of node.liveConsumerNode) if (!consumer.dirty) consumerMarkDirty(consumer); + } finally { + inNotificationPhase = prev; + } +} +function producerUpdatesAllowed() { + return (activeConsumer == null ? void 0 : activeConsumer.consumerAllowSignalWrites) !== false; +} +function consumerMarkDirty(node) { + var _a; + node.dirty = true; + producerNotifyConsumers(node); + (_a = node.consumerMarkedDirty) == null || _a.call(node.wrapper ?? node); +} +function consumerBeforeComputation(node) { + node && (node.nextProducerIndex = 0); + return setActiveConsumer(node); +} +function consumerAfterComputation(node, prevConsumer) { + setActiveConsumer(prevConsumer); + if ( + !node || + node.producerNode === void 0 || + node.producerIndexOfThis === void 0 || + node.producerLastReadVersion === void 0 + ) + return; + if (consumerIsLive(node)) + for (let i = node.nextProducerIndex; i < node.producerNode.length; i++) + producerRemoveLiveConsumerAtIndex(node.producerNode[i], node.producerIndexOfThis[i]); + while (node.producerNode.length > node.nextProducerIndex) { + node.producerNode.pop(); + node.producerLastReadVersion.pop(); + node.producerIndexOfThis.pop(); + } +} +function consumerPollProducersForChange(node) { + assertConsumerNode(node); + for (let i = 0; i < node.producerNode.length; i++) { + const producer = node.producerNode[i]; + const seenVersion = node.producerLastReadVersion[i]; + if (seenVersion !== producer.version) return true; + producerUpdateValueVersion(producer); + if (seenVersion !== producer.version) return true; + } + return false; +} +function producerAddLiveConsumer(node, consumer, indexOfThis) { + var _a; + assertProducerNode(node); + assertConsumerNode(node); + if (node.liveConsumerNode.length === 0) { + (_a = node.watched) == null || _a.call(node.wrapper); + for (let i = 0; i < node.producerNode.length; i++) + node.producerIndexOfThis[i] = producerAddLiveConsumer(node.producerNode[i], node, i); + } + node.liveConsumerIndexOfThis.push(indexOfThis); + return node.liveConsumerNode.push(consumer) - 1; +} +function producerRemoveLiveConsumerAtIndex(node, idx) { + var _a; + assertProducerNode(node); + assertConsumerNode(node); + if (typeof ngDevMode !== "undefined" && ngDevMode && idx >= node.liveConsumerNode.length) + throw new Error( + `Assertion error: active consumer index ${idx} is out of bounds of ${node.liveConsumerNode.length} consumers)`, + ); + if (node.liveConsumerNode.length === 1) { + (_a = node.unwatched) == null || _a.call(node.wrapper); + for (let i = 0; i < node.producerNode.length; i++) + producerRemoveLiveConsumerAtIndex(node.producerNode[i], node.producerIndexOfThis[i]); + } + const lastIdx = node.liveConsumerNode.length - 1; + node.liveConsumerNode[idx] = node.liveConsumerNode[lastIdx]; + node.liveConsumerIndexOfThis[idx] = node.liveConsumerIndexOfThis[lastIdx]; + node.liveConsumerNode.length--; + node.liveConsumerIndexOfThis.length--; + if (idx < node.liveConsumerNode.length) { + const idxProducer = node.liveConsumerIndexOfThis[idx]; + const consumer = node.liveConsumerNode[idx]; + assertConsumerNode(consumer); + consumer.producerIndexOfThis[idxProducer] = idx; + } +} +function consumerIsLive(node) { + var _a; + return ( + node.consumerIsAlwaysLive || + (((_a = node == null ? void 0 : node.liveConsumerNode) == null ? void 0 : _a.length) ?? 0) > 0 + ); +} +function assertConsumerNode(node) { + node.producerNode ?? (node.producerNode = []); + node.producerIndexOfThis ?? (node.producerIndexOfThis = []); + node.producerLastReadVersion ?? (node.producerLastReadVersion = []); +} +function assertProducerNode(node) { + node.liveConsumerNode ?? (node.liveConsumerNode = []); + node.liveConsumerIndexOfThis ?? (node.liveConsumerIndexOfThis = []); +} +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +function computedGet(node) { + producerUpdateValueVersion(node); + producerAccessed(node); + if (node.value === ERRORED) throw node.error; + return node.value; +} +function createComputed(computation) { + const node = Object.create(COMPUTED_NODE); + node.computation = computation; + const computed = () => computedGet(node); + computed[SIGNAL] = node; + return computed; +} +const UNSET = /* @__PURE__ */ Symbol("UNSET"); +const COMPUTING = /* @__PURE__ */ Symbol("COMPUTING"); +const ERRORED = /* @__PURE__ */ Symbol("ERRORED"); +const COMPUTED_NODE = { + ...REACTIVE_NODE, + value: UNSET, + dirty: true, + error: null, + equal: defaultEquals, + producerMustRecompute(node) { + return node.value === UNSET || node.value === COMPUTING; + }, + producerRecomputeValue(node) { + if (node.value === COMPUTING) throw new Error("Detected cycle in computations."); + const oldValue = node.value; + node.value = COMPUTING; + const prevConsumer = consumerBeforeComputation(node); + let newValue; + let wasEqual = false; + try { + newValue = node.computation.call(node.wrapper); + wasEqual = + oldValue !== UNSET && + oldValue !== ERRORED && + node.equal.call(node.wrapper, oldValue, newValue); + } catch (err) { + newValue = ERRORED; + node.error = err; + } finally { + consumerAfterComputation(node, prevConsumer); + } + if (wasEqual) { + node.value = oldValue; + return; + } + node.value = newValue; + node.version++; + }, +}; +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +function defaultThrowError() { + throw new Error(); +} +let throwInvalidWriteToSignalErrorFn = defaultThrowError; +function throwInvalidWriteToSignalError() { + throwInvalidWriteToSignalErrorFn(); +} +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +function createSignal(initialValue) { + const node = Object.create(SIGNAL_NODE); + node.value = initialValue; + const getter = () => { + producerAccessed(node); + return node.value; + }; + getter[SIGNAL] = node; + return getter; +} +function signalGetFn() { + producerAccessed(this); + return this.value; +} +function signalSetFn(node, newValue) { + if (!producerUpdatesAllowed()) throwInvalidWriteToSignalError(); + if (!node.equal.call(node.wrapper, node.value, newValue)) { + node.value = newValue; + signalValueChanged(node); + } +} +const SIGNAL_NODE = { + ...REACTIVE_NODE, + equal: defaultEquals, + value: void 0, +}; +function signalValueChanged(node) { + node.version++; + producerIncrementEpoch(); + producerNotifyConsumers(node); +} +/** + * @license + * Copyright 2024 Bloomberg Finance L.P. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const NODE = Symbol("node"); +var Signal; +((Signal2) => { + var _a, _brand, _b, _brand2; + class State { + constructor(initialValue, options = {}) { + __privateAdd(this, _brand); + __publicField(this, _a); + const node = createSignal(initialValue)[SIGNAL]; + this[NODE] = node; + node.wrapper = this; + if (options) { + const equals = options.equals; + if (equals) node.equal = equals; + node.watched = options[Signal2.subtle.watched]; + node.unwatched = options[Signal2.subtle.unwatched]; + } + } + get() { + if (!(0, Signal2.isState)(this)) + throw new TypeError("Wrong receiver type for Signal.State.prototype.get"); + return signalGetFn.call(this[NODE]); + } + set(newValue) { + if (!(0, Signal2.isState)(this)) + throw new TypeError("Wrong receiver type for Signal.State.prototype.set"); + if (isInNotificationPhase()) + throw new Error("Writes to signals not permitted during Watcher callback"); + const ref = this[NODE]; + signalSetFn(ref, newValue); + } + } + _a = NODE; + _brand = /* @__PURE__ */ new WeakSet(); + Signal2.isState = (s) => typeof s === "object" && __privateIn(_brand, s); + Signal2.State = State; + class Computed { + constructor(computation, options) { + __privateAdd(this, _brand2); + __publicField(this, _b); + const node = createComputed(computation)[SIGNAL]; + node.consumerAllowSignalWrites = true; + this[NODE] = node; + node.wrapper = this; + if (options) { + const equals = options.equals; + if (equals) node.equal = equals; + node.watched = options[Signal2.subtle.watched]; + node.unwatched = options[Signal2.subtle.unwatched]; + } + } + get() { + if (!(0, Signal2.isComputed)(this)) + throw new TypeError("Wrong receiver type for Signal.Computed.prototype.get"); + return computedGet(this[NODE]); + } + } + _b = NODE; + _brand2 = /* @__PURE__ */ new WeakSet(); + Signal2.isComputed = (c) => typeof c === "object" && __privateIn(_brand2, c); + Signal2.Computed = Computed; + ((subtle2) => { + var _a2, _brand3, _assertSignals, assertSignals_fn; + function untrack(cb) { + let output; + let prevActiveConsumer = null; + try { + prevActiveConsumer = setActiveConsumer(null); + output = cb(); + } finally { + setActiveConsumer(prevActiveConsumer); + } + return output; + } + subtle2.untrack = untrack; + function introspectSources(sink) { + var _a3; + if (!(0, Signal2.isComputed)(sink) && !(0, Signal2.isWatcher)(sink)) + throw new TypeError("Called introspectSources without a Computed or Watcher argument"); + return ((_a3 = sink[NODE].producerNode) == null ? void 0 : _a3.map((n) => n.wrapper)) ?? []; + } + subtle2.introspectSources = introspectSources; + function introspectSinks(signal) { + var _a3; + if (!(0, Signal2.isComputed)(signal) && !(0, Signal2.isState)(signal)) + throw new TypeError("Called introspectSinks without a Signal argument"); + return ( + ((_a3 = signal[NODE].liveConsumerNode) == null ? void 0 : _a3.map((n) => n.wrapper)) ?? [] + ); + } + subtle2.introspectSinks = introspectSinks; + function hasSinks(signal) { + if (!(0, Signal2.isComputed)(signal) && !(0, Signal2.isState)(signal)) + throw new TypeError("Called hasSinks without a Signal argument"); + const liveConsumerNode = signal[NODE].liveConsumerNode; + if (!liveConsumerNode) return false; + return liveConsumerNode.length > 0; + } + subtle2.hasSinks = hasSinks; + function hasSources(signal) { + if (!(0, Signal2.isComputed)(signal) && !(0, Signal2.isWatcher)(signal)) + throw new TypeError("Called hasSources without a Computed or Watcher argument"); + const producerNode = signal[NODE].producerNode; + if (!producerNode) return false; + return producerNode.length > 0; + } + subtle2.hasSources = hasSources; + class Watcher { + constructor(notify) { + __privateAdd(this, _brand3); + __privateAdd(this, _assertSignals); + __publicField(this, _a2); + let node = Object.create(REACTIVE_NODE); + node.wrapper = this; + node.consumerMarkedDirty = notify; + node.consumerIsAlwaysLive = true; + node.consumerAllowSignalWrites = false; + node.producerNode = []; + this[NODE] = node; + } + watch(...signals) { + if (!(0, Signal2.isWatcher)(this)) + throw new TypeError("Called unwatch without Watcher receiver"); + __privateMethod(this, _assertSignals, assertSignals_fn).call(this, signals); + const node = this[NODE]; + node.dirty = false; + const prev = setActiveConsumer(node); + for (const signal of signals) producerAccessed(signal[NODE]); + setActiveConsumer(prev); + } + unwatch(...signals) { + if (!(0, Signal2.isWatcher)(this)) + throw new TypeError("Called unwatch without Watcher receiver"); + __privateMethod(this, _assertSignals, assertSignals_fn).call(this, signals); + const node = this[NODE]; + assertConsumerNode(node); + for (let i = node.producerNode.length - 1; i >= 0; i--) + if (signals.includes(node.producerNode[i].wrapper)) { + producerRemoveLiveConsumerAtIndex(node.producerNode[i], node.producerIndexOfThis[i]); + const lastIdx = node.producerNode.length - 1; + node.producerNode[i] = node.producerNode[lastIdx]; + node.producerIndexOfThis[i] = node.producerIndexOfThis[lastIdx]; + node.producerNode.length--; + node.producerIndexOfThis.length--; + node.nextProducerIndex--; + if (i < node.producerNode.length) { + const idxConsumer = node.producerIndexOfThis[i]; + const producer = node.producerNode[i]; + assertProducerNode(producer); + producer.liveConsumerIndexOfThis[idxConsumer] = i; + } + } + } + getPending() { + if (!(0, Signal2.isWatcher)(this)) + throw new TypeError("Called getPending without Watcher receiver"); + return this[NODE].producerNode.filter((n) => n.dirty).map((n) => n.wrapper); + } + } + _a2 = NODE; + _brand3 = /* @__PURE__ */ new WeakSet(); + _assertSignals = /* @__PURE__ */ new WeakSet(); + assertSignals_fn = function (signals) { + for (const signal of signals) + if (!(0, Signal2.isComputed)(signal) && !(0, Signal2.isState)(signal)) + throw new TypeError("Called watch/unwatch without a Computed or State argument"); + }; + Signal2.isWatcher = (w) => __privateIn(_brand3, w); + subtle2.Watcher = Watcher; + function currentComputed() { + var _a3; + return (_a3 = getActiveConsumer()) == null ? void 0 : _a3.wrapper; + } + subtle2.currentComputed = currentComputed; + subtle2.watched = Symbol("watched"); + subtle2.unwatched = Symbol("unwatched"); + })(Signal2.subtle || (Signal2.subtle = {})); +})(Signal || (Signal = {})); +/** + * equality check here is always false so that we can dirty the storage + * via setting to _anything_ + * + * + * This is for a pattern where we don't *directly* use signals to back the values used in collections + * so that instanceof checks and getters and other native features "just work" without having + * to do nested proxying. + * + * (though, see deep.ts for nested / deep behavior) + */ +const createStorage = (initial = null) => new Signal.State(initial, { equals: () => false }); +const ARRAY_GETTER_METHODS = new Set([ + Symbol.iterator, + "concat", + "entries", + "every", + "filter", + "find", + "findIndex", + "flat", + "flatMap", + "forEach", + "includes", + "indexOf", + "join", + "keys", + "lastIndexOf", + "map", + "reduce", + "reduceRight", + "slice", + "some", + "values", +]); +const ARRAY_WRITE_THEN_READ_METHODS = new Set(["fill", "push", "unshift"]); +function convertToInt(prop) { + if (typeof prop === "symbol") return null; + const num = Number(prop); + if (isNaN(num)) return null; + return num % 1 === 0 ? num : null; +} +var SignalArray = class SignalArray { + /** + * Creates an array from an iterable object. + * @param iterable An iterable object to convert to an array. + */ + /** + * Creates an array from an iterable object. + * @param iterable An iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + static from(iterable, mapfn, thisArg) { + return mapfn + ? new SignalArray(Array.from(iterable, mapfn, thisArg)) + : new SignalArray(Array.from(iterable)); + } + static of(...arr) { + return new SignalArray(arr); + } + constructor(arr = []) { + let clone = arr.slice(); + let self = this; + let boundFns = /* @__PURE__ */ new Map(); + /** + Flag to track whether we have *just* intercepted a call to `.push()` or + `.unshift()`, since in those cases (and only those cases!) the `Array` + itself checks `.length` to return from the function call. + */ + let nativelyAccessingLengthFromPushOrUnshift = false; + return new Proxy(clone, { + get(target, prop) { + let index = convertToInt(prop); + if (index !== null) { + self.#readStorageFor(index); + self.#collection.get(); + return target[index]; + } + if (prop === "length") { + if (nativelyAccessingLengthFromPushOrUnshift) + nativelyAccessingLengthFromPushOrUnshift = false; + else self.#collection.get(); + return target[prop]; + } + if (ARRAY_WRITE_THEN_READ_METHODS.has(prop)) + nativelyAccessingLengthFromPushOrUnshift = true; + if (ARRAY_GETTER_METHODS.has(prop)) { + let fn = boundFns.get(prop); + if (fn === void 0) { + fn = (...args) => { + self.#collection.get(); + return target[prop](...args); + }; + boundFns.set(prop, fn); + } + return fn; + } + return target[prop]; + }, + set(target, prop, value) { + target[prop] = value; + let index = convertToInt(prop); + if (index !== null) { + self.#dirtyStorageFor(index); + self.#collection.set(null); + } else if (prop === "length") self.#collection.set(null); + return true; + }, + getPrototypeOf() { + return SignalArray.prototype; + }, + }); + } + #collection = createStorage(); + #storages = /* @__PURE__ */ new Map(); + #readStorageFor(index) { + let storage = this.#storages.get(index); + if (storage === void 0) { + storage = createStorage(); + this.#storages.set(index, storage); + } + storage.get(); + } + #dirtyStorageFor(index) { + const storage = this.#storages.get(index); + if (storage) storage.set(null); + } +}; +Object.setPrototypeOf(SignalArray.prototype, Array.prototype); +var SignalMap = class { + collection = createStorage(); + storages = /* @__PURE__ */ new Map(); + vals; + readStorageFor(key) { + const { storages } = this; + let storage = storages.get(key); + if (storage === void 0) { + storage = createStorage(); + storages.set(key, storage); + } + storage.get(); + } + dirtyStorageFor(key) { + const storage = this.storages.get(key); + if (storage) storage.set(null); + } + constructor(existing) { + this.vals = existing ? new Map(existing) : /* @__PURE__ */ new Map(); + } + get(key) { + this.readStorageFor(key); + return this.vals.get(key); + } + has(key) { + this.readStorageFor(key); + return this.vals.has(key); + } + entries() { + this.collection.get(); + return this.vals.entries(); + } + keys() { + this.collection.get(); + return this.vals.keys(); + } + values() { + this.collection.get(); + return this.vals.values(); + } + forEach(fn) { + this.collection.get(); + this.vals.forEach(fn); + } + get size() { + this.collection.get(); + return this.vals.size; + } + [Symbol.iterator]() { + this.collection.get(); + return this.vals[Symbol.iterator](); + } + get [Symbol.toStringTag]() { + return this.vals[Symbol.toStringTag]; + } + set(key, value) { + this.dirtyStorageFor(key); + this.collection.set(null); + this.vals.set(key, value); + return this; + } + delete(key) { + this.dirtyStorageFor(key); + this.collection.set(null); + return this.vals.delete(key); + } + clear() { + this.storages.forEach((s) => s.set(null)); + this.collection.set(null); + this.vals.clear(); + } +}; +Object.setPrototypeOf(SignalMap.prototype, Map.prototype); +/** + * Create a reactive Object, backed by Signals, using a Proxy. + * This allows dynamic creation and deletion of signals using the object primitive + * APIs that most folks are familiar with -- the only difference is instantiation. + * ```js + * const obj = new SignalObject({ foo: 123 }); + * + * obj.foo // 123 + * obj.foo = 456 + * obj.foo // 456 + * obj.bar = 2 + * obj.bar // 2 + * ``` + */ +const SignalObject = class SignalObjectImpl { + static fromEntries(entries) { + return new SignalObjectImpl(Object.fromEntries(entries)); + } + #storages = /* @__PURE__ */ new Map(); + #collection = createStorage(); + constructor(obj = {}) { + let proto = Object.getPrototypeOf(obj); + let descs = Object.getOwnPropertyDescriptors(obj); + let clone = Object.create(proto); + for (let prop in descs) Object.defineProperty(clone, prop, descs[prop]); + let self = this; + return new Proxy(clone, { + get(target, prop, receiver) { + self.#readStorageFor(prop); + return Reflect.get(target, prop, receiver); + }, + has(target, prop) { + self.#readStorageFor(prop); + return prop in target; + }, + ownKeys(target) { + self.#collection.get(); + return Reflect.ownKeys(target); + }, + set(target, prop, value, receiver) { + let result = Reflect.set(target, prop, value, receiver); + self.#dirtyStorageFor(prop); + self.#dirtyCollection(); + return result; + }, + deleteProperty(target, prop) { + if (prop in target) { + delete target[prop]; + self.#dirtyStorageFor(prop); + self.#dirtyCollection(); + } + return true; + }, + getPrototypeOf() { + return SignalObjectImpl.prototype; + }, + }); + } + #readStorageFor(key) { + let storage = this.#storages.get(key); + if (storage === void 0) { + storage = createStorage(); + this.#storages.set(key, storage); + } + storage.get(); + } + #dirtyStorageFor(key) { + const storage = this.#storages.get(key); + if (storage) storage.set(null); + } + #dirtyCollection() { + this.#collection.set(null); + } +}; +var SignalSet = class { + collection = createStorage(); + storages = /* @__PURE__ */ new Map(); + vals; + storageFor(key) { + const storages = this.storages; + let storage = storages.get(key); + if (storage === void 0) { + storage = createStorage(); + storages.set(key, storage); + } + return storage; + } + dirtyStorageFor(key) { + const storage = this.storages.get(key); + if (storage) storage.set(null); + } + constructor(existing) { + this.vals = new Set(existing); + } + has(value) { + this.storageFor(value).get(); + return this.vals.has(value); + } + entries() { + this.collection.get(); + return this.vals.entries(); + } + keys() { + this.collection.get(); + return this.vals.keys(); + } + values() { + this.collection.get(); + return this.vals.values(); + } + forEach(fn) { + this.collection.get(); + this.vals.forEach(fn); + } + get size() { + this.collection.get(); + return this.vals.size; + } + [Symbol.iterator]() { + this.collection.get(); + return this.vals[Symbol.iterator](); + } + get [Symbol.toStringTag]() { + return this.vals[Symbol.toStringTag]; + } + add(value) { + this.dirtyStorageFor(value); + this.collection.set(null); + this.vals.add(value); + return this; + } + delete(value) { + this.dirtyStorageFor(value); + this.collection.set(null); + return this.vals.delete(value); + } + clear() { + this.storages.forEach((s) => s.set(null)); + this.collection.set(null); + this.vals.clear(); + } +}; +Object.setPrototypeOf(SignalSet.prototype, Set.prototype); +function create() { + return new A2uiMessageProcessor({ + arrayCtor: SignalArray, + mapCtor: SignalMap, + objCtor: SignalObject, + setCtor: SignalSet, + }); +} +const Data = { + createSignalA2uiMessageProcessor: create, + A2uiMessageProcessor, + Guards: guards_exports, +}; +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const t$1 = (t) => (e, o) => { + void 0 !== o + ? o.addInitializer(() => { + customElements.define(t, e); + }) + : customElements.define(t, e); +}; +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ const o$9 = { + attribute: !0, + type: String, + converter: u$3, + reflect: !1, + hasChanged: f$3, + }, + r$7 = (t = o$9, e, r) => { + const { kind: n, metadata: i } = r; + let s = globalThis.litPropertyMetadata.get(i); + if ( + (void 0 === s && globalThis.litPropertyMetadata.set(i, (s = /* @__PURE__ */ new Map())), + "setter" === n && ((t = Object.create(t)).wrapped = !0), + s.set(r.name, t), + "accessor" === n) + ) { + const { name: o } = r; + return { + set(r) { + const n = e.get.call(this); + (e.set.call(this, r), this.requestUpdate(o, n, t, !0, r)); + }, + init(e) { + return (void 0 !== e && this.C(o, void 0, t, e), e); + }, + }; + } + if ("setter" === n) { + const { name: o } = r; + return function (r) { + const n = this[o]; + (e.call(this, r), this.requestUpdate(o, n, t, !0, r)); + }; + } + throw Error("Unsupported decorator location: " + n); + }; +function n$6(t) { + return (e, o) => + "object" == typeof o + ? r$7(t, e, o) + : ((t, e, o) => { + const r = e.hasOwnProperty(o); + return ( + e.constructor.createProperty(o, t), r ? Object.getOwnPropertyDescriptor(e, o) : void 0 + ); + })(t, e, o); +} +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ function r$6(r) { + return n$6({ + ...r, + state: !0, + attribute: !1, + }); +} +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const e$6 = (e, t, c) => ( + (c.configurable = !0), + (c.enumerable = !0), + Reflect.decorate && "object" != typeof t && Object.defineProperty(e, t, c), + c +); +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ function e$5(e, r) { + return (n, s, i) => { + const o = (t) => t.renderRoot?.querySelector(e) ?? null; + if (r) { + const { get: e, set: r } = + "object" == typeof s + ? n + : (i ?? + (() => { + const t = Symbol(); + return { + get() { + return this[t]; + }, + set(e) { + this[t] = e; + }, + }; + })()); + return e$6(n, s, { + get() { + let t = e.call(this); + return ( + void 0 === t && ((t = o(this)), (null !== t || this.hasUpdated) && r.call(this, t)), t + ); + }, + }); + } + return e$6(n, s, { + get() { + return o(this); + }, + }); + }; +} +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ let i$2 = !1; +const s$1 = new Signal.subtle.Watcher(() => { + i$2 || + ((i$2 = !0), + queueMicrotask(() => { + i$2 = !1; + for (const t of s$1.getPending()) t.get(); + s$1.watch(); + })); + }), + h$3 = Symbol("SignalWatcherBrand"), + e$3 = new FinalizationRegistry((i) => { + i.unwatch(...Signal.subtle.introspectSources(i)); + }), + n$4 = /* @__PURE__ */ new WeakMap(); +function o$7(i) { + return !0 === i[h$3] + ? (console.warn("SignalWatcher should not be applied to the same class more than once."), i) + : class extends i { + constructor() { + (super(...arguments), + (this._$St = /* @__PURE__ */ new Map()), + (this._$So = new Signal.State(0)), + (this._$Si = !1)); + } + _$Sl() { + var t, i; + const s = [], + h = []; + this._$St.forEach((t, i) => { + ((null == t ? void 0 : t.beforeUpdate) ? s : h).push(i); + }); + const e = + null === (t = this.h) || void 0 === t + ? void 0 + : t.getPending().filter((t) => t !== this._$Su && !this._$St.has(t)); + (s.forEach((t) => t.get()), + null === (i = this._$Su) || void 0 === i || i.get(), + e.forEach((t) => t.get()), + h.forEach((t) => t.get())); + } + _$Sv() { + this.isUpdatePending || + queueMicrotask(() => { + this.isUpdatePending || this._$Sl(); + }); + } + _$S_() { + if (void 0 !== this.h) return; + this._$Su = new Signal.Computed(() => { + (this._$So.get(), super.performUpdate()); + }); + const i = (this.h = new Signal.subtle.Watcher(function () { + const t = n$4.get(this); + void 0 !== t && + (!1 === t._$Si && + (new Set(this.getPending()).has(t._$Su) ? t.requestUpdate() : t._$Sv()), + this.watch()); + })); + (n$4.set(i, this), + e$3.register(this, i), + i.watch(this._$Su), + i.watch(...Array.from(this._$St).map(([t]) => t))); + } + _$Sp() { + if (void 0 === this.h) return; + let i = !1; + (this.h.unwatch( + ...Signal.subtle.introspectSources(this.h).filter((t) => { + var s; + const h = + !0 !== (null === (s = this._$St.get(t)) || void 0 === s ? void 0 : s.manualDispose); + return (h && this._$St.delete(t), i || (i = !h), h); + }), + ), + i || ((this._$Su = void 0), (this.h = void 0), this._$St.clear())); + } + updateEffect(i, s) { + var h; + this._$S_(); + const e = new Signal.Computed(() => { + i(); + }); + return ( + this.h.watch(e), + this._$St.set(e, s), + null !== (h = null == s ? void 0 : s.beforeUpdate) && void 0 !== h && h + ? Signal.subtle.untrack(() => e.get()) + : this.updateComplete.then(() => Signal.subtle.untrack(() => e.get())), + () => { + (this._$St.delete(e), this.h.unwatch(e), !1 === this.isConnected && this._$Sp()); + } + ); + } + performUpdate() { + this.isUpdatePending && + (this._$S_(), + (this._$Si = !0), + this._$So.set(this._$So.get() + 1), + (this._$Si = !1), + this._$Sl()); + } + connectedCallback() { + (super.connectedCallback(), this.requestUpdate()); + } + disconnectedCallback() { + (super.disconnectedCallback(), + queueMicrotask(() => { + !1 === this.isConnected && this._$Sp(); + })); + } + }; +} +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ const s = (i, t) => { + const e = i._$AN; + if (void 0 === e) return !1; + for (const i of e) (i._$AO?.(t, !1), s(i, t)); + return !0; + }, + o$6 = (i) => { + let t, e; + do { + if (void 0 === (t = i._$AM)) break; + ((e = t._$AN), e.delete(i), (i = t)); + } while (0 === e?.size); + }, + r$3 = (i) => { + for (let t; (t = i._$AM); i = t) { + let e = t._$AN; + if (void 0 === e) t._$AN = e = /* @__PURE__ */ new Set(); + else if (e.has(i)) break; + (e.add(i), c(t)); + } + }; +function h$2(i) { + void 0 !== this._$AN ? (o$6(this), (this._$AM = i), r$3(this)) : (this._$AM = i); +} +function n$3(i, t = !1, e = 0) { + const r = this._$AH, + h = this._$AN; + if (void 0 !== h && 0 !== h.size) + if (t) + if (Array.isArray(r)) for (let i = e; i < r.length; i++) (s(r[i], !1), o$6(r[i])); + else null != r && (s(r, !1), o$6(r)); + else s(this, i); +} +const c = (i) => { + i.type == t$4.CHILD && ((i._$AP ??= n$3), (i._$AQ ??= h$2)); +}; +var f = class extends i$5 { + constructor() { + (super(...arguments), (this._$AN = void 0)); + } + _$AT(i, t, e) { + (super._$AT(i, t, e), r$3(this), (this.isConnected = i._$AU)); + } + _$AO(i, t = !0) { + (i !== this.isConnected && + ((this.isConnected = i), i ? this.reconnected?.() : this.disconnected?.()), + t && (s(this, i), o$6(this))); + } + setValue(t) { + if (r$8(this._$Ct)) this._$Ct._$AI(t, this); + else { + const i = [...this._$Ct._$AH]; + ((i[this._$Ci] = t), this._$Ct._$AI(i, this, 0)); + } + } + disconnected() {} + reconnected() {} +}; +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +let o$5 = !1; +const n$2 = new Signal.subtle.Watcher(async () => { + o$5 || + ((o$5 = !0), + queueMicrotask(() => { + o$5 = !1; + for (const i of n$2.getPending()) i.get(); + n$2.watch(); + })); +}); +var r$2 = class extends f { + _$S_() { + var i, t; + void 0 === this._$Sm && + ((this._$Sj = new Signal.Computed(() => { + var i; + const t = null === (i = this._$SW) || void 0 === i ? void 0 : i.get(); + return (this.setValue(t), t); + })), + (this._$Sm = + null !== (t = null === (i = this._$Sk) || void 0 === i ? void 0 : i.h) && void 0 !== t + ? t + : n$2), + this._$Sm.watch(this._$Sj), + Signal.subtle.untrack(() => { + var i; + return null === (i = this._$Sj) || void 0 === i ? void 0 : i.get(); + })); + } + _$Sp() { + void 0 !== this._$Sm && (this._$Sm.unwatch(this._$SW), (this._$Sm = void 0)); + } + render(i) { + return Signal.subtle.untrack(() => i.get()); + } + update(i, [t]) { + var o, n; + return ( + (null !== (o = this._$Sk) && void 0 !== o) || + (this._$Sk = null === (n = i.options) || void 0 === n ? void 0 : n.host), + t !== this._$SW && void 0 !== this._$SW && this._$Sp(), + (this._$SW = t), + this._$S_(), + Signal.subtle.untrack(() => this._$SW.get()) + ); + } + disconnected() { + this._$Sp(); + } + reconnected() { + this._$S_(); + } +}; +const h$1 = e$10(r$2), + m = + (o) => + (t, ...m) => + o( + t, + ...m.map((o) => (o instanceof Signal.State || o instanceof Signal.Computed ? h$1(o) : o)), + ); +m(b); +m(w); +Signal.State; +Signal.Computed; +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +function* o$3(o, f) { + if (void 0 !== o) { + let i = 0; + for (const t of o) yield f(t, i++); + } +} +let pending = false; +let watcher = new Signal.subtle.Watcher(() => { + if (!pending) { + pending = true; + queueMicrotask(() => { + pending = false; + flushPending(); + }); + } +}); +function flushPending() { + for (const signal of watcher.getPending()) signal.get(); + watcher.watch(); +} +/** + * ⚠️ WARNING: Nothing unwatches ⚠️ + * This will produce a memory leak. + */ +function effect(cb) { + let c = new Signal.Computed(() => cb()); + watcher.watch(c); + c.get(); + return () => { + watcher.unwatch(c); + }; +} +const themeContext = n$7("A2UITheme"); +const structuralStyles = r$11(structuralStyles$1); +var ComponentRegistry = class { + constructor() { + this.registry = /* @__PURE__ */ new Map(); + } + register(typeName, constructor, tagName) { + if (!/^[a-zA-Z0-9]+$/.test(typeName)) + throw new Error(`[Registry] Invalid typeName '${typeName}'. Must be alphanumeric.`); + this.registry.set(typeName, constructor); + const actualTagName = tagName || `a2ui-custom-${typeName.toLowerCase()}`; + const existingName = customElements.getName(constructor); + if (existingName) { + if (existingName !== actualTagName) + throw new Error( + `Component ${typeName} is already registered as ${existingName}, but requested as ${actualTagName}.`, + ); + return; + } + if (!customElements.get(actualTagName)) customElements.define(actualTagName, constructor); + } + get(typeName) { + return this.registry.get(typeName); + } +}; +const componentRegistry = new ComponentRegistry(); +var __runInitializers$19 = function (thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + return useValue ? value : void 0; +}; +var __esDecorate$19 = function ( + ctor, + descriptorIn, + decorators, + contextIn, + initializers, + extraInitializers, +) { + function accept(f) { + if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); + return f; + } + var kind = contextIn.kind, + key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? (contextIn["static"] ? ctor : ctor.prototype) : null; + var descriptor = + descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, + done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function (f) { + if (done) throw new TypeError("Cannot add initializers after decoration has completed"); + extraInitializers.push(accept(f || null)); + }; + var result = (0, decorators[i])( + kind === "accessor" + ? { + get: descriptor.get, + set: descriptor.set, + } + : descriptor[key], + context, + ); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if ((_ = accept(result.get))) descriptor.get = _; + if ((_ = accept(result.set))) descriptor.set = _; + if ((_ = accept(result.init))) initializers.unshift(_); + } else if ((_ = accept(result))) + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; +}; +let Root = (() => { + let _classDecorators = [t$1("a2ui-root")]; + let _classDescriptor; + let _classExtraInitializers = []; + let _classThis; + let _classSuper = o$7(i$6); + let _instanceExtraInitializers = []; + let _surfaceId_decorators; + let _surfaceId_initializers = []; + let _surfaceId_extraInitializers = []; + let _component_decorators; + let _component_initializers = []; + let _component_extraInitializers = []; + let _theme_decorators; + let _theme_initializers = []; + let _theme_extraInitializers = []; + let _childComponents_decorators; + let _childComponents_initializers = []; + let _childComponents_extraInitializers = []; + let _processor_decorators; + let _processor_initializers = []; + let _processor_extraInitializers = []; + let _dataContextPath_decorators; + let _dataContextPath_initializers = []; + let _dataContextPath_extraInitializers = []; + let _enableCustomElements_decorators; + let _enableCustomElements_initializers = []; + let _enableCustomElements_extraInitializers = []; + let _set_weight_decorators; + var Root = class extends _classSuper { + static { + _classThis = this; + } + static { + const _metadata = + typeof Symbol === "function" && Symbol.metadata + ? Object.create(_classSuper[Symbol.metadata] ?? null) + : void 0; + _surfaceId_decorators = [n$6()]; + _component_decorators = [n$6()]; + _theme_decorators = [c$1({ context: themeContext })]; + _childComponents_decorators = [n$6({ attribute: false })]; + _processor_decorators = [n$6({ attribute: false })]; + _dataContextPath_decorators = [n$6()]; + _enableCustomElements_decorators = [n$6()]; + _set_weight_decorators = [n$6()]; + __esDecorate$19( + this, + null, + _surfaceId_decorators, + { + kind: "accessor", + name: "surfaceId", + static: false, + private: false, + access: { + has: (obj) => "surfaceId" in obj, + get: (obj) => obj.surfaceId, + set: (obj, value) => { + obj.surfaceId = value; + }, + }, + metadata: _metadata, + }, + _surfaceId_initializers, + _surfaceId_extraInitializers, + ); + __esDecorate$19( + this, + null, + _component_decorators, + { + kind: "accessor", + name: "component", + static: false, + private: false, + access: { + has: (obj) => "component" in obj, + get: (obj) => obj.component, + set: (obj, value) => { + obj.component = value; + }, + }, + metadata: _metadata, + }, + _component_initializers, + _component_extraInitializers, + ); + __esDecorate$19( + this, + null, + _theme_decorators, + { + kind: "accessor", + name: "theme", + static: false, + private: false, + access: { + has: (obj) => "theme" in obj, + get: (obj) => obj.theme, + set: (obj, value) => { + obj.theme = value; + }, + }, + metadata: _metadata, + }, + _theme_initializers, + _theme_extraInitializers, + ); + __esDecorate$19( + this, + null, + _childComponents_decorators, + { + kind: "accessor", + name: "childComponents", + static: false, + private: false, + access: { + has: (obj) => "childComponents" in obj, + get: (obj) => obj.childComponents, + set: (obj, value) => { + obj.childComponents = value; + }, + }, + metadata: _metadata, + }, + _childComponents_initializers, + _childComponents_extraInitializers, + ); + __esDecorate$19( + this, + null, + _processor_decorators, + { + kind: "accessor", + name: "processor", + static: false, + private: false, + access: { + has: (obj) => "processor" in obj, + get: (obj) => obj.processor, + set: (obj, value) => { + obj.processor = value; + }, + }, + metadata: _metadata, + }, + _processor_initializers, + _processor_extraInitializers, + ); + __esDecorate$19( + this, + null, + _dataContextPath_decorators, + { + kind: "accessor", + name: "dataContextPath", + static: false, + private: false, + access: { + has: (obj) => "dataContextPath" in obj, + get: (obj) => obj.dataContextPath, + set: (obj, value) => { + obj.dataContextPath = value; + }, + }, + metadata: _metadata, + }, + _dataContextPath_initializers, + _dataContextPath_extraInitializers, + ); + __esDecorate$19( + this, + null, + _enableCustomElements_decorators, + { + kind: "accessor", + name: "enableCustomElements", + static: false, + private: false, + access: { + has: (obj) => "enableCustomElements" in obj, + get: (obj) => obj.enableCustomElements, + set: (obj, value) => { + obj.enableCustomElements = value; + }, + }, + metadata: _metadata, + }, + _enableCustomElements_initializers, + _enableCustomElements_extraInitializers, + ); + __esDecorate$19( + this, + null, + _set_weight_decorators, + { + kind: "setter", + name: "weight", + static: false, + private: false, + access: { + has: (obj) => "weight" in obj, + set: (obj, value) => { + obj.weight = value; + }, + }, + metadata: _metadata, + }, + null, + _instanceExtraInitializers, + ); + __esDecorate$19( + null, + (_classDescriptor = { value: _classThis }), + _classDecorators, + { + kind: "class", + name: _classThis.name, + metadata: _metadata, + }, + null, + _classExtraInitializers, + ); + Root = _classThis = _classDescriptor.value; + if (_metadata) + Object.defineProperty(_classThis, Symbol.metadata, { + enumerable: true, + configurable: true, + writable: true, + value: _metadata, + }); + } + #surfaceId_accessor_storage = + (__runInitializers$19(this, _instanceExtraInitializers), + __runInitializers$19(this, _surfaceId_initializers, null)); + get surfaceId() { + return this.#surfaceId_accessor_storage; + } + set surfaceId(value) { + this.#surfaceId_accessor_storage = value; + } + #component_accessor_storage = + (__runInitializers$19(this, _surfaceId_extraInitializers), + __runInitializers$19(this, _component_initializers, null)); + get component() { + return this.#component_accessor_storage; + } + set component(value) { + this.#component_accessor_storage = value; + } + #theme_accessor_storage = + (__runInitializers$19(this, _component_extraInitializers), + __runInitializers$19(this, _theme_initializers, void 0)); + get theme() { + return this.#theme_accessor_storage; + } + set theme(value) { + this.#theme_accessor_storage = value; + } + #childComponents_accessor_storage = + (__runInitializers$19(this, _theme_extraInitializers), + __runInitializers$19(this, _childComponents_initializers, null)); + get childComponents() { + return this.#childComponents_accessor_storage; + } + set childComponents(value) { + this.#childComponents_accessor_storage = value; + } + #processor_accessor_storage = + (__runInitializers$19(this, _childComponents_extraInitializers), + __runInitializers$19(this, _processor_initializers, null)); + get processor() { + return this.#processor_accessor_storage; + } + set processor(value) { + this.#processor_accessor_storage = value; + } + #dataContextPath_accessor_storage = + (__runInitializers$19(this, _processor_extraInitializers), + __runInitializers$19(this, _dataContextPath_initializers, "")); + get dataContextPath() { + return this.#dataContextPath_accessor_storage; + } + set dataContextPath(value) { + this.#dataContextPath_accessor_storage = value; + } + #enableCustomElements_accessor_storage = + (__runInitializers$19(this, _dataContextPath_extraInitializers), + __runInitializers$19(this, _enableCustomElements_initializers, false)); + get enableCustomElements() { + return this.#enableCustomElements_accessor_storage; + } + set enableCustomElements(value) { + this.#enableCustomElements_accessor_storage = value; + } + set weight(weight) { + this.#weight = weight; + this.style.setProperty("--weight", `${weight}`); + } + get weight() { + return this.#weight; + } + #weight = (__runInitializers$19(this, _enableCustomElements_extraInitializers), 1); + static { + this.styles = [ + structuralStyles, + i$9` + :host { + display: flex; + flex-direction: column; + gap: 8px; + max-height: 80%; + } + `, + ]; + } + /** + * Holds the cleanup function for our effect. + * We need this to stop the effect when the component is disconnected. + */ + #lightDomEffectDisposer = null; + willUpdate(changedProperties) { + if (changedProperties.has("childComponents")) { + if (this.#lightDomEffectDisposer) this.#lightDomEffectDisposer(); + this.#lightDomEffectDisposer = effect(() => { + const allChildren = this.childComponents ?? null; + D(this.renderComponentTree(allChildren), this, { host: this }); + }); + } + } + /** + * Clean up the effect when the component is removed from the DOM. + */ + disconnectedCallback() { + super.disconnectedCallback(); + if (this.#lightDomEffectDisposer) this.#lightDomEffectDisposer(); + } + /** + * Turns the SignalMap into a renderable TemplateResult for Lit. + */ + renderComponentTree(components) { + if (!components) return A; + if (!Array.isArray(components)) return A; + return b` ${o$3(components, (component) => { + if (this.enableCustomElements) { + const elCtor = + componentRegistry.get(component.type) || customElements.get(component.type); + if (elCtor) { + const node = component; + const el = new elCtor(); + el.id = node.id; + if (node.slotName) el.slot = node.slotName; + el.component = node; + el.weight = node.weight ?? "initial"; + el.processor = this.processor; + el.surfaceId = this.surfaceId; + el.dataContextPath = node.dataContextPath ?? "/"; + for (const [prop, val] of Object.entries(component.properties)) el[prop] = val; + return b`${el}`; + } + } + switch (component.type) { + case "List": { + const node = component; + const childComponents = node.properties.children; + return b``; + } + case "Card": { + const node = component; + let childComponents = node.properties.children; + if (!childComponents && node.properties.child) + childComponents = [node.properties.child]; + return b``; + } + case "Column": { + const node = component; + return b``; + } + case "Row": { + const node = component; + return b``; + } + case "Image": { + const node = component; + return b``; + } + case "Icon": { + const node = component; + return b``; + } + case "AudioPlayer": { + const node = component; + return b``; + } + case "Button": { + const node = component; + return b``; + } + case "Text": { + const node = component; + return b``; + } + case "CheckBox": { + const node = component; + return b``; + } + case "DateTimeInput": { + const node = component; + return b``; + } + case "Divider": { + const node = component; + return b``; + } + case "MultipleChoice": { + const node = component; + return b``; + } + case "Slider": { + const node = component; + return b``; + } + case "TextField": { + const node = component; + return b``; + } + case "Video": { + const node = component; + return b``; + } + case "Tabs": { + const node = component; + const titles = []; + const childComponents = []; + if (node.properties.tabItems) + for (const item of node.properties.tabItems) { + titles.push(item.title); + childComponents.push(item.child); + } + return b``; + } + case "Modal": { + const node = component; + const childComponents = [node.properties.entryPointChild, node.properties.contentChild]; + node.properties.entryPointChild.slotName = "entry"; + return b``; + } + default: + return this.renderCustomComponent(component); + } + })}`; + } + renderCustomComponent(component) { + if (!this.enableCustomElements) return; + const node = component; + const elCtor = componentRegistry.get(component.type) || customElements.get(component.type); + if (!elCtor) return b`Unknown element ${component.type}`; + const el = new elCtor(); + el.id = node.id; + if (node.slotName) el.slot = node.slotName; + el.component = node; + el.weight = node.weight ?? "initial"; + el.processor = this.processor; + el.surfaceId = this.surfaceId; + el.dataContextPath = node.dataContextPath ?? "/"; + for (const [prop, val] of Object.entries(component.properties)) el[prop] = val; + return b`${el}`; + } + render() { + return b``; + } + static { + __runInitializers$19(_classThis, _classExtraInitializers); + } + }; + return _classThis; +})(); +/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ const e$2 = e$10( + class extends i$5 { + constructor(t) { + if ((super(t), t.type !== t$4.ATTRIBUTE || "class" !== t.name || t.strings?.length > 2)) + throw Error( + "`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.", + ); + } + render(t) { + return ( + " " + + Object.keys(t) + .filter((s) => t[s]) + .join(" ") + + " " + ); + } + update(s, [i]) { + if (void 0 === this.st) { + ((this.st = /* @__PURE__ */ new Set()), + void 0 !== s.strings && + (this.nt = new Set( + s.strings + .join(" ") + .split(/\s/) + .filter((t) => "" !== t), + ))); + for (const t in i) i[t] && !this.nt?.has(t) && this.st.add(t); + return this.render(i); + } + const r = s.element.classList; + for (const t of this.st) t in i || (r.remove(t), this.st.delete(t)); + for (const t in i) { + const s = !!i[t]; + s === this.st.has(t) || + this.nt?.has(t) || + (s ? (r.add(t), this.st.add(t)) : (r.remove(t), this.st.delete(t))); + } + return E; + } + }, +); +/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ const n$1 = "important", + i = " !" + n$1, + o$2 = e$10( + class extends i$5 { + constructor(t) { + if ((super(t), t.type !== t$4.ATTRIBUTE || "style" !== t.name || t.strings?.length > 2)) + throw Error( + "The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.", + ); + } + render(t) { + return Object.keys(t).reduce((e, r) => { + const s = t[r]; + return null == s + ? e + : e + + `${(r = r.includes("-") ? r : r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase())}:${s};`; + }, ""); + } + update(e, [r]) { + const { style: s } = e.element; + if (void 0 === this.ft) return ((this.ft = new Set(Object.keys(r))), this.render(r)); + for (const t of this.ft) + null == r[t] && + (this.ft.delete(t), t.includes("-") ? s.removeProperty(t) : (s[t] = null)); + for (const t in r) { + const e = r[t]; + if (null != e) { + this.ft.add(t); + const r = "string" == typeof e && e.endsWith(i); + t.includes("-") || r + ? s.setProperty(t, r ? e.slice(0, -11) : e, r ? n$1 : "") + : (s[t] = e); + } + } + return E; + } + }, + ); +var __esDecorate$18 = function ( + ctor, + descriptorIn, + decorators, + contextIn, + initializers, + extraInitializers, +) { + function accept(f) { + if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); + return f; + } + var kind = contextIn.kind, + key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? (contextIn["static"] ? ctor : ctor.prototype) : null; + var descriptor = + descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, + done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function (f) { + if (done) throw new TypeError("Cannot add initializers after decoration has completed"); + extraInitializers.push(accept(f || null)); + }; + var result = (0, decorators[i])( + kind === "accessor" + ? { + get: descriptor.get, + set: descriptor.set, + } + : descriptor[key], + context, + ); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if ((_ = accept(result.get))) descriptor.get = _; + if ((_ = accept(result.set))) descriptor.set = _; + if ((_ = accept(result.init))) initializers.unshift(_); + } else if ((_ = accept(result))) + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; +}; +var __runInitializers$18 = function (thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + return useValue ? value : void 0; +}; +(() => { + let _classDecorators = [t$1("a2ui-audioplayer")]; + let _classDescriptor; + let _classExtraInitializers = []; + let _classThis; + let _classSuper = Root; + let _url_decorators; + let _url_initializers = []; + let _url_extraInitializers = []; + var Audio = class extends _classSuper { + static { + _classThis = this; + } + static { + const _metadata = + typeof Symbol === "function" && Symbol.metadata + ? Object.create(_classSuper[Symbol.metadata] ?? null) + : void 0; + _url_decorators = [n$6()]; + __esDecorate$18( + this, + null, + _url_decorators, + { + kind: "accessor", + name: "url", + static: false, + private: false, + access: { + has: (obj) => "url" in obj, + get: (obj) => obj.url, + set: (obj, value) => { + obj.url = value; + }, + }, + metadata: _metadata, + }, + _url_initializers, + _url_extraInitializers, + ); + __esDecorate$18( + null, + (_classDescriptor = { value: _classThis }), + _classDecorators, + { + kind: "class", + name: _classThis.name, + metadata: _metadata, + }, + null, + _classExtraInitializers, + ); + Audio = _classThis = _classDescriptor.value; + if (_metadata) + Object.defineProperty(_classThis, Symbol.metadata, { + enumerable: true, + configurable: true, + writable: true, + value: _metadata, + }); + } + #url_accessor_storage = __runInitializers$18(this, _url_initializers, null); + get url() { + return this.#url_accessor_storage; + } + set url(value) { + this.#url_accessor_storage = value; + } + static { + this.styles = [ + structuralStyles, + i$9` + * { + box-sizing: border-box; + } + + :host { + display: block; + flex: var(--weight); + min-height: 0; + overflow: auto; + } + + audio { + display: block; + width: 100%; + } + `, + ]; + } + #renderAudio() { + if (!this.url) return A; + if (this.url && typeof this.url === "object") { + if ("literalString" in this.url) return b`