@alexanderfortin/pi-tavily-tools 0.5.18 → 0.6.0

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 CHANGED
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.6.0] - 2026-06-10
11
+
12
+ ### Added
13
+
14
+ - Support Pi AuthStorage for TAVILY_API_KEY (#67)
15
+
16
+ ### Changed
17
+
18
+ - **deps-dev**: update dependencies (#63)
19
+
10
20
  ## [0.5.18] - 2026-06-03
11
21
 
12
22
  ### Changed
@@ -210,7 +220,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
210
220
 
211
221
  - Initial release with `web_search` tool using Tavily
212
222
 
213
- [unreleased]: https://github.com/shaftoe/pi-tavily-tools/compare/v0.5.18...HEAD
223
+ [unreleased]: https://github.com/shaftoe/pi-tavily-tools/compare/v0.6.0...HEAD
224
+ [0.6.0]: https://github.com/shaftoe/pi-tavily-tools/compare/v0.5.18...v0.6.0
214
225
  [0.5.18]: https://github.com/shaftoe/pi-tavily-tools/compare/v0.5.17...v0.5.18
215
226
  [0.5.17]: https://github.com/shaftoe/pi-tavily-tools/compare/v0.5.16...v0.5.17
216
227
  [0.5.16]: https://github.com/shaftoe/pi-tavily-tools/compare/v0.5.15...v0.5.16
package/dist/index.d.ts CHANGED
@@ -9,12 +9,15 @@ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
9
9
  /**
10
10
  * Main extension entry point.
11
11
  *
12
- * Requires TAVILY_API_KEY to be set if missing, no hooks are registered
13
- * and the extension is effectively a no-op.
12
+ * Resolves API key from AuthStorage under key "tavily" first,
13
+ * falling back to TAVILY_API_KEY environment variable.
14
+ *
15
+ * If neither is available, no hooks are registered and the extension
16
+ * is effectively a no-op.
14
17
  *
15
18
  * Defers tool registration to `session_start` so Pi can start
16
- * even if the TAVILY_API_KEY is missing. The tool is registered only
19
+ * even if the API key is missing. The tool is registered only
17
20
  * once on the first agent run and persists across sessions.
18
21
  */
19
- export default function (pi: ExtensionAPI): void;
22
+ export default function (pi: ExtensionAPI): Promise<void>;
20
23
  //# sourceMappingURL=index.d.ts.map
@@ -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,iCAAiC,CAAC;AAUpE;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,WAAW,EAAE,EAAE,YAAY,GAAG,IAAI,CAkC/C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAWpE;;;;;;;;;;;;GAYG;AACH,yBAA+B,EAAE,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAwC9D"}
package/dist/index.js CHANGED
@@ -5,23 +5,28 @@
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 { AuthStorage } from "@earendil-works/pi-coding-agent";
8
9
  import { cleanupTempDir, createTavilyClient, registerWebExtractTool, registerWebSearchTool, resultCache, } from "./tools/index.js";
9
10
  import { UsageCache } from "./usage/index.js";
10
11
  /**
11
12
  * Main extension entry point.
12
13
  *
13
- * Requires TAVILY_API_KEY to be set if missing, no hooks are registered
14
- * and the extension is effectively a no-op.
14
+ * Resolves API key from AuthStorage under key "tavily" first,
15
+ * falling back to TAVILY_API_KEY environment variable.
16
+ *
17
+ * If neither is available, no hooks are registered and the extension
18
+ * is effectively a no-op.
15
19
  *
16
20
  * Defers tool registration to `session_start` so Pi can start
17
- * even if the TAVILY_API_KEY is missing. The tool is registered only
21
+ * even if the API key is missing. The tool is registered only
18
22
  * once on the first agent run and persists across sessions.
19
23
  */
20
- export default function (pi) {
21
- const apiKey = process.env.TAVILY_API_KEY?.trim();
24
+ export default async function (pi) {
25
+ const authStorage = AuthStorage.create();
26
+ const apiKey = (await authStorage.getApiKey("tavily"))?.trim() ?? process.env.TAVILY_API_KEY?.trim();
22
27
  if (!apiKey) {
23
28
  pi.on("session_start", (_event, ctx) => {
24
- ctx.ui.notify("Web Search · TAVILY_API_KEY not set. Get a free key at tavily.com", "warning");
29
+ ctx.ui.notify('Web Search · API key not found. Add to ~/.pi/agent/auth.json under "tavily" key or set TAVILY_API_KEY env var. Get a free key at tavily.com', "warning");
25
30
  });
26
31
  return;
27
32
  }
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,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,CAAC,MAAM,EAAE,GAAG,EAAE,EA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EH,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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@alexanderfortin/pi-tavily-tools",
3
3
  "author": "Alexander Fortin",
4
- "version": "0.5.18",
4
+ "version": "0.6.0",
5
5
  "description": "Pi coding agent extension for web search and content extraction using Tavily",
6
6
  "keywords": [
7
7
  "pi-package",
@@ -61,7 +61,7 @@
61
61
  "release:dry-run": "semantic-release --dry-run"
62
62
  },
63
63
  "devDependencies": {
64
- "@alexanderfortin/semantic-release-keep-a-changelog": "^0.3.0",
64
+ "@alexanderfortin/semantic-release-keep-a-changelog": "^0.4.0",
65
65
  "@earendil-works/pi-ai": "0.74.0",
66
66
  "@earendil-works/pi-coding-agent": "0.74.0",
67
67
  "@earendil-works/pi-tui": "0.74.0",
@@ -74,7 +74,7 @@
74
74
  "@semantic-release/release-notes-generator": "14.1.1",
75
75
  "@sinclair/typebox": "0.34.49",
76
76
  "@types/bun": "1.3.14",
77
- "@types/node": "25.9.1",
77
+ "@types/node": "^25.9.2",
78
78
  "@typescript-eslint/eslint-plugin": "^8.60.1",
79
79
  "@typescript-eslint/parser": "^8.60.1",
80
80
  "eslint": "10.4.1",