@cyanheads/mcp-ts-core 0.9.16 → 0.9.18
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/AGENTS.md +3 -2
- package/CLAUDE.md +3 -2
- package/README.md +1 -1
- package/changelog/0.9.x/0.9.17.md +23 -0
- package/changelog/0.9.x/0.9.18.md +12 -0
- package/dist/mcp-server/tools/utils/toolDefinition.d.ts.map +1 -1
- package/dist/mcp-server/tools/utils/toolDefinition.js.map +1 -1
- package/dist/services/mirror/core/defineMirror.d.ts +62 -0
- package/dist/services/mirror/core/defineMirror.d.ts.map +1 -0
- package/dist/services/mirror/core/defineMirror.js +99 -0
- package/dist/services/mirror/core/defineMirror.js.map +1 -0
- package/dist/services/mirror/core/runner.d.ts +29 -0
- package/dist/services/mirror/core/runner.d.ts.map +1 -0
- package/dist/services/mirror/core/runner.js +95 -0
- package/dist/services/mirror/core/runner.js.map +1 -0
- package/dist/services/mirror/index.d.ts +18 -0
- package/dist/services/mirror/index.d.ts.map +1 -0
- package/dist/services/mirror/index.js +17 -0
- package/dist/services/mirror/index.js.map +1 -0
- package/dist/services/mirror/sqlite/handle.d.ts +48 -0
- package/dist/services/mirror/sqlite/handle.d.ts.map +1 -0
- package/dist/services/mirror/sqlite/handle.js +105 -0
- package/dist/services/mirror/sqlite/handle.js.map +1 -0
- package/dist/services/mirror/sqlite/schema.d.ts +38 -0
- package/dist/services/mirror/sqlite/schema.d.ts.map +1 -0
- package/dist/services/mirror/sqlite/schema.js +124 -0
- package/dist/services/mirror/sqlite/schema.js.map +1 -0
- package/dist/services/mirror/sqlite/sqliteMirrorStore.d.ts +27 -0
- package/dist/services/mirror/sqlite/sqliteMirrorStore.d.ts.map +1 -0
- package/dist/services/mirror/sqlite/sqliteMirrorStore.js +286 -0
- package/dist/services/mirror/sqlite/sqliteMirrorStore.js.map +1 -0
- package/dist/services/mirror/types.d.ts +211 -0
- package/dist/services/mirror/types.d.ts.map +1 -0
- package/dist/services/mirror/types.js +9 -0
- package/dist/services/mirror/types.js.map +1 -0
- package/dist/utils/internal/error-handler/types.d.ts.map +1 -1
- package/dist/utils/internal/requestContext.d.ts.map +1 -1
- package/dist/utils/internal/requestContext.js.map +1 -1
- package/dist/utils/pagination/pagination.d.ts.map +1 -1
- package/dist/utils/pagination/pagination.js.map +1 -1
- package/package.json +12 -2
- package/scripts/check-skill-versions.ts +137 -0
- package/scripts/devcheck.ts +39 -0
- package/skills/api-mirror/SKILL.md +103 -0
- package/skills/design-mcp-server/SKILL.md +2 -1
- package/dist/logs/combined.log +0 -4
- package/dist/logs/error.log +0 -2
- package/dist/logs/interactions.log +0 -0
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Public contracts for the MirrorService — the source-agnostic
|
|
3
|
+
* machinery for a persistent, self-refreshing local mirror of a bulk upstream
|
|
4
|
+
* dataset. The framework owns the store, the sync-state machine, and the runner;
|
|
5
|
+
* each server supplies only the ingester (`sync` generator) and the schema.
|
|
6
|
+
* @module services/mirror/types
|
|
7
|
+
*/
|
|
8
|
+
import type { SqliteHandle, SqlValue } from './sqlite/handle.js';
|
|
9
|
+
export type { SqliteHandle, SqliteStatement, SqlValue } from './sqlite/handle.js';
|
|
10
|
+
/** One mirrored record — a flat object keyed by declared column name. */
|
|
11
|
+
export type MirrorRow = Record<string, SqlValue>;
|
|
12
|
+
/** Lifecycle state of a mirror's local dataset. */
|
|
13
|
+
export type SyncStatus = 'pending' | 'in_progress' | 'complete' | 'error';
|
|
14
|
+
/**
|
|
15
|
+
* Duck-typed logger consumed by the runner. A sync runs outside the MCP request
|
|
16
|
+
* pipeline (cron job or CLI script), so it has no request `Context` — any
|
|
17
|
+
* logger with these methods works (the framework `logger`, a `ctx.log`, or a
|
|
18
|
+
* console wrapper). All methods are optional.
|
|
19
|
+
*/
|
|
20
|
+
export interface MirrorLogger {
|
|
21
|
+
debug?(message: string, meta?: object): void;
|
|
22
|
+
error?(message: string, meta?: object): void;
|
|
23
|
+
info?(message: string, meta?: object): void;
|
|
24
|
+
notice?(message: string, meta?: object): void;
|
|
25
|
+
warning?(message: string, meta?: object): void;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Persisted sync state — the resume-on-interrupt checkpoint store. The two
|
|
29
|
+
* position fields are deliberately distinct:
|
|
30
|
+
*
|
|
31
|
+
* - `cursor` is the **volatile** intra-run resume position (e.g. an OAI-PMH
|
|
32
|
+
* resumption token). It is valid only within a single run, may expire, and is
|
|
33
|
+
* cleared on completion. The runner threads it back into `sync()` to resume an
|
|
34
|
+
* interrupted init.
|
|
35
|
+
* - `checkpoint` is the **durable** high-water mark (e.g. the max record
|
|
36
|
+
* datestamp). It advances monotonically and only on success, and seeds the
|
|
37
|
+
* next incremental refresh.
|
|
38
|
+
*
|
|
39
|
+
* They cannot be merged: for a token-paged source the mid-run cursor is not a
|
|
40
|
+
* valid refresh seed, and the high-water mark is not a valid mid-run resume
|
|
41
|
+
* position.
|
|
42
|
+
*/
|
|
43
|
+
export interface SyncState {
|
|
44
|
+
/** Durable incremental high-water mark; advances only on success. */
|
|
45
|
+
checkpoint?: string | undefined;
|
|
46
|
+
/** ISO 8601 timestamp the last run completed successfully. Drives readiness. */
|
|
47
|
+
completedAt?: string | undefined;
|
|
48
|
+
/** Volatile intra-run resume position; cleared on completion. */
|
|
49
|
+
cursor?: string | undefined;
|
|
50
|
+
/** Message from the last failed run, set when `status === 'error'`. */
|
|
51
|
+
error?: string | undefined;
|
|
52
|
+
/** ISO 8601 timestamp the current run started. */
|
|
53
|
+
startedAt?: string | undefined;
|
|
54
|
+
status: SyncStatus;
|
|
55
|
+
/** Record count, set when a sync completes. */
|
|
56
|
+
total?: number | undefined;
|
|
57
|
+
}
|
|
58
|
+
/** Context passed to a server's `sync` generator on each run. */
|
|
59
|
+
export interface SyncContext {
|
|
60
|
+
/** Durable high-water mark to harvest from (refresh; also init-resume recovery). */
|
|
61
|
+
checkpoint?: string | undefined;
|
|
62
|
+
/** Volatile resume position from a prior interrupted run (init only). */
|
|
63
|
+
cursor?: string | undefined;
|
|
64
|
+
/** `init` for a full harvest, `refresh` for an incremental one. */
|
|
65
|
+
mode: SyncMode;
|
|
66
|
+
/** Aborts the run; the generator should stop and the runner persists state. */
|
|
67
|
+
signal: AbortSignal;
|
|
68
|
+
}
|
|
69
|
+
export type SyncMode = 'init' | 'refresh';
|
|
70
|
+
/**
|
|
71
|
+
* One page yielded by a server's `sync` generator. The framework upserts the
|
|
72
|
+
* records, deletes the tombstones, and persists the cursor/checkpoint — all in
|
|
73
|
+
* one transaction per page — so an interrupt resumes from the last yielded page.
|
|
74
|
+
*/
|
|
75
|
+
export interface SyncPage {
|
|
76
|
+
/**
|
|
77
|
+
* Updated durable high-water mark after this page. Must be lexicographically
|
|
78
|
+
* monotonic (e.g. ISO 8601) — the runner advances the stored checkpoint only
|
|
79
|
+
* when a page's value compares greater.
|
|
80
|
+
*/
|
|
81
|
+
checkpoint?: string | undefined;
|
|
82
|
+
/** Updated volatile resume position after this page. */
|
|
83
|
+
cursor?: string | undefined;
|
|
84
|
+
/** Records to upsert (keyed by column name). */
|
|
85
|
+
records: MirrorRow[];
|
|
86
|
+
/** Primary-key values to delete (deleted upstream records). */
|
|
87
|
+
tombstones?: string[];
|
|
88
|
+
}
|
|
89
|
+
/** A server's ingester: an async generator of pages from the upstream source. */
|
|
90
|
+
export type SyncGenerator = (ctx: SyncContext) => AsyncGenerator<SyncPage>;
|
|
91
|
+
/** Progress hook invoked after each persisted page. */
|
|
92
|
+
export type SyncProgress = (info: {
|
|
93
|
+
pages: number;
|
|
94
|
+
records: number;
|
|
95
|
+
tombstones: number;
|
|
96
|
+
cursor?: string | undefined;
|
|
97
|
+
checkpoint?: string | undefined;
|
|
98
|
+
}) => void;
|
|
99
|
+
/** Options for a single sync run. */
|
|
100
|
+
export interface RunSyncOptions {
|
|
101
|
+
mode: SyncMode;
|
|
102
|
+
onProgress?: SyncProgress;
|
|
103
|
+
}
|
|
104
|
+
/** Outcome of a completed sync run. */
|
|
105
|
+
export interface SyncResult {
|
|
106
|
+
pagesFetched: number;
|
|
107
|
+
recordsApplied: number;
|
|
108
|
+
tombstonesApplied: number;
|
|
109
|
+
total: number;
|
|
110
|
+
}
|
|
111
|
+
/** Public status of a mirror — what tools surface to agents. */
|
|
112
|
+
export interface MirrorStatus {
|
|
113
|
+
checkpoint?: string | undefined;
|
|
114
|
+
completedAt?: string | undefined;
|
|
115
|
+
error?: string | undefined;
|
|
116
|
+
/**
|
|
117
|
+
* `true` once a full sync has ever completed (`completedAt != null`), NOT
|
|
118
|
+
* `status === 'complete'`. The dataset stays queryable during a refresh, so
|
|
119
|
+
* readiness keys off the durable completion marker — an in-progress or failed
|
|
120
|
+
* refresh on top of a complete mirror is still ready.
|
|
121
|
+
*/
|
|
122
|
+
ready: boolean;
|
|
123
|
+
startedAt?: string | undefined;
|
|
124
|
+
status: SyncStatus;
|
|
125
|
+
total?: number | undefined;
|
|
126
|
+
}
|
|
127
|
+
/** Comparison operators for a {@link QueryFilter}. */
|
|
128
|
+
export type FilterOp = 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
|
|
129
|
+
/** A single structured filter applied as an indexed `WHERE` clause. */
|
|
130
|
+
export interface QueryFilter {
|
|
131
|
+
/** Column to filter — must be a declared column. */
|
|
132
|
+
column: string;
|
|
133
|
+
op: FilterOp;
|
|
134
|
+
/** Scalar for scalar ops; array for `in`. */
|
|
135
|
+
value: SqlValue | SqlValue[];
|
|
136
|
+
}
|
|
137
|
+
/** Sort directive: by a declared column, or `'relevance'` (FTS bm25, requires `match`). */
|
|
138
|
+
export type QuerySort = {
|
|
139
|
+
column: string;
|
|
140
|
+
direction: 'asc' | 'desc';
|
|
141
|
+
} | 'relevance';
|
|
142
|
+
/** Options for the generic {@link MirrorStore.query}. */
|
|
143
|
+
export interface QueryOptions {
|
|
144
|
+
/** Structured filters, AND-combined. */
|
|
145
|
+
filters?: QueryFilter[];
|
|
146
|
+
limit: number;
|
|
147
|
+
/** FTS5 `MATCH` expression. The server translates its own query syntax to FTS5. */
|
|
148
|
+
match?: string | undefined;
|
|
149
|
+
offset: number;
|
|
150
|
+
/** Sort directive. Defaults to insertion order (rowid) when omitted. */
|
|
151
|
+
sort?: QuerySort | undefined;
|
|
152
|
+
}
|
|
153
|
+
/** Result of a {@link MirrorStore.query}. */
|
|
154
|
+
export interface QueryResult {
|
|
155
|
+
rows: MirrorRow[];
|
|
156
|
+
/** Total matches before `limit`/`offset`. */
|
|
157
|
+
total: number;
|
|
158
|
+
}
|
|
159
|
+
/** A schema migration: bump `version` and apply `up` on open when the stored version is lower. */
|
|
160
|
+
export interface Migration {
|
|
161
|
+
/** Apply the migration. Runs inside the open handle; should be idempotent. */
|
|
162
|
+
up(handle: SqliteHandle): void;
|
|
163
|
+
/** Target schema version this migration produces. */
|
|
164
|
+
version: number;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Pluggable backend contract — the embedded-store half of a mirror. The default
|
|
168
|
+
* implementation is `sqliteMirrorStore`; the interface leaves a clean path to
|
|
169
|
+
* other backends (DuckDB, Postgres) without re-architecting the runner. All
|
|
170
|
+
* methods lazy-open the underlying store on first call (async per the Tier-3
|
|
171
|
+
* convention) and are then backed by synchronous driver calls.
|
|
172
|
+
*/
|
|
173
|
+
export interface MirrorStore {
|
|
174
|
+
/** Upsert records and delete tombstoned primary keys in one transaction. */
|
|
175
|
+
applyBatch(records: MirrorRow[], tombstones: string[]): Promise<void>;
|
|
176
|
+
/** Close the underlying store. */
|
|
177
|
+
close(): Promise<void>;
|
|
178
|
+
/** Total record count. */
|
|
179
|
+
count(): Promise<number>;
|
|
180
|
+
/** Fetch records by primary-key list, preserving input order; missing keys skipped. */
|
|
181
|
+
getByIds(ids: string[]): Promise<MirrorRow[]>;
|
|
182
|
+
/** `PRAGMA integrity_check` + `quick_check`. */
|
|
183
|
+
integrityCheck(): Promise<{
|
|
184
|
+
ok: boolean;
|
|
185
|
+
results: string[];
|
|
186
|
+
}>;
|
|
187
|
+
/** Generic flat query: FTS `MATCH` + indexed filters + sort + pagination. */
|
|
188
|
+
query(options: QueryOptions): Promise<QueryResult>;
|
|
189
|
+
/**
|
|
190
|
+
* The opened runtime-agnostic handle — the escape hatch for server-specific
|
|
191
|
+
* access paths (auxiliary tables, junctions, custom indexes, bespoke queries)
|
|
192
|
+
* that the generic `query()` does not cover.
|
|
193
|
+
*/
|
|
194
|
+
raw(): Promise<SqliteHandle>;
|
|
195
|
+
/** Read the persisted sync state. */
|
|
196
|
+
readState(): Promise<SyncState>;
|
|
197
|
+
/** Write the persisted sync state. Durable fields (`completedAt`/`total`) are preserved when omitted. */
|
|
198
|
+
writeState(state: SyncState): Promise<void>;
|
|
199
|
+
}
|
|
200
|
+
/** Definition passed to {@link defineMirror}. */
|
|
201
|
+
export interface MirrorDefinition {
|
|
202
|
+
/** Logger for sync runs; defaults to the framework `logger`. */
|
|
203
|
+
logger?: MirrorLogger;
|
|
204
|
+
/** Stable name for logs and telemetry (e.g. `'arxiv-papers'`). */
|
|
205
|
+
name: string;
|
|
206
|
+
/** The backend store (e.g. from `sqliteMirrorStore({...})`). */
|
|
207
|
+
store: MirrorStore;
|
|
208
|
+
/** The ingester — the one irreducibly per-source part. */
|
|
209
|
+
sync: SyncGenerator;
|
|
210
|
+
}
|
|
211
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/mirror/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEjE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAElF,yEAAyE;AACzE,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAA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E,MAAM,CAAC;CACjB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,4EAA4E;IAC5E,UAAU,CAAC,OAAO,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtE,kCAAkC;IAClC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,0BAA0B;IAC1B,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACzB,uFAAuF;IACvF,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;IAC9C,gDAAgD;IAChD,cAAc,IAAI,OAAO,CAAC;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IAC9D,6EAA6E;IAC7E,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACnD;;;;OAIG;IACH,GAAG,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC;IAC7B,qCAAqC;IACrC,SAAS,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,yGAAyG;IACzG,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7C;AAED,iDAAiD;AACjD,MAAM,WAAW,gBAAgB;IAC/B,gEAAgE;IAChE,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,KAAK,EAAE,WAAW,CAAC;IACnB,0DAA0D;IAC1D,IAAI,EAAE,aAAa,CAAC;CACrB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Public contracts for the MirrorService — the source-agnostic
|
|
3
|
+
* machinery for a persistent, self-refreshing local mirror of a bulk upstream
|
|
4
|
+
* dataset. The framework owns the store, the sync-state machine, and the runner;
|
|
5
|
+
* each server supplies only the ingester (`sync` generator) and the schema.
|
|
6
|
+
* @module services/mirror/types
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/services/mirror/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/utils/internal/error-handler/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/utils/internal/error-handler/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IAEH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;IAEvB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAE7B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,CAAC;IAExC;;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;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,6BAA6B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../src/utils/pagination/pagination.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEzE;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,mEAAmE;IACnE,KAAK,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC;IACf,iFAAiF;
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../src/utils/pagination/pagination.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEzE;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,mEAAmE;IACnE,KAAK,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC;IACf,iFAAiF;IAEjF,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,iCAAiC;IACjC,KAAK,EAAE,CAAC,EAAE,CAAC;IACX;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CAc3D;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,eAAe,CA6BrF;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,aAAa,CAAC,MAAM,CAAC,EAAE;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC7B,GAAG,MAAM,GAAG,SAAS,CAErB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAC7B,KAAK,EAAE,CAAC,EAAE,EACV,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,eAAe,EAAE,MAAM,EACvB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,cAAc,GACtB,eAAe,CAAC,CAAC,CAAC,CAmCpB;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,yBAAyB;IACpC,uCAAuC;;IAEvC,qCAAqC;;IAErC,qCAAqC;;CAE7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../../src/utils/pagination/pagination.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../../src/utils/pagination/pagination.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAsCpD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,YAAY,CAAC,KAAsB;IACjD,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KAAK,CAAC,MAAM,CAAC;IAE9C,kEAAkE;IAClE,MAAM,MAAM,GAAuB;QACjC,KAAK,EAAE,SAAS;QAChB,UAAU,EAAE,KAAK,CAAC,MAAM;KACzB,CAAC;IAEF,4CAA4C;IAC5C,IAAI,OAAO,EAAE,CAAC;QACZ,MAAM,CAAC,UAAU,GAAG,YAAY,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IACtE,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,uCAAuC;IACvC,iBAAiB,EAAE,EAAE;IACrB,qCAAqC;IACrC,aAAa,EAAE,IAAI;IACnB,qCAAqC;IACrC,aAAa,EAAE,CAAC;CACR,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyanheads/mcp-ts-core",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.18",
|
|
4
4
|
"mcpName": "io.github.cyanheads/mcp-ts-core",
|
|
5
5
|
"description": "Agent-native TypeScript framework for building MCP servers. Declarative definitions with auth, multi-backend storage, OpenTelemetry, and first-class support for Bun/Node/Cloudflare Workers.",
|
|
6
6
|
"main": "dist/core/index.js",
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"scripts/build.ts",
|
|
13
13
|
"scripts/check-docs-sync.ts",
|
|
14
14
|
"scripts/check-framework-antipatterns.ts",
|
|
15
|
+
"scripts/check-skill-versions.ts",
|
|
15
16
|
"scripts/check-skills-sync.ts",
|
|
16
17
|
"scripts/clean.ts",
|
|
17
18
|
"scripts/devcheck.ts",
|
|
@@ -79,6 +80,10 @@
|
|
|
79
80
|
"types": "./dist/services/canvas/index.d.ts",
|
|
80
81
|
"import": "./dist/services/canvas/index.js"
|
|
81
82
|
},
|
|
83
|
+
"./mirror": {
|
|
84
|
+
"types": "./dist/services/mirror/index.d.ts",
|
|
85
|
+
"import": "./dist/services/mirror/index.js"
|
|
86
|
+
},
|
|
82
87
|
"./utils": {
|
|
83
88
|
"types": "./dist/utils/index.d.ts",
|
|
84
89
|
"import": "./dist/utils/index.js"
|
|
@@ -171,7 +176,7 @@
|
|
|
171
176
|
"devDependencies": {
|
|
172
177
|
"@biomejs/biome": "2.4.16",
|
|
173
178
|
"@cloudflare/vitest-pool-workers": "^0.16.10",
|
|
174
|
-
"@cloudflare/workers-types": "
|
|
179
|
+
"@cloudflare/workers-types": "4.20260531.1",
|
|
175
180
|
"@duckdb/node-api": "^1.5.3-r.2",
|
|
176
181
|
"@hono/otel": "^1.1.2",
|
|
177
182
|
"@opentelemetry/exporter-metrics-otlp-http": "^0.218.0",
|
|
@@ -192,6 +197,7 @@
|
|
|
192
197
|
"@types/validator": "^13.15.10",
|
|
193
198
|
"@vitest/coverage-istanbul": "4.1.7",
|
|
194
199
|
"@vitest/ui": "4.1.7",
|
|
200
|
+
"better-sqlite3": "^12.10.0",
|
|
195
201
|
"bun-types": "^1.3.14",
|
|
196
202
|
"chrono-node": "^2.9.1",
|
|
197
203
|
"clipboardy": "^5.3.1",
|
|
@@ -292,6 +298,7 @@
|
|
|
292
298
|
"@opentelemetry/sdk-trace-node": "^2.7.0",
|
|
293
299
|
"@opentelemetry/semantic-conventions": "^1.40.0",
|
|
294
300
|
"@supabase/supabase-js": "^2.103.3",
|
|
301
|
+
"better-sqlite3": "^12.0.0",
|
|
295
302
|
"chrono-node": "^2.9.0",
|
|
296
303
|
"defuddle": "^0.18.1",
|
|
297
304
|
"diff": "latest",
|
|
@@ -346,6 +353,9 @@
|
|
|
346
353
|
"@supabase/supabase-js": {
|
|
347
354
|
"optional": true
|
|
348
355
|
},
|
|
356
|
+
"better-sqlite3": {
|
|
357
|
+
"optional": true
|
|
358
|
+
},
|
|
349
359
|
"chrono-node": {
|
|
350
360
|
"optional": true
|
|
351
361
|
},
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Enforces the skill-versioning policy (#98 → #99): a change to a
|
|
4
|
+
* `skills/<name>/SKILL.md` body must bump `metadata.version` in the same edit.
|
|
5
|
+
* Documenting the policy made the expectation visible; this check makes it stick.
|
|
6
|
+
* The triggering incident was 7 missed bumps across 2 consecutive releases — the
|
|
7
|
+
* kind of low-salience checklist item that needs tooling, not vigilance.
|
|
8
|
+
*
|
|
9
|
+
* For each `skills/<name>/SKILL.md` that differs from `HEAD` (working tree, staged
|
|
10
|
+
* or not), it compares the frontmatter `metadata.version` and the body across
|
|
11
|
+
* `HEAD` → working tree. A changed body with an unchanged version is a violation.
|
|
12
|
+
* Whitespace-only body edits never trigger it (the policy's typo/whitespace
|
|
13
|
+
* carve-out); a genuine typo fix opts out via `devcheck.config.json`:
|
|
14
|
+
*
|
|
15
|
+
* {
|
|
16
|
+
* "skillVersions": {
|
|
17
|
+
* "ignore": ["add-tool", "api-linter/SKILL.md"]
|
|
18
|
+
* }
|
|
19
|
+
* }
|
|
20
|
+
*
|
|
21
|
+
* A bare name (`add-tool`) and the file path (`add-tool/SKILL.md`) both match.
|
|
22
|
+
*
|
|
23
|
+
* Diffing against `HEAD` keeps the per-release-cycle carve-out automatic: once the
|
|
24
|
+
* version line is bumped, later commits in the same cycle no longer re-trigger.
|
|
25
|
+
* Severity mirrors `check-skills-sync.ts` — exits 1, demoted to a warning by
|
|
26
|
+
* devcheck. New skills (no `HEAD` version) and non-git trees are skipped.
|
|
27
|
+
*
|
|
28
|
+
* Runs standalone (`bun run scripts/check-skill-versions.ts`) and as a devcheck step.
|
|
29
|
+
*
|
|
30
|
+
* @module scripts/check-skill-versions
|
|
31
|
+
*/
|
|
32
|
+
import { spawnSync } from 'node:child_process';
|
|
33
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
34
|
+
import { resolve } from 'node:path';
|
|
35
|
+
import process from 'node:process';
|
|
36
|
+
|
|
37
|
+
const ROOT = resolve('.');
|
|
38
|
+
const SKILL_MD_RE = /^skills\/[^/]+\/SKILL\.md$/;
|
|
39
|
+
|
|
40
|
+
interface DevcheckConfig {
|
|
41
|
+
skillVersions?: { ignore?: string[] };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function loadIgnorePatterns(): string[] {
|
|
45
|
+
try {
|
|
46
|
+
const cfg = JSON.parse(
|
|
47
|
+
readFileSync(resolve(ROOT, 'devcheck.config.json'), 'utf-8'),
|
|
48
|
+
) as DevcheckConfig;
|
|
49
|
+
return cfg.skillVersions?.ignore ?? [];
|
|
50
|
+
} catch {
|
|
51
|
+
return [];
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Match check-skills-sync semantics: full `<name>/SKILL.md` path or the bare `<name>`. */
|
|
56
|
+
function isIgnored(relPath: string, patterns: string[]): boolean {
|
|
57
|
+
const name = relPath.split('/')[1]; // skills/<name>/SKILL.md → <name>
|
|
58
|
+
return patterns.some(
|
|
59
|
+
(p) => p === relPath || p === name || (name !== undefined && p === `${name}/SKILL.md`),
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Skill `SKILL.md` files that differ from `HEAD` (staged + unstaged). */
|
|
64
|
+
function changedSkillFiles(): string[] {
|
|
65
|
+
const result = spawnSync('git', ['diff', '--name-only', 'HEAD', '--'], { encoding: 'utf-8' });
|
|
66
|
+
if (result.status !== 0) return []; // not a git repo / no HEAD commit
|
|
67
|
+
return result.stdout
|
|
68
|
+
.trim()
|
|
69
|
+
.split('\n')
|
|
70
|
+
.filter((p) => SKILL_MD_RE.test(p));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** Content of a path at `HEAD`, or null when it didn't exist there (new file). */
|
|
74
|
+
function headContent(relPath: string): string | null {
|
|
75
|
+
const result = spawnSync('git', ['show', `HEAD:${relPath}`], { encoding: 'utf-8' });
|
|
76
|
+
return result.status === 0 ? result.stdout : null;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** `metadata.version` from skill frontmatter, or null when absent/unparseable. */
|
|
80
|
+
function extractVersion(content: string): string | null {
|
|
81
|
+
const block = content.match(/^---\n([\s\S]*?)\n---/)?.[1];
|
|
82
|
+
if (!block) return null;
|
|
83
|
+
const version = block.match(/^\s*version:\s*["']?([^"'\n]+?)["']?\s*$/m)?.[1];
|
|
84
|
+
return version?.trim() ?? null;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** Body = everything after the frontmatter block. */
|
|
88
|
+
function extractBody(content: string): string {
|
|
89
|
+
const fm = content.match(/^---\n[\s\S]*?\n---/)?.[0];
|
|
90
|
+
return fm ? content.slice(fm.length) : content;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** Whitespace-insensitive comparison (`git diff -w` style). */
|
|
94
|
+
function bodiesDiffer(a: string, b: string): boolean {
|
|
95
|
+
return a.replace(/\s+/g, '') !== b.replace(/\s+/g, '');
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (!existsSync(resolve(ROOT, 'skills'))) {
|
|
99
|
+
console.log('Skipped: no skills/ directory.');
|
|
100
|
+
process.exit(0);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const ignore = loadIgnorePatterns();
|
|
104
|
+
const changed = changedSkillFiles().filter((f) => !isIgnored(f, ignore));
|
|
105
|
+
|
|
106
|
+
const violations: { file: string; version: string }[] = [];
|
|
107
|
+
for (const file of changed) {
|
|
108
|
+
const oldContent = headContent(file);
|
|
109
|
+
if (oldContent === null) continue; // new skill — no prior version to compare
|
|
110
|
+
const newContent = readFileSync(resolve(ROOT, file), 'utf-8');
|
|
111
|
+
|
|
112
|
+
if (!bodiesDiffer(extractBody(oldContent), extractBody(newContent))) continue; // whitespace-only
|
|
113
|
+
|
|
114
|
+
const oldVersion = extractVersion(oldContent);
|
|
115
|
+
const newVersion = extractVersion(newContent);
|
|
116
|
+
if (oldVersion !== null && oldVersion === newVersion) {
|
|
117
|
+
violations.push({ file, version: oldVersion });
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (violations.length === 0) {
|
|
122
|
+
console.log('Skill versions are in step with body changes.');
|
|
123
|
+
process.exit(0);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const lines = [
|
|
127
|
+
`${violations.length} skill${violations.length === 1 ? '' : 's'} changed body without a metadata.version bump:`,
|
|
128
|
+
'',
|
|
129
|
+
];
|
|
130
|
+
for (const v of violations) {
|
|
131
|
+
lines.push(` - ${v.file} body changed but metadata.version is still "${v.version}"`);
|
|
132
|
+
}
|
|
133
|
+
lines.push('');
|
|
134
|
+
lines.push('Fix: bump metadata.version in the SKILL.md frontmatter, or add the skill to');
|
|
135
|
+
lines.push(' devcheck.config.json `skillVersions.ignore` for the typo/whitespace carve-out.');
|
|
136
|
+
console.log(lines.join('\n'));
|
|
137
|
+
process.exit(1);
|
package/scripts/devcheck.ts
CHANGED
|
@@ -242,6 +242,9 @@ interface DevcheckConfig {
|
|
|
242
242
|
skillsSync?: {
|
|
243
243
|
ignore?: string[];
|
|
244
244
|
};
|
|
245
|
+
skillVersions?: {
|
|
246
|
+
ignore?: string[];
|
|
247
|
+
};
|
|
245
248
|
}
|
|
246
249
|
|
|
247
250
|
function loadDevcheckConfig(rootDir: string): DevcheckConfig {
|
|
@@ -438,6 +441,21 @@ const ALL_CHECKS: Check[] = [
|
|
|
438
441
|
tip: (c) =>
|
|
439
442
|
`Remove the flagged SDK-coupling shortcut. See ${c.bold('scripts/check-framework-antipatterns.ts')} for rule rationale.`,
|
|
440
443
|
},
|
|
444
|
+
{
|
|
445
|
+
name: 'Open-Indexed Interfaces',
|
|
446
|
+
flag: '--no-open-index',
|
|
447
|
+
canFix: false,
|
|
448
|
+
// Framework-only AST check (#123): flags interfaces mixing named members with an
|
|
449
|
+
// open `[key: string]: unknown|any` index signature that lack an opt-out comment.
|
|
450
|
+
// Not shipped in package.json `files:`, so the existence guard skips it cleanly in
|
|
451
|
+
// consumer projects — the pattern is common and legitimate in consumer code.
|
|
452
|
+
getCommand: () => {
|
|
453
|
+
if (!existsSync(path.join(ROOT_DIR, 'scripts/audit-open-index-signatures.ts'))) return null;
|
|
454
|
+
return ['bun', 'run', 'scripts/audit-open-index-signatures.ts'];
|
|
455
|
+
},
|
|
456
|
+
tip: (c) =>
|
|
457
|
+
`Add ${c.bold('// allow open-indexed-named: <rationale>')} above the index signature, or use explicit fields. See ${c.bold('scripts/audit-open-index-signatures.ts')}.`,
|
|
458
|
+
},
|
|
441
459
|
{
|
|
442
460
|
name: 'Docs Sync',
|
|
443
461
|
flag: '--no-docs-sync',
|
|
@@ -470,6 +488,27 @@ const ALL_CHECKS: Check[] = [
|
|
|
470
488
|
tip: (c) =>
|
|
471
489
|
`Propagate ${c.bold('skills/')} to ${c.bold('.agents/skills/')} and ${c.bold('.claude/skills/')}, or add entries to ${c.bold('devcheck.config.json')} ${c.bold('skillsSync.ignore')}.`,
|
|
472
490
|
},
|
|
491
|
+
{
|
|
492
|
+
name: 'Skill Versions',
|
|
493
|
+
flag: '--no-skill-versions',
|
|
494
|
+
canFix: false,
|
|
495
|
+
// Flags skills/<name>/SKILL.md body changes (vs HEAD) that lack a metadata.version
|
|
496
|
+
// bump (#99). Skipped when skills/ is absent. Drift is demoted to a warning via
|
|
497
|
+
// isSuccess — the typo/whitespace carve-out lives in devcheck.config.json
|
|
498
|
+
// `skillVersions.ignore`.
|
|
499
|
+
getCommand: () => {
|
|
500
|
+
if (!existsSync(path.join(ROOT_DIR, 'skills'))) return null;
|
|
501
|
+
return ['bun', 'run', 'scripts/check-skill-versions.ts'];
|
|
502
|
+
},
|
|
503
|
+
isSuccess: (result) => {
|
|
504
|
+
if (result.exitCode === 0) return true;
|
|
505
|
+
const firstLine =
|
|
506
|
+
result.stdout.split('\n')[0]?.trim() || 'Skill bodies changed without a version bump.';
|
|
507
|
+
return { success: true, warning: firstLine };
|
|
508
|
+
},
|
|
509
|
+
tip: (c) =>
|
|
510
|
+
`Bump ${c.bold('metadata.version')} in the changed ${c.bold('SKILL.md')}, or add it to ${c.bold('devcheck.config.json')} ${c.bold('skillVersions.ignore')}.`,
|
|
511
|
+
},
|
|
473
512
|
{
|
|
474
513
|
name: 'Changelog Sync',
|
|
475
514
|
flag: '--no-changelog-sync',
|