Files
ai-kit/package.json
T
CatoandClaude 5c9102e286 feat(web): keyless fallback backends for when every configured one is down (1.25.0) (#111)
* feat(web): keyless fallback backends for when every configured one is down

A self-hosted SearXNG is refused by upstream engines from time to time;
without a paid key the chain then has nothing left, and every app on the
box says it could not look (seen on Substrata, 2026-11-11 to -12).

- gdeltProvider: GDELT DOC 2.0 news search, keyless. Paced to one request
  every five seconds per process (GDELT's own ask); a call that cannot wait
  its turn fails as rate_limited without being sent. Its plain-text refusals
  are typed failures, never empty results.
- wikipediaProvider: one Wikipedia edition's search, keyless, no invented
  date (the API's timestamp is the last edit).
- keylessProviders() and withKeylessFallback(env): one call to opt in.
  defaultProviders is unchanged.
- A provider may declare coverage: "partial"; a partial index answering
  empty never turns a search into "nothing".

Version 1.25.0.

Claude-Session: https://claude.ai/code/session_019MDtmuvTGrpo3VChP3skH8

* fix(web): keyless providers, from review

- GDELT query: OR and the parentheses grouping it are kept; a short
  acronym ("AI", "EU") is joined to its neighbour as a phrase instead of
  dropped; lower-case function words go; CJK words are quoted; unbalanced
  quotes are removed.
- GDELT: a non-object body or row is bad_response, not "unreachable"; a
  non-finite or negative interval falls back to 5 s instead of corrupting
  the shared pacing; a call left with under a second is not sent.
- Wikipedia: a site naming an edition searches that edition; edition codes
  such as "simple" and "zh-yue" are honoured and an unknown hint falls back
  to the configured edition; a MediaWiki error in a 200 body is a failure,
  never an empty search.

Claude-Session: https://claude.ai/code/session_019MDtmuvTGrpo3VChP3skH8

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-12 08:00:02 +01:00

140 lines
3.4 KiB
JSON

{
"name": "@bitbaum/ai-kit",
"version": "1.25.0",
"license": "MIT",
"author": "Mao Nakamoto",
"homepage": "https://github.com/bitbaum/ai-kit#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/bitbaum/ai-kit.git"
},
"bugs": {
"url": "https://github.com/bitbaum/ai-kit/issues"
},
"keywords": [
"ai",
"llm",
"form-fill",
"fallback",
"failover",
"health-check",
"free-tier",
"rate-limit",
"quota",
"usage",
"fair-share",
"groq",
"openrouter"
],
"type": "module",
"sideEffects": false,
"packageManager": "pnpm@11.25.0",
"engines": {
"node": ">=20"
},
"publishConfig": {
"access": "public",
"provenance": true
},
"files": [
"dist",
"dist-cjs",
"src"
],
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./sse": {
"types": "./dist/sse.d.ts",
"default": "./dist/sse.js"
},
"./forms": {
"types": "./dist/forms.d.ts",
"default": "./dist/forms.js"
},
"./react": {
"types": "./dist/react.d.ts",
"default": "./dist/react.js"
},
"./server": {
"types": "./dist/server.d.ts",
"default": "./dist/server.js"
},
"./registry": {
"types": "./dist/registry.d.ts",
"require": "./dist-cjs/registry.js",
"default": "./dist/registry.js"
},
"./web": {
"types": "./dist/web/index.d.ts",
"default": "./dist/web/index.js"
},
"./mcp": {
"types": "./dist/mcp.d.ts",
"default": "./dist/mcp.js"
},
"./capability": {
"types": "./dist/capability/index.d.ts",
"default": "./dist/capability/index.js"
},
"./grounding": {
"types": "./dist/grounding/index.d.ts",
"require": "./dist-cjs/grounding/index.js",
"default": "./dist/grounding/index.js"
},
"./byok": {
"types": "./dist/byok.d.ts",
"default": "./dist/byok.js"
},
"./seal": {
"types": "./dist/seal.d.ts",
"default": "./dist/seal.js"
},
"./byok-probe": {
"types": "./dist/byok-probe.d.ts",
"default": "./dist/byok-probe.js"
},
"./images": {
"types": "./dist/images.d.ts",
"default": "./dist/images.js"
}
},
"scripts": {
"build": "tsc -p tsconfig.json && tsc -p tsconfig.cjs.json && node -e \"require('fs').writeFileSync('dist-cjs/package.json', JSON.stringify({type:'commonjs'})+'\\n')\"",
"lint": "eslint .",
"typecheck": "tsc -p tsconfig.json --noEmit",
"test": "node --test test/*.test.js",
"check:catalog": "pnpm run build && node scripts/check-catalog.mjs",
"check:vision": "pnpm run build && node scripts/probe-vision.mjs",
"smoke": "pnpm run build && node scripts/smoke.mjs",
"verify": "pnpm run format:check && pnpm run lint && pnpm run typecheck && pnpm run build && pnpm test",
"prepare": "pnpm run build",
"format": "prettier --write .",
"format:check": "prettier --check ."
},
"devDependencies": {
"@eslint/js": "^10.0.1",
"@types/node": "^26.6.6",
"eslint": "^10.14.0",
"globals": "^17.14.0",
"prettier": "3.9.10",
"typescript": "^6.0.3",
"typescript-eslint": "^8.72.1"
},
"dependencies": {
"@mozilla/readability": "^0.6.0",
"ai-forms": "^0.1.3",
"linkedom": "^0.18.15"
},
"peerDependencies": {
"react": ">=18"
},
"peerDependenciesMeta": {
"react": {
"optional": true
}
}
}