/** * Compile-time parity checks between klient wire schemas and the engine * types they mirror. Plain `.ts` (not `.test.ts`) — vitest must not pick it * up; `tsc -p tsconfig.json --noEmit` is the check. * * Wire shapes are reached through indexed access on the engine service * interfaces, so klient needs no direct dependency for most of them. */ import type { z } from 'zod'; import type { AgentContextData } from '@moonshot-ai/agent-core-v2/agent/contextMemory/types'; import type { IAgentCommandService } from '@moonshot-ai/agent-core-v2/agent/command/agentCommand'; import type { IAgentRuntimeBindingService } from '@moonshot-ai/agent-core-v2/agent/runtimeBinding/runtimeBinding'; import type { TurnEndReason } from '@moonshot-ai/agent-core-v2/agent/loop/turnEvents'; import type { SessionActivityState } from '@moonshot-ai/agent-core-v2/session/sessionActivity/sessionActivity'; import type { PermissionMode } from '@moonshot-ai/agent-core-v2/agent/permissionPolicy/types'; import type { IAgentProfileService } from '@moonshot-ai/agent-core-v2/agent/profile/profile'; import type { PromptLaunchResult, PromptPayload, SteerPayload } from '@moonshot-ai/agent-core-v2/agent/loop/loop'; import type { IAgentShellCommandService } from '@moonshot-ai/agent-core-v2/agent/shellCommand/shellCommand'; import type { IAgentSkillService } from '@moonshot-ai/agent-core-v2/features/skill/skillService'; import type { ContentPart } from '@moonshot-ai/agent-core-v2/human/llm/message'; import type { PlanData } from '@moonshot-ai/agent-core-v2/features/plan/plan'; import type { UsageStatus } from '@moonshot-ai/agent-core-v2/agent/usage/usage'; import type { SkillSummary } from '@moonshot-ai/agent-core-v2/features/skill/catalog/types'; import type { McpServerEntry } from '@moonshot-ai/agent-core-v2/mcpCore/connection-manager'; import type { GlobalMcpServerConfig, McpAuthStatusQuery, McpManagedServer, McpServerAuthBeginResult, McpServerAuthFlowHandle, McpServerAuthState, McpServerAuthStatus, McpServerInspection, McpServerLocator, McpServerTestResult, McpServerTestTarget, } from '@moonshot-ai/agent-core-v2/app/mcpManagement/mcpManagement'; import type { McpRegistryPluginOrigin, McpRegistryQuery, McpServerSource, } from '@moonshot-ai/agent-core-v2/app/mcpRegistry/mcpRegistry'; import type { McpServerConfig } from '@moonshot-ai/agent-core-v2/mcpCore/config-schema'; import type { McpServerConfigView } from '@moonshot-ai/agent-core-v2/mcpCore/configView'; import type { FullCompactionInput } from '@moonshot-ai/agent-core-v2/agent/fullCompaction/fullCompaction'; import type { ISessionScopeHandle } from '@moonshot-ai/agent-core-v2/_base/di/scope'; import type { CreateChildSessionOptions, CreateSessionOptions, ForkSessionOptions, ResumeSessionOptions, } from '@moonshot-ai/agent-core-v2/workspace/sessionLifecycle/sessionLifecycle'; import type { ApprovalRequest, ApprovalResponse, } from '@moonshot-ai/agent-core-v2/agent/interaction/approval'; import type { Interaction, InteractionResolution, } from '@moonshot-ai/agent-core-v2/human/interaction/interaction'; import type { QuestionAnswers, QuestionItem, QuestionOption, QuestionRequest, QuestionResponse, QuestionResult, } from '@moonshot-ai/agent-core-v2/agent/interaction/question'; import type { AgentMeta, SessionMeta, SessionMetadataChangedEvent, SessionMetaPatch, } from '@moonshot-ai/agent-core-v2/session/sessionMetadata/sessionMetadata'; import type { ISessionTitleService } from '@moonshot-ai/agent-core-v2/session/sessionTitle/sessionTitle'; import type { AuthStatus, IOAuthService, } from '@moonshot-ai/agent-core-v2/app/auth/auth'; import type { IBootstrapService } from '@moonshot-ai/agent-core-v2/app/bootstrap/bootstrap'; import type { ConfigDiagnostic, ConfigInspectValue, ConfigTarget, } from '@moonshot-ai/agent-core-v2/app/config/config'; import type { CapabilityInstallProgress, CapabilityStatus, CapabilityStep, } from '@moonshot-ai/agent-core-v2/app/capability/types'; import type { ExperimentalFeatureState } from '@moonshot-ai/agent-core-v2/app/flag/flag'; import type { FileMeta, SaveOptions, } from '@moonshot-ai/agent-core-v2/app/file/fileService'; import type { FsBrowseResponse, FsHomeResponse, } from '@moonshot-ai/agent-core-v2/app/hostFolderBrowser/hostFolderBrowser'; import type { ModelRecord } from '@moonshot-ai/agent-core-v2/llm-adapter/model/model'; import type { IModelCatalog } from '@moonshot-ai/agent-core-v2/llm-adapter/model/catalog'; import type { IProviderDiscoveryService } from '@moonshot-ai/agent-core-v2/app/kosongConfig/discovery'; import type { GetPluginInfoInput, InstallPluginInput, RemovePluginInput, SetPluginEnabledInput, SetPluginMcpServerEnabledInput, } from '@moonshot-ai/agent-core-v2/app/plugin/plugin'; import type { PluginCommandDef, PluginDiagnostic, PluginGithubMetadata, PluginInfo, PluginManifest, PluginMcpServerInfo, PluginSummary, PluginUpdateStatus, ReloadSummary, } from '@moonshot-ai/agent-core-v2/app/plugin/types'; import type { ProviderConfig } from '@moonshot-ai/agent-core-v2/llm-adapter/provider/provider'; import type { SessionListQuery, SessionSummary, } from '@moonshot-ai/agent-core-v2/app/sessionIndex/sessionIndex'; import type { Workspace, WorkspaceUpdate, } from '@moonshot-ai/agent-core-v2/app/workspace/workspace'; // Test-only: the v1 wire event types now live in agent-core-v2; importing // them here (never in `src/`) strengthens parity for the agent event stream. import type { ToolResultEvent } from '@moonshot-ai/agent-core-v2/events'; import type { CompactionBlockedEvent, CompactionCancelledEvent, CompactionCompletedEvent, CompactionStartedEvent, } from '@moonshot-ai/agent-core-v2/agent/fullCompaction/compactionOps'; import type { AssistantDeltaEvent, ThinkingDeltaEvent, TurnStartedEvent, } from '@moonshot-ai/agent-core-v2/agent/loop/turnEvents'; import type { TurnEndedEvent } from '@moonshot-ai/agent-core-v2/agent/loop/turnOps'; import type { PromptAbortedEvent, PromptCompletedEvent, } from '@moonshot-ai/agent-core-v2/agent/prompt/promptEvents'; import type { TaskInfo } from '@moonshot-ai/agent-core-v2/agent/task/types'; import type { ToolCallDeltaEvent, ToolCallStartedEvent, ToolProgressEvent, } from '@moonshot-ai/agent-core-v2/agent/toolExecutor/toolExecutorEvents'; import type { WarningEvent } from '@moonshot-ai/agent-core-v2/errors'; import { sessionActivityStateSchema } from '../src/contract/session/activity.js'; import { agentCommandInfoSchema, agentContextDataSchema, agentTaskInfoSchema, activateSkillPayloadSchema, cancelPayloadSchema, cancelPlanPayloadSchema, cancelShellCommandPayloadSchema, emptyPayloadSchema, getTaskOutputPayloadSchema, getTasksPayloadSchema, planDataSchema, promptLaunchResultSchema, promptPartSchema, promptPayloadSchema, promptSkillActivationSchema, promptWithSkillsPayloadSchema, promptWithSkillsResultSchema, runCommandPayloadSchema, runShellCommandPayloadSchema, runtimeBindingSchema, setModelPayloadSchema, setModelResultSchema, setPermissionPayloadSchema, shellCommandResultSchema, steerPayloadSchema, stopTaskPayloadSchema, tokenUsageSchema, usageStatusSchema, } from '../src/contract/agent/schemas.js'; import { assistantDeltaEventSchema, compactionBlockedEventSchema, compactionCancelledEventSchema, compactionCompletedEventSchema, compactionStartedEventSchema, promptAbortedEventSchema, promptCompletedEventSchema, thinkingDeltaEventSchema, toolCallDeltaEventSchema, toolCallStartedEventSchema, toolProgressEventSchema, toolResultEventSchema, turnEndedEventSchema, turnStartedEventSchema, warningEventSchema, } from '../src/contract/agent/events.js'; import { approvalRequestSchema, approvalResponseSchema, } from '../src/contract/session/approval.js'; import { fullCompactionInputSchema, mcpServerEntrySchema, } from '../src/contract/agent/services.js'; import { createChildSessionOptionsSchema, createSessionOptionsSchema, forkSessionOptionsSchema, handleWireSchema, resumeSessionOptionsSchema, } from '../src/contract/session/lifecycle.js'; import { interactionResolutionSchema, interactionSchema, } from '../src/contract/session/interaction.js'; import { agentMetaSchema, sessionMetaPatchSchema, sessionMetaSchema, sessionMetadataChangedEventSchema, } from '../src/contract/session/metadata.js'; import { questionAnswersSchema, questionItemSchema, questionOptionSchema, questionRequestSchema, questionResponseSchema, questionResultSchema, } from '../src/contract/session/question.js'; import { skillSummarySchema } from '../src/contract/session/skills.js'; import { sessionTitleContract } from '../src/contract/session/title.js'; import { authStatusSchema, oAuthFlowSnapshotSchema, oAuthFlowStartSchema, oAuthLoginCancelResponseSchema, oAuthLogoutResponseSchema, refreshOAuthProviderModelsResponseSchema, } from '../src/contract/global/auth.js'; import { configDiagnosticSchema, configInspectValueSchema, configTargetSchema, } from '../src/contract/global/config.js'; import { capabilityInstallProgressSchema, capabilityStatusSchema, capabilityStepSchema, } from '../src/contract/global/capabilities.js'; import { modelCatalogItemSchema, providerCatalogItemSchema, setDefaultModelResponseSchema, } from '../src/contract/global/catalog.js'; import { refreshProviderModelsOptionsSchema, refreshProviderModelsResponseSchema, } from '../src/contract/global/providerDiscovery.js'; import { experimentalFeatureStateSchema } from '../src/contract/global/flags.js'; import { fileMetaSchema, fileSaveOptionsSchema, } from '../src/contract/global/files.js'; import { fsBrowseResponseSchema, fsHomeResponseSchema, } from '../src/contract/global/hostFs.js'; import { modelConfigSchema } from '../src/contract/global/models.js'; import { globalMcpServerConfigSchema, mcpAuthStatusQuerySchema, mcpManagedServerSchema, mcpRegistryPluginOriginSchema, mcpRegistryQuerySchema, mcpServerAuthBeginResultSchema, mcpServerAuthFlowHandleSchema, mcpServerAuthStateSchema, mcpServerAuthStatusSchema, mcpServerConfigDataSchema, mcpServerInspectionSchema, mcpServerLocatorSchema, mcpServerSourceSchema, mcpServerTestResultSchema, mcpServerTestTargetSchema, } from '../src/contract/global/mcpManagement.js'; import { getPluginInfoInputSchema, installPluginInputSchema, pluginCommandDefSchema, pluginDiagnosticSchema, pluginGithubMetadataSchema, pluginInfoSchema, pluginManifestSchema, pluginMcpServerInfoSchema, pluginSummarySchema, pluginUpdateStatusSchema, reloadSummarySchema, removePluginInputSchema, setPluginEnabledInputSchema, setPluginMcpServerEnabledInputSchema, } from '../src/contract/global/plugins.js'; import { providerConfigSchema } from '../src/contract/global/providers.js'; import { sessionListQuerySchema, sessionSummarySchema, } from '../src/contract/global/sessions.js'; import { workspaceSchema, workspaceUpdateSchema, } from '../src/contract/global/workspaces.js'; import type { AssertWire, MutableDeep } from './helpers/typeAssert.js'; import type { AgentFacade } from '../src/core/facade/agent.js'; /** One-directional: the engine type must be assignable TO the schema's infer. */ type AssertEngineToWire = [MutableDeep] extends [ z.infer, ] ? true : never; /** One-directional: the schema's infer must be assignable TO the engine type. */ type AssertWireToEngine = [z.infer] extends [ MutableDeep, ] ? true : never; // Wire shapes, derived from the engine interfaces. type OAuthFlowStart = Awaited>; type OAuthFlowSnapshot = NonNullable>; type OAuthLoginCancelResponse = Awaited>; type OAuthLogoutResponse = Awaited>; type RefreshOAuthProviderModelsResponse = Awaited< ReturnType >; /** String-enum value union (`'user' | 'memory'`). */ type ConfigTargetValues = `${ConfigTarget}`; // sessions.ts const _sessionSummary: AssertWire = true; const _sessionListQuery: AssertWire = true; // workspaces.ts const _workspace: AssertWire = true; const _workspaceUpdate: AssertWire = true; // config.ts // One-directional: the engine declares the `ConfigInspectValue` keys as // required with `| undefined` values, while the wire schema marks them // `.optional()`; optional → required is not assignable, so only the // engine → wire direction holds. const _configInspectValue: AssertEngineToWire = true; const _configDiagnostic: AssertWire = true; const _configTarget: AssertWire = true; // capabilities.ts const _capabilityStep: AssertWire = true; const _capabilityInstallProgress: AssertWire< typeof capabilityInstallProgressSchema, CapabilityInstallProgress > = true; const _capabilityStatus: AssertWire = true; // providers.ts const _providerConfig: AssertWire = true; // auth.ts const _oAuthFlowStart: AssertWire = true; const _oAuthFlowSnapshot: AssertWire = true; const _oAuthLoginCancelResponse: AssertWire< typeof oAuthLoginCancelResponseSchema, OAuthLoginCancelResponse > = true; const _oAuthLogoutResponse: AssertWire = true; const _authStatus: AssertWire = true; const _refreshOAuthProviderModelsResponse: AssertWire< typeof refreshOAuthProviderModelsResponseSchema, RefreshOAuthProviderModelsResponse > = true; // flags.ts const _experimentalFeatureState: AssertWire< typeof experimentalFeatureStateSchema, ExperimentalFeatureState > = true; // hostFs.ts const _fsBrowseResponse: AssertWire = true; const _fsHomeResponse: AssertWire = true; // files.ts (`fileGetResultSchema` has no engine counterpart — the wire // adaptation replaces `GetResult.stream` with base64 `data`). const _fileMeta: AssertWire = true; const _fileSaveOptions: AssertWire = true; // catalog.ts / providerDiscovery.ts — protocol wire shapes derived through the // catalog and discovery service interfaces. type ModelCatalogItem = Awaited>[number]; type ProviderCatalogItem = Awaited>[number]; type SetDefaultModelResponse = Awaited>; type RefreshProviderModelsOptions = NonNullable< Parameters[0] >; type RefreshProviderModelsResponse = Awaited< ReturnType >; const _modelCatalogItem: AssertWire = true; const _providerCatalogItem: AssertWire = true; const _setDefaultModelResponse: AssertWire< typeof setDefaultModelResponseSchema, SetDefaultModelResponse > = true; const _refreshProviderModelsOptions: AssertWire< typeof refreshProviderModelsOptionsSchema, RefreshProviderModelsOptions > = true; const _refreshProviderModelsResponse: AssertWire< typeof refreshProviderModelsResponseSchema, RefreshProviderModelsResponse > = true; // models.ts const _modelConfig: AssertWire = true; // plugins.ts const _pluginSummary: AssertWire = true; const _pluginInfo: AssertWire = true; const _pluginManifest: AssertWire = true; const _pluginMcpServerInfo: AssertWire = true; const _pluginDiagnostic: AssertWire = true; const _pluginGithubMetadata: AssertWire = true; const _reloadSummary: AssertWire = true; const _pluginUpdateStatus: AssertWire = true; const _pluginCommandDef: AssertWire = true; const _installPluginInput: AssertWire = true; const _setPluginEnabledInput: AssertWire< typeof setPluginEnabledInputSchema, SetPluginEnabledInput > = true; const _setPluginMcpServerEnabledInput: AssertWire< typeof setPluginMcpServerEnabledInputSchema, SetPluginMcpServerEnabledInput > = true; const _removePluginInput: AssertWire = true; const _getPluginInfoInput: AssertWire = true; // global/mcpManagement.ts — the `McpServerConfig | McpServerConfigView` union // a managed server's `config` carries (full for mutable entries, redacted for // read-only ones) is mirrored by one schema covering both shapes; the // inspection's `config` is always the redacted view, and both assignability // directions hold against either engine type. const _mcpServerSource: AssertWire = true; const _mcpRegistryPluginOrigin: AssertWire< typeof mcpRegistryPluginOriginSchema, McpRegistryPluginOrigin > = true; const _mcpRegistryQuery: AssertWire = true; const _mcpAuthStatusQuery: AssertWire = true; const _globalMcpServerConfig: AssertWire< typeof globalMcpServerConfigSchema, GlobalMcpServerConfig > = true; const _mcpServerConfigData: AssertWire< typeof mcpServerConfigDataSchema, McpServerConfig | McpServerConfigView > = true; const _mcpServerConfigViewData: AssertWire< typeof mcpServerConfigDataSchema, McpServerConfigView > = true; const _mcpManagedServer: AssertWire = true; const _mcpServerTestTarget: AssertWire = true; const _mcpServerTestResult: AssertWire = true; const _mcpServerLocator: AssertWire = true; const _mcpServerAuthState: AssertWire = true; const _mcpServerInspection: AssertWire = true; const _mcpServerAuthStatus: AssertWire = true; const _mcpServerAuthBeginResult: AssertWire< typeof mcpServerAuthBeginResultSchema, McpServerAuthBeginResult > = true; const _mcpServerAuthFlowHandle: AssertWire< typeof mcpServerAuthFlowHandleSchema, McpServerAuthFlowHandle > = true; // env.ts has no named schemas; `platform` narrows to `NodeJS.Platform` in the // engine — assert the bootstrap properties are all strings instead. The // object-typed `clientIdentity` is intentionally not in this list. type _bootstrapStringProps = AssertStringProps< Pick< IBootstrapService, | 'platform' | 'arch' | 'cwd' | 'osHomeDir' | 'homeDir' | 'configPath' | 'sessionsDir' | 'blobsDir' | 'storeDir' | 'cacheDir' | 'logsDir' > >; type AssertStringProps = T extends Record ? true : never; const _envProps: _bootstrapStringProps = true; // ── session scope ─────────────────────────────────────────────────────────── // session/metadata.ts const _sessionMeta: AssertWire = true; const _agentMeta: AssertWire = true; const _sessionMetaPatch: AssertWire = true; const _sessionMetadataChangedEvent: AssertWire< typeof sessionMetadataChangedEventSchema, SessionMetadataChangedEvent > = true; // session/lifecycle.ts const _createSessionOptions: AssertWire = true; const _forkSessionOptions: AssertWire = true; const _resumeSessionOptions: AssertWire = true; const _createChildSessionOptions: AssertWire< typeof createChildSessionOptionsSchema, CreateChildSessionOptions > = true; // One-directional: the wire handle is `z.looseObject` — the in-process // `ISessionScopeHandle` carries an `accessor` and `dispose()` that JSON // drops, so only the engine → wire direction holds. const _handleWire: AssertEngineToWire = true; // session/interaction.ts const _interaction: AssertWire = true; const _interactionResolution: AssertWire< typeof interactionResolutionSchema, InteractionResolution > = true; // session/approval.ts // One-directional: `display` is the protocol `ToolInputDisplay` union (huge) // and crosses the wire as `unknown`; the wire schema cannot be assignable // back to the engine type. const _approvalRequest: AssertEngineToWire = true; const _approvalResponse: AssertWire = true; // session/question.ts const _questionRequest: AssertWire = true; const _questionItem: AssertWire = true; const _questionOption: AssertWire = true; const _questionAnswers: AssertWire = true; const _questionResponse: AssertWire = true; const _questionResult: AssertWire = true; // session/skills.ts const _skillSummary: AssertWire = true; // session/title.ts const _generateTitleOutput: AssertWire< (typeof sessionTitleContract)['generateTitle']['output'], Awaited> > = true; // session/activity.ts const _sessionActivityState: AssertWire = true; // ── agent scope (services.ts / schemas.ts) ────────────────────────────────── // Payload/result types are derived from the domain service interfaces the // facade calls, so the assertions track the exact methods the contract // mirrors; facade-only payload shapes (cancel / setPermission / plan / task / // command) derive from the `AgentFacade` input types. type ActivateSkillPayload = Parameters[0]; type PromptWithSkillsPayload = Parameters[0]; type PromptSkillActivation = PromptWithSkillsPayload['skills'][number]; type AgentCommandInfo = ReturnType[number]; type RuntimeBinding = ReturnType; type RunShellCommandPayload = Parameters[0]; type ShellCommandResult = Awaited>; type SetModelResult = Awaited>; type TokenUsage = NonNullable; type PromptPart = Extract; type EmptyPayload = {}; type CancelPayload = NonNullable[0]>; type SetPermissionPayload = { mode: PermissionMode }; type RunCommandPayload = Parameters[0]; type CancelShellCommandPayload = Parameters[0]; type SetModelPayload = { model: string }; type CancelPlanPayload = NonNullable[0]>; type GetTasksPayload = NonNullable[0]>; type StopTaskPayload = Parameters[0]; type GetTaskOutputPayload = Parameters[0]; const _emptyPayload: AssertWire = true; const _promptPart: AssertWire = true; // One-directional (wire → engine): the engine's `PromptPayload.input` accepts // the full `ContentPart` union (also think/audio parts); the wire mirrors the // `PromptPart` subset clients may send, so the reverse direction fails. const _promptPayload: AssertWireToEngine = true; const _promptSkillActivation: AssertWire< typeof promptSkillActivationSchema, PromptSkillActivation > = true; // Same one-directional rule as `promptPayload`: the engine's `input` accepts // the full `ContentPart` union; the wire mirrors the `PromptPart` subset. const _promptWithSkillsPayload: AssertWireToEngine< typeof promptWithSkillsPayloadSchema, PromptWithSkillsPayload > = true; const _steerPayload: AssertWireToEngine = true; const _activateSkillPayload: AssertWire = true; const _promptLaunchResult: AssertWire = true; type PromptWithSkillsResult = Awaited>; const _promptWithSkillsResult: AssertWire< typeof promptWithSkillsResultSchema, PromptWithSkillsResult > = true; const _cancelPayload: AssertWire = true; const _runShellCommandPayload: AssertWire< typeof runShellCommandPayloadSchema, RunShellCommandPayload > = true; const _shellCommandResult: AssertWire = true; const _cancelShellCommandPayload: AssertWire< typeof cancelShellCommandPayloadSchema, CancelShellCommandPayload > = true; const _setModelPayload: AssertWire = true; const _setModelResult: AssertWire = true; const _setPermissionPayload: AssertWire = true; const _tokenUsage: AssertWire = true; const _usageStatus: AssertWire = true; // One-directional: `history` entries are full `ContextMessage`s (deep // `Message`/`Tool`/`PromptOrigin` unions) mirrored as `unknown`. const _agentContextData: AssertEngineToWire = true; const _agentCommandInfo: AssertWire = true; const _runtimeBinding: AssertWire = true; const _runCommandPayload: AssertWire = true; const _planData: AssertWire = true; const _cancelPlanPayload: AssertWire = true; const _getTasksPayload: AssertWire = true; // The wire task union mirrors the protocol `TaskInfo`; the engine's // declaration-merged `AgentTaskInfo` is structurally identical but depends on // tool-module augmentation, so parity is pinned to the protocol type. const _agentTaskInfo: AssertWire = true; const _stopTaskPayload: AssertWire = true; const _getTaskOutputPayload: AssertWire = true; // agent/services.ts (mcp / fullCompaction) const _mcpServerEntry: AssertWire = true; const _fullCompactionInput: AssertWire = true; // ── agent scope (events.ts) ───────────────────────────────────────────────── // Parity against the protocol event types (the stream carries flat // `{ type, ... }` events; schemas keep the `type` literal). One-directional // where a field is mirrored as `unknown`. const _turnStartedEvent: AssertEngineToWire = true; const _turnEndedEvent: AssertEngineToWire = true; const _assistantDeltaEvent: AssertWire = true; const _thinkingDeltaEvent: AssertWire = true; const _toolCallStartedEvent: AssertEngineToWire< typeof toolCallStartedEventSchema, ToolCallStartedEvent > = true; const _toolCallDeltaEvent: AssertWire = true; const _toolProgressEvent: AssertWire = true; const _toolResultEvent: AssertWire = true; const _promptCompletedEvent: AssertWire = true; const _promptAbortedEvent: AssertWire = true; const _compactionStartedEvent: AssertWire< typeof compactionStartedEventSchema, CompactionStartedEvent > = true; const _compactionBlockedEvent: AssertWire< typeof compactionBlockedEventSchema, CompactionBlockedEvent > = true; const _compactionCancelledEvent: AssertWire< typeof compactionCancelledEventSchema, CompactionCancelledEvent > = true; const _compactionCompletedEvent: AssertWire< typeof compactionCompletedEventSchema, CompactionCompletedEvent > = true; const _warningEvent: AssertWire = true; // No parity assertions for `errorEventSchema`, `permissionApproval*Schema`, // and `agentStatusUpdatedEventSchema`: they are deliberately `z.looseObject`s // (index signature breaks both-ways assignability) — `permission.approval.*` // is not part of the protocol event union at all.