@jarcelao/pi-exa-api 0.2.1 → 0.2.2

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/README.md CHANGED
@@ -10,6 +10,9 @@ Install as a pi package:
10
10
  pi install npm:@jarcelao/pi-exa-api
11
11
  ```
12
12
 
13
+ > [!NOTE]
14
+ > This extension is compatible with `pi-coding-agent` v0.69.0
15
+
13
16
  ## Configuration
14
17
 
15
18
  Set your Exa API key as an environment variable before starting pi:
@@ -16,11 +16,12 @@ import type { ExtensionAPI, ExtensionContext } from "@mariozechner/pi-coding-age
16
16
  import {
17
17
  DEFAULT_MAX_BYTES,
18
18
  DEFAULT_MAX_LINES,
19
+ defineTool,
19
20
  formatSize,
20
21
  truncateHead,
21
22
  } from "@mariozechner/pi-coding-agent";
22
23
  import { Text } from "@mariozechner/pi-tui";
23
- import { Type, type Static } from "@mariozechner/pi-ai";
24
+ import { Type, type Static } from "typebox";
24
25
  import Exa from "exa-js";
25
26
 
26
27
  // API Key Management
@@ -276,9 +277,10 @@ export default function exaSearchExtension(pi: ExtensionAPI): void {
276
277
  ),
277
278
  });
278
279
 
279
- pi.registerTool({
280
- name: "exa_search",
281
- label: "Exa Search",
280
+ pi.registerTool(
281
+ defineTool({
282
+ name: "exa_search",
283
+ label: "Exa Search",
282
284
  description:
283
285
  "Search the web using Exa's neural search API. Best for factual queries, research, and finding relevant web content. Use highlights mode by default for token efficiency.",
284
286
  parameters: ExaSearchParams,
@@ -366,7 +368,9 @@ export default function exaSearchExtension(pi: ExtensionAPI): void {
366
368
  const cost = details.cost ? ` • $${details.cost.total.toFixed(6)}` : "";
367
369
  return new Text(theme.fg("success", `✓ ${details.numResults} results${cost}`), 0, 0);
368
370
  },
369
- });
371
+ })
372
+ );
373
+
370
374
 
371
375
  // Register exa_fetch tool
372
376
 
@@ -384,9 +388,10 @@ export default function exaSearchExtension(pi: ExtensionAPI): void {
384
388
  ),
385
389
  });
386
390
 
387
- pi.registerTool({
388
- name: "exa_fetch",
389
- label: "Exa Fetch",
391
+ pi.registerTool(
392
+ defineTool({
393
+ name: "exa_fetch",
394
+ label: "Exa Fetch",
390
395
  description:
391
396
  "Fetch and extract content from a specific URL using Exa. Can return full text, highlights, or AI-generated summary.",
392
397
  parameters: ExaFetchParams,
@@ -488,7 +493,8 @@ export default function exaSearchExtension(pi: ExtensionAPI): void {
488
493
 
489
494
  return new Text(theme.fg("success", `✓ Fetched${cost}`), 0, 0);
490
495
  },
491
- });
496
+ })
497
+ );
492
498
 
493
499
  // Register exa_code_context tool
494
500
 
@@ -508,9 +514,10 @@ export default function exaSearchExtension(pi: ExtensionAPI): void {
508
514
  ),
509
515
  });
510
516
 
511
- pi.registerTool({
512
- name: "exa_code_context",
513
- label: "Exa Code Context",
517
+ pi.registerTool(
518
+ defineTool({
519
+ name: "exa_code_context",
520
+ label: "Exa Code Context",
514
521
  description:
515
522
  "Search for code snippets and examples from open source libraries and repositories. Use this to find working code examples that help understand how libraries, frameworks, or concepts are implemented.",
516
523
  parameters: ExaCodeContextParams,
@@ -618,7 +625,9 @@ export default function exaSearchExtension(pi: ExtensionAPI): void {
618
625
  0,
619
626
  );
620
627
  },
621
- });
628
+ })
629
+ );
630
+
622
631
 
623
632
  // Register /exa-status command
624
633
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jarcelao/pi-exa-api",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Web search and content fetching for pi via the Exa API",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -34,7 +34,7 @@
34
34
  "peerDependencies": {
35
35
  "@mariozechner/pi-coding-agent": "*",
36
36
  "@mariozechner/pi-tui": "*",
37
- "@sinclair/typebox": "*"
37
+ "typebox": "*"
38
38
  },
39
39
  "pi": {
40
40
  "extensions": [