rewind-mcp-server 0.10.0 → 1.0.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/__tests__/helpers/build-client.d.ts +2 -0
- package/dist/__tests__/helpers/build-client.js +24 -0
- package/dist/__tests__/helpers/build-client.js.map +1 -0
- package/dist/__tests__/helpers.test.js +11 -0
- package/dist/__tests__/helpers.test.js.map +1 -1
- package/dist/__tests__/image-block.live.js +1 -1
- package/dist/__tests__/image-block.live.js.map +1 -1
- package/dist/__tests__/manifest-snapshot.test.js +1 -0
- package/dist/__tests__/manifest-snapshot.test.js.map +1 -1
- package/dist/__tests__/output-schema-attending.test.d.ts +1 -0
- package/dist/__tests__/output-schema-attending.test.js +353 -0
- package/dist/__tests__/output-schema-attending.test.js.map +1 -0
- package/dist/__tests__/output-schema-collecting.test.d.ts +1 -0
- package/dist/__tests__/output-schema-collecting.test.js +155 -0
- package/dist/__tests__/output-schema-collecting.test.js.map +1 -0
- package/dist/__tests__/output-schema-cross-domain.test.d.ts +1 -0
- package/dist/__tests__/output-schema-cross-domain.test.js +142 -0
- package/dist/__tests__/output-schema-cross-domain.test.js.map +1 -0
- package/dist/__tests__/output-schema-listening.test.d.ts +1 -0
- package/dist/__tests__/output-schema-listening.test.js +235 -0
- package/dist/__tests__/output-schema-listening.test.js.map +1 -0
- package/dist/__tests__/output-schema-reading.test.d.ts +1 -0
- package/dist/__tests__/output-schema-reading.test.js +181 -0
- package/dist/__tests__/output-schema-reading.test.js.map +1 -0
- package/dist/__tests__/output-schema-running.test.d.ts +1 -0
- package/dist/__tests__/output-schema-running.test.js +185 -0
- package/dist/__tests__/output-schema-running.test.js.map +1 -0
- package/dist/__tests__/output-schema-watching.test.d.ts +1 -0
- package/dist/__tests__/output-schema-watching.test.js +190 -0
- package/dist/__tests__/output-schema-watching.test.js.map +1 -0
- package/dist/__tests__/output-schema.live.d.ts +1 -0
- package/dist/__tests__/output-schema.live.js +180 -0
- package/dist/__tests__/output-schema.live.js.map +1 -0
- package/dist/__tests__/output-schema.test.d.ts +1 -0
- package/dist/__tests__/output-schema.test.js +38 -0
- package/dist/__tests__/output-schema.test.js.map +1 -0
- package/dist/__tests__/server.test.js +1 -1
- package/dist/server.js +10 -12
- package/dist/server.js.map +1 -1
- package/dist/tools/attending.js +9 -0
- package/dist/tools/attending.js.map +1 -1
- package/dist/tools/collecting.js +5 -0
- package/dist/tools/collecting.js.map +1 -1
- package/dist/tools/cross-domain.js +12 -1
- package/dist/tools/cross-domain.js.map +1 -1
- package/dist/tools/helpers.js +14 -9
- package/dist/tools/helpers.js.map +1 -1
- package/dist/tools/listening.js +12 -1
- package/dist/tools/listening.js.map +1 -1
- package/dist/tools/reading.js +8 -1
- package/dist/tools/reading.js.map +1 -1
- package/dist/tools/running.js +8 -0
- package/dist/tools/running.js.map +1 -1
- package/dist/tools/schemas/attending.d.ts +8225 -0
- package/dist/tools/schemas/attending.js +404 -0
- package/dist/tools/schemas/attending.js.map +1 -0
- package/dist/tools/schemas/collecting.d.ts +1011 -0
- package/dist/tools/schemas/collecting.js +108 -0
- package/dist/tools/schemas/collecting.js.map +1 -0
- package/dist/tools/schemas/cross-domain.d.ts +1001 -0
- package/dist/tools/schemas/cross-domain.js +107 -0
- package/dist/tools/schemas/cross-domain.js.map +1 -0
- package/dist/tools/schemas/listening.d.ts +4298 -0
- package/dist/tools/schemas/listening.js +255 -0
- package/dist/tools/schemas/listening.js.map +1 -0
- package/dist/tools/schemas/reading.d.ts +1421 -0
- package/dist/tools/schemas/reading.js +151 -0
- package/dist/tools/schemas/reading.js.map +1 -0
- package/dist/tools/schemas/running.d.ts +680 -0
- package/dist/tools/schemas/running.js +154 -0
- package/dist/tools/schemas/running.js.map +1 -0
- package/dist/tools/schemas/shared.d.ts +98 -0
- package/dist/tools/schemas/shared.js +74 -0
- package/dist/tools/schemas/shared.js.map +1 -0
- package/dist/tools/schemas/system.d.ts +57 -0
- package/dist/tools/schemas/system.js +22 -0
- package/dist/tools/schemas/system.js.map +1 -0
- package/dist/tools/schemas/watching.d.ts +1821 -0
- package/dist/tools/schemas/watching.js +167 -0
- package/dist/tools/schemas/watching.js.map +1 -0
- package/dist/tools/watching.js +8 -0
- package/dist/tools/watching.js.map +1 -1
- package/dist/ui-bundles.d.ts +10 -11
- package/dist/ui-bundles.js +20 -22
- package/dist/ui-bundles.js.map +1 -1
- package/package.json +5 -4
- package/dist/tools/debug.d.ts +0 -6
- package/dist/tools/debug.js +0 -26
- package/dist/tools/debug.js.map +0 -1
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output schemas for the cross-domain tools (issue #105).
|
|
3
|
+
*
|
|
4
|
+
* These schemas are the source of truth for the cross-domain tools'
|
|
5
|
+
* return shapes: `cross-domain.ts` derives its `SearchResult` /
|
|
6
|
+
* `FeedItem` / `OnThisDay` types from them via `z.infer`, so the
|
|
7
|
+
* declared schema and the TypeScript type cannot drift.
|
|
8
|
+
*
|
|
9
|
+
* Every object schema uses `.passthrough()` so the JSON Schema advertised
|
|
10
|
+
* to clients stays `additionalProperties`-open -- a field the Rewind API
|
|
11
|
+
* adds later does not break client-side validation. See schemas/shared.ts.
|
|
12
|
+
*/
|
|
13
|
+
import { z } from 'zod';
|
|
14
|
+
import { imageSchema, searchPaginationSchema, feedPaginationSchema, } from './shared.js';
|
|
15
|
+
// --- Element schemas ------------------------------------------------------
|
|
16
|
+
/**
|
|
17
|
+
* A single cross-domain search result, as listed by `search` and
|
|
18
|
+
* `semantic_search`. The item mixes entries from every domain, so the
|
|
19
|
+
* domain-specific URL fields (`url`, `instapaper_url`, etc.) are all
|
|
20
|
+
* optional. `score` is present on semantic / hybrid results, optional on
|
|
21
|
+
* keyword results.
|
|
22
|
+
*/
|
|
23
|
+
export const searchResultSchema = z
|
|
24
|
+
.object({
|
|
25
|
+
domain: z.string(),
|
|
26
|
+
entity_type: z.string(),
|
|
27
|
+
entity_id: z.string(),
|
|
28
|
+
title: z.string(),
|
|
29
|
+
subtitle: z.string().nullable(),
|
|
30
|
+
image: imageSchema().optional(),
|
|
31
|
+
url: z.string().nullish(),
|
|
32
|
+
instapaper_url: z.string().nullish(),
|
|
33
|
+
instapaper_app_url: z.string().nullish(),
|
|
34
|
+
author: z.string().nullish(),
|
|
35
|
+
score: z.number().optional(),
|
|
36
|
+
})
|
|
37
|
+
.passthrough();
|
|
38
|
+
/** A single entry in the unified activity feed, as listed by `get_feed`. */
|
|
39
|
+
export const feedItemSchema = z
|
|
40
|
+
.object({
|
|
41
|
+
domain: z.string(),
|
|
42
|
+
event_type: z.string(),
|
|
43
|
+
occurred_at: z.string(),
|
|
44
|
+
title: z.string(),
|
|
45
|
+
subtitle: z.string().nullable(),
|
|
46
|
+
})
|
|
47
|
+
.passthrough();
|
|
48
|
+
/** A single item inside an `get_on_this_day` year group. */
|
|
49
|
+
const onThisDayItemSchema = z
|
|
50
|
+
.object({
|
|
51
|
+
domain: z.string(),
|
|
52
|
+
event_type: z.string(),
|
|
53
|
+
title: z.string(),
|
|
54
|
+
subtitle: z.string().nullable(),
|
|
55
|
+
})
|
|
56
|
+
.passthrough();
|
|
57
|
+
/** One year's worth of items inside an `get_on_this_day` response. */
|
|
58
|
+
const onThisDayYearSchema = z
|
|
59
|
+
.object({
|
|
60
|
+
year: z.number(),
|
|
61
|
+
items: z.array(onThisDayItemSchema),
|
|
62
|
+
})
|
|
63
|
+
.passthrough();
|
|
64
|
+
// --- Tool output schemas --------------------------------------------------
|
|
65
|
+
/**
|
|
66
|
+
* outputSchema for `search`. The empty-state branch returns
|
|
67
|
+
* `{ items: [], pagination }`, which satisfies the same schema -- no
|
|
68
|
+
* union needed.
|
|
69
|
+
*/
|
|
70
|
+
export const searchOutputSchema = z
|
|
71
|
+
.object({
|
|
72
|
+
items: z.array(searchResultSchema),
|
|
73
|
+
pagination: searchPaginationSchema(),
|
|
74
|
+
})
|
|
75
|
+
.passthrough();
|
|
76
|
+
/**
|
|
77
|
+
* outputSchema for `semantic_search`. Same shape as `search` -- both
|
|
78
|
+
* return `{ items, pagination }` with cross-domain result items.
|
|
79
|
+
*/
|
|
80
|
+
export const semanticSearchOutputSchema = z
|
|
81
|
+
.object({
|
|
82
|
+
items: z.array(searchResultSchema),
|
|
83
|
+
pagination: searchPaginationSchema(),
|
|
84
|
+
})
|
|
85
|
+
.passthrough();
|
|
86
|
+
/**
|
|
87
|
+
* outputSchema for `get_feed`. The empty-state branch returns
|
|
88
|
+
* `{ items: [], pagination }`, which satisfies the same schema.
|
|
89
|
+
*/
|
|
90
|
+
export const feedOutputSchema = z
|
|
91
|
+
.object({
|
|
92
|
+
items: z.array(feedItemSchema),
|
|
93
|
+
pagination: feedPaginationSchema(),
|
|
94
|
+
})
|
|
95
|
+
.passthrough();
|
|
96
|
+
/**
|
|
97
|
+
* outputSchema for `get_on_this_day`. The empty-state branch returns the
|
|
98
|
+
* same `{ month, day, years: [] }` shape with an empty `years` array.
|
|
99
|
+
*/
|
|
100
|
+
export const onThisDayOutputSchema = z
|
|
101
|
+
.object({
|
|
102
|
+
month: z.number(),
|
|
103
|
+
day: z.number(),
|
|
104
|
+
years: z.array(onThisDayYearSchema),
|
|
105
|
+
})
|
|
106
|
+
.passthrough();
|
|
107
|
+
//# sourceMappingURL=cross-domain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cross-domain.js","sourceRoot":"","sources":["../../../src/tools/schemas/cross-domain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,WAAW,EACX,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AAErB,6EAA6E;AAE7E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC;KAChC,MAAM,CAAC;IACN,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE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