ci: add extension type-checking to CI pipeline (#568)

* ci: add extension type-checking to CI pipeline and prepublishOnly

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: resolve remaining extension type errors after merge

- Use cred.type === "api_key" for proper union narrowing in loadToolApiKeys
- Fix optional level parameter in provider-error-pause test

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
TÂCHES 2026-03-15 19:26:45 -06:00 committed by GitHub
parent 7578292b6b
commit 324d508eaf
4 changed files with 11 additions and 4 deletions

View file

@ -28,6 +28,9 @@ jobs:
- name: Build
run: npm run build
- name: Typecheck extensions
run: npm run typecheck:extensions
- name: Validate package is installable
run: npm run validate-pack
@ -58,5 +61,8 @@ jobs:
- name: Build
run: npm run build
- name: Typecheck extensions
run: npm run typecheck:extensions
- name: Run unit tests
run: npm run test:unit

View file

@ -61,7 +61,8 @@
"sync-pkg-version": "node scripts/sync-pkg-version.cjs",
"sync-platform-versions": "node native/scripts/sync-platform-versions.cjs",
"validate-pack": "bash scripts/validate-pack.sh",
"prepublishOnly": "npm run sync-pkg-version && npm run sync-platform-versions && git diff --exit-code || (echo 'ERROR: version sync changed files — commit them before publishing' && exit 1) && npm run build && npm run validate-pack"
"typecheck:extensions": "tsc --noEmit --project tsconfig.extensions.json",
"prepublishOnly": "npm run sync-pkg-version && npm run sync-platform-versions && git diff --exit-code || (echo 'ERROR: version sync changed files — commit them before publishing' && exit 1) && npm run build && npm run typecheck:extensions && npm run validate-pack"
},
"dependencies": {
"@anthropic-ai/sdk": "^0.73.0",

View file

@ -662,7 +662,7 @@ export function loadToolApiKeys(): void {
const auth = AuthStorage.create(authPath);
for (const tool of TOOL_KEYS) {
const cred = auth.get(tool.id);
if (cred && "key" in cred && cred.key && !process.env[tool.env]) {
if (cred && cred.type === "api_key" && cred.key && !process.env[tool.env]) {
process.env[tool.env] = cred.key;
}
}

View file

@ -9,8 +9,8 @@ test("pauseAutoForProviderError warns and pauses without requiring ctx.log", asy
await pauseAutoForProviderError(
{
notify(message, level) {
notifications.push({ message, level });
notify(message, level?) {
notifications.push({ message, level: level ?? "info" });
},
},
": terminated",