Make session compaction adapter-aware

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Dotta
2026-03-16 19:35:11 -05:00
parent 2539950ad7
commit fee3df2e62
8 changed files with 393 additions and 33 deletions

View File

@@ -1,4 +1,5 @@
import type { ServerAdapterModule } from "./types.js";
import { getAdapterSessionManagement } from "@paperclipai/adapter-utils";
import {
execute as claudeExecute,
testEnvironment as claudeTestEnvironment,
@@ -70,6 +71,7 @@ const claudeLocalAdapter: ServerAdapterModule = {
execute: claudeExecute,
testEnvironment: claudeTestEnvironment,
sessionCodec: claudeSessionCodec,
sessionManagement: getAdapterSessionManagement("claude_local") ?? undefined,
models: claudeModels,
supportsLocalAgentJwt: true,
agentConfigurationDoc: claudeAgentConfigurationDoc,
@@ -81,6 +83,7 @@ const codexLocalAdapter: ServerAdapterModule = {
execute: codexExecute,
testEnvironment: codexTestEnvironment,
sessionCodec: codexSessionCodec,
sessionManagement: getAdapterSessionManagement("codex_local") ?? undefined,
models: codexModels,
listModels: listCodexModels,
supportsLocalAgentJwt: true,
@@ -93,6 +96,7 @@ const cursorLocalAdapter: ServerAdapterModule = {
execute: cursorExecute,
testEnvironment: cursorTestEnvironment,
sessionCodec: cursorSessionCodec,
sessionManagement: getAdapterSessionManagement("cursor") ?? undefined,
models: cursorModels,
listModels: listCursorModels,
supportsLocalAgentJwt: true,
@@ -104,6 +108,7 @@ const geminiLocalAdapter: ServerAdapterModule = {
execute: geminiExecute,
testEnvironment: geminiTestEnvironment,
sessionCodec: geminiSessionCodec,
sessionManagement: getAdapterSessionManagement("gemini_local") ?? undefined,
models: geminiModels,
supportsLocalAgentJwt: true,
agentConfigurationDoc: geminiAgentConfigurationDoc,
@@ -123,6 +128,7 @@ const openCodeLocalAdapter: ServerAdapterModule = {
execute: openCodeExecute,
testEnvironment: openCodeTestEnvironment,
sessionCodec: openCodeSessionCodec,
sessionManagement: getAdapterSessionManagement("opencode_local") ?? undefined,
models: [],
listModels: listOpenCodeModels,
supportsLocalAgentJwt: true,
@@ -134,6 +140,7 @@ const piLocalAdapter: ServerAdapterModule = {
execute: piExecute,
testEnvironment: piTestEnvironment,
sessionCodec: piSessionCodec,
sessionManagement: getAdapterSessionManagement("pi_local") ?? undefined,
models: [],
listModels: listPiModels,
supportsLocalAgentJwt: true,

View File

@@ -3,6 +3,7 @@
// imports (process/, http/, heartbeat.ts) don't need rewriting.
export type {
AdapterAgent,
AdapterSessionManagement,
AdapterRuntime,
UsageSummary,
AdapterExecutionResult,
@@ -15,5 +16,8 @@ export type {
AdapterEnvironmentTestContext,
AdapterSessionCodec,
AdapterModel,
NativeContextManagement,
ResolvedSessionCompactionPolicy,
SessionCompactionPolicy,
ServerAdapterModule,
} from "@paperclipai/adapter-utils";