// /home/user/Projects/fewtok/src/proxy/adapters/registerTier1.ts
//
// Single registration point for Tier-1 adapters.
// Order matters — first-match-wins in AdapterRegistry.dispatch.
// Reorder = swap array positions. Add adapter = insert at desired position.
//
// passthrough MUST be last — AdapterRegistry.dispatch throws if no adapter
// matches, and passthrough is the safety-net match-everything fallback.

import type { AdapterRegistry } from "./index.ts";
import { readDedupe } from "./read-dedupe.ts";
import { bashPassthroughSmall } from "./bash-passthrough-small.ts";
import { contentRouter } from "./ContentRouter.ts";
import { bashTruncateLarge } from "./bash-truncate-large.ts";
import { mcpTruncateLarge } from "./mcp-truncate-large.ts";
import { webfetchTruncateLarge } from "./webfetch-truncate-large.ts";
import { grepTruncateLarge } from "./grep-truncate-large.ts";
import { passthroughAdapter } from "./passthrough.ts";

export function registerTier1(reg: AdapterRegistry): void {
  reg.register(readDedupe);
  reg.register(bashPassthroughSmall);
  reg.register(contentRouter);
  reg.register(bashTruncateLarge);
  reg.register(mcpTruncateLarge);
  reg.register(webfetchTruncateLarge);
  reg.register(grepTruncateLarge);
  reg.register(passthroughAdapter); // always last — guaranteed fallback.
}
