@aliou/pi-linkup 0.3.1 → 0.4.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 +13 -0
- package/README.md +6 -0
- package/package.json +7 -3
- package/skills/linkup/SKILL.md +16 -8
- package/src/client.ts +4 -1
- package/src/tools/web-search.ts +8 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @aliou/pi-linkup
|
|
2
2
|
|
|
3
|
+
## 0.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 052fc2b: Add fast mode support to linkup_web_search tool. The depth parameter now accepts "fast", "standard", or "deep" modes:
|
|
8
|
+
- fast: Sub-second latency using pre-indexed atoms of information
|
|
9
|
+
- standard: Single iteration retrieval, balanced speed/depth (default)
|
|
10
|
+
- deep: Up to 10 iterations with chain-of-thought reasoning
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- a238ba7: Add User-Agent header to all Linkup API requests for attribution.
|
|
15
|
+
|
|
3
16
|
## 0.3.1
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Web search and content fetching extension for [Pi](https://buildwithpi.ai/) using the [Linkup API](https://linkup.so).
|
|
4
4
|
|
|
5
|
+
|
|
6
|
+
|
|
5
7
|
## Features
|
|
6
8
|
|
|
7
9
|
- `linkup_web_search` - Search the web, get relevant sources with content
|
|
@@ -9,6 +11,10 @@ Web search and content fetching extension for [Pi](https://buildwithpi.ai/) usin
|
|
|
9
11
|
- `linkup_web_fetch` - Extract clean markdown from URLs
|
|
10
12
|
- `/linkup:balance` - Check API credit balance
|
|
11
13
|
|
|
14
|
+
|
|
15
|
+
https://github.com/user-attachments/assets/a0f131a4-d57c-4162-aeb5-ffc1a0a8d7ff
|
|
16
|
+
|
|
17
|
+
|
|
12
18
|
## Installation
|
|
13
19
|
|
|
14
20
|
### Get API Key
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aliou/pi-linkup",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/aliou/pi-linkup"
|
|
@@ -17,11 +17,15 @@
|
|
|
17
17
|
],
|
|
18
18
|
"video": "https://assets.aliou.me/pi-extensions/demos/pi-linkup.mp4"
|
|
19
19
|
},
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"@mariozechner/pi-coding-agent": ">=0.52.7",
|
|
22
|
+
"@mariozechner/pi-ai": ">=0.52.7"
|
|
23
|
+
},
|
|
20
24
|
"devDependencies": {
|
|
21
25
|
"@biomejs/biome": "^2.3.13",
|
|
22
26
|
"@changesets/cli": "^2.27.11",
|
|
23
|
-
"@mariozechner/pi-coding-agent": "0.
|
|
24
|
-
"@mariozechner/pi-tui": "0.
|
|
27
|
+
"@mariozechner/pi-coding-agent": "0.52.7",
|
|
28
|
+
"@mariozechner/pi-tui": "0.52.7",
|
|
25
29
|
"@sinclair/typebox": "^0.34.48",
|
|
26
30
|
"@types/node": "^25.0.10",
|
|
27
31
|
"husky": "^9.1.7",
|
package/skills/linkup/SKILL.md
CHANGED
|
@@ -14,11 +14,14 @@ Web search and content fetching tools powered by Linkup API.
|
|
|
14
14
|
Search the web and get sources with content snippets.
|
|
15
15
|
|
|
16
16
|
```
|
|
17
|
-
linkup_web_search(query: string,
|
|
17
|
+
linkup_web_search(query: string, depth?: "fast" | "standard" | "deep")
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
- `query`: Be specific and detailed. Include context like dates, locations, company names.
|
|
21
|
-
- `
|
|
21
|
+
- `depth`: Search depth mode. Default: "standard".
|
|
22
|
+
- `fast`: Sub-second latency, uses pre-indexed "atoms of information". Best for quick facts and simple lookups.
|
|
23
|
+
- `standard`: Single iteration retrieval. Balanced speed and depth for most queries.
|
|
24
|
+
- `deep`: Up to 10 iterations with chain-of-thought reasoning. Best for complex multi-step research (slower).
|
|
22
25
|
|
|
23
26
|
**Use when:** Discovering information across multiple sources, researching topics, comparing perspectives.
|
|
24
27
|
|
|
@@ -68,18 +71,23 @@ linkup_web_fetch(url: string, renderJs?: boolean)
|
|
|
68
71
|
- Location: "French company Total", "US market"
|
|
69
72
|
- Specifics: company names, version numbers, exact terms
|
|
70
73
|
|
|
71
|
-
##
|
|
74
|
+
## Depth Mode Selection
|
|
72
75
|
|
|
73
|
-
**
|
|
76
|
+
**Fast:** Sub-second responses for quick facts, simple lookups, known facts.
|
|
77
|
+
|
|
78
|
+
**Standard (default):** Single iteration, balanced speed/depth for most queries.
|
|
74
79
|
|
|
75
80
|
**Deep:** Complex research, multi-step queries, comprehensive coverage needed.
|
|
76
81
|
|
|
77
82
|
```
|
|
78
|
-
//
|
|
79
|
-
linkup_web_search("Node.js 22 release date")
|
|
83
|
+
// Fast - instant facts, sub-second
|
|
84
|
+
linkup_web_search("Node.js 22 release date", depth: "fast")
|
|
85
|
+
|
|
86
|
+
// Standard - balanced, one search iteration
|
|
87
|
+
linkup_web_search("React useEffect cleanup best practices")
|
|
80
88
|
|
|
81
|
-
// Deep -
|
|
82
|
-
linkup_web_search("comparison of Rust web frameworks performance benchmarks 2025",
|
|
89
|
+
// Deep - complex research, multiple iterations
|
|
90
|
+
linkup_web_search("comparison of Rust web frameworks performance benchmarks 2025", depth: "deep")
|
|
83
91
|
```
|
|
84
92
|
|
|
85
93
|
## Common Patterns
|
package/src/client.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import packageJson from "../package.json" with { type: "json" };
|
|
2
|
+
|
|
1
3
|
import type {
|
|
2
4
|
LinkupBalanceResponse,
|
|
3
5
|
LinkupErrorResponse,
|
|
@@ -24,6 +26,7 @@ export class LinkupClient {
|
|
|
24
26
|
headers: {
|
|
25
27
|
Authorization: `Bearer ${this.apiKey}`,
|
|
26
28
|
"Content-Type": "application/json",
|
|
29
|
+
"User-Agent": `pi-linkup/${packageJson.version} (+https://github.com/aliou/pi-linkup)`,
|
|
27
30
|
...options.headers,
|
|
28
31
|
},
|
|
29
32
|
});
|
|
@@ -41,7 +44,7 @@ export class LinkupClient {
|
|
|
41
44
|
|
|
42
45
|
async search(params: {
|
|
43
46
|
query: string;
|
|
44
|
-
depth: "standard" | "deep";
|
|
47
|
+
depth: "standard" | "deep" | "fast";
|
|
45
48
|
outputType: "searchResults" | "sourcedAnswer";
|
|
46
49
|
}): Promise<LinkupSearchResponse | LinkupSourcedAnswerResponse> {
|
|
47
50
|
return this.request("/search", {
|
package/src/tools/web-search.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { StringEnum } from "@mariozechner/pi-ai";
|
|
1
2
|
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
2
3
|
import { Text } from "@mariozechner/pi-tui";
|
|
3
4
|
import { Type } from "@sinclair/typebox";
|
|
@@ -22,10 +23,10 @@ export function registerWebSearchTool(pi: ExtensionAPI) {
|
|
|
22
23
|
description:
|
|
23
24
|
"The search query. Be specific and detailed for best results.",
|
|
24
25
|
}),
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
depth: Type.Optional(
|
|
27
|
+
StringEnum(["deep", "standard", "fast"], {
|
|
27
28
|
description:
|
|
28
|
-
"
|
|
29
|
+
"Search depth: 'fast' for sub-second quick facts, 'standard' (default) for balanced speed/depth, 'deep' for comprehensive multi-step research (slower).",
|
|
29
30
|
}),
|
|
30
31
|
),
|
|
31
32
|
}),
|
|
@@ -38,7 +39,7 @@ export function registerWebSearchTool(pi: ExtensionAPI) {
|
|
|
38
39
|
content: [
|
|
39
40
|
{
|
|
40
41
|
type: "text",
|
|
41
|
-
text: `Searching${params.
|
|
42
|
+
text: `Searching${params.depth && params.depth !== "standard" ? ` (${params.depth} mode)` : ""}...`,
|
|
42
43
|
},
|
|
43
44
|
],
|
|
44
45
|
details: {},
|
|
@@ -46,7 +47,7 @@ export function registerWebSearchTool(pi: ExtensionAPI) {
|
|
|
46
47
|
|
|
47
48
|
const response = (await client.search({
|
|
48
49
|
query: params.query,
|
|
49
|
-
depth: params.
|
|
50
|
+
depth: (params.depth ?? "standard") as "standard" | "deep" | "fast",
|
|
50
51
|
outputType: "searchResults",
|
|
51
52
|
})) as LinkupSearchResponse;
|
|
52
53
|
|
|
@@ -77,8 +78,8 @@ export function registerWebSearchTool(pi: ExtensionAPI) {
|
|
|
77
78
|
renderCall(args, theme) {
|
|
78
79
|
let text = theme.fg("toolTitle", theme.bold("Linkup: WebSearch "));
|
|
79
80
|
text += theme.fg("accent", `"${args.query}"`);
|
|
80
|
-
if (args.
|
|
81
|
-
text += theme.fg("dim",
|
|
81
|
+
if (args.depth && args.depth !== "standard") {
|
|
82
|
+
text += theme.fg("dim", ` (${args.depth})`);
|
|
82
83
|
}
|
|
83
84
|
return new Text(text, 0, 0);
|
|
84
85
|
},
|