rewind-mcp-server 0.10.0 → 0.11.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 +1 -1
- 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,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output schemas for the running-domain tools (issue #105).
|
|
3
|
+
*
|
|
4
|
+
* These schemas are the source of truth for the running tools' return
|
|
5
|
+
* shapes: `running.ts` derives its `Activity` / `ActivityDetail` types
|
|
6
|
+
* from them via `z.infer`, so the declared schema and the TypeScript
|
|
7
|
+
* 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
|
+
// --- Element schemas ------------------------------------------------------
|
|
15
|
+
/** A single run, as listed by get_recent_runs. */
|
|
16
|
+
export const activitySchema = z
|
|
17
|
+
.object({
|
|
18
|
+
id: z.number(),
|
|
19
|
+
strava_id: z.number().optional(),
|
|
20
|
+
name: z.string(),
|
|
21
|
+
date: z.string(),
|
|
22
|
+
distance_mi: z.number(),
|
|
23
|
+
duration: z.string(),
|
|
24
|
+
pace: z.string(),
|
|
25
|
+
elevation_ft: z.number(),
|
|
26
|
+
city: z.string().nullable(),
|
|
27
|
+
state: z.string().nullable(),
|
|
28
|
+
is_race: z.boolean(),
|
|
29
|
+
strava_url: z.string().nullish(),
|
|
30
|
+
})
|
|
31
|
+
.passthrough();
|
|
32
|
+
/** A single personal record, as listed by get_personal_records. */
|
|
33
|
+
export const personalRecordSchema = z
|
|
34
|
+
.object({
|
|
35
|
+
distance_label: z.string(),
|
|
36
|
+
time: z.string(),
|
|
37
|
+
pace: z.string(),
|
|
38
|
+
date: z.string(),
|
|
39
|
+
activity_name: z.string(),
|
|
40
|
+
activity_id: z.number(),
|
|
41
|
+
})
|
|
42
|
+
.passthrough();
|
|
43
|
+
/** A single per-mile split, as listed by get_activity_splits. */
|
|
44
|
+
export const activitySplitSchema = z
|
|
45
|
+
.object({
|
|
46
|
+
split: z.number(),
|
|
47
|
+
distance_mi: z.number(),
|
|
48
|
+
moving_time_s: z.number(),
|
|
49
|
+
elapsed_time_s: z.number(),
|
|
50
|
+
elevation_ft: z.number(),
|
|
51
|
+
pace: z.string(),
|
|
52
|
+
heartrate: z.number().nullable(),
|
|
53
|
+
})
|
|
54
|
+
.passthrough();
|
|
55
|
+
/** A single per-year summary, as listed by get_running_years. */
|
|
56
|
+
export const runningYearSchema = z
|
|
57
|
+
.object({
|
|
58
|
+
year: z.number(),
|
|
59
|
+
total_runs: z.number(),
|
|
60
|
+
total_distance_mi: z.number(),
|
|
61
|
+
total_elevation_ft: z.number(),
|
|
62
|
+
total_duration_s: z.number(),
|
|
63
|
+
avg_pace: z.string().nullable(),
|
|
64
|
+
longest_run_mi: z.number().nullable(),
|
|
65
|
+
race_count: z.number(),
|
|
66
|
+
})
|
|
67
|
+
.passthrough();
|
|
68
|
+
// --- Tool output schemas --------------------------------------------------
|
|
69
|
+
/** outputSchema for get_running_stats (flat stats object from `data`). */
|
|
70
|
+
export const runningStatsOutputSchema = z
|
|
71
|
+
.object({
|
|
72
|
+
total_runs: z.number(),
|
|
73
|
+
total_distance_mi: z.number(),
|
|
74
|
+
total_elevation_ft: z.number(),
|
|
75
|
+
total_duration: z.string(),
|
|
76
|
+
avg_pace: z.string().nullable(),
|
|
77
|
+
years_active: z.number(),
|
|
78
|
+
first_run: z.string().nullable(),
|
|
79
|
+
eddington_number: z.number(),
|
|
80
|
+
})
|
|
81
|
+
.passthrough();
|
|
82
|
+
/**
|
|
83
|
+
* outputSchema for get_recent_runs. The empty-state branch returns
|
|
84
|
+
* `{ items: [] }`, which satisfies the same schema -- no union needed.
|
|
85
|
+
*/
|
|
86
|
+
export const recentRunsOutputSchema = z
|
|
87
|
+
.object({ items: z.array(activitySchema) })
|
|
88
|
+
.passthrough();
|
|
89
|
+
/**
|
|
90
|
+
* outputSchema for get_personal_records. The empty-state branch returns
|
|
91
|
+
* `{ items: [] }`, which satisfies the same schema.
|
|
92
|
+
*/
|
|
93
|
+
export const personalRecordsOutputSchema = z
|
|
94
|
+
.object({ items: z.array(personalRecordSchema) })
|
|
95
|
+
.passthrough();
|
|
96
|
+
/** outputSchema for get_running_streaks (nested current/longest). */
|
|
97
|
+
export const runningStreaksOutputSchema = z
|
|
98
|
+
.object({
|
|
99
|
+
current: z
|
|
100
|
+
.object({
|
|
101
|
+
days: z.number(),
|
|
102
|
+
start: z.string().nullable(),
|
|
103
|
+
end: z.string().nullable(),
|
|
104
|
+
})
|
|
105
|
+
.passthrough(),
|
|
106
|
+
longest: z
|
|
107
|
+
.object({
|
|
108
|
+
days: z.number(),
|
|
109
|
+
start: z.string().nullable(),
|
|
110
|
+
end: z.string().nullable(),
|
|
111
|
+
})
|
|
112
|
+
.passthrough(),
|
|
113
|
+
})
|
|
114
|
+
.passthrough();
|
|
115
|
+
/** outputSchema for get_activity_details (a single run's detail object). */
|
|
116
|
+
export const activityDetailsOutputSchema = z
|
|
117
|
+
.object({
|
|
118
|
+
id: z.number().optional(),
|
|
119
|
+
name: z.string(),
|
|
120
|
+
date: z.string(),
|
|
121
|
+
distance_mi: z.number(),
|
|
122
|
+
duration: z.string(),
|
|
123
|
+
pace: z.string(),
|
|
124
|
+
elevation_ft: z.number(),
|
|
125
|
+
heartrate_avg: z.number().nullable(),
|
|
126
|
+
heartrate_max: z.number().nullable(),
|
|
127
|
+
cadence: z.number().nullable(),
|
|
128
|
+
calories: z.number().nullable(),
|
|
129
|
+
suffer_score: z.number().nullable(),
|
|
130
|
+
city: z.string().nullable(),
|
|
131
|
+
state: z.string().nullable(),
|
|
132
|
+
is_race: z.boolean(),
|
|
133
|
+
workout_type: z.string(),
|
|
134
|
+
strava_url: z.string().nullable(),
|
|
135
|
+
})
|
|
136
|
+
.passthrough();
|
|
137
|
+
/**
|
|
138
|
+
* outputSchema for get_activity_splits. The empty-state branch returns
|
|
139
|
+
* `{ activity_id, items: [] }`, which satisfies the same schema.
|
|
140
|
+
*/
|
|
141
|
+
export const activitySplitsOutputSchema = z
|
|
142
|
+
.object({
|
|
143
|
+
activity_id: z.number(),
|
|
144
|
+
items: z.array(activitySplitSchema),
|
|
145
|
+
})
|
|
146
|
+
.passthrough();
|
|
147
|
+
/**
|
|
148
|
+
* outputSchema for get_running_years. The empty-state branch returns
|
|
149
|
+
* `{ items: [] }`, which satisfies the same schema.
|
|
150
|
+
*/
|
|
151
|
+
export const runningYearsOutputSchema = z
|
|
152
|
+
.object({ items: z.array(runningYearSchema) })
|
|
153
|
+
.passthrough();
|
|
154
|
+
//# sourceMappingURL=running.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"running.js","sourceRoot":"","sources":["../../../src/tools/schemas/running.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,6EAA6E;AAE7E,kDAAkD;AAClD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC;KAC5B,MAAM,CAAC;IACN,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,QAAQ,EAAE,CAAC,CAAC,MAAM,E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MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC;KACD,WAAW,EAAE,CAAC;AAEjB;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC;KACxC,MAAM,CAAC;IACN,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC;CACpC,CAAC;KACD,WAAW,EAAE,CAAC;AAEjB;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC;KACtC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,EAAE,CAAC;KAC7C,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared output-schema fragments reused across tool domains.
|
|
3
|
+
*
|
|
4
|
+
* Part of the `outputSchema` work scoped in
|
|
5
|
+
* docs/projects/mcp-server/outputschema-scope.md (issue #105).
|
|
6
|
+
*
|
|
7
|
+
* Fragments are exposed as **factory functions**, not shared constants.
|
|
8
|
+
* The JSON Schema converter emits a `$ref` whenever it sees the *same
|
|
9
|
+
* schema object* more than once in a single conversion -- so a tool that
|
|
10
|
+
* uses `imageSchema` several times (e.g. an artist card with images on
|
|
11
|
+
* the artist, its top tracks, and its top albums) would serialise with
|
|
12
|
+
* `$ref`s, which older Claude Desktop builds failed to compile. Calling a
|
|
13
|
+
* factory yields a fresh object per use, so every occurrence inlines.
|
|
14
|
+
*
|
|
15
|
+
* Object schemas use `.passthrough()` so the advertised JSON Schema is
|
|
16
|
+
* `additionalProperties`-open -- a field the Rewind API adds later does
|
|
17
|
+
* not break a client validating against it.
|
|
18
|
+
*/
|
|
19
|
+
import { z } from 'zod';
|
|
20
|
+
/**
|
|
21
|
+
* Image reference attached to listening / watching / collecting
|
|
22
|
+
* entities. Every key is optional and nullable -- the API omits keys it
|
|
23
|
+
* has no value for, and the whole object is null when there is no image.
|
|
24
|
+
*/
|
|
25
|
+
export declare function imageSchema(): z.ZodNullable<z.ZodObject<{
|
|
26
|
+
cdn_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
27
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
28
|
+
thumbhash: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
29
|
+
dominant_color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
30
|
+
accent_color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
31
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
32
|
+
cdn_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
33
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
34
|
+
thumbhash: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
35
|
+
dominant_color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
36
|
+
accent_color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
37
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
38
|
+
cdn_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
39
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
40
|
+
thumbhash: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
41
|
+
dominant_color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
42
|
+
accent_color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
43
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
44
|
+
/**
|
|
45
|
+
* Canonical pagination block -- the `pagination` field of a
|
|
46
|
+
* `{ data: [...], pagination: {...} }` response. Used by the browse /
|
|
47
|
+
* collection list endpoints. Always present on a paginated response.
|
|
48
|
+
*/
|
|
49
|
+
export declare function paginationSchema(): z.ZodObject<{
|
|
50
|
+
page: z.ZodNumber;
|
|
51
|
+
limit: z.ZodNumber;
|
|
52
|
+
total: z.ZodNumber;
|
|
53
|
+
total_pages: z.ZodNumber;
|
|
54
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
55
|
+
page: z.ZodNumber;
|
|
56
|
+
limit: z.ZodNumber;
|
|
57
|
+
total: z.ZodNumber;
|
|
58
|
+
total_pages: z.ZodNumber;
|
|
59
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
60
|
+
page: z.ZodNumber;
|
|
61
|
+
limit: z.ZodNumber;
|
|
62
|
+
total: z.ZodNumber;
|
|
63
|
+
total_pages: z.ZodNumber;
|
|
64
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
65
|
+
/**
|
|
66
|
+
* Pagination variants that are NOT the canonical four-field block.
|
|
67
|
+
* Centralised here so a domain does not have to re-discover them:
|
|
68
|
+
* - search / semantic_search report only a result `total`
|
|
69
|
+
* - the unified feed reports only a `has_more` cursor flag
|
|
70
|
+
* - the reading-highlights endpoint omits `limit`
|
|
71
|
+
*/
|
|
72
|
+
export declare function searchPaginationSchema(): z.ZodObject<{
|
|
73
|
+
total: z.ZodNumber;
|
|
74
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
75
|
+
total: z.ZodNumber;
|
|
76
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
77
|
+
total: z.ZodNumber;
|
|
78
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
79
|
+
export declare function feedPaginationSchema(): z.ZodObject<{
|
|
80
|
+
has_more: z.ZodBoolean;
|
|
81
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
82
|
+
has_more: z.ZodBoolean;
|
|
83
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
84
|
+
has_more: z.ZodBoolean;
|
|
85
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
86
|
+
export declare function highlightsPaginationSchema(): z.ZodObject<{
|
|
87
|
+
page: z.ZodNumber;
|
|
88
|
+
total: z.ZodNumber;
|
|
89
|
+
total_pages: z.ZodNumber;
|
|
90
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
91
|
+
page: z.ZodNumber;
|
|
92
|
+
total: z.ZodNumber;
|
|
93
|
+
total_pages: z.ZodNumber;
|
|
94
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
95
|
+
page: z.ZodNumber;
|
|
96
|
+
total: z.ZodNumber;
|
|
97
|
+
total_pages: z.ZodNumber;
|
|
98
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared output-schema fragments reused across tool domains.
|
|
3
|
+
*
|
|
4
|
+
* Part of the `outputSchema` work scoped in
|
|
5
|
+
* docs/projects/mcp-server/outputschema-scope.md (issue #105).
|
|
6
|
+
*
|
|
7
|
+
* Fragments are exposed as **factory functions**, not shared constants.
|
|
8
|
+
* The JSON Schema converter emits a `$ref` whenever it sees the *same
|
|
9
|
+
* schema object* more than once in a single conversion -- so a tool that
|
|
10
|
+
* uses `imageSchema` several times (e.g. an artist card with images on
|
|
11
|
+
* the artist, its top tracks, and its top albums) would serialise with
|
|
12
|
+
* `$ref`s, which older Claude Desktop builds failed to compile. Calling a
|
|
13
|
+
* factory yields a fresh object per use, so every occurrence inlines.
|
|
14
|
+
*
|
|
15
|
+
* Object schemas use `.passthrough()` so the advertised JSON Schema is
|
|
16
|
+
* `additionalProperties`-open -- a field the Rewind API adds later does
|
|
17
|
+
* not break a client validating against it.
|
|
18
|
+
*/
|
|
19
|
+
import { z } from 'zod';
|
|
20
|
+
/**
|
|
21
|
+
* Image reference attached to listening / watching / collecting
|
|
22
|
+
* entities. Every key is optional and nullable -- the API omits keys it
|
|
23
|
+
* has no value for, and the whole object is null when there is no image.
|
|
24
|
+
*/
|
|
25
|
+
export function imageSchema() {
|
|
26
|
+
return z
|
|
27
|
+
.object({
|
|
28
|
+
cdn_url: z.string().nullish(),
|
|
29
|
+
url: z.string().nullish(),
|
|
30
|
+
thumbhash: z.string().nullish(),
|
|
31
|
+
dominant_color: z.string().nullish(),
|
|
32
|
+
accent_color: z.string().nullish(),
|
|
33
|
+
})
|
|
34
|
+
.passthrough()
|
|
35
|
+
.nullable();
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Canonical pagination block -- the `pagination` field of a
|
|
39
|
+
* `{ data: [...], pagination: {...} }` response. Used by the browse /
|
|
40
|
+
* collection list endpoints. Always present on a paginated response.
|
|
41
|
+
*/
|
|
42
|
+
export function paginationSchema() {
|
|
43
|
+
return z
|
|
44
|
+
.object({
|
|
45
|
+
page: z.number(),
|
|
46
|
+
limit: z.number(),
|
|
47
|
+
total: z.number(),
|
|
48
|
+
total_pages: z.number(),
|
|
49
|
+
})
|
|
50
|
+
.passthrough();
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Pagination variants that are NOT the canonical four-field block.
|
|
54
|
+
* Centralised here so a domain does not have to re-discover them:
|
|
55
|
+
* - search / semantic_search report only a result `total`
|
|
56
|
+
* - the unified feed reports only a `has_more` cursor flag
|
|
57
|
+
* - the reading-highlights endpoint omits `limit`
|
|
58
|
+
*/
|
|
59
|
+
export function searchPaginationSchema() {
|
|
60
|
+
return z.object({ total: z.number() }).passthrough();
|
|
61
|
+
}
|
|
62
|
+
export function feedPaginationSchema() {
|
|
63
|
+
return z.object({ has_more: z.boolean() }).passthrough();
|
|
64
|
+
}
|
|
65
|
+
export function highlightsPaginationSchema() {
|
|
66
|
+
return z
|
|
67
|
+
.object({
|
|
68
|
+
page: z.number(),
|
|
69
|
+
total: z.number(),
|
|
70
|
+
total_pages: z.number(),
|
|
71
|
+
})
|
|
72
|
+
.passthrough();
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/tools/schemas/shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,CAAC;SACL,MAAM,CAAC;QACN,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;QAC7B,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;QACzB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;QAC/B,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;QACpC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;KACnC,CAAC;SACD,WAAW,EAAE;SACb,QAAQ,EAAE,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,CAAC;SACL,MAAM,CAAC;QACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;QACjB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;QACjB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;KACxB,CAAC;SACD,WAAW,EAAE,CAAC;AACnB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB;IACpC,OAAO,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,OAAO,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;AAC3D,CAAC;AAED,MAAM,UAAU,0BAA0B;IACxC,OAAO,CAAC;SACL,MAAM,CAAC;QACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;QACjB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;KACxB,CAAC;SACD,WAAW,EAAE,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output schema for the system tool (get_health). Issue #105.
|
|
3
|
+
*
|
|
4
|
+
* `.passthrough()` keeps the advertised JSON Schema forward-compatible.
|
|
5
|
+
* See schemas/shared.ts.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
/** outputSchema for get_health: API status plus per-domain sync health. */
|
|
9
|
+
export declare const healthOutputSchema: z.ZodObject<{
|
|
10
|
+
api_status: z.ZodString;
|
|
11
|
+
timestamp: z.ZodString;
|
|
12
|
+
domains: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
13
|
+
status: z.ZodString;
|
|
14
|
+
last_sync: z.ZodNullable<z.ZodString>;
|
|
15
|
+
items_synced: z.ZodNullable<z.ZodNumber>;
|
|
16
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
17
|
+
status: z.ZodString;
|
|
18
|
+
last_sync: z.ZodNullable<z.ZodString>;
|
|
19
|
+
items_synced: z.ZodNullable<z.ZodNumber>;
|
|
20
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
21
|
+
status: z.ZodString;
|
|
22
|
+
last_sync: z.ZodNullable<z.ZodString>;
|
|
23
|
+
items_synced: z.ZodNullable<z.ZodNumber>;
|
|
24
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
25
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
26
|
+
api_status: z.ZodString;
|
|
27
|
+
timestamp: z.ZodString;
|
|
28
|
+
domains: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
29
|
+
status: z.ZodString;
|
|
30
|
+
last_sync: z.ZodNullable<z.ZodString>;
|
|
31
|
+
items_synced: z.ZodNullable<z.ZodNumber>;
|
|
32
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
33
|
+
status: z.ZodString;
|
|
34
|
+
last_sync: z.ZodNullable<z.ZodString>;
|
|
35
|
+
items_synced: z.ZodNullable<z.ZodNumber>;
|
|
36
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
37
|
+
status: z.ZodString;
|
|
38
|
+
last_sync: z.ZodNullable<z.ZodString>;
|
|
39
|
+
items_synced: z.ZodNullable<z.ZodNumber>;
|
|
40
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
41
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
42
|
+
api_status: z.ZodString;
|
|
43
|
+
timestamp: z.ZodString;
|
|
44
|
+
domains: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
45
|
+
status: z.ZodString;
|
|
46
|
+
last_sync: z.ZodNullable<z.ZodString>;
|
|
47
|
+
items_synced: z.ZodNullable<z.ZodNumber>;
|
|
48
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
49
|
+
status: z.ZodString;
|
|
50
|
+
last_sync: z.ZodNullable<z.ZodString>;
|
|
51
|
+
items_synced: z.ZodNullable<z.ZodNumber>;
|
|
52
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
53
|
+
status: z.ZodString;
|
|
54
|
+
last_sync: z.ZodNullable<z.ZodString>;
|
|
55
|
+
items_synced: z.ZodNullable<z.ZodNumber>;
|
|
56
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
57
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output schema for the system tool (get_health). Issue #105.
|
|
3
|
+
*
|
|
4
|
+
* `.passthrough()` keeps the advertised JSON Schema forward-compatible.
|
|
5
|
+
* See schemas/shared.ts.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
/** outputSchema for get_health: API status plus per-domain sync health. */
|
|
9
|
+
export const healthOutputSchema = z
|
|
10
|
+
.object({
|
|
11
|
+
api_status: z.string(),
|
|
12
|
+
timestamp: z.string(),
|
|
13
|
+
domains: z.record(z
|
|
14
|
+
.object({
|
|
15
|
+
status: z.string(),
|
|
16
|
+
last_sync: z.string().nullable(),
|
|
17
|
+
items_synced: z.number().nullable(),
|
|
18
|
+
})
|
|
19
|
+
.passthrough()),
|
|
20
|
+
})
|
|
21
|
+
.passthrough();
|
|
22
|
+
//# sourceMappingURL=system.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.js","sourceRoot":"","sources":["../../../src/tools/schemas/system.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,2EAA2E;AAC3E,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC;KAChC,MAAM,CAAC;IACN,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,OAAO,EAAE,CAAC,CAAC,MAAM,CACf,CAAC;SACE,MAAM,CAAC;QACN,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;QAClB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAChC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KACpC,CAAC;SACD,WAAW,EAAE,CACjB;CACF,CAAC;KACD,WAAW,EAAE,CAAC"}
|