mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-17 11:20:37 +09:00
Move adapter implementations into shared workspace packages
Extract claude-local and codex-local adapter code from cli/server/ui into packages/adapters/ and packages/adapter-utils/. CLI, server, and UI now import shared adapter logic instead of duplicating it. Removes ~1100 lines of duplicated code across packages. Register new packages in pnpm workspace. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
47ccd946b6
commit
631c859b89
49 changed files with 656 additions and 381 deletions
|
|
@ -1,9 +1,19 @@
|
|||
import type { CLIAdapterModule } from "./types.js";
|
||||
import { claudeLocalCLIAdapter } from "./claude-local/index.js";
|
||||
import { codexLocalCLIAdapter } from "./codex-local/index.js";
|
||||
import type { CLIAdapterModule } from "@paperclip/adapter-utils";
|
||||
import { printClaudeStreamEvent } from "@paperclip/adapter-claude-local/cli";
|
||||
import { printCodexStreamEvent } from "@paperclip/adapter-codex-local/cli";
|
||||
import { processCLIAdapter } from "./process/index.js";
|
||||
import { httpCLIAdapter } from "./http/index.js";
|
||||
|
||||
const claudeLocalCLIAdapter: CLIAdapterModule = {
|
||||
type: "claude_local",
|
||||
formatStdoutEvent: printClaudeStreamEvent,
|
||||
};
|
||||
|
||||
const codexLocalCLIAdapter: CLIAdapterModule = {
|
||||
type: "codex_local",
|
||||
formatStdoutEvent: printCodexStreamEvent,
|
||||
};
|
||||
|
||||
const adaptersByType = new Map<string, CLIAdapterModule>(
|
||||
[claudeLocalCLIAdapter, codexLocalCLIAdapter, processCLIAdapter, httpCLIAdapter].map((a) => [a.type, a]),
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue