@coppermind/mcp-core 0.3.3
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/index.d.ts +63 -0
- package/dist/index.js +162 -0
- package/dist/index.js.map +1 -0
- package/package.json +49 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const COPPERMIND_TOOL_NAMES: readonly ["memory_search", "memory_ingest", "memory_get", "memory_stats", "memory_delete"];
|
|
4
|
+
interface MemoryEpisodeLike {
|
|
5
|
+
id: string;
|
|
6
|
+
userId: string;
|
|
7
|
+
content: string;
|
|
8
|
+
metadata: Record<string, unknown>;
|
|
9
|
+
createdAt: string;
|
|
10
|
+
updatedAt: string;
|
|
11
|
+
tags: string[];
|
|
12
|
+
embedding?: number[];
|
|
13
|
+
}
|
|
14
|
+
interface MemoryStatsLike {
|
|
15
|
+
totalEpisodes?: number;
|
|
16
|
+
totalTokens?: number;
|
|
17
|
+
oldestAt?: string;
|
|
18
|
+
newestAt?: string;
|
|
19
|
+
}
|
|
20
|
+
interface McpResponse {
|
|
21
|
+
content: Array<{
|
|
22
|
+
type: "text";
|
|
23
|
+
text: string;
|
|
24
|
+
}>;
|
|
25
|
+
isError?: boolean;
|
|
26
|
+
}
|
|
27
|
+
interface CoppermindToolClient {
|
|
28
|
+
searchMemory(args: {
|
|
29
|
+
userId: string;
|
|
30
|
+
query: string;
|
|
31
|
+
limit: number;
|
|
32
|
+
}): Promise<{
|
|
33
|
+
fragments?: MemoryEpisodeLike[];
|
|
34
|
+
}>;
|
|
35
|
+
ingest(args: {
|
|
36
|
+
userId: string;
|
|
37
|
+
data: Array<{
|
|
38
|
+
content: string;
|
|
39
|
+
tags?: string[];
|
|
40
|
+
metadata?: Record<string, unknown>;
|
|
41
|
+
}>;
|
|
42
|
+
}): Promise<{
|
|
43
|
+
inserted?: number;
|
|
44
|
+
}>;
|
|
45
|
+
getMemory(userId: string): Promise<{
|
|
46
|
+
fragments?: MemoryEpisodeLike[];
|
|
47
|
+
}>;
|
|
48
|
+
getStats(userId: string): Promise<MemoryStatsLike>;
|
|
49
|
+
deleteMemory(userId: string, episodeIds: string[]): Promise<{
|
|
50
|
+
success: boolean;
|
|
51
|
+
}>;
|
|
52
|
+
}
|
|
53
|
+
interface ToolRegistrar {
|
|
54
|
+
tool(name: string, description: string, schema: Record<string, z.ZodTypeAny>, handler: (args: any) => Promise<McpResponse>): void;
|
|
55
|
+
}
|
|
56
|
+
interface RegisterMemoryToolsOptions {
|
|
57
|
+
client: CoppermindToolClient;
|
|
58
|
+
defaultUserId: string;
|
|
59
|
+
formatError: (error: unknown) => string;
|
|
60
|
+
}
|
|
61
|
+
declare function registerMemoryTools(server: ToolRegistrar, options: RegisterMemoryToolsOptions): void;
|
|
62
|
+
|
|
63
|
+
export { COPPERMIND_TOOL_NAMES, type CoppermindToolClient, type McpResponse, type MemoryEpisodeLike, type MemoryStatsLike, type RegisterMemoryToolsOptions, type ToolRegistrar, registerMemoryTools };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var COPPERMIND_TOOL_NAMES = [
|
|
4
|
+
"memory_search",
|
|
5
|
+
"memory_ingest",
|
|
6
|
+
"memory_get",
|
|
7
|
+
"memory_stats",
|
|
8
|
+
"memory_delete"
|
|
9
|
+
];
|
|
10
|
+
function textResponse(text, isError = false) {
|
|
11
|
+
return {
|
|
12
|
+
content: [{ type: "text", text }],
|
|
13
|
+
...isError ? { isError: true } : {}
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function formatEpisodes(fragments, includeTags = false) {
|
|
17
|
+
return fragments.map((fragment, index) => {
|
|
18
|
+
const date = fragment.createdAt ? ` (${fragment.createdAt})` : "";
|
|
19
|
+
const tags = includeTags && fragment.tags?.length ? ` [${fragment.tags.join(", ")}]` : "";
|
|
20
|
+
const id = fragment.id ? ` [${fragment.id}]` : "";
|
|
21
|
+
return `${index + 1}.${id} ${fragment.content || ""}${date}${tags}`;
|
|
22
|
+
}).join("\n\n");
|
|
23
|
+
}
|
|
24
|
+
function registerMemoryTools(server, options) {
|
|
25
|
+
const { client, defaultUserId, formatError } = options;
|
|
26
|
+
server.tool(
|
|
27
|
+
"memory_search",
|
|
28
|
+
"Search your long-term memory for relevant information. Use this when you need to recall past conversations, decisions, preferences, or any historical context. Performs semantic search \u2014 you don't need exact keywords, just describe what you're looking for.",
|
|
29
|
+
{
|
|
30
|
+
query: z.string().describe(
|
|
31
|
+
"Natural language search query (e.g., 'database schema decisions', 'user coding preferences', 'authentication discussion last week')"
|
|
32
|
+
),
|
|
33
|
+
limit: z.number().int().min(1).max(20).optional().default(5).describe("Maximum number of results to return (default: 5)"),
|
|
34
|
+
user_id: z.string().optional().describe("User ID for memory scope (defaults to env COPPERMIND_USER_ID)")
|
|
35
|
+
},
|
|
36
|
+
async ({ query, limit, user_id }) => {
|
|
37
|
+
try {
|
|
38
|
+
const result = await client.searchMemory({
|
|
39
|
+
userId: user_id || defaultUserId,
|
|
40
|
+
query,
|
|
41
|
+
limit: limit ?? 5
|
|
42
|
+
});
|
|
43
|
+
const fragments = result.fragments || [];
|
|
44
|
+
if (fragments.length === 0) {
|
|
45
|
+
return textResponse(`No memories found matching: "${query}"`);
|
|
46
|
+
}
|
|
47
|
+
return textResponse(
|
|
48
|
+
`Found ${fragments.length} memories:
|
|
49
|
+
|
|
50
|
+
${formatEpisodes(fragments, true)}`
|
|
51
|
+
);
|
|
52
|
+
} catch (error) {
|
|
53
|
+
return textResponse(formatError(error), true);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
server.tool(
|
|
58
|
+
"memory_ingest",
|
|
59
|
+
"Store new information into long-term memory. Use this to save important facts, decisions, preferences, or context that should be remembered across sessions. Stored memories are searchable via memory_search.",
|
|
60
|
+
{
|
|
61
|
+
content: z.string().describe(
|
|
62
|
+
"The text content to store as memory (e.g., 'User prefers TypeScript over JavaScript', 'Database will use PostgreSQL with Drizzle ORM')"
|
|
63
|
+
),
|
|
64
|
+
tags: z.array(z.string()).optional().describe(
|
|
65
|
+
"Optional tags for categorization (e.g., ['preferences', 'editor'])"
|
|
66
|
+
),
|
|
67
|
+
user_id: z.string().optional().describe("User ID for memory scope (defaults to env COPPERMIND_USER_ID)")
|
|
68
|
+
},
|
|
69
|
+
async ({ content, tags, user_id }) => {
|
|
70
|
+
try {
|
|
71
|
+
const result = await client.ingest({
|
|
72
|
+
userId: user_id || defaultUserId,
|
|
73
|
+
data: [
|
|
74
|
+
{
|
|
75
|
+
content,
|
|
76
|
+
...tags && tags.length > 0 ? { tags } : {}
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
});
|
|
80
|
+
return textResponse(
|
|
81
|
+
`Memory stored successfully. Inserted: ${result.inserted ?? 1} episode(s).`
|
|
82
|
+
);
|
|
83
|
+
} catch (error) {
|
|
84
|
+
return textResponse(formatError(error), true);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
server.tool(
|
|
89
|
+
"memory_get",
|
|
90
|
+
"Get all stored memories for a user. Returns the full memory context including all fragments. Use this for a broad overview of everything remembered, rather than searching for specific topics.",
|
|
91
|
+
{
|
|
92
|
+
user_id: z.string().optional().describe(
|
|
93
|
+
"User ID to retrieve memories for (defaults to env COPPERMIND_USER_ID)"
|
|
94
|
+
)
|
|
95
|
+
},
|
|
96
|
+
async ({ user_id }) => {
|
|
97
|
+
try {
|
|
98
|
+
const result = await client.getMemory(user_id || defaultUserId);
|
|
99
|
+
const fragments = result.fragments || [];
|
|
100
|
+
if (fragments.length === 0) {
|
|
101
|
+
return textResponse("No memories stored yet for this user.");
|
|
102
|
+
}
|
|
103
|
+
return textResponse(`${fragments.length} memories:
|
|
104
|
+
|
|
105
|
+
${formatEpisodes(fragments)}`);
|
|
106
|
+
} catch (error) {
|
|
107
|
+
return textResponse(formatError(error), true);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
server.tool(
|
|
112
|
+
"memory_stats",
|
|
113
|
+
"Get memory usage statistics \u2014 total episodes stored, token count, and timestamps. Useful for understanding how much memory is being used and whether the user is approaching their plan limits.",
|
|
114
|
+
{
|
|
115
|
+
user_id: z.string().optional().describe("User ID to get stats for (defaults to env COPPERMIND_USER_ID)")
|
|
116
|
+
},
|
|
117
|
+
async ({ user_id }) => {
|
|
118
|
+
try {
|
|
119
|
+
const stats = await client.getStats(user_id || defaultUserId);
|
|
120
|
+
const lines = [
|
|
121
|
+
"Memory Statistics:",
|
|
122
|
+
` Total episodes: ${stats.totalEpisodes ?? "unknown"}`,
|
|
123
|
+
` Total tokens: ${stats.totalTokens ?? "unknown"}`
|
|
124
|
+
];
|
|
125
|
+
if (stats.oldestAt) {
|
|
126
|
+
lines.push(` Oldest memory: ${stats.oldestAt}`);
|
|
127
|
+
}
|
|
128
|
+
if (stats.newestAt) {
|
|
129
|
+
lines.push(` Newest memory: ${stats.newestAt}`);
|
|
130
|
+
}
|
|
131
|
+
return textResponse(lines.join("\n"));
|
|
132
|
+
} catch (error) {
|
|
133
|
+
return textResponse(formatError(error), true);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
);
|
|
137
|
+
server.tool(
|
|
138
|
+
"memory_delete",
|
|
139
|
+
"Delete specific memory episodes by their IDs. Use with caution \u2014 deleted memories cannot be recovered. Get episode IDs from memory_get or memory_search results.",
|
|
140
|
+
{
|
|
141
|
+
episode_ids: z.array(z.string()).min(1).describe("Array of episode IDs to delete"),
|
|
142
|
+
user_id: z.string().optional().describe(
|
|
143
|
+
"User ID who owns the episodes (defaults to env COPPERMIND_USER_ID)"
|
|
144
|
+
)
|
|
145
|
+
},
|
|
146
|
+
async ({ episode_ids, user_id }) => {
|
|
147
|
+
try {
|
|
148
|
+
const result = await client.deleteMemory(user_id || defaultUserId, episode_ids);
|
|
149
|
+
return textResponse(
|
|
150
|
+
result.success ? `Deleted ${episode_ids.length} memory episode(s).` : "Delete operation returned unsuccessfully."
|
|
151
|
+
);
|
|
152
|
+
} catch (error) {
|
|
153
|
+
return textResponse(formatError(error), true);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
export {
|
|
159
|
+
COPPERMIND_TOOL_NAMES,
|
|
160
|
+
registerMemoryTools
|
|
161
|
+
};
|
|
162
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const COPPERMIND_TOOL_NAMES = [\n \"memory_search\",\n \"memory_ingest\",\n \"memory_get\",\n \"memory_stats\",\n \"memory_delete\",\n] as const;\n\nexport interface MemoryEpisodeLike {\n id: string;\n userId: string;\n content: string;\n metadata: Record<string, unknown>;\n createdAt: string;\n updatedAt: string;\n tags: string[];\n embedding?: number[];\n}\n\nexport interface MemoryStatsLike {\n totalEpisodes?: number;\n totalTokens?: number;\n oldestAt?: string;\n newestAt?: string;\n}\n\nexport interface McpResponse {\n content: Array<{\n type: \"text\";\n text: string;\n }>;\n isError?: boolean;\n}\n\nexport interface CoppermindToolClient {\n searchMemory(args: { userId: string; query: string; limit: number }): Promise<{ fragments?: MemoryEpisodeLike[] }>;\n ingest(args: {\n userId: string;\n data: Array<{ content: string; tags?: string[]; metadata?: Record<string, unknown> }>;\n }): Promise<{ inserted?: number }>;\n getMemory(userId: string): Promise<{ fragments?: MemoryEpisodeLike[] }>;\n getStats(userId: string): Promise<MemoryStatsLike>;\n deleteMemory(userId: string, episodeIds: string[]): Promise<{ success: boolean }>;\n}\n\nexport interface ToolRegistrar {\n tool(\n name: string,\n description: string,\n schema: Record<string, z.ZodTypeAny>,\n handler: (args: any) => Promise<McpResponse>,\n ): void;\n}\n\nexport interface RegisterMemoryToolsOptions {\n client: CoppermindToolClient;\n defaultUserId: string;\n formatError: (error: unknown) => string;\n}\n\nfunction textResponse(text: string, isError = false): McpResponse {\n return {\n content: [{ type: \"text\", text }],\n ...(isError ? { isError: true } : {}),\n };\n}\n\nfunction formatEpisodes(fragments: MemoryEpisodeLike[], includeTags = false): string {\n return fragments\n .map((fragment, index) => {\n const date = fragment.createdAt ? ` (${fragment.createdAt})` : \"\";\n const tags =\n includeTags && fragment.tags?.length ? ` [${fragment.tags.join(\", \")}]` : \"\";\n const id = fragment.id ? ` [${fragment.id}]` : \"\";\n return `${index + 1}.${id} ${fragment.content || \"\"}${date}${tags}`;\n })\n .join(\"\\n\\n\");\n}\n\nexport function registerMemoryTools(\n server: ToolRegistrar,\n options: RegisterMemoryToolsOptions,\n): void {\n const { client, defaultUserId, formatError } = options;\n\n server.tool(\n \"memory_search\",\n \"Search your long-term memory for relevant information. Use this when \" +\n \"you need to recall past conversations, decisions, preferences, or any \" +\n \"historical context. Performs semantic search — you don't need exact \" +\n \"keywords, just describe what you're looking for.\",\n {\n query: z\n .string()\n .describe(\n \"Natural language search query (e.g., 'database schema decisions', \" +\n \"'user coding preferences', 'authentication discussion last week')\",\n ),\n limit: z\n .number()\n .int()\n .min(1)\n .max(20)\n .optional()\n .default(5)\n .describe(\"Maximum number of results to return (default: 5)\"),\n user_id: z\n .string()\n .optional()\n .describe(\"User ID for memory scope (defaults to env COPPERMIND_USER_ID)\"),\n },\n async ({ query, limit, user_id }) => {\n try {\n const result = await client.searchMemory({\n userId: user_id || defaultUserId,\n query,\n limit: limit ?? 5,\n });\n const fragments = result.fragments || [];\n if (fragments.length === 0) {\n return textResponse(`No memories found matching: \"${query}\"`);\n }\n\n return textResponse(\n `Found ${fragments.length} memories:\\n\\n${formatEpisodes(fragments, true)}`,\n );\n } catch (error) {\n return textResponse(formatError(error), true);\n }\n },\n );\n\n server.tool(\n \"memory_ingest\",\n \"Store new information into long-term memory. Use this to save important \" +\n \"facts, decisions, preferences, or context that should be remembered \" +\n \"across sessions. Stored memories are searchable via memory_search.\",\n {\n content: z\n .string()\n .describe(\n \"The text content to store as memory (e.g., 'User prefers TypeScript \" +\n \"over JavaScript', 'Database will use PostgreSQL with Drizzle ORM')\",\n ),\n tags: z\n .array(z.string())\n .optional()\n .describe(\n \"Optional tags for categorization (e.g., ['preferences', 'editor'])\",\n ),\n user_id: z\n .string()\n .optional()\n .describe(\"User ID for memory scope (defaults to env COPPERMIND_USER_ID)\"),\n },\n async ({ content, tags, user_id }) => {\n try {\n const result = await client.ingest({\n userId: user_id || defaultUserId,\n data: [\n {\n content,\n ...(tags && tags.length > 0 ? { tags } : {}),\n },\n ],\n });\n\n return textResponse(\n `Memory stored successfully. Inserted: ${result.inserted ?? 1} episode(s).`,\n );\n } catch (error) {\n return textResponse(formatError(error), true);\n }\n },\n );\n\n server.tool(\n \"memory_get\",\n \"Get all stored memories for a user. Returns the full memory context \" +\n \"including all fragments. Use this for a broad overview of everything \" +\n \"remembered, rather than searching for specific topics.\",\n {\n user_id: z\n .string()\n .optional()\n .describe(\n \"User ID to retrieve memories for (defaults to env COPPERMIND_USER_ID)\",\n ),\n },\n async ({ user_id }) => {\n try {\n const result = await client.getMemory(user_id || defaultUserId);\n const fragments = result.fragments || [];\n if (fragments.length === 0) {\n return textResponse(\"No memories stored yet for this user.\");\n }\n\n return textResponse(`${fragments.length} memories:\\n\\n${formatEpisodes(fragments)}`);\n } catch (error) {\n return textResponse(formatError(error), true);\n }\n },\n );\n\n server.tool(\n \"memory_stats\",\n \"Get memory usage statistics — total episodes stored, token count, \" +\n \"and timestamps. Useful for understanding how much memory is being \" +\n \"used and whether the user is approaching their plan limits.\",\n {\n user_id: z\n .string()\n .optional()\n .describe(\"User ID to get stats for (defaults to env COPPERMIND_USER_ID)\"),\n },\n async ({ user_id }) => {\n try {\n const stats = await client.getStats(user_id || defaultUserId);\n const lines = [\n \"Memory Statistics:\",\n ` Total episodes: ${stats.totalEpisodes ?? \"unknown\"}`,\n ` Total tokens: ${stats.totalTokens ?? \"unknown\"}`,\n ];\n if (stats.oldestAt) {\n lines.push(` Oldest memory: ${stats.oldestAt}`);\n }\n if (stats.newestAt) {\n lines.push(` Newest memory: ${stats.newestAt}`);\n }\n return textResponse(lines.join(\"\\n\"));\n } catch (error) {\n return textResponse(formatError(error), true);\n }\n },\n );\n\n server.tool(\n \"memory_delete\",\n \"Delete specific memory episodes by their IDs. Use with caution — \" +\n \"deleted memories cannot be recovered. Get episode IDs from \" +\n \"memory_get or memory_search results.\",\n {\n episode_ids: z\n .array(z.string())\n .min(1)\n .describe(\"Array of episode IDs to delete\"),\n user_id: z\n .string()\n .optional()\n .describe(\n \"User ID who owns the episodes (defaults to env COPPERMIND_USER_ID)\",\n ),\n },\n async ({ episode_ids, user_id }) => {\n try {\n const result = await client.deleteMemory(user_id || defaultUserId, episode_ids);\n return textResponse(\n result.success\n ? `Deleted ${episode_ids.length} memory episode(s).`\n : \"Delete operation returned unsuccessfully.\",\n );\n } catch (error) {\n return textResponse(formatError(error), true);\n }\n },\n );\n}\n"],"mappings":";AAAA,SAAS,SAAS;AAEX,IAAM,wBAAwB;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAsDA,SAAS,aAAa,MAAc,UAAU,OAAoB;AAChE,SAAO;AAAA,IACL,SAAS,CAAC,EAAE,MAAM,QAAQ,KAAK,CAAC;AAAA,IAChC,GAAI,UAAU,EAAE,SAAS,KAAK,IAAI,CAAC;AAAA,EACrC;AACF;AAEA,SAAS,eAAe,WAAgC,cAAc,OAAe;AACnF,SAAO,UACJ,IAAI,CAAC,UAAU,UAAU;AACxB,UAAM,OAAO,SAAS,YAAY,KAAK,SAAS,SAAS,MAAM;AAC/D,UAAM,OACJ,eAAe,SAAS,MAAM,SAAS,KAAK,SAAS,KAAK,KAAK,IAAI,CAAC,MAAM;AAC5E,UAAM,KAAK,SAAS,KAAK,KAAK,SAAS,EAAE,MAAM;AAC/C,WAAO,GAAG,QAAQ,CAAC,IAAI,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AS;AAAA,QACrD;AACA,YAAI,MAAM,UAAU;AAClB,gBAAM,KAAK,qBAAqB,MAAM,QAAQ,EAAE;AAAA,QAClD;AACA,YAAI,MAAM,UAAU;AAClB,gBAAM,KAAK,qBAAqB,MAAM,QAAQ,EAAE;AAAA,QAClD;AACA,eAAO,aAAa,MAAM,KAAK,IAAI,CAAC;AAAA,MACtC,SAAS,OAAO;AACd,eAAO,aAAa,YAAY,KAAK,GAAG,IAAI;AAAA,MAC9C;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IAGA;AAAA,MACE,aAAa,EACV,MAAM,EAAE,OAAO,CAAC,EAChB,IAAI,CAAC,EACL,SAAS,gCAAgC;AAAA,MAC5C,SAAS,EACN,OAAO,EACP,SAAS,EACT;AAAA,QACC;AAAA,MACF;AAAA,IACJ;AAAA,IACA,OAAO,EAAE,aAAa,QAAQ,MAAM;AAClC,UAAI;AACF,cAAM,SAAS,MAAM,OAAO,aAAa,WAAW,eAAe,WAAW;AAC9E,eAAO;AAAA,UACL,OAAO,UACH,WAAW,YAAY,MAAM,wBAC7B;AAAA,QACN;AAAA,MACF,SAAS,OAAO;AACd,eAAO,aAAa,YAAY,KAAK,GAAG,IAAI;AAAA,MAC9C;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@coppermind/mcp-core",
|
|
3
|
+
"version": "0.3.3",
|
|
4
|
+
"description": "Shared MCP contract logic for Coppermind local and cloud servers",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/Yames-Games/coppermindapi.git",
|
|
12
|
+
"directory": "mcp-core"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://coppermindapi.com",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/Yames-Games/coppermindapi/issues"
|
|
17
|
+
},
|
|
18
|
+
"type": "module",
|
|
19
|
+
"main": "./dist/index.js",
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"import": "./dist/index.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist"
|
|
29
|
+
],
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "tsup",
|
|
32
|
+
"dev": "tsup --watch",
|
|
33
|
+
"test": "vitest run",
|
|
34
|
+
"typecheck": "tsc --noEmit",
|
|
35
|
+
"clean": "rm -rf dist"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"zod": "^3.23.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@types/node": "^20.0.0",
|
|
42
|
+
"tsup": "^8.0.0",
|
|
43
|
+
"typescript": "^5.3.0",
|
|
44
|
+
"vitest": "^4.1.2"
|
|
45
|
+
},
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">=20.0.0"
|
|
48
|
+
}
|
|
49
|
+
}
|