From f1b08eea54c70df0d824ccd0094c36cf6a359ccf Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Sun, 12 Apr 2026 12:40:25 +0100 Subject: [PATCH] fix(cycles): cut madge back-edges in agent and cron types --- src/agents/auth-profiles/oauth-refresh-failure.ts | 2 +- src/agents/model-fallback.types.ts | 2 +- src/agents/plugin-text-transforms.ts | 2 +- src/agents/tools/session-status-tool.ts | 2 +- src/context-engine/delegate.ts | 14 ++------------ src/cron/types.ts | 2 +- 6 files changed, 7 insertions(+), 17 deletions(-) diff --git a/src/agents/auth-profiles/oauth-refresh-failure.ts b/src/agents/auth-profiles/oauth-refresh-failure.ts index ce71a3f94db..4cea4112fcd 100644 --- a/src/agents/auth-profiles/oauth-refresh-failure.ts +++ b/src/agents/auth-profiles/oauth-refresh-failure.ts @@ -1,6 +1,6 @@ import { formatCliCommand } from "../../cli/command-format.js"; import { sanitizeForLog } from "../../terminal/ansi.js"; -import { normalizeProviderId } from "../model-selection.js"; +import { normalizeProviderId } from "../provider-id.js"; export type OAuthRefreshFailureReason = | "refresh_token_reused" diff --git a/src/agents/model-fallback.types.ts b/src/agents/model-fallback.types.ts index 92b5f974788..ef2ed1cc015 100644 --- a/src/agents/model-fallback.types.ts +++ b/src/agents/model-fallback.types.ts @@ -1,4 +1,4 @@ -import type { FailoverReason } from "./pi-embedded-helpers.js"; +import type { FailoverReason } from "./pi-embedded-helpers/types.js"; export type ModelCandidate = { provider: string; diff --git a/src/agents/plugin-text-transforms.ts b/src/agents/plugin-text-transforms.ts index db0cd71d903..27ee881336e 100644 --- a/src/agents/plugin-text-transforms.ts +++ b/src/agents/plugin-text-transforms.ts @@ -1,6 +1,6 @@ import type { StreamFn } from "@mariozechner/pi-agent-core"; import { streamSimple, type AssistantMessageEvent } from "@mariozechner/pi-ai"; -import type { PluginTextReplacement, PluginTextTransforms } from "../plugins/types.js"; +import type { PluginTextReplacement, PluginTextTransforms } from "../plugins/cli-backend.types.js"; export function mergePluginTextTransforms( ...transforms: Array diff --git a/src/agents/tools/session-status-tool.ts b/src/agents/tools/session-status-tool.ts index 46baa360147..daab753b108 100644 --- a/src/agents/tools/session-status-tool.ts +++ b/src/agents/tools/session-status-tool.ts @@ -61,7 +61,7 @@ type CommandsStatusRuntimeModule = { sessionEntry?: SessionEntry; sessionKey: string; parentSessionKey?: string; - sessionScope?: "per-sender" | "per-thread" | "shared"; + sessionScope?: "global" | "per-sender" | "per-thread" | "shared"; storePath?: string; statusChannel: string; provider: string; diff --git a/src/context-engine/delegate.ts b/src/context-engine/delegate.ts index 0a2df0c4120..66ea59a532e 100644 --- a/src/context-engine/delegate.ts +++ b/src/context-engine/delegate.ts @@ -1,3 +1,4 @@ +import type { CompactEmbeddedPiSessionDirect } from "../agents/pi-embedded-runner/compact.runtime.types.js"; import { normalizeStructuredPromptSection } from "../agents/prompt-cache-stability.js"; import type { MemoryCitationsMode } from "../config/types.memory.js"; import { buildMemoryPromptSection } from "../plugins/memory-state.js"; @@ -5,18 +6,7 @@ import { importRuntimeModule } from "../shared/runtime-import.js"; import type { ContextEngine, CompactResult, ContextEngineRuntimeContext } from "./types.js"; type CompactRuntimeModule = { - compactEmbeddedPiSessionDirect: (params: Record) => Promise<{ - ok: boolean; - compacted: boolean; - reason?: string; - result?: { - summary?: string; - firstKeptEntryId?: string; - tokensBefore?: number; - tokensAfter?: number; - details?: unknown; - }; - }>; + compactEmbeddedPiSessionDirect: CompactEmbeddedPiSessionDirect; }; const COMPACT_RUNTIME_SPEC = ["../agents/pi-embedded-runner/compact.runtime", ".js"] as const; diff --git a/src/cron/types.ts b/src/cron/types.ts index c3eaaa70362..047086a533a 100644 --- a/src/cron/types.ts +++ b/src/cron/types.ts @@ -1,4 +1,4 @@ -import type { FailoverReason } from "../agents/pi-embedded-helpers.js"; +import type { FailoverReason } from "../agents/pi-embedded-helpers/types.js"; import type { ChannelId } from "../channels/plugins/types.public.js"; import type { HookExternalContentSource } from "../security/external-content.js"; import type { CronJobBase } from "./types-shared.js";