openalmanac 0.1.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/dist/auth.d.ts +13 -0
- package/dist/auth.js +71 -0
- package/dist/browser.d.ts +1 -0
- package/dist/browser.js +16 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +21 -0
- package/dist/login-core.d.ts +12 -0
- package/dist/login-core.js +64 -0
- package/dist/login.d.ts +2 -0
- package/dist/login.js +23 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +27 -0
- package/dist/tools/auth.d.ts +2 -0
- package/dist/tools/auth.js +32 -0
- package/dist/tools/read.d.ts +2 -0
- package/dist/tools/read.js +65 -0
- package/dist/tools/research.d.ts +2 -0
- package/dist/tools/research.js +43 -0
- package/dist/tools/write.d.ts +2 -0
- package/dist/tools/write.js +105 -0
- package/dist/types.d.ts +953 -0
- package/dist/types.js +91 -0
- package/package.json +37 -0
package/dist/types.js
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const Source = z.object({
|
|
3
|
+
url: z.string().describe("Source URL (must start with http:// or https://)"),
|
|
4
|
+
title: z.string().describe("Source title"),
|
|
5
|
+
accessed_date: z.string().describe("Date accessed in YYYY-MM-DD format"),
|
|
6
|
+
});
|
|
7
|
+
export const InfoboxDetail = z.object({
|
|
8
|
+
key: z.string(),
|
|
9
|
+
value: z.string(),
|
|
10
|
+
});
|
|
11
|
+
export const InfoboxHeader = z.object({
|
|
12
|
+
image_url: z.string().nullable().optional().describe("URL to a representative image"),
|
|
13
|
+
subtitle: z
|
|
14
|
+
.string()
|
|
15
|
+
.nullable()
|
|
16
|
+
.optional()
|
|
17
|
+
.describe("Short tagline, e.g. 'Mathematician & Computer Scientist'"),
|
|
18
|
+
details: z.array(InfoboxDetail).default([]).describe("Key-value pairs for quick facts"),
|
|
19
|
+
links: z.array(z.string()).default([]).describe("External reference URLs"),
|
|
20
|
+
});
|
|
21
|
+
export const TimelineItem = z.object({
|
|
22
|
+
primary: z.string().describe("Main event description (required)"),
|
|
23
|
+
secondary: z.string().nullable().optional(),
|
|
24
|
+
period: z.string().nullable().optional().describe("Time period, e.g. '1936'"),
|
|
25
|
+
location: z.string().nullable().optional(),
|
|
26
|
+
description: z.array(z.string()).nullable().optional().describe("List of detail strings"),
|
|
27
|
+
link: z.string().nullable().optional(),
|
|
28
|
+
});
|
|
29
|
+
export const ListItem = z.object({
|
|
30
|
+
title: z.string().describe("Item title (required)"),
|
|
31
|
+
subtitle: z.string().nullable().optional(),
|
|
32
|
+
year: z.string().nullable().optional(),
|
|
33
|
+
description: z.array(z.string()).nullable().optional().describe("List of detail strings"),
|
|
34
|
+
link: z.string().nullable().optional(),
|
|
35
|
+
});
|
|
36
|
+
export const GridItem = z.object({
|
|
37
|
+
title: z.string().describe("Item title (required)"),
|
|
38
|
+
image_url: z.string().nullable().optional(),
|
|
39
|
+
year: z.string().nullable().optional(),
|
|
40
|
+
description: z.string().nullable().optional().describe("Plain string (not a list)"),
|
|
41
|
+
link: z.string().nullable().optional(),
|
|
42
|
+
type: z.string().nullable().optional(),
|
|
43
|
+
});
|
|
44
|
+
export const TableItems = z.object({
|
|
45
|
+
headers: z.array(z.string()).describe("Column headers (non-empty)"),
|
|
46
|
+
rows: z
|
|
47
|
+
.array(z.object({ cells: z.array(z.string()) }))
|
|
48
|
+
.describe("List of {cells: [str]} dicts matching headers"),
|
|
49
|
+
});
|
|
50
|
+
export const TimelineSection = z.object({
|
|
51
|
+
type: z.literal("timeline"),
|
|
52
|
+
title: z.string(),
|
|
53
|
+
items: z.array(TimelineItem),
|
|
54
|
+
});
|
|
55
|
+
export const ListSection = z.object({
|
|
56
|
+
type: z.literal("list"),
|
|
57
|
+
title: z.string(),
|
|
58
|
+
items: z.array(ListItem),
|
|
59
|
+
});
|
|
60
|
+
export const TagsSection = z.object({
|
|
61
|
+
type: z.literal("tags"),
|
|
62
|
+
title: z.string(),
|
|
63
|
+
items: z.array(z.string()).describe("Flat list of tag strings"),
|
|
64
|
+
});
|
|
65
|
+
export const GridSection = z.object({
|
|
66
|
+
type: z.literal("grid"),
|
|
67
|
+
title: z.string(),
|
|
68
|
+
items: z.array(GridItem),
|
|
69
|
+
});
|
|
70
|
+
export const TableSection = z.object({
|
|
71
|
+
type: z.literal("table"),
|
|
72
|
+
title: z.string(),
|
|
73
|
+
items: TableItems,
|
|
74
|
+
});
|
|
75
|
+
export const KeyValueSection = z.object({
|
|
76
|
+
type: z.literal("key_value"),
|
|
77
|
+
title: z.string(),
|
|
78
|
+
items: z.array(InfoboxDetail),
|
|
79
|
+
});
|
|
80
|
+
export const InfoboxSection = z.discriminatedUnion("type", [
|
|
81
|
+
TimelineSection,
|
|
82
|
+
ListSection,
|
|
83
|
+
TagsSection,
|
|
84
|
+
GridSection,
|
|
85
|
+
TableSection,
|
|
86
|
+
KeyValueSection,
|
|
87
|
+
]);
|
|
88
|
+
export const Infobox = z.object({
|
|
89
|
+
header: InfoboxHeader,
|
|
90
|
+
sections: z.array(InfoboxSection).default([]),
|
|
91
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "openalmanac",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "OpenAlmanac — search, read, create, and update articles in the open knowledge base",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"openalmanac": "dist/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"dev": "tsc --watch",
|
|
12
|
+
"start": "node dist/cli.js"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"openalmanac",
|
|
16
|
+
"mcp",
|
|
17
|
+
"knowledge-base",
|
|
18
|
+
"ai",
|
|
19
|
+
"articles"
|
|
20
|
+
],
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"fastmcp": "^1.0.0",
|
|
24
|
+
"zod": "^3.24.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/node": "^22.0.0",
|
|
28
|
+
"typescript": "^5.7.0"
|
|
29
|
+
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=18.0.0"
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"dist",
|
|
35
|
+
"skill"
|
|
36
|
+
]
|
|
37
|
+
}
|