feat(adapters): add capability flags to ServerAdapterModule
Replace 5 hardcoded adapter type lists with declarative capability flags on ServerAdapterModule, enabling external adapter plugins to declare their capabilities without modifying Paperclip source. New optional fields on ServerAdapterModule: - supportsInstructionsBundle: managed instructions bundle support - instructionsPathKey: config key for instructions file path - requiresMaterializedRuntimeSkills: skill materialization needed Server changes: - agents.ts: capability-aware helpers with legacy fallbacks - adapters.ts: expose capabilities in GET /api/adapters response - registry.ts: explicit flags on all built-in adapters UI changes: - New useAdapterCapabilities hook for capability lookups - AgentDetail.tsx: replace hardcoded isLocal allowlist - AgentConfigForm.tsx: replace NONLOCAL_TYPES denylist - OnboardingWizard.tsx: replace NONLOCAL_TYPES denylist All flags are optional with backwards-compatible fallbacks to the legacy hardcoded lists for adapters that don't set them. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -328,6 +328,36 @@ export interface ServerAdapterModule {
|
||||
* resolved inside this method — the caller receives a fully hydrated schema.
|
||||
*/
|
||||
getConfigSchema?: () => Promise<AdapterConfigSchema> | AdapterConfigSchema;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Adapter capability flags
|
||||
//
|
||||
// These allow adapter plugins to declare what "local" capabilities they
|
||||
// support, replacing hardcoded type lists in the server and UI.
|
||||
// All flags are optional — when undefined, the server falls back to
|
||||
// legacy hardcoded lists for built-in adapters.
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Adapter supports managed instructions bundle (AGENTS.md files).
|
||||
* When true, the server uses instructionsPathKey (default "instructionsFilePath")
|
||||
* to resolve the instructions config key, and the UI shows the bundle editor.
|
||||
* Built-in local adapters default to true; external plugins must opt in.
|
||||
*/
|
||||
supportsInstructionsBundle?: boolean;
|
||||
|
||||
/**
|
||||
* The adapterConfig key that holds the instructions file path.
|
||||
* Defaults to "instructionsFilePath" when supportsInstructionsBundle is true.
|
||||
*/
|
||||
instructionsPathKey?: string;
|
||||
|
||||
/**
|
||||
* Adapter needs runtime skill entries materialized (written to disk)
|
||||
* before being passed via config. Used by adapters that scan a directory
|
||||
* rather than reading config.paperclipRuntimeSkills.
|
||||
*/
|
||||
requiresMaterializedRuntimeSkills?: boolean;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user