@rnsk/toolkits 0.0.9 → 0.0.10
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 +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +13 -1
- package/dist/toolkits/hacker-news/icon.d.ts +5 -0
- package/dist/toolkits/hacker-news/icon.js +9 -0
- package/dist/toolkits/hacker-news/manifest.d.ts +3 -0
- package/dist/toolkits/hacker-news/manifest.js +25 -0
- package/dist/toolkits/hacker-news/tools/client.d.ts +8 -0
- package/dist/toolkits/hacker-news/tools/client.js +51 -0
- package/dist/toolkits/hacker-news/tools/index.d.ts +89 -0
- package/dist/toolkits/hacker-news/tools/index.js +22 -0
- package/dist/toolkits/hacker-news/tools/items.d.ts +42 -0
- package/dist/toolkits/hacker-news/tools/items.js +126 -0
- package/dist/toolkits/hacker-news/tools/search.d.ts +12 -0
- package/dist/toolkits/hacker-news/tools/search.js +40 -0
- package/dist/toolkits/hacker-news/tools/stories.d.ts +25 -0
- package/dist/toolkits/hacker-news/tools/stories.js +98 -0
- package/dist/toolkits/hostinger/icon.d.ts +5 -0
- package/dist/toolkits/hostinger/icon.js +6 -0
- package/dist/toolkits/hostinger/manifest.d.ts +3 -0
- package/dist/toolkits/hostinger/manifest.js +36 -0
- package/dist/toolkits/hostinger/tools/billing.d.ts +12 -0
- package/dist/toolkits/hostinger/tools/billing.js +35 -0
- package/dist/toolkits/hostinger/tools/client.d.ts +6 -0
- package/dist/toolkits/hostinger/tools/client.js +57 -0
- package/dist/toolkits/hostinger/tools/dns.d.ts +22 -0
- package/dist/toolkits/hostinger/tools/dns.js +47 -0
- package/dist/toolkits/hostinger/tools/domains.d.ts +21 -0
- package/dist/toolkits/hostinger/tools/domains.js +62 -0
- package/dist/toolkits/hostinger/tools/hosting.d.ts +17 -0
- package/dist/toolkits/hostinger/tools/hosting.js +38 -0
- package/dist/toolkits/hostinger/tools/index.d.ts +179 -0
- package/dist/toolkits/hostinger/tools/index.js +35 -0
- package/dist/toolkits/hostinger/tools/vps.d.ts +27 -0
- package/dist/toolkits/hostinger/tools/vps.js +77 -0
- package/dist/toolkits/hostinger/tools/whois.d.ts +33 -0
- package/dist/toolkits/hostinger/tools/whois.js +85 -0
- package/dist/toolkits/hugging-face/icon.d.ts +5 -0
- package/dist/toolkits/hugging-face/icon.js +6 -0
- package/dist/toolkits/hugging-face/manifest.d.ts +3 -0
- package/dist/toolkits/hugging-face/manifest.js +42 -0
- package/dist/toolkits/hugging-face/tools/client.d.ts +93 -0
- package/dist/toolkits/hugging-face/tools/client.js +192 -0
- package/dist/toolkits/hugging-face/tools/datasets-viewer.d.ts +65 -0
- package/dist/toolkits/hugging-face/tools/datasets-viewer.js +150 -0
- package/dist/toolkits/hugging-face/tools/datasets.d.ts +160 -0
- package/dist/toolkits/hugging-face/tools/datasets.js +383 -0
- package/dist/toolkits/hugging-face/tools/discussions.d.ts +68 -0
- package/dist/toolkits/hugging-face/tools/discussions.js +144 -0
- package/dist/toolkits/hugging-face/tools/index.d.ts +523 -0
- package/dist/toolkits/hugging-face/tools/index.js +163 -0
- package/dist/toolkits/hugging-face/tools/inference.d.ts +42 -0
- package/dist/toolkits/hugging-face/tools/inference.js +86 -0
- package/dist/toolkits/hugging-face/tools/models.d.ts +117 -0
- package/dist/toolkits/hugging-face/tools/models.js +273 -0
- package/dist/toolkits/hugging-face/tools/papers.d.ts +37 -0
- package/dist/toolkits/hugging-face/tools/papers.js +91 -0
- package/dist/toolkits/hugging-face/tools/repos.d.ts +96 -0
- package/dist/toolkits/hugging-face/tools/repos.js +201 -0
- package/dist/toolkits/hugging-face/tools/settings.d.ts +53 -0
- package/dist/toolkits/hugging-face/tools/settings.js +88 -0
- package/dist/toolkits/hugging-face/tools/spaces.d.ts +245 -0
- package/dist/toolkits/hugging-face/tools/spaces.js +468 -0
- package/dist/toolkits/hugging-face/tools/sql.d.ts +21 -0
- package/dist/toolkits/hugging-face/tools/sql.js +47 -0
- package/dist/toolkits/hugging-face/tools/users.d.ts +60 -0
- package/dist/toolkits/hugging-face/tools/users.js +132 -0
- package/dist/toolkits/hugging-face/tools/webhooks.d.ts +35 -0
- package/dist/toolkits/hugging-face/tools/webhooks.js +87 -0
- package/dist/toolkits/jira/icon.d.ts +5 -0
- package/dist/toolkits/jira/icon.js +6 -0
- package/dist/toolkits/jira/manifest.d.ts +3 -0
- package/dist/toolkits/jira/manifest.js +53 -0
- package/dist/toolkits/jira/tools/boards.d.ts +52 -0
- package/dist/toolkits/jira/tools/boards.js +104 -0
- package/dist/toolkits/jira/tools/client.d.ts +23 -0
- package/dist/toolkits/jira/tools/client.js +270 -0
- package/dist/toolkits/jira/tools/index.d.ts +1280 -0
- package/dist/toolkits/jira/tools/index.js +119 -0
- package/dist/toolkits/jira/tools/issue-fields.d.ts +10 -0
- package/dist/toolkits/jira/tools/issue-fields.js +111 -0
- package/dist/toolkits/jira/tools/issues.d.ts +304 -0
- package/dist/toolkits/jira/tools/issues.js +593 -0
- package/dist/toolkits/jira/tools/meta.d.ts +212 -0
- package/dist/toolkits/jira/tools/meta.js +369 -0
- package/dist/toolkits/jira/tools/projects.d.ts +130 -0
- package/dist/toolkits/jira/tools/projects.js +263 -0
- package/dist/toolkits/jira/tools/search.d.ts +90 -0
- package/dist/toolkits/jira/tools/search.js +181 -0
- package/dist/toolkits/jira/tools/users.d.ts +114 -0
- package/dist/toolkits/jira/tools/users.js +221 -0
- package/dist/toolkits/neo4j/icon.d.ts +5 -0
- package/dist/toolkits/neo4j/icon.js +6 -0
- package/dist/toolkits/neo4j/manifest.d.ts +3 -0
- package/dist/toolkits/neo4j/manifest.js +33 -0
- package/dist/toolkits/neo4j/tools/analytics.d.ts +21 -0
- package/dist/toolkits/neo4j/tools/analytics.js +91 -0
- package/dist/toolkits/neo4j/tools/client.d.ts +6 -0
- package/dist/toolkits/neo4j/tools/client.js +105 -0
- package/dist/toolkits/neo4j/tools/index.d.ts +198 -0
- package/dist/toolkits/neo4j/tools/index.js +30 -0
- package/dist/toolkits/neo4j/tools/instances.d.ts +47 -0
- package/dist/toolkits/neo4j/tools/instances.js +127 -0
- package/dist/toolkits/neo4j/tools/projects.d.ts +44 -0
- package/dist/toolkits/neo4j/tools/projects.js +110 -0
- package/dist/toolkits/neo4j/tools/snapshots.d.ts +20 -0
- package/dist/toolkits/neo4j/tools/snapshots.js +57 -0
- package/dist/toolkits/neon/icon.d.ts +5 -0
- package/dist/toolkits/neon/icon.js +8 -0
- package/dist/toolkits/neon/manifest.d.ts +3 -0
- package/dist/toolkits/neon/manifest.js +36 -0
- package/dist/toolkits/neon/tools/auth.d.ts +115 -0
- package/dist/toolkits/neon/tools/auth.js +286 -0
- package/dist/toolkits/neon/tools/branches.d.ts +189 -0
- package/dist/toolkits/neon/tools/branches.js +465 -0
- package/dist/toolkits/neon/tools/client.d.ts +10 -0
- package/dist/toolkits/neon/tools/client.js +69 -0
- package/dist/toolkits/neon/tools/dataapi.d.ts +42 -0
- package/dist/toolkits/neon/tools/dataapi.js +111 -0
- package/dist/toolkits/neon/tools/endpoints.d.ts +59 -0
- package/dist/toolkits/neon/tools/endpoints.js +163 -0
- package/dist/toolkits/neon/tools/index.d.ts +976 -0
- package/dist/toolkits/neon/tools/index.js +130 -0
- package/dist/toolkits/neon/tools/meta.d.ts +4 -0
- package/dist/toolkits/neon/tools/meta.js +16 -0
- package/dist/toolkits/neon/tools/orgs.d.ts +112 -0
- package/dist/toolkits/neon/tools/orgs.js +303 -0
- package/dist/toolkits/neon/tools/projects.d.ts +177 -0
- package/dist/toolkits/neon/tools/projects.js +468 -0
- package/dist/toolkits/neon/tools/snapshots.d.ts +24 -0
- package/dist/toolkits/neon/tools/snapshots.js +67 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ Manifest-driven toolkit registry for AI agents — connector definitions you pub
|
|
|
16
16
|
|
|
17
17
|
## Toolkits
|
|
18
18
|
|
|
19
|
-
**
|
|
19
|
+
**1471 tools** across **40 toolkits** (run `npm run validate` for live counts).
|
|
20
20
|
|
|
21
21
|
| Toolkit | Tools | Auth |
|
|
22
22
|
|---------|------:|------|
|
|
@@ -54,6 +54,12 @@ Manifest-driven toolkit registry for AI agents — connector definitions you pub
|
|
|
54
54
|
| discord | 23 | OAuth2 |
|
|
55
55
|
| gitlab | 25 | OAuth2 |
|
|
56
56
|
| bitbucket | 108 | OAuth2 |
|
|
57
|
+
| hugging-face | 135 | OAuth2 |
|
|
58
|
+
| hostinger | 24 | API key |
|
|
59
|
+
| hacker-news | 14 | none |
|
|
60
|
+
| jira | 103 | OAuth2 |
|
|
61
|
+
| neo4j | 21 | basic auth |
|
|
62
|
+
| neon | 110 | API key |
|
|
57
63
|
|
|
58
64
|
## Install
|
|
59
65
|
|
package/dist/index.d.ts
CHANGED
|
@@ -32,9 +32,15 @@ import slack from './toolkits/slack/manifest.js';
|
|
|
32
32
|
import discord from './toolkits/discord/manifest.js';
|
|
33
33
|
import bitbucket from './toolkits/bitbucket/manifest.js';
|
|
34
34
|
import gitlab from './toolkits/gitlab/manifest.js';
|
|
35
|
+
import huggingFace from './toolkits/hugging-face/manifest.js';
|
|
36
|
+
import hostinger from './toolkits/hostinger/manifest.js';
|
|
37
|
+
import hackerNews from './toolkits/hacker-news/manifest.js';
|
|
38
|
+
import jira from './toolkits/jira/manifest.js';
|
|
39
|
+
import neo4j from './toolkits/neo4j/manifest.js';
|
|
40
|
+
import neon from './toolkits/neon/manifest.js';
|
|
35
41
|
import type { ToolkitManifest } from './core/types.js';
|
|
36
42
|
export declare const toolkits: ToolkitManifest[];
|
|
37
|
-
export { mathematics, linear, gmail, webSearch, github, notion, googleCalendar, googleSheets, googleDrive, googleDocs, googleMaps, googlePhotos, googleContacts, googleForms, googleMeet, googleSlides, googleClassroom, googleTasks, googleSearchConsole, googleAnalytics, googleAds, youtube, figma, aws, gcp, grafana, dockerHub, reddit, groww, cloudflare, slack, discord, gitlab, bitbucket, };
|
|
43
|
+
export { mathematics, linear, gmail, webSearch, github, notion, googleCalendar, googleSheets, googleDrive, googleDocs, googleMaps, googlePhotos, googleContacts, googleForms, googleMeet, googleSlides, googleClassroom, googleTasks, googleSearchConsole, googleAnalytics, googleAds, youtube, figma, aws, gcp, grafana, dockerHub, reddit, groww, cloudflare, slack, discord, gitlab, bitbucket, huggingFace, hostinger, hackerNews, jira, neo4j, neon, };
|
|
38
44
|
export * from './core/index.js';
|
|
39
45
|
export declare function getAllTools(): {
|
|
40
46
|
name: string;
|
package/dist/index.js
CHANGED
|
@@ -32,6 +32,12 @@ import slack from './toolkits/slack/manifest.js';
|
|
|
32
32
|
import discord from './toolkits/discord/manifest.js';
|
|
33
33
|
import bitbucket from './toolkits/bitbucket/manifest.js';
|
|
34
34
|
import gitlab from './toolkits/gitlab/manifest.js';
|
|
35
|
+
import huggingFace from './toolkits/hugging-face/manifest.js';
|
|
36
|
+
import hostinger from './toolkits/hostinger/manifest.js';
|
|
37
|
+
import hackerNews from './toolkits/hacker-news/manifest.js';
|
|
38
|
+
import jira from './toolkits/jira/manifest.js';
|
|
39
|
+
import neo4j from './toolkits/neo4j/manifest.js';
|
|
40
|
+
import neon from './toolkits/neon/manifest.js';
|
|
35
41
|
export const toolkits = [
|
|
36
42
|
mathematics,
|
|
37
43
|
linear,
|
|
@@ -67,8 +73,14 @@ export const toolkits = [
|
|
|
67
73
|
discord,
|
|
68
74
|
gitlab,
|
|
69
75
|
bitbucket,
|
|
76
|
+
huggingFace,
|
|
77
|
+
hostinger,
|
|
78
|
+
hackerNews,
|
|
79
|
+
jira,
|
|
80
|
+
neo4j,
|
|
81
|
+
neon,
|
|
70
82
|
];
|
|
71
|
-
export { mathematics, linear, gmail, webSearch, github, notion, googleCalendar, googleSheets, googleDrive, googleDocs, googleMaps, googlePhotos, googleContacts, googleForms, googleMeet, googleSlides, googleClassroom, googleTasks, googleSearchConsole, googleAnalytics, googleAds, youtube, figma, aws, gcp, grafana, dockerHub, reddit, groww, cloudflare, slack, discord, gitlab, bitbucket, };
|
|
83
|
+
export { mathematics, linear, gmail, webSearch, github, notion, googleCalendar, googleSheets, googleDrive, googleDocs, googleMaps, googlePhotos, googleContacts, googleForms, googleMeet, googleSlides, googleClassroom, googleTasks, googleSearchConsole, googleAnalytics, googleAds, youtube, figma, aws, gcp, grafana, dockerHub, reddit, groww, cloudflare, slack, discord, gitlab, bitbucket, huggingFace, hostinger, hackerNews, jira, neo4j, neon, };
|
|
72
84
|
export * from './core/index.js';
|
|
73
85
|
export function getAllTools() {
|
|
74
86
|
return toolkits.flatMap((t) => t.tools.map((toolDef) => ({
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const SVG = `<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 122.88 122.88" style="enable-background:new 0 0 122.88 122.88" xml:space="preserve"><style type="text/css"><![CDATA[
|
|
2
|
+
.st0{fill:#FF6600;}
|
|
3
|
+
.st1{fill:#FFFFFF;}
|
|
4
|
+
]]></style><g><path class="st0" d="M18.43,0h86.02c10.18,0,18.43,8.25,18.43,18.43v86.02c0,10.18-8.25,18.43-18.43,18.43H18.43 C8.25,122.88,0,114.63,0,104.45l0-86.02C0,8.25,8.25,0,18.43,0L18.43,0z"/><polygon class="st1" points="29.76,21.84 42,21.84 61.44,60.72 80.88,21.36 93.12,21.36 66.24,70.32 66.24,102.96 56.64,102.96 56.64,70.32 29.76,21.84"/></g></svg>`;
|
|
5
|
+
export const HACKER_NEWS_ICON = {
|
|
6
|
+
kind: 'svg',
|
|
7
|
+
dataUri: `data:image/svg+xml;base64,${Buffer.from(SVG).toString('base64')}`,
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=icon.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineToolkit, defineTool } from '../../core/define.js';
|
|
2
|
+
import { HACKER_NEWS_ICON } from './icon.js';
|
|
3
|
+
import { hackerNewsTools } from './tools/index.js';
|
|
4
|
+
export default defineToolkit({
|
|
5
|
+
id: 'hacker-news',
|
|
6
|
+
displayName: 'Hacker News',
|
|
7
|
+
shortDescription: 'Top stories, discussions, search, items, and user profiles from Hacker News.',
|
|
8
|
+
category: 'Social Media',
|
|
9
|
+
icon: HACKER_NEWS_ICON,
|
|
10
|
+
auth: { type: 'none' },
|
|
11
|
+
allowedHosts: ['hacker-news.firebaseio.com', 'hn.algolia.com'],
|
|
12
|
+
tools: hackerNewsTools.map((entry) => defineTool({
|
|
13
|
+
name: entry.name,
|
|
14
|
+
description: entry.description,
|
|
15
|
+
tool: entry.tool,
|
|
16
|
+
scope: entry.scope,
|
|
17
|
+
})),
|
|
18
|
+
meta: {
|
|
19
|
+
since: '0.0.9',
|
|
20
|
+
homepage: 'https://news.ycombinator.com',
|
|
21
|
+
docsUrl: 'https://github.com/HackerNews/API',
|
|
22
|
+
apiDocsUrl: 'https://github.com/HackerNews/API',
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=manifest.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function hnFirebase(path: string, query?: Record<string, string | number | undefined>): Promise<any>;
|
|
2
|
+
export declare function hnSearch(params: {
|
|
3
|
+
query?: string;
|
|
4
|
+
tags?: string[];
|
|
5
|
+
page?: number;
|
|
6
|
+
hitsPerPage?: number;
|
|
7
|
+
}): Promise<any>;
|
|
8
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
const FIREBASE_BASE = 'https://hacker-news.firebaseio.com/v0';
|
|
3
|
+
const ALGOLIA_BASE = 'https://hn.algolia.com/api/v1';
|
|
4
|
+
export async function hnFirebase(path, query = {}) {
|
|
5
|
+
const params = new URLSearchParams();
|
|
6
|
+
for (const [key, value] of Object.entries(query)) {
|
|
7
|
+
if (value !== undefined && value !== '')
|
|
8
|
+
params.append(key, String(value));
|
|
9
|
+
}
|
|
10
|
+
const qs = params.toString();
|
|
11
|
+
const url = `${FIREBASE_BASE}${path}${qs ? `?${qs}` : ''}`;
|
|
12
|
+
try {
|
|
13
|
+
const response = await fetch(url);
|
|
14
|
+
if (!response.ok) {
|
|
15
|
+
return { error: `Hacker News API request failed with status ${response.status}` };
|
|
16
|
+
}
|
|
17
|
+
return await response.json();
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
return {
|
|
21
|
+
error: 'Error calling Hacker News API',
|
|
22
|
+
message: error instanceof Error ? error.message : 'Unknown error',
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export async function hnSearch(params) {
|
|
27
|
+
const search = new URLSearchParams();
|
|
28
|
+
if (params.query)
|
|
29
|
+
search.append('query', params.query);
|
|
30
|
+
if (params.tags && params.tags.length > 0)
|
|
31
|
+
search.append('tags', `(${params.tags.join(',')})`);
|
|
32
|
+
if (params.page !== undefined)
|
|
33
|
+
search.append('page', String(params.page));
|
|
34
|
+
if (params.hitsPerPage !== undefined)
|
|
35
|
+
search.append('hitsPerPage', String(params.hitsPerPage));
|
|
36
|
+
const qs = search.toString();
|
|
37
|
+
try {
|
|
38
|
+
const response = await fetch(`${ALGOLIA_BASE}/search${qs ? `?${qs}` : ''}`);
|
|
39
|
+
if (!response.ok) {
|
|
40
|
+
return { error: `Hacker News search request failed with status ${response.status}` };
|
|
41
|
+
}
|
|
42
|
+
return await response.json();
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
return {
|
|
46
|
+
error: 'Error searching Hacker News',
|
|
47
|
+
message: error instanceof Error ? error.message : 'Unknown error',
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { hackerNewsGetAskStories, hackerNewsGetBestStories, hackerNewsGetJobStories, hackerNewsGetNewStories, hackerNewsGetShowStories, hackerNewsGetTopStories, hackerNewsGetMaxItemId, hackerNewsGetUpdates } from './stories.js';
|
|
2
|
+
import { hackerNewsGetItem, hackerNewsGetItemWithId, hackerNewsGetUser, hackerNewsGetUserByUsername } from './items.js';
|
|
3
|
+
import { hackerNewsGetLatestPosts, hackerNewsSearchPosts } from './search.js';
|
|
4
|
+
export { hackerNewsGetAskStories, hackerNewsGetBestStories, hackerNewsGetJobStories, hackerNewsGetNewStories, hackerNewsGetShowStories, hackerNewsGetTopStories, hackerNewsGetMaxItemId, hackerNewsGetUpdates, hackerNewsGetItem, hackerNewsGetItemWithId, hackerNewsGetUser, hackerNewsGetUserByUsername, hackerNewsGetLatestPosts, hackerNewsSearchPosts, };
|
|
5
|
+
export declare const hackerNewsTools: ({
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
tool: import("ai").Tool<{
|
|
9
|
+
print?: string | undefined;
|
|
10
|
+
}, any>;
|
|
11
|
+
scope: "read";
|
|
12
|
+
} | {
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
tool: import("ai").Tool<{
|
|
16
|
+
printFormat?: string | undefined;
|
|
17
|
+
}, any>;
|
|
18
|
+
scope: "read";
|
|
19
|
+
} | {
|
|
20
|
+
name: string;
|
|
21
|
+
description: string;
|
|
22
|
+
tool: import("ai").Tool<{
|
|
23
|
+
id: number;
|
|
24
|
+
}, any>;
|
|
25
|
+
scope: "read";
|
|
26
|
+
} | {
|
|
27
|
+
name: string;
|
|
28
|
+
description: string;
|
|
29
|
+
tool: import("ai").Tool<{
|
|
30
|
+
itemId: string;
|
|
31
|
+
maxDepth?: number | undefined;
|
|
32
|
+
maxChildren?: number | undefined;
|
|
33
|
+
truncateText?: boolean | undefined;
|
|
34
|
+
}, {
|
|
35
|
+
found: boolean;
|
|
36
|
+
item: null;
|
|
37
|
+
errorMessage: string;
|
|
38
|
+
} | {
|
|
39
|
+
found: boolean;
|
|
40
|
+
item: {
|
|
41
|
+
id: unknown;
|
|
42
|
+
type: unknown;
|
|
43
|
+
author: {} | null;
|
|
44
|
+
title: unknown;
|
|
45
|
+
url: {} | null;
|
|
46
|
+
text: unknown;
|
|
47
|
+
points: {} | null;
|
|
48
|
+
parentId: {} | null;
|
|
49
|
+
storyId: null;
|
|
50
|
+
createdAt: string | null;
|
|
51
|
+
createdAtI: {} | null;
|
|
52
|
+
options: {} | null;
|
|
53
|
+
children: unknown[];
|
|
54
|
+
childrenShown: number;
|
|
55
|
+
totalChildrenCount: number;
|
|
56
|
+
childrenTruncated: boolean;
|
|
57
|
+
maxDepthReached: boolean;
|
|
58
|
+
};
|
|
59
|
+
errorMessage?: undefined;
|
|
60
|
+
}>;
|
|
61
|
+
scope: "read";
|
|
62
|
+
} | {
|
|
63
|
+
name: string;
|
|
64
|
+
description: string;
|
|
65
|
+
tool: import("ai").Tool<{
|
|
66
|
+
username: string;
|
|
67
|
+
}, any>;
|
|
68
|
+
scope: "read";
|
|
69
|
+
} | {
|
|
70
|
+
name: string;
|
|
71
|
+
description: string;
|
|
72
|
+
tool: import("ai").Tool<{
|
|
73
|
+
size?: number | undefined;
|
|
74
|
+
page?: number | undefined;
|
|
75
|
+
tags?: string[] | undefined;
|
|
76
|
+
}, any>;
|
|
77
|
+
scope: "read";
|
|
78
|
+
} | {
|
|
79
|
+
name: string;
|
|
80
|
+
description: string;
|
|
81
|
+
tool: import("ai").Tool<{
|
|
82
|
+
query: string;
|
|
83
|
+
size?: number | undefined;
|
|
84
|
+
page?: number | undefined;
|
|
85
|
+
tags?: string[] | undefined;
|
|
86
|
+
}, any>;
|
|
87
|
+
scope: "read";
|
|
88
|
+
})[];
|
|
89
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { hackerNewsGetAskStories, hackerNewsGetBestStories, hackerNewsGetJobStories, hackerNewsGetNewStories, hackerNewsGetShowStories, hackerNewsGetTopStories, hackerNewsGetMaxItemId, hackerNewsGetUpdates, } from './stories.js';
|
|
3
|
+
import { hackerNewsGetItem, hackerNewsGetItemWithId, hackerNewsGetUser, hackerNewsGetUserByUsername, } from './items.js';
|
|
4
|
+
import { hackerNewsGetLatestPosts, hackerNewsSearchPosts } from './search.js';
|
|
5
|
+
export { hackerNewsGetAskStories, hackerNewsGetBestStories, hackerNewsGetJobStories, hackerNewsGetNewStories, hackerNewsGetShowStories, hackerNewsGetTopStories, hackerNewsGetMaxItemId, hackerNewsGetUpdates, hackerNewsGetItem, hackerNewsGetItemWithId, hackerNewsGetUser, hackerNewsGetUserByUsername, hackerNewsGetLatestPosts, hackerNewsSearchPosts, };
|
|
6
|
+
export const hackerNewsTools = [
|
|
7
|
+
{ name: 'HackerNewsGetAskStories', description: hackerNewsGetAskStories.description, tool: hackerNewsGetAskStories, scope: 'read' },
|
|
8
|
+
{ name: 'HackerNewsGetBestStories', description: hackerNewsGetBestStories.description, tool: hackerNewsGetBestStories, scope: 'read' },
|
|
9
|
+
{ name: 'HackerNewsGetJobStories', description: hackerNewsGetJobStories.description, tool: hackerNewsGetJobStories, scope: 'read' },
|
|
10
|
+
{ name: 'HackerNewsGetNewStories', description: hackerNewsGetNewStories.description, tool: hackerNewsGetNewStories, scope: 'read' },
|
|
11
|
+
{ name: 'HackerNewsGetShowStories', description: hackerNewsGetShowStories.description, tool: hackerNewsGetShowStories, scope: 'read' },
|
|
12
|
+
{ name: 'HackerNewsGetTopStories', description: hackerNewsGetTopStories.description, tool: hackerNewsGetTopStories, scope: 'read' },
|
|
13
|
+
{ name: 'HackerNewsGetMaxItemId', description: hackerNewsGetMaxItemId.description, tool: hackerNewsGetMaxItemId, scope: 'read' },
|
|
14
|
+
{ name: 'HackerNewsGetUpdates', description: hackerNewsGetUpdates.description, tool: hackerNewsGetUpdates, scope: 'read' },
|
|
15
|
+
{ name: 'HackerNewsGetItem', description: hackerNewsGetItem.description, tool: hackerNewsGetItem, scope: 'read' },
|
|
16
|
+
{ name: 'HackerNewsGetItemWithId', description: hackerNewsGetItemWithId.description, tool: hackerNewsGetItemWithId, scope: 'read' },
|
|
17
|
+
{ name: 'HackerNewsGetUser', description: hackerNewsGetUser.description, tool: hackerNewsGetUser, scope: 'read' },
|
|
18
|
+
{ name: 'HackerNewsGetUserByUsername', description: hackerNewsGetUserByUsername.description, tool: hackerNewsGetUserByUsername, scope: 'read' },
|
|
19
|
+
{ name: 'HackerNewsGetLatestPosts', description: hackerNewsGetLatestPosts.description, tool: hackerNewsGetLatestPosts, scope: 'read' },
|
|
20
|
+
{ name: 'HackerNewsSearchPosts', description: hackerNewsSearchPosts.description, tool: hackerNewsSearchPosts, scope: 'read' },
|
|
21
|
+
];
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare const hackerNewsGetItem: import("ai").Tool<{
|
|
2
|
+
id: number;
|
|
3
|
+
}, any>;
|
|
4
|
+
export declare const hackerNewsGetItemWithId: import("ai").Tool<{
|
|
5
|
+
itemId: string;
|
|
6
|
+
maxDepth?: number | undefined;
|
|
7
|
+
maxChildren?: number | undefined;
|
|
8
|
+
truncateText?: boolean | undefined;
|
|
9
|
+
}, {
|
|
10
|
+
found: boolean;
|
|
11
|
+
item: null;
|
|
12
|
+
errorMessage: string;
|
|
13
|
+
} | {
|
|
14
|
+
found: boolean;
|
|
15
|
+
item: {
|
|
16
|
+
id: unknown;
|
|
17
|
+
type: unknown;
|
|
18
|
+
author: {} | null;
|
|
19
|
+
title: unknown;
|
|
20
|
+
url: {} | null;
|
|
21
|
+
text: unknown;
|
|
22
|
+
points: {} | null;
|
|
23
|
+
parentId: {} | null;
|
|
24
|
+
storyId: null;
|
|
25
|
+
createdAt: string | null;
|
|
26
|
+
createdAtI: {} | null;
|
|
27
|
+
options: {} | null;
|
|
28
|
+
children: unknown[];
|
|
29
|
+
childrenShown: number;
|
|
30
|
+
totalChildrenCount: number;
|
|
31
|
+
childrenTruncated: boolean;
|
|
32
|
+
maxDepthReached: boolean;
|
|
33
|
+
};
|
|
34
|
+
errorMessage?: undefined;
|
|
35
|
+
}>;
|
|
36
|
+
export declare const hackerNewsGetUser: import("ai").Tool<{
|
|
37
|
+
username: string;
|
|
38
|
+
}, any>;
|
|
39
|
+
export declare const hackerNewsGetUserByUsername: import("ai").Tool<{
|
|
40
|
+
username: string;
|
|
41
|
+
}, any>;
|
|
42
|
+
//# sourceMappingURL=items.d.ts.map
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { tool } from 'ai';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { hnFirebase } from './client.js';
|
|
5
|
+
export const hackerNewsGetItem = tool({
|
|
6
|
+
description: 'Get a Hacker News item (story, comment, job, poll, or pollopt) by its numeric ID. Returns author, score, title, text, timestamps, and comment IDs.',
|
|
7
|
+
inputSchema: z.object({
|
|
8
|
+
id: z.number().int().positive().describe('Unique numeric ID of the item to retrieve'),
|
|
9
|
+
}),
|
|
10
|
+
execute: async ({ id }) => {
|
|
11
|
+
const item = await hnFirebase(`/item/${id}.json`);
|
|
12
|
+
if (item && typeof item === 'object' && 'error' in item)
|
|
13
|
+
return item;
|
|
14
|
+
if (item === null)
|
|
15
|
+
return { error: `Hacker News item ${id} not found` };
|
|
16
|
+
return item;
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
function truncate(text, enabled) {
|
|
20
|
+
if (!enabled || typeof text !== 'string' || text.length <= 500)
|
|
21
|
+
return text;
|
|
22
|
+
return text.slice(0, 500);
|
|
23
|
+
}
|
|
24
|
+
async function resolveChildren(kids, depth, maxDepth, maxChildren, truncateText) {
|
|
25
|
+
if (depth > maxDepth || !kids || kids.length === 0 || maxChildren === 0) {
|
|
26
|
+
return { children: [], truncated: (kids?.length ?? 0) > 0 && depth <= maxDepth && maxChildren === 0, depthReached: depth > maxDepth };
|
|
27
|
+
}
|
|
28
|
+
const shown = kids.slice(0, maxChildren);
|
|
29
|
+
const children = [];
|
|
30
|
+
for (const kidId of shown) {
|
|
31
|
+
const raw = await hnFirebase(`/item/${kidId}.json`);
|
|
32
|
+
if (!raw || typeof raw !== 'object' || 'error' in raw || raw === null)
|
|
33
|
+
continue;
|
|
34
|
+
const item = raw;
|
|
35
|
+
const nested = await resolveChildren(item.kids, depth + 1, maxDepth, maxChildren, truncateText);
|
|
36
|
+
children.push({
|
|
37
|
+
id: item.id,
|
|
38
|
+
type: item.type,
|
|
39
|
+
author: item.by ?? null,
|
|
40
|
+
text: truncate(item.text ?? null, truncateText),
|
|
41
|
+
createdAt: typeof item.time === 'number' ? new Date(item.time * 1000).toISOString() : null,
|
|
42
|
+
createdAtI: item.time ?? null,
|
|
43
|
+
parentId: item.parent ?? null,
|
|
44
|
+
children: nested.children,
|
|
45
|
+
childrenTruncated: nested.truncated,
|
|
46
|
+
maxDepthReached: nested.depthReached,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return { children, truncated: kids.length > shown.length, depthReached: false };
|
|
50
|
+
}
|
|
51
|
+
export const hackerNewsGetItemWithId = tool({
|
|
52
|
+
description: 'Get a Hacker News item with nested comment replies. Limits depth, child count, and text length to prevent context overflow. Use for reading stories with their discussion.',
|
|
53
|
+
inputSchema: z.object({
|
|
54
|
+
itemId: z.string().describe('Numeric ID of the item (story, comment, job, poll, or pollopt)'),
|
|
55
|
+
maxDepth: z.number().int().min(0).max(10).optional().describe('Nested reply depth to include (0 = no children). Defaults to 2.'),
|
|
56
|
+
maxChildren: z.number().int().min(0).max(100).optional().describe('Direct child comments per item. Defaults to 10.'),
|
|
57
|
+
truncateText: z.boolean().optional().describe('Truncate long text to 500 characters. Defaults to true.'),
|
|
58
|
+
}),
|
|
59
|
+
execute: async ({ itemId, maxDepth = 2, maxChildren = 10, truncateText = true, }) => {
|
|
60
|
+
const id = Number(itemId);
|
|
61
|
+
if (!Number.isInteger(id) || id <= 0) {
|
|
62
|
+
return { found: false, item: null, errorMessage: `Invalid item ID: ${itemId}` };
|
|
63
|
+
}
|
|
64
|
+
const raw = await hnFirebase(`/item/${id}.json`);
|
|
65
|
+
if (raw && typeof raw === 'object' && 'error' in raw) {
|
|
66
|
+
return { found: false, item: null, errorMessage: raw.error };
|
|
67
|
+
}
|
|
68
|
+
if (raw === null) {
|
|
69
|
+
return { found: false, item: null, errorMessage: `Item ${id} not found` };
|
|
70
|
+
}
|
|
71
|
+
const item = raw;
|
|
72
|
+
const nested = await resolveChildren(item.kids, 1, maxDepth, maxChildren, truncateText);
|
|
73
|
+
return {
|
|
74
|
+
found: true,
|
|
75
|
+
item: {
|
|
76
|
+
id: item.id,
|
|
77
|
+
type: item.type,
|
|
78
|
+
author: item.by ?? null,
|
|
79
|
+
title: truncate(item.title ?? null, truncateText),
|
|
80
|
+
url: item.url ?? null,
|
|
81
|
+
text: truncate(item.text ?? null, truncateText),
|
|
82
|
+
points: item.score ?? null,
|
|
83
|
+
parentId: item.parent ?? null,
|
|
84
|
+
storyId: null,
|
|
85
|
+
createdAt: typeof item.time === 'number' ? new Date(item.time * 1000).toISOString() : null,
|
|
86
|
+
createdAtI: item.time ?? null,
|
|
87
|
+
options: item.parts ?? null,
|
|
88
|
+
children: nested.children,
|
|
89
|
+
childrenShown: nested.children.length,
|
|
90
|
+
totalChildrenCount: Array.isArray(item.kids) ? item.kids.length : 0,
|
|
91
|
+
childrenTruncated: nested.truncated,
|
|
92
|
+
maxDepthReached: nested.depthReached,
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
export const hackerNewsGetUser = tool({
|
|
98
|
+
description: 'Get a Hacker News user public profile by username. Returns username, karma, and bio. Use to look up HN community members.',
|
|
99
|
+
inputSchema: z.object({
|
|
100
|
+
username: z.string().describe('Case-sensitive HN username, e.g. "pg"'),
|
|
101
|
+
}),
|
|
102
|
+
execute: async ({ username }) => {
|
|
103
|
+
const user = await hnFirebase(`/user/${username}.json`);
|
|
104
|
+
if (user && typeof user === 'object' && 'error' in user)
|
|
105
|
+
return user;
|
|
106
|
+
if (user === null)
|
|
107
|
+
return { error: `Hacker News user "${username}" not found` };
|
|
108
|
+
const u = user;
|
|
109
|
+
return { username: u.id, karma: u.karma, about: u.about ?? null };
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
export const hackerNewsGetUserByUsername = tool({
|
|
113
|
+
description: 'Get detailed Hacker News user info by username, including creation date, karma, bio, and submission history.',
|
|
114
|
+
inputSchema: z.object({
|
|
115
|
+
username: z.string().describe('Case-sensitive HN username, e.g. "pg"'),
|
|
116
|
+
}),
|
|
117
|
+
execute: async ({ username }) => {
|
|
118
|
+
const user = await hnFirebase(`/user/${username}.json`);
|
|
119
|
+
if (user && typeof user === 'object' && 'error' in user)
|
|
120
|
+
return user;
|
|
121
|
+
if (user === null)
|
|
122
|
+
return { error: `Hacker News user "${username}" not found` };
|
|
123
|
+
return user;
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
//# sourceMappingURL=items.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const hackerNewsGetLatestPosts: import("ai").Tool<{
|
|
2
|
+
size?: number | undefined;
|
|
3
|
+
page?: number | undefined;
|
|
4
|
+
tags?: string[] | undefined;
|
|
5
|
+
}, any>;
|
|
6
|
+
export declare const hackerNewsSearchPosts: import("ai").Tool<{
|
|
7
|
+
query: string;
|
|
8
|
+
size?: number | undefined;
|
|
9
|
+
page?: number | undefined;
|
|
10
|
+
tags?: string[] | undefined;
|
|
11
|
+
}, any>;
|
|
12
|
+
//# sourceMappingURL=search.d.ts.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { tool } from 'ai';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { hnSearch } from './client.js';
|
|
5
|
+
const tagsField = z
|
|
6
|
+
.array(z.string())
|
|
7
|
+
.optional()
|
|
8
|
+
.describe('Filter tags (ANDed). Available: story, comment, poll, pollopt, show_hn, ask_hn, front_page, author_<USERNAME>, story_<ID>.');
|
|
9
|
+
export const hackerNewsGetLatestPosts = tool({
|
|
10
|
+
description: 'Get latest Hacker News posts with optional tag filters. Use to browse recent stories or comments, optionally filtered by type or author.',
|
|
11
|
+
inputSchema: z.object({
|
|
12
|
+
page: z.number().int().min(0).optional().describe('Page number, 0-indexed. Defaults to 0.'),
|
|
13
|
+
size: z.number().int().min(0).optional().describe('Max results to return. Defaults to 5. Set to 0 for the full page (up to 20).'),
|
|
14
|
+
tags: tagsField,
|
|
15
|
+
}),
|
|
16
|
+
execute: async ({ page = 0, size = 5, tags }) => {
|
|
17
|
+
const result = await hnSearch({ page, hitsPerPage: size && size > 0 ? size : 20, tags });
|
|
18
|
+
if (result && typeof result === 'object' && 'error' in result)
|
|
19
|
+
return result;
|
|
20
|
+
const hits = Array.isArray(result.hits) ? result.hits : [];
|
|
21
|
+
return { ...result, hits: size && size > 0 ? hits.slice(0, size) : hits };
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
export const hackerNewsSearchPosts = tool({
|
|
25
|
+
description: 'Full-text search of Hacker News stories and comments via Algolia. Supports AND/OR/NOT operators plus tag and author filters.',
|
|
26
|
+
inputSchema: z.object({
|
|
27
|
+
query: z.string().describe('Full-text search query'),
|
|
28
|
+
page: z.number().int().min(0).optional().describe('Page number, 0-indexed. Defaults to 0.'),
|
|
29
|
+
size: z.number().int().min(0).optional().describe('Max results to return. Defaults to 5. Set to 0 for the full page (up to 20).'),
|
|
30
|
+
tags: tagsField,
|
|
31
|
+
}),
|
|
32
|
+
execute: async ({ query, page = 0, size = 5, tags, }) => {
|
|
33
|
+
const result = await hnSearch({ query, page, hitsPerPage: size && size > 0 ? size : 20, tags });
|
|
34
|
+
if (result && typeof result === 'object' && 'error' in result)
|
|
35
|
+
return result;
|
|
36
|
+
const hits = Array.isArray(result.hits) ? result.hits : [];
|
|
37
|
+
return { ...result, hits: size && size > 0 ? hits.slice(0, size) : hits };
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const hackerNewsGetAskStories: import("ai").Tool<{
|
|
2
|
+
print?: string | undefined;
|
|
3
|
+
}, any>;
|
|
4
|
+
export declare const hackerNewsGetBestStories: import("ai").Tool<{
|
|
5
|
+
print?: string | undefined;
|
|
6
|
+
}, any>;
|
|
7
|
+
export declare const hackerNewsGetJobStories: import("ai").Tool<{
|
|
8
|
+
printFormat?: string | undefined;
|
|
9
|
+
}, any>;
|
|
10
|
+
export declare const hackerNewsGetNewStories: import("ai").Tool<{
|
|
11
|
+
printFormat?: string | undefined;
|
|
12
|
+
}, any>;
|
|
13
|
+
export declare const hackerNewsGetShowStories: import("ai").Tool<{
|
|
14
|
+
printFormat?: string | undefined;
|
|
15
|
+
}, any>;
|
|
16
|
+
export declare const hackerNewsGetTopStories: import("ai").Tool<{
|
|
17
|
+
print?: string | undefined;
|
|
18
|
+
}, any>;
|
|
19
|
+
export declare const hackerNewsGetMaxItemId: import("ai").Tool<{
|
|
20
|
+
print?: string | undefined;
|
|
21
|
+
}, any>;
|
|
22
|
+
export declare const hackerNewsGetUpdates: import("ai").Tool<{
|
|
23
|
+
print?: string | undefined;
|
|
24
|
+
}, any>;
|
|
25
|
+
//# sourceMappingURL=stories.d.ts.map
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { tool } from 'ai';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { hnFirebase } from './client.js';
|
|
5
|
+
const prettyField = z
|
|
6
|
+
.string()
|
|
7
|
+
.optional()
|
|
8
|
+
.describe("Set to 'pretty' for formatted JSON output. Leave unset for compact JSON.");
|
|
9
|
+
function feedTool(name, description, endpoint, resultKey) {
|
|
10
|
+
return tool({
|
|
11
|
+
description,
|
|
12
|
+
inputSchema: z.object({
|
|
13
|
+
print: prettyField,
|
|
14
|
+
}),
|
|
15
|
+
execute: async ({ print }) => {
|
|
16
|
+
const ids = await hnFirebase(`/${endpoint}.json`, print ? { print } : {});
|
|
17
|
+
if (ids && typeof ids === 'object' && 'error' in ids)
|
|
18
|
+
return ids;
|
|
19
|
+
return { [resultKey]: ids, count: Array.isArray(ids) ? ids.length : 0 };
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
export const hackerNewsGetAskStories = feedTool('ask', 'Get up to 200 latest Ask HN story IDs in ranked order. Use the IDs with HackerNewsGetItem to fetch full story details.', 'askstories', 'storyIds');
|
|
24
|
+
export const hackerNewsGetBestStories = feedTool('best', 'Get up to 500 best Hacker News story IDs ranked by score. Use the IDs with HackerNewsGetItem to fetch full story details.', 'beststories', 'storyIds');
|
|
25
|
+
export const hackerNewsGetJobStories = tool({
|
|
26
|
+
description: 'Get up to 200 latest Hacker News job story IDs. Use the IDs with HackerNewsGetItem to fetch full job details.',
|
|
27
|
+
inputSchema: z.object({
|
|
28
|
+
printFormat: z
|
|
29
|
+
.string()
|
|
30
|
+
.optional()
|
|
31
|
+
.describe("Set to 'pretty' for formatted JSON output. Leave unset for compact JSON."),
|
|
32
|
+
}),
|
|
33
|
+
execute: async ({ printFormat }) => {
|
|
34
|
+
const ids = await hnFirebase('/jobstories.json', printFormat ? { print: printFormat } : {});
|
|
35
|
+
if (ids && typeof ids === 'object' && 'error' in ids)
|
|
36
|
+
return ids;
|
|
37
|
+
return { jobStoryIds: ids, count: Array.isArray(ids) ? ids.length : 0 };
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
export const hackerNewsGetNewStories = tool({
|
|
41
|
+
description: 'Get up to 500 newest Hacker News story IDs, most recent first. Use the IDs with HackerNewsGetItem to fetch full story details.',
|
|
42
|
+
inputSchema: z.object({
|
|
43
|
+
printFormat: z
|
|
44
|
+
.string()
|
|
45
|
+
.optional()
|
|
46
|
+
.describe("Set to 'pretty' for formatted JSON output. Leave unset for compact JSON."),
|
|
47
|
+
}),
|
|
48
|
+
execute: async ({ printFormat }) => {
|
|
49
|
+
const ids = await hnFirebase('/newstories.json', printFormat ? { print: printFormat } : {});
|
|
50
|
+
if (ids && typeof ids === 'object' && 'error' in ids)
|
|
51
|
+
return ids;
|
|
52
|
+
return { storyIds: ids, count: Array.isArray(ids) ? ids.length : 0 };
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
export const hackerNewsGetShowStories = tool({
|
|
56
|
+
description: 'Get up to 200 latest Show HN story IDs where people share projects and products. Use the IDs with HackerNewsGetItem to fetch full details.',
|
|
57
|
+
inputSchema: z.object({
|
|
58
|
+
printFormat: z
|
|
59
|
+
.string()
|
|
60
|
+
.optional()
|
|
61
|
+
.describe("Set to 'pretty' for formatted JSON output. Leave unset for compact JSON."),
|
|
62
|
+
}),
|
|
63
|
+
execute: async ({ printFormat }) => {
|
|
64
|
+
const ids = await hnFirebase('/showstories.json', printFormat ? { print: printFormat } : {});
|
|
65
|
+
if (ids && typeof ids === 'object' && 'error' in ids)
|
|
66
|
+
return ids;
|
|
67
|
+
return { storyIds: ids, count: Array.isArray(ids) ? ids.length : 0 };
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
export const hackerNewsGetTopStories = feedTool('top', 'Get up to 500 top Hacker News story IDs in front-page order. Use the IDs with HackerNewsGetItem to fetch full story details.', 'topstories', 'storyIds');
|
|
71
|
+
export const hackerNewsGetMaxItemId = tool({
|
|
72
|
+
description: 'Get the current largest Hacker News item ID. Use to discover the most recent items or walk backward through all items.',
|
|
73
|
+
inputSchema: z.object({
|
|
74
|
+
print: z
|
|
75
|
+
.string()
|
|
76
|
+
.optional()
|
|
77
|
+
.describe("Set to 'pretty' for formatted JSON output. Leave unset for compact JSON."),
|
|
78
|
+
}),
|
|
79
|
+
execute: async ({ print }) => {
|
|
80
|
+
const maxId = await hnFirebase('/maxitem.json', print ? { print } : {});
|
|
81
|
+
if (maxId && typeof maxId === 'object' && 'error' in maxId)
|
|
82
|
+
return maxId;
|
|
83
|
+
return { maxItemId: maxId };
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
export const hackerNewsGetUpdates = tool({
|
|
87
|
+
description: 'Get recently changed Hacker News item IDs and user profiles. Use to monitor recent activity on the platform.',
|
|
88
|
+
inputSchema: z.object({
|
|
89
|
+
print: z
|
|
90
|
+
.string()
|
|
91
|
+
.optional()
|
|
92
|
+
.describe("Set to 'pretty' for formatted JSON output. Leave unset for compact JSON."),
|
|
93
|
+
}),
|
|
94
|
+
execute: async ({ print }) => {
|
|
95
|
+
return hnFirebase('/updates.json', print ? { print } : {});
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
//# sourceMappingURL=stories.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const SVG = `<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M347.979 6v149.166l120.52 70.5V67.437L347.98 6zM43.499 6v234.104h391.98L316.207 174.54l-155.354-.062V68.999L43.5 6zm304.48 435.291V336.729l-156.542-.105c.146.688-121.25-66.604-121.25-66.604l398.312 1.896V506l-120.52-64.708zM43.499 288.312v152.979l117.355 61.437V357.145L43.5 288.312z" fill="#673de6" fill-rule="nonzero"/></svg>`;
|
|
2
|
+
export const HOSTINGER_ICON = {
|
|
3
|
+
kind: 'svg',
|
|
4
|
+
dataUri: `data:image/svg+xml;base64,${Buffer.from(SVG).toString('base64')}`,
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=icon.js.map
|