tarsk 0.0.1 → 0.0.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/package.json +4 -4
- package/dist-old/.tarsk/.tools/books.js +0 -59
- package/dist-old/.tarsk/.tools/dust.js +0 -82
- package/dist-old/.tarsk/settings.json +0 -1
- package/dist-old/.tarsk/tools/books.json +0 -4
- package/dist-old/.tarsk/tools/books.ts +0 -59
- package/dist-old/.tarsk/tools/dust.json +0 -4
- package/dist-old/.tarsk/tools/dust.ts +0 -82
package/package.json
CHANGED
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
"tarsk": "dist/index.js"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@hono/node-server": "
|
|
15
|
-
"hono": "
|
|
16
|
-
"ts-blank-space": "
|
|
14
|
+
"@hono/node-server": "1.14.1",
|
|
15
|
+
"hono": "4.7.7",
|
|
16
|
+
"ts-blank-space": "0.6.1"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@types/node": "^20.11.17",
|
|
20
20
|
"tsx": "^4.7.1"
|
|
21
21
|
},
|
|
22
|
-
"version": "0.0.
|
|
22
|
+
"version": "0.0.2"
|
|
23
23
|
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
// Searches for books in the Project Gutenberg library based on provided search terms
|
|
2
|
-
// @param @array @required searchTerms List of search terms to find books in the Gutenberg library (e.g. ['dickens', 'great'] to search for books by Dickens with 'great' in the title)
|
|
3
|
-
export async function searchGutenbergBooks(searchTerms ) {
|
|
4
|
-
const searchQuery = searchTerms.join(' ');
|
|
5
|
-
const url = 'https://gutendex.com/books';
|
|
6
|
-
const response = await fetch(`${url}?search=${searchQuery}`);
|
|
7
|
-
const data = await response.json();
|
|
8
|
-
return data.results.map((book ) => ({
|
|
9
|
-
id: book.id,
|
|
10
|
-
title: book.title,
|
|
11
|
-
authors: book.authors,
|
|
12
|
-
}));
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const toolMap = {
|
|
16
|
-
searchGutenbergBooks
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export default function tools() {
|
|
20
|
-
return booksTools;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// Automate via TS Morph?
|
|
24
|
-
const booksTools = [
|
|
25
|
-
{
|
|
26
|
-
type: 'function',
|
|
27
|
-
function: {
|
|
28
|
-
name: 'searchGutenbergBooks',
|
|
29
|
-
description:
|
|
30
|
-
'Search for books in the Project Gutenberg library based on specified search terms',
|
|
31
|
-
parameters: {
|
|
32
|
-
type: 'object',
|
|
33
|
-
properties: {
|
|
34
|
-
searchTerms: { // Must match argument name in function
|
|
35
|
-
type: 'array',
|
|
36
|
-
items: {
|
|
37
|
-
type: 'string',
|
|
38
|
-
},
|
|
39
|
-
description:
|
|
40
|
-
"List of search terms to find books in the Gutenberg library (e.g. ['dickens', 'great'] to search for books by Dickens with 'great' in the title)",
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
required: ['searchTerms'],
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
];
|
|
48
|
-
|
|
49
|
-
;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
export async function searchBurns(searchTerms ) {
|
|
2
|
-
const searchQuery = searchTerms.join(' ');
|
|
3
|
-
const url = 'https://api.dust.events/data/festivals.json';
|
|
4
|
-
const response = await fetch(`${url}`);
|
|
5
|
-
const data = await response.json();
|
|
6
|
-
data = data.filter((b) => b.active);
|
|
7
|
-
return data.map((burn ) => ({
|
|
8
|
-
name: burn.name,
|
|
9
|
-
title: burn.title,
|
|
10
|
-
year: burn.year,
|
|
11
|
-
startDate: burn.start,
|
|
12
|
-
endDate: burn.end,
|
|
13
|
-
lat: burn.lat,
|
|
14
|
-
long: burn.long,
|
|
15
|
-
timeZone: burn.timeZone,
|
|
16
|
-
region: burn.region,
|
|
17
|
-
website: burn.website
|
|
18
|
-
}));
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const toolMap = {
|
|
22
|
-
searchBurns
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default function tools() {
|
|
26
|
-
return burnTools;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const burnTools = [
|
|
30
|
-
{
|
|
31
|
-
type: 'function',
|
|
32
|
-
function: {
|
|
33
|
-
name: 'searchBurns',
|
|
34
|
-
description:
|
|
35
|
-
"Search for regional burning man events based on specified search terms",
|
|
36
|
-
parameters: {
|
|
37
|
-
type: 'object',
|
|
38
|
-
properties: {
|
|
39
|
-
searchTerms: { // Must match argument name in function
|
|
40
|
-
type: 'array',
|
|
41
|
-
items: {
|
|
42
|
-
type: 'string',
|
|
43
|
-
},
|
|
44
|
-
description:
|
|
45
|
-
"List of search terms (e.g. ['snrg', 'soak'] to search for regional burns with 'snrg' or 'soak' in the title",
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
required: ['searchTerms'],
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
];
|
|
53
|
-
|
|
54
|
-
;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
zO3DHSWwKmpUWImXKWcplw==:3JB/NEXlkvGBxoHDcGPz7uWbAALPiq2+EiRLIC3ejJy0CxaKVV2Aquaw807PwN0z0LLBOvzD56a9atm9cA3yvVhRuwqqIC3Tx4Wy/8dQWixomj9rjKHbnDp7uJ2EZt853AYUuY9ZpgDgM61X+AwcVLw8Xs4meHzV7yZxM57oOER4Y/hLu7ywMV+wEucZd9PL/VBW4/6p/6tFmA5C7DD3CNgIEIyrqyJMzn8L/kQiSs+ZfGa3iXjdQtyPuNBY0fSA4o6lWJnbQ6IkKifL6DDx2A==
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
// Searches for books in the Project Gutenberg library based on provided search terms
|
|
2
|
-
// @param @array @required searchTerms List of search terms to find books in the Gutenberg library (e.g. ['dickens', 'great'] to search for books by Dickens with 'great' in the title)
|
|
3
|
-
export async function searchGutenbergBooks(searchTerms: string[]): Promise<Book[]> {
|
|
4
|
-
const searchQuery = searchTerms.join(' ');
|
|
5
|
-
const url = 'https://gutendex.com/books';
|
|
6
|
-
const response = await fetch(`${url}?search=${searchQuery}`);
|
|
7
|
-
const data = await response.json();
|
|
8
|
-
return data.results.map((book: any) => ({
|
|
9
|
-
id: book.id,
|
|
10
|
-
title: book.title,
|
|
11
|
-
authors: book.authors,
|
|
12
|
-
}));
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const toolMap = {
|
|
16
|
-
searchGutenbergBooks
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export default function tools() {
|
|
20
|
-
return booksTools;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// Automate via TS Morph?
|
|
24
|
-
const booksTools = [
|
|
25
|
-
{
|
|
26
|
-
type: 'function',
|
|
27
|
-
function: {
|
|
28
|
-
name: 'searchGutenbergBooks',
|
|
29
|
-
description:
|
|
30
|
-
'Search for books in the Project Gutenberg library based on specified search terms',
|
|
31
|
-
parameters: {
|
|
32
|
-
type: 'object',
|
|
33
|
-
properties: {
|
|
34
|
-
searchTerms: { // Must match argument name in function
|
|
35
|
-
type: 'array',
|
|
36
|
-
items: {
|
|
37
|
-
type: 'string',
|
|
38
|
-
},
|
|
39
|
-
description:
|
|
40
|
-
"List of search terms to find books in the Gutenberg library (e.g. ['dickens', 'great'] to search for books by Dickens with 'great' in the title)",
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
required: ['searchTerms'],
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
];
|
|
48
|
-
|
|
49
|
-
interface Book {
|
|
50
|
-
id: string;
|
|
51
|
-
title: string;
|
|
52
|
-
authors: Person[];
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
interface Person {
|
|
56
|
-
birth_year?: number;
|
|
57
|
-
death_year?: number;
|
|
58
|
-
name: string;
|
|
59
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
export async function searchBurns(searchTerms: string[]): Promise<Burn[]> {
|
|
2
|
-
const searchQuery = searchTerms.join(' ');
|
|
3
|
-
const url = 'https://api.dust.events/data/festivals.json';
|
|
4
|
-
const response = await fetch(`${url}`);
|
|
5
|
-
const data = await response.json();
|
|
6
|
-
data = data.filter((b) => b.active);
|
|
7
|
-
return data.map((burn: any) => ({
|
|
8
|
-
name: burn.name,
|
|
9
|
-
title: burn.title,
|
|
10
|
-
year: burn.year,
|
|
11
|
-
startDate: burn.start,
|
|
12
|
-
endDate: burn.end,
|
|
13
|
-
lat: burn.lat,
|
|
14
|
-
long: burn.long,
|
|
15
|
-
timeZone: burn.timeZone,
|
|
16
|
-
region: burn.region,
|
|
17
|
-
website: burn.website
|
|
18
|
-
}));
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const toolMap = {
|
|
22
|
-
searchBurns
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default function tools() {
|
|
26
|
-
return burnTools;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const burnTools = [
|
|
30
|
-
{
|
|
31
|
-
type: 'function',
|
|
32
|
-
function: {
|
|
33
|
-
name: 'searchBurns',
|
|
34
|
-
description:
|
|
35
|
-
"Search for regional burning man events based on specified search terms",
|
|
36
|
-
parameters: {
|
|
37
|
-
type: 'object',
|
|
38
|
-
properties: {
|
|
39
|
-
searchTerms: { // Must match argument name in function
|
|
40
|
-
type: 'array',
|
|
41
|
-
items: {
|
|
42
|
-
type: 'string',
|
|
43
|
-
},
|
|
44
|
-
description:
|
|
45
|
-
"List of search terms (e.g. ['snrg', 'soak'] to search for regional burns with 'snrg' or 'soak' in the title",
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
required: ['searchTerms'],
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
];
|
|
53
|
-
|
|
54
|
-
export interface Burn {
|
|
55
|
-
name: string
|
|
56
|
-
title: string
|
|
57
|
-
year: string
|
|
58
|
-
active: boolean
|
|
59
|
-
id: string
|
|
60
|
-
uid: number
|
|
61
|
-
start: string
|
|
62
|
-
end: string
|
|
63
|
-
lat: any
|
|
64
|
-
long: any
|
|
65
|
-
imageUrl?: string
|
|
66
|
-
timeZone: string
|
|
67
|
-
mapDirection: number
|
|
68
|
-
mastodonHandle: string
|
|
69
|
-
rssFeed: string
|
|
70
|
-
inboxEmail: string
|
|
71
|
-
region: string
|
|
72
|
-
website: string
|
|
73
|
-
unknownDates: boolean
|
|
74
|
-
volunteeripateSubdomain: string
|
|
75
|
-
volunteeripateIdentifier: string
|
|
76
|
-
pin_size_multiplier: number
|
|
77
|
-
camp_registration: boolean
|
|
78
|
-
event_registration: boolean
|
|
79
|
-
pin: string
|
|
80
|
-
directions?: string
|
|
81
|
-
}
|
|
82
|
-
|