test: add exa web provider adapter

This commit is contained in:
alex wiesner
2026-04-09 11:08:09 +01:00
parent 5e1315a20a
commit 30cfe7e8f1
4 changed files with 296 additions and 5 deletions

View File

@@ -384,7 +384,7 @@ git -C /home/alex/dotfiles commit -m "test: add web search config loader"
- Create: `/home/alex/dotfiles/.pi/agent/extensions/web-search/src/providers/exa.ts`
- Test: `/home/alex/dotfiles/.pi/agent/extensions/web-search/src/providers/exa.test.ts`
- [ ] **Step 1: Write the failing Exa adapter tests**
- [x] **Step 1: Write the failing Exa adapter tests**
Create `/home/alex/dotfiles/.pi/agent/extensions/web-search/src/providers/exa.test.ts` with this content:
@@ -501,7 +501,7 @@ test("createExaProvider fetch defaults to text and preserves per-url failures",
});
```
- [ ] **Step 2: Run the Exa adapter tests to verify they fail**
- [x] **Step 2: Run the Exa adapter tests to verify they fail**
Run:
@@ -512,7 +512,7 @@ npx tsx --test src/providers/exa.test.ts
Expected: `FAIL` with an `ERR_MODULE_NOT_FOUND` error for `./exa.ts`.
- [ ] **Step 3: Write the provider interface and Exa adapter implementation**
- [x] **Step 3: Write the provider interface and Exa adapter implementation**
Create `/home/alex/dotfiles/.pi/agent/extensions/web-search/src/providers/types.ts` with this content:
@@ -705,7 +705,7 @@ export function createExaProvider(
}
```
- [ ] **Step 4: Run the Exa adapter tests to verify they pass**
- [x] **Step 4: Run the Exa adapter tests to verify they pass**
Run:
@@ -716,7 +716,7 @@ npx tsx --test src/providers/exa.test.ts
Expected: `PASS` for both tests.
- [ ] **Step 5: Commit the provider layer**
- [x] **Step 5: Commit the provider layer**
Run: