Skip to content

Commit 68e40b3

Browse files
committed
wip
1 parent 89f44ab commit 68e40b3

File tree

8 files changed

+75
-10
lines changed

8 files changed

+75
-10
lines changed

epicshop/epic-me/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
"skipLibCheck": true,
1212
"strict": true,
1313
"noEmit": true,
14-
"types": ["./worker-configuration.d.ts"]
14+
"types": ["./types/worker-configuration.d.ts"]
1515
}
1616
}

epicshop/epic-me/workers/db/client/dist/schema.d.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,31 @@ export declare const entrySchema: z.ZodObject<{
5252
isPrivate?: number;
5353
isFavorite?: number;
5454
}>;
55+
export declare const entryListItemSchema: z.ZodIntersection<z.ZodObject<Pick<{
56+
id: z.ZodNumber;
57+
userId: z.ZodNumber;
58+
title: z.ZodString;
59+
content: z.ZodString;
60+
mood: z.ZodNullable<z.ZodString>;
61+
location: z.ZodNullable<z.ZodString>;
62+
weather: z.ZodNullable<z.ZodString>;
63+
isPrivate: z.ZodNumber;
64+
isFavorite: z.ZodNumber;
65+
createdAt: z.ZodEffects<z.ZodNumber, number, unknown>;
66+
updatedAt: z.ZodEffects<z.ZodNumber, number, unknown>;
67+
}, "id" | "title">, "strip", z.ZodTypeAny, {
68+
id?: number;
69+
title?: string;
70+
}, {
71+
id?: number;
72+
title?: string;
73+
}>, z.ZodObject<{
74+
tagCount: z.ZodNumber;
75+
}, "strip", z.ZodTypeAny, {
76+
tagCount?: number;
77+
}, {
78+
tagCount?: number;
79+
}>>;
5580
export declare const entryWithTagsSchema: z.ZodObject<{
5681
id: z.ZodNumber;
5782
userId: z.ZodNumber;
@@ -155,6 +180,20 @@ export declare const tagSchema: z.ZodObject<{
155180
name?: string;
156181
description?: string;
157182
}>;
183+
export declare const tagListItemSchema: z.ZodObject<Pick<{
184+
id: z.ZodNumber;
185+
userId: z.ZodNumber;
186+
name: z.ZodString;
187+
description: z.ZodNullable<z.ZodString>;
188+
createdAt: z.ZodEffects<z.ZodNumber, number, unknown>;
189+
updatedAt: z.ZodEffects<z.ZodNumber, number, unknown>;
190+
}, "id" | "name">, "strip", z.ZodTypeAny, {
191+
id?: number;
192+
name?: string;
193+
}, {
194+
id?: number;
195+
name?: string;
196+
}>;
158197
export declare const newTagSchema: z.ZodObject<{
159198
name: z.ZodString;
160199
description: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string, string>;

epicshop/epic-me/workers/db/client/dist/schema.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ export var entrySchema = z.object({
4040
createdAt: timestampSchema,
4141
updatedAt: timestampSchema,
4242
});
43+
export var entryListItemSchema = entrySchema
44+
.pick({
45+
id: true,
46+
title: true,
47+
})
48+
.and(z.object({ tagCount: z.number() }));
4349
export var entryWithTagsSchema = entrySchema.extend({
4450
tags: z.array(z.object({ id: z.number(), name: z.string() })),
4551
});
@@ -60,6 +66,10 @@ export var tagSchema = z.object({
6066
createdAt: timestampSchema,
6167
updatedAt: timestampSchema,
6268
});
69+
export var tagListItemSchema = tagSchema.pick({
70+
id: true,
71+
name: true,
72+
});
6373
export var newTagSchema = z.object({
6474
name: z.string(),
6575
description: z

epicshop/epic-me/workers/db/client/schema.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ export const entrySchema = z.object({
3333
updatedAt: timestampSchema,
3434
})
3535

36+
export const entryListItemSchema = entrySchema
37+
.pick({
38+
id: true,
39+
title: true,
40+
})
41+
.and(z.object({ tagCount: z.number() }))
42+
3643
export const entryWithTagsSchema = entrySchema.extend({
3744
tags: z.array(z.object({ id: z.number(), name: z.string() })),
3845
})
@@ -56,6 +63,11 @@ export const tagSchema = z.object({
5663
updatedAt: timestampSchema,
5764
})
5865

66+
export const tagListItemSchema = tagSchema.pick({
67+
id: true,
68+
name: true,
69+
})
70+
5971
export const newTagSchema = z.object({
6072
name: z.string(),
6173
description: z

exercises/01.start/01.solution/src/tools.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ import {
22
createEntryInputSchema,
33
createTagInputSchema,
44
entryIdSchema,
5-
entrySchema,
5+
entryListItemSchema,
66
entryTagIdSchema,
77
entryTagSchema,
88
entryWithTagsSchema,
99
tagIdSchema,
10+
tagListItemSchema,
1011
tagSchema,
1112
updateEntryInputSchema,
1213
updateTagInputSchema,
@@ -92,7 +93,7 @@ export async function initializeTools(agent: EpicMeMCP) {
9293
readOnlyHint: true,
9394
openWorldHint: false,
9495
},
95-
outputSchema: { entries: z.array(entrySchema) },
96+
outputSchema: { entries: z.array(entryListItemSchema) },
9697
},
9798
async () => {
9899
const entries = await agent.db.getEntries()
@@ -252,7 +253,7 @@ export async function initializeTools(agent: EpicMeMCP) {
252253
readOnlyHint: true,
253254
openWorldHint: false,
254255
},
255-
outputSchema: { tags: z.array(tagSchema) },
256+
outputSchema: { tags: z.array(tagListItemSchema) },
256257
},
257258
async () => {
258259
const tags = await agent.db.getTags()

exercises/02.start/01.solution/src/tools.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ import {
22
createEntryInputSchema,
33
createTagInputSchema,
44
entryIdSchema,
5-
entrySchema,
5+
entryListItemSchema,
66
entryTagIdSchema,
77
entryTagSchema,
88
entryWithTagsSchema,
99
tagIdSchema,
10+
tagListItemSchema,
1011
tagSchema,
1112
updateEntryInputSchema,
1213
updateTagInputSchema,
@@ -92,7 +93,7 @@ export async function initializeTools(agent: EpicMeMCP) {
9293
readOnlyHint: true,
9394
openWorldHint: false,
9495
},
95-
outputSchema: { entries: z.array(entrySchema) },
96+
outputSchema: { entries: z.array(entryListItemSchema) },
9697
},
9798
async () => {
9899
const entries = await agent.db.getEntries()
@@ -252,7 +253,7 @@ export async function initializeTools(agent: EpicMeMCP) {
252253
readOnlyHint: true,
253254
openWorldHint: false,
254255
},
255-
outputSchema: { tags: z.array(tagSchema) },
256+
outputSchema: { tags: z.array(tagListItemSchema) },
256257
},
257258
async () => {
258259
const tags = await agent.db.getTags()

exercises/99.finished/99.solution/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
},
2222
"devDependencies": {
2323
"@epic-web/config": "^1.21.3",
24+
"@epic-web/mcp-dev": "*",
2425
"@faker-js/faker": "^9.9.0",
2526
"@modelcontextprotocol/inspector": "0.16.2",
2627
"@types/node": "^24.2.1",

exercises/99.finished/99.solution/src/tools.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ import {
22
createEntryInputSchema,
33
createTagInputSchema,
44
entryIdSchema,
5-
entrySchema,
5+
entryListItemSchema,
66
entryTagIdSchema,
77
entryTagSchema,
88
entryWithTagsSchema,
99
tagIdSchema,
10+
tagListItemSchema,
1011
tagSchema,
1112
updateEntryInputSchema,
1213
updateTagInputSchema,
@@ -113,7 +114,7 @@ export async function initializeTools(agent: EpicMeMCP) {
113114
readOnlyHint: true,
114115
openWorldHint: false,
115116
},
116-
outputSchema: { entries: z.array(entrySchema) },
117+
outputSchema: { entries: z.array(entryListItemSchema) },
117118
},
118119
async () => {
119120
const entries = await agent.db.getEntries()
@@ -273,7 +274,7 @@ export async function initializeTools(agent: EpicMeMCP) {
273274
readOnlyHint: true,
274275
openWorldHint: false,
275276
},
276-
outputSchema: { tags: z.array(tagSchema) },
277+
outputSchema: { tags: z.array(tagListItemSchema) },
277278
},
278279
async () => {
279280
const tags = await agent.db.getTags()

0 commit comments

Comments
 (0)