@alexanderfortin/pi-tavily-tools 0.5.4 → 0.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -10
- package/dist/index.js.map +1 -1
- package/dist/tools/index.d.ts +6 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +6 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/shared/truncation.d.ts +8 -0
- package/dist/tools/shared/truncation.d.ts.map +1 -1
- package/dist/tools/shared/truncation.js +16 -2
- package/dist/tools/shared/truncation.js.map +1 -1
- package/dist/usage/api.d.ts +7 -0
- package/dist/usage/api.d.ts.map +1 -1
- package/dist/usage/api.js +34 -1
- package/dist/usage/api.js.map +1 -1
- package/dist/usage/index.d.ts +5 -2
- package/dist/usage/index.d.ts.map +1 -1
- package/dist/usage/index.js +5 -2
- package/dist/usage/index.js.map +1 -1
- package/dist/usage/status.d.ts +2 -1
- package/dist/usage/status.d.ts.map +1 -1
- package/dist/usage/status.js +28 -11
- package/dist/usage/status.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
## [0.5.
|
|
1
|
+
## [0.5.6](https://github.com/shaftoe/pi-tavily-tools/compare/v0.5.5...v0.5.6) (2026-04-09)
|
|
2
2
|
|
|
3
3
|
### Bug Fixes
|
|
4
4
|
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
## [0.5.3](https://github.com/shaftoe/pi-tavily-tools/compare/v0.5.2...v0.5.3) (2026-04-08)
|
|
8
|
-
|
|
9
|
-
### Bug Fixes
|
|
10
|
-
|
|
11
|
-
- ensure default max result is consistent ([deaaaeb](https://github.com/shaftoe/pi-tavily-tools/commit/deaaaeba17f846cf34ac88bde04a0ba645264c80))
|
|
5
|
+
- handle 429 rate limit errors on Tavily usage endpoint ([#13](https://github.com/shaftoe/pi-tavily-tools/issues/13)) ([24304df](https://github.com/shaftoe/pi-tavily-tools/commit/24304dfe9ae5eb30812c789ad63e966ea0e955b5))
|
|
12
6
|
|
|
13
7
|
# Changelog
|
|
14
8
|
|
|
@@ -18,6 +12,26 @@ This project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
|
|
|
18
12
|
uses [semantic-release](https://semantic-release.gitbook.io/) for automated releases.
|
|
19
13
|
The format is based on [Keep a Changelog](https://keepachangelog.org/en/1.1.0/).
|
|
20
14
|
|
|
15
|
+
## [Unreleased]
|
|
16
|
+
|
|
17
|
+
## [0.5.5](https://github.com/shaftoe/pi-tavily-tools/compare/v0.5.4...v0.5.5) (2026-04-09)
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
- remove doulbe counting in status when paygo is enabled ([9e4f630](https://github.com/shaftoe/pi-tavily-tools/commit/9e4f63056a887636541ee65e6604a48b58b599ab))
|
|
22
|
+
|
|
23
|
+
## [0.5.4](https://github.com/shaftoe/pi-tavily-tools/compare/v0.5.3...v0.5.4) (2026-04-08)
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
- relax FETCH_COOLDOWN_MS to 2 minutes ([8b78e32](https://github.com/shaftoe/pi-tavily-tools/commit/8b78e323540f55038874ef12ed188dc1a95f27f2))
|
|
28
|
+
|
|
29
|
+
## [0.5.3](https://github.com/shaftoe/pi-tavily-tools/compare/v0.5.2...v0.5.3) (2026-04-08)
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
- ensure default max result is consistent ([deaaaeb](https://github.com/shaftoe/pi-tavily-tools/commit/deaaaeba17f846cf34ac88bde04a0ba645264c80))
|
|
34
|
+
|
|
21
35
|
## [0.5.2](https://github.com/shaftoe/pi-tavily-tools/compare/v0.5.1...v0.5.2) (2026-04-08)
|
|
22
36
|
|
|
23
37
|
### Performance Improvements
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAUlE;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,WAAW,EAAE,EAAE,YAAY,GAAG,IAAI,CAiC/C"}
|
package/dist/index.js
CHANGED
|
@@ -5,11 +5,8 @@
|
|
|
5
5
|
* Adds a `web_search` tool that the LLM can use to find current
|
|
6
6
|
* information, recent news, documentation, and time-sensitive data.
|
|
7
7
|
*/
|
|
8
|
-
import { resultCache } from "./tools/
|
|
9
|
-
import {
|
|
10
|
-
import { registerWebExtractTool } from "./tools/web-extract.js";
|
|
11
|
-
import { registerWebSearchTool } from "./tools/web-search.js";
|
|
12
|
-
import { TavilyUsageCache } from "./usage/index.js";
|
|
8
|
+
import { cleanupTempDir, createTavilyClient, registerWebExtractTool, registerWebSearchTool, resultCache, } from "./tools/index.js";
|
|
9
|
+
import { UsageCache } from "./usage/index.js";
|
|
13
10
|
/**
|
|
14
11
|
* Main extension entry point.
|
|
15
12
|
*
|
|
@@ -29,7 +26,7 @@ export default function (pi) {
|
|
|
29
26
|
return;
|
|
30
27
|
}
|
|
31
28
|
let registered = false;
|
|
32
|
-
const usageCache = new
|
|
29
|
+
const usageCache = new UsageCache(apiKey);
|
|
33
30
|
pi.on("session_start", async (_event, ctx) => {
|
|
34
31
|
resultCache.clear();
|
|
35
32
|
if (registered)
|
|
@@ -43,11 +40,9 @@ export default function (pi) {
|
|
|
43
40
|
pi.on("turn_end", async (_event, ctx) => {
|
|
44
41
|
await usageCache.updateStatus(ctx);
|
|
45
42
|
});
|
|
46
|
-
pi.on("session_shutdown", (_event, ctx) => {
|
|
43
|
+
pi.on("session_shutdown", async (_event, ctx) => {
|
|
47
44
|
usageCache.clear(ctx);
|
|
48
|
-
|
|
49
|
-
.then(({ rm }) => rm(`${ctx.cwd}/.pi-tavily-temp`, { recursive: true, force: true }))
|
|
50
|
-
.catch(() => { }); // best-effort
|
|
45
|
+
await cleanupTempDir(ctx.cwd).catch(() => { }); // best-effort
|
|
51
46
|
});
|
|
52
47
|
}
|
|
53
48
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,WAAW,EAAgB;IACvC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,IAAI,EAAE,CAAC;IAClD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,EAAE,CAAC,EAAE,CAAC,eAAe,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE;YACrC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,mEAAmE,EAAE,SAAS,CAAC,CAAC;QAChG,CAAC,CAAC,CAAC;QACH,OAAO;IACT,CAAC;IAED,IAAI,UAAU,GAAG,KAAK,CAAC;IACvB,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IAE1C,EAAE,CAAC,EAAE,CAAC,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE;QAC3C,WAAW,CAAC,KAAK,EAAE,CAAC;QAEpB,IAAI,UAAU;YAAE,OAAO;QACvB,UAAU,GAAG,IAAI,CAAC;QAElB,MAAM,MAAM,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;QAC1C,qBAAqB,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QAClC,sBAAsB,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QAEnC,MAAM,UAAU,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE;QACtC,MAAM,UAAU,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,EAAE,CAAC,kBAAkB,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE;QAC9C,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACtB,MAAM,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC,CAAC,cAAc;IAC/D,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Tavily Tools for Pi
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Public API barrel. External consumers (e.g. src/index.ts) should
|
|
5
|
+
* import everything from here.
|
|
5
6
|
*/
|
|
7
|
+
export { resultCache } from "./shared/cache.js";
|
|
8
|
+
export { buildToolResult, raceAbort, sanitizeError, sendProgress } from "./shared/execute.js";
|
|
9
|
+
export { cleanupTempDir } from "./shared/truncation.js";
|
|
10
|
+
export { createTavilyClient } from "./tavily/client.js";
|
|
6
11
|
export { registerWebExtractTool } from "./web-extract.js";
|
|
7
12
|
export { registerWebSearchTool } from "./web-search.js";
|
|
8
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/tools/index.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Tavily Tools for Pi
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Public API barrel. External consumers (e.g. src/index.ts) should
|
|
5
|
+
* import everything from here.
|
|
5
6
|
*/
|
|
7
|
+
export { resultCache } from "./shared/cache.js";
|
|
8
|
+
export { buildToolResult, raceAbort, sanitizeError, sendProgress } from "./shared/execute.js";
|
|
9
|
+
export { cleanupTempDir } from "./shared/truncation.js";
|
|
10
|
+
export { createTavilyClient } from "./tavily/client.js";
|
|
6
11
|
export { registerWebExtractTool } from "./web-extract.js";
|
|
7
12
|
export { registerWebSearchTool } from "./web-search.js";
|
|
8
13
|
//# sourceMappingURL=index.js.map
|
package/dist/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -7,6 +7,14 @@ export interface TruncatedOutput {
|
|
|
7
7
|
truncation?: TruncationResult;
|
|
8
8
|
fullOutputPath?: string;
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Get the temp directory path used for storing truncated output files.
|
|
12
|
+
*/
|
|
13
|
+
export declare function getTempDir(cwd: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Remove the temp directory and all its contents.
|
|
16
|
+
*/
|
|
17
|
+
export declare function cleanupTempDir(cwd: string): Promise<void>;
|
|
10
18
|
/**
|
|
11
19
|
* Apply truncation to output and save full content to temp file if needed
|
|
12
20
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"truncation.d.ts","sourceRoot":"","sources":["../../../src/tools/shared/truncation.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAML,KAAK,gBAAgB,EACtB,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"truncation.d.ts","sourceRoot":"","sources":["../../../src/tools/shared/truncation.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAML,KAAK,gBAAgB,EACtB,MAAM,+BAA+B,CAAC;AAOvC,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAG/D;AAED;;GAEG;AACH,wBAAsB,eAAe,CACnC,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,eAAe,CAAC,CAwC1B"}
|
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
* Shared truncation utilities
|
|
3
3
|
*/
|
|
4
4
|
import { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize, truncateHead, withFileMutationQueue, } from "@mariozechner/pi-coding-agent";
|
|
5
|
+
import { Temporal } from "temporal-polyfill";
|
|
6
|
+
/**
|
|
7
|
+
* Get the temp directory path used for storing truncated output files.
|
|
8
|
+
*/
|
|
9
|
+
export function getTempDir(cwd) {
|
|
10
|
+
return `${cwd}/.pi-tavily-temp`;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Remove the temp directory and all its contents.
|
|
14
|
+
*/
|
|
15
|
+
export async function cleanupTempDir(cwd) {
|
|
16
|
+
const { rm } = await import("node:fs/promises");
|
|
17
|
+
await rm(getTempDir(cwd), { recursive: true, force: true });
|
|
18
|
+
}
|
|
5
19
|
/**
|
|
6
20
|
* Apply truncation to output and save full content to temp file if needed
|
|
7
21
|
*/
|
|
@@ -13,8 +27,8 @@ export async function applyTruncation(fullOutput, cwd, toolName) {
|
|
|
13
27
|
let content = truncation.content;
|
|
14
28
|
// Save full output to temp file if truncated
|
|
15
29
|
if (truncation.truncated) {
|
|
16
|
-
const tempDir =
|
|
17
|
-
const timestamp =
|
|
30
|
+
const tempDir = getTempDir(cwd);
|
|
31
|
+
const timestamp = Temporal.Now.instant().epochMilliseconds;
|
|
18
32
|
const tempFile = `${tempDir}/${toolName}-${timestamp}.txt`;
|
|
19
33
|
await withFileMutationQueue(tempFile, async () => {
|
|
20
34
|
const { writeFile, mkdir } = await import("node:fs/promises");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"truncation.js","sourceRoot":"","sources":["../../../src/tools/shared/truncation.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,qBAAqB,GAEtB,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"truncation.js","sourceRoot":"","sources":["../../../src/tools/shared/truncation.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,qBAAqB,GAEtB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAY7C;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,OAAO,GAAG,GAAG,kBAAkB,CAAC;AAClC,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,GAAW;IAC9C,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,CAAC;IAChD,MAAM,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,UAAkB,EAClB,GAAW,EACX,QAAgB;IAEhB,MAAM,UAAU,GAAG,YAAY,CAAC,UAAU,EAAE;QAC1C,QAAQ,EAAE,iBAAiB;QAC3B,QAAQ,EAAE,iBAAiB;KAC5B,CAAC,CAAC;IAEH,IAAI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,cAAc,EAAE,QAAQ;SACzB,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,CAAC;AACrB,CAAC"}
|
package/dist/usage/api.d.ts
CHANGED
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
* Fetches usage data from the Tavily usage endpoint.
|
|
5
5
|
* @see https://docs.tavily.com/documentation/api-reference/endpoint/usage
|
|
6
6
|
*/
|
|
7
|
+
/** Default retry-after duration in milliseconds (5 minutes) */
|
|
8
|
+
export declare const DEFAULT_RETRY_AFTER_MS = 300000;
|
|
9
|
+
/** Error thrown when the Tavily usage API rate limit is exceeded */
|
|
10
|
+
export declare class RateLimitError extends Error {
|
|
11
|
+
readonly retryAfterMs: number;
|
|
12
|
+
constructor(retryAfterMs: number);
|
|
13
|
+
}
|
|
7
14
|
export interface TavilyUsageKeySection {
|
|
8
15
|
usage: number;
|
|
9
16
|
limit: number;
|
package/dist/usage/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/usage/api.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/usage/api.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,+DAA+D;AAC/D,eAAO,MAAM,sBAAsB,SAAU,CAAC;AAM9C,oEAAoE;AACpE,qBAAa,cAAe,SAAQ,KAAK;IACvC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;gBAElB,YAAY,EAAE,MAAM;CAKjC;AAuBD,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,yBAAyB;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,qBAAqB,CAAC;IAC3B,OAAO,EAAE,yBAAyB,CAAC;CACpC;AAED,MAAM,WAAW,eAAe;IAC9B,wEAAwE;IACxE,UAAU,EAAE,MAAM,CAAC;IACnB,wBAAwB;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,6BAA6B;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,wBAAwB;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,wBAAwB;IACxB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAMD;;;GAGG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CA6C7E"}
|
package/dist/usage/api.js
CHANGED
|
@@ -5,6 +5,34 @@
|
|
|
5
5
|
* @see https://docs.tavily.com/documentation/api-reference/endpoint/usage
|
|
6
6
|
*/
|
|
7
7
|
const TAVILY_USAGE_API_URL = "https://api.tavily.com/usage";
|
|
8
|
+
/** Default retry-after duration in milliseconds (5 minutes) */
|
|
9
|
+
export const DEFAULT_RETRY_AFTER_MS = 300_000;
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// Errors
|
|
12
|
+
// ============================================================================
|
|
13
|
+
/** Error thrown when the Tavily usage API rate limit is exceeded */
|
|
14
|
+
export class RateLimitError extends Error {
|
|
15
|
+
retryAfterMs;
|
|
16
|
+
constructor(retryAfterMs) {
|
|
17
|
+
super(`Tavily usage API rate limited; retry after ${retryAfterMs}ms`);
|
|
18
|
+
this.name = "RateLimitError";
|
|
19
|
+
this.retryAfterMs = retryAfterMs;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
// ============================================================================
|
|
23
|
+
// Utilities
|
|
24
|
+
// ============================================================================
|
|
25
|
+
/**
|
|
26
|
+
* Parse the HTTP Retry-After header to milliseconds.
|
|
27
|
+
* Tavily returns the value as decimal integer seconds (e.g., "60").
|
|
28
|
+
*/
|
|
29
|
+
function parseRetryAfter(retryAfterHeader) {
|
|
30
|
+
if (!retryAfterHeader) {
|
|
31
|
+
return DEFAULT_RETRY_AFTER_MS;
|
|
32
|
+
}
|
|
33
|
+
const seconds = parseInt(retryAfterHeader.trim(), 10);
|
|
34
|
+
return isNaN(seconds) ? DEFAULT_RETRY_AFTER_MS : Math.max(seconds * 1000, 0);
|
|
35
|
+
}
|
|
8
36
|
// ============================================================================
|
|
9
37
|
// API Client
|
|
10
38
|
// ============================================================================
|
|
@@ -22,6 +50,11 @@ export async function getTavilyUsage(apiKey) {
|
|
|
22
50
|
},
|
|
23
51
|
});
|
|
24
52
|
if (!response.ok) {
|
|
53
|
+
if (response.status === 429) {
|
|
54
|
+
const retryAfterHeader = response.headers.get("retry-after");
|
|
55
|
+
const retryAfterMs = parseRetryAfter(retryAfterHeader);
|
|
56
|
+
throw new RateLimitError(retryAfterMs);
|
|
57
|
+
}
|
|
25
58
|
throw new Error(`Tavily usage API request failed with status ${response.status}`);
|
|
26
59
|
}
|
|
27
60
|
const data = (await response.json());
|
|
@@ -31,7 +64,7 @@ export async function getTavilyUsage(apiKey) {
|
|
|
31
64
|
if (typeof data.account.plan_limit !== "number") {
|
|
32
65
|
throw new Error("Unexpected Tavily usage API response: missing account plan limit");
|
|
33
66
|
}
|
|
34
|
-
const totalUsage = data.account.plan_usage
|
|
67
|
+
const totalUsage = data.account.plan_usage;
|
|
35
68
|
const totalLimit = data.account.plan_limit + (data.account.paygo_limit ?? 0);
|
|
36
69
|
const percentage = (totalUsage / (totalLimit || 1)) * 100;
|
|
37
70
|
return {
|
package/dist/usage/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/usage/api.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,oBAAoB,GAAG,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/usage/api.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,oBAAoB,GAAG,8BAA8B,CAAC;AAE5D,+DAA+D;AAC/D,MAAM,CAAC,MAAM,sBAAsB,GAAG,OAAO,CAAC;AAE9C,+EAA+E;AAC/E,SAAS;AACT,+EAA+E;AAE/E,oEAAoE;AACpE,MAAM,OAAO,cAAe,SAAQ,KAAK;IAC9B,YAAY,CAAS;IAE9B,YAAY,YAAoB;QAC9B,KAAK,CAAC,8CAA8C,YAAY,IAAI,CAAC,CAAC;QACtE,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAC7B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;CACF;AAED,+EAA+E;AAC/E,YAAY;AACZ,+EAA+E;AAE/E;;;GAGG;AACH,SAAS,eAAe,CAAC,gBAA+B;IACtD,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,OAAO,sBAAsB,CAAC;IAChC,CAAC;IAED,MAAM,OAAO,GAAG,QAAQ,CAAC,gBAAgB,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IACtD,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC;AAC/E,CAAC;AAmDD,+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AC,IAAI,CAAC,OAAO,CAAC,WAAW,IAAI,CAAC,CAAC,CAAC;IAC7E,MAAM,UAAU,GAAG,CAAC,UAAU,GAAG,CAAC,UAAU,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;IAE1D,OAAO;QACL,UAAU;QACV,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU;QAClC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU;QAClC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,WAAW,IAAI,CAAC;QACzC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,WAAW,IAAI,CAAC;QACzC,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,KAAK,IAAI,CAAC;QAC9B,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,KAAK,IAAI,CAAC;KAC/B,CAAC;AACJ,CAAC"}
|
package/dist/usage/index.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Tavily Usage Cache
|
|
3
|
+
*/
|
|
4
|
+
export { RateLimitError, getTavilyUsage } from "./api.js";
|
|
2
5
|
export type { TavilyUsageData } from "./api.js";
|
|
3
|
-
export {
|
|
6
|
+
export { UsageCache } from "./status.js";
|
|
4
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/usage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/usage/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1D,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/usage/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Tavily Usage Cache
|
|
3
|
+
*/
|
|
4
|
+
export { RateLimitError, getTavilyUsage } from "./api.js";
|
|
5
|
+
export { UsageCache } from "./status.js";
|
|
3
6
|
//# sourceMappingURL=index.js.map
|
package/dist/usage/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/usage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/usage/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/usage/status.d.ts
CHANGED
|
@@ -9,10 +9,11 @@ import { type TavilyUsageData } from "./api.js";
|
|
|
9
9
|
/** Fetch usage function signature (same as getTavilyUsage for testability) */
|
|
10
10
|
export type FetchUsageFn = (apiKey: string) => Promise<TavilyUsageData>;
|
|
11
11
|
/** Cache for Tavily usage data to avoid excessive API calls */
|
|
12
|
-
export declare class
|
|
12
|
+
export declare class UsageCache {
|
|
13
13
|
private readonly apiKey;
|
|
14
14
|
private lastUsage;
|
|
15
15
|
private lastFetchTime;
|
|
16
|
+
private backoffUntil;
|
|
16
17
|
private static readonly FETCH_COOLDOWN_MS;
|
|
17
18
|
constructor(apiKey: string);
|
|
18
19
|
/** Build and set footer status string from usage data */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/usage/status.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,OAAO,
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/usage/status.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,OAAO,EAAkC,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhF,8EAA8E;AAC9E,MAAM,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;AAExE,+DAA+D;AAC/D,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,SAAS,CAAgC;IACjD,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAW;gBAExC,MAAM,EAAE,MAAM;IAI1B,yDAAyD;IACzD,OAAO,CAAC,kBAAkB;IAS1B,yDAAyD;IACnD,YAAY,CAChB,GAAG,EAAE,gBAAgB,EACrB,UAAU,GAAE,YAA6B,GACxC,OAAO,CAAC,IAAI,CAAC;IAyChB,uCAAuC;IACvC,KAAK,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI;CAGnC"}
|
package/dist/usage/status.js
CHANGED
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
* with caching to avoid excessive API calls.
|
|
6
6
|
*/
|
|
7
7
|
import { Temporal } from "temporal-polyfill";
|
|
8
|
-
import { getTavilyUsage } from "./api.js";
|
|
8
|
+
import { RateLimitError, getTavilyUsage } from "./api.js";
|
|
9
9
|
/** Cache for Tavily usage data to avoid excessive API calls */
|
|
10
|
-
export class
|
|
10
|
+
export class UsageCache {
|
|
11
11
|
apiKey;
|
|
12
12
|
lastUsage = null;
|
|
13
13
|
lastFetchTime = 0;
|
|
14
|
+
backoffUntil = 0;
|
|
14
15
|
static FETCH_COOLDOWN_MS = 120_000;
|
|
15
16
|
constructor(apiKey) {
|
|
16
17
|
this.apiKey = apiKey;
|
|
@@ -24,23 +25,39 @@ export class TavilyUsageCache {
|
|
|
24
25
|
}
|
|
25
26
|
/** Update footer status with Tavily usage information */
|
|
26
27
|
async updateStatus(ctx, fetchUsage = getTavilyUsage) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (this.lastUsage
|
|
31
|
-
this.lastFetchTime &&
|
|
32
|
-
now - this.lastFetchTime < TavilyUsageCache.FETCH_COOLDOWN_MS) {
|
|
28
|
+
const now = Temporal.Now.instant().epochMilliseconds;
|
|
29
|
+
// Respect rate-limit backoff — use cached data or skip silently
|
|
30
|
+
if (now < this.backoffUntil) {
|
|
31
|
+
if (this.lastUsage) {
|
|
33
32
|
this.setStatusFromUsage(ctx, this.lastUsage);
|
|
34
|
-
return;
|
|
35
33
|
}
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
// Use cached data if still fresh
|
|
37
|
+
if (this.lastUsage &&
|
|
38
|
+
this.lastFetchTime &&
|
|
39
|
+
now - this.lastFetchTime < UsageCache.FETCH_COOLDOWN_MS) {
|
|
40
|
+
this.setStatusFromUsage(ctx, this.lastUsage);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
try {
|
|
36
44
|
const usage = await fetchUsage(this.apiKey);
|
|
37
45
|
this.lastUsage = usage;
|
|
38
46
|
this.lastFetchTime = now;
|
|
39
47
|
this.setStatusFromUsage(ctx, usage);
|
|
40
48
|
}
|
|
41
49
|
catch (error) {
|
|
42
|
-
|
|
43
|
-
|
|
50
|
+
if (error instanceof RateLimitError) {
|
|
51
|
+
this.backoffUntil = now + error.retryAfterMs;
|
|
52
|
+
// Keep last known status instead of clearing
|
|
53
|
+
if (this.lastUsage) {
|
|
54
|
+
this.setStatusFromUsage(ctx, this.lastUsage);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
console.error(`Error updating Tavily usage: ${String(error)}`);
|
|
59
|
+
this.clear(ctx);
|
|
60
|
+
}
|
|
44
61
|
}
|
|
45
62
|
}
|
|
46
63
|
/** Clear Tavily usage footer status */
|
package/dist/usage/status.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/usage/status.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAwB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/usage/status.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAwB,MAAM,UAAU,CAAC;AAKhF,+DAA+D;AAC/D,MAAM,OAAO,UAAU;IACJ,MAAM,CAAS;IACxB,SAAS,GAA2B,IAAI,CAAC;IACzC,aAAa,GAAG,CAAC,CAAC;IAClB,YAAY,GAAG,CAAC,CAAC;IACjB,MAAM,CAAU,iBAAiB,GAAG,OAAO,CAAC;IAEpD,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,yDAAyD;IACjD,kBAAkB,CAAC,GAAqB,EAAE,SAA0B;QAC1E,MAAM,KAAK,GAAG,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC;QAC3B,MAAM,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,UAAU,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC;QAErE,IAAI,MAAM,GAAG,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,iBAAiB,GAAG,CAAC,CAAC;QAExF,GAAG,CAAC,EAAE,CAAC,SAAS,CAAC,cAAc,EA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