@@ -5,7 +5,7 @@ session discovery, transcript parsing, search, diagnostics, archive, backup, and
55delete behavior, so new providers need both capability metadata and path-safety
66coverage.
77
8- This guide describes the current internal extension path. It is not an external
8+ This guide describes the current in-repo extension path. It is not an external
99plugin API, and new provider code should stay in reviewed source until a separate
1010security model exists.
1111
@@ -44,12 +44,17 @@ folder under `apps/api-ts/src/domains/providers/`.
4444
4545Touch these files deliberately:
4646
47+ - ` packages/shared-contracts/src/index.ts ` for the shared provider capability
48+ source of truth
4749- ` apps/api-ts/src/domains/providers/registry.ts ` for the explicit implemented
4850 adapter registration
4951- ` apps/api-ts/src/domains/providers/capabilities.ts ` for route/search/report
5052 exposure policy
53+ - ` apps/api-ts/src/domains/providers/shared/file-roots.ts ` for canonical file
54+ root specs and scan root specs
5155- ` apps/api-ts/src/domains/providers/adapters/<provider>/ ` for provider-specific
52- root discovery, title, transcript, or health evidence
56+ root discovery, title, transcript, or health evidence when real
57+ provider-specific behavior exists
5358- ` apps/api-ts/src/domains/providers/shared/ ` only for provider-neutral path/root
5459 helpers
5560
@@ -74,22 +79,31 @@ export type ProviderAdapter = {
7479 label: string ;
7580 roots(): ProviderRootSpec [];
7681 scanRoots? (): Promise <ProviderRootSpec []>;
82+ scanSessions? (): Promise <ProviderSessionCandidate [] | ProviderSessionRow []>;
83+ health? (): Promise <ProviderHealthEvidence >;
7784};
7885```
7986
8087Do not duplicate capabilities in adapters. Capabilities must remain sourced from
8188` getProviderCapability(adapter.id) ` .
8289
90+ Do not create empty ` adapters/<provider>/transcript.ts ` , ` title.ts ` , or
91+ ` health.ts ` files just to match a template. Optional adapter modules should
92+ exist only when they hold real provider-specific behavior.
93+
8394Providers that do not store sessions as standalone files should use a session
84- locator model in later PRs instead of encoding provider-specific ids into fake
85- file paths:
95+ locator model instead of encoding provider-specific ids into fake file paths:
8696
8797``` ts
8898export type ProviderSessionLocator =
8999 | { kind: " file" ; file_path: string }
90100 | { kind: " sqlite" ; db_path: string ; session_id: string };
91101```
92102
103+ The locator type exists in the registry, but full DB-backed product support
104+ also needs transcript routing and UI selection keys that do not collapse
105+ multiple sessions sharing one backing database file.
106+
93107## 3. Add Search and Transcript Support
94108
95109Most providers can use the existing JSON/JSONL transcript flow. Provider-neutral
@@ -158,6 +172,7 @@ At minimum, cover:
158172
159173Useful existing tests:
160174
175+ - ` apps/api-ts/src/domains/providers/provider-extension-contract.test.ts `
161176- ` apps/api-ts/src/domains/providers/path-safety.test.ts `
162177- ` apps/api-ts/src/domains/providers/parser-fixtures.test.ts `
163178- ` apps/api-ts/src/domains/providers/services/search/session-search.test.ts `
@@ -170,7 +185,7 @@ Useful existing tests:
170185
171186## Adapter Direction
172187
173- The provider boundary is an internal provider adapter registry, not an external
188+ The provider boundary is an in-repo provider adapter registry, not an external
174189plugin system.
175190
176191The adapter boundary starts with provider identity and root discovery. Keep
@@ -198,10 +213,7 @@ code unless a separate security model is designed.
198213Before opening a provider PR:
199214
200215``` sh
201- pnpm docs:provider-support
202- pnpm --filter @threadlens/shared-contracts test
203- pnpm --filter @threadlens/api test
204- pnpm lint:deps
216+ pnpm qa:provider
205217```
206218
207219If provider UI copy changes are included, also run the relevant web or TUI tests.
0 commit comments