@davidwoods/skylight-mcp 1.12.0 → 1.13.1

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/README.md CHANGED
@@ -343,6 +343,18 @@ placeholder, so nothing account-specific can be committed), asks you for a
343
343
  sign-in passphrase, deploys, sets `WORKER_URL`, deploys again and prints the
344
344
  connector URL. Re-deploy later with `npm run worker:deploy:local`.
345
345
 
346
+ **Upgrading a Worker deployed before 1.13.1:** add the change counter to your
347
+ `wrangler.local.jsonc` (a new setup gets it automatically), then deploy:
348
+
349
+ ```jsonc
350
+ "durable_objects": { "bindings": [{ "name": "WRITE_LIMITER", "class_name": "WriteLimiter" }] },
351
+ "migrations": [{ "tag": "v1-write-limiter", "new_sqlite_classes": ["WriteLimiter"] }],
352
+ ```
353
+
354
+ Without it the Worker still runs, but its change limit counts in memory and
355
+ limits nothing across requests. After a deploy, make a change and look for
356
+ `"limiter":"durable"` in the Worker's logs.
357
+
346
358
  Doing it by hand instead:
347
359
 
348
360
  ```bash
@@ -11,6 +11,7 @@
11
11
  */
12
12
  import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
13
13
  import type { ToolAnnotations } from "@modelcontextprotocol/sdk/types.js";
14
+ import { type WriteGuardLike } from "../utils/write-guard.js";
14
15
  /**
15
16
  * read: no change to Skylight data.
16
17
  * write: creates or updates; reversible by another edit.
@@ -27,6 +28,8 @@ export interface RegisterToolsOptions {
27
28
  include?: readonly string[];
28
29
  /** Register the photo tools (uploads). Default: true when hasPlus. */
29
30
  photos?: boolean;
31
+ /** Rate backstop for non-read tools. Default: the process-wide guard. Tests pass their own. */
32
+ writeGuard?: WriteGuardLike;
30
33
  }
31
34
  export declare function annotationsFor(effect: ToolEffect): ToolAnnotations;
32
35
  /** Names of the tools that would be registered with these options. */
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/tools/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;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AU,CAAC,CAqE7D,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACnC,8EAA8E;IAC9E,OAAO,EAAE,OAAO,CAAC;IACjB,yCAAyC;IACzC,OAAO,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IAChC,uGAAuG;IACvG,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,sEAAsE;IACtE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,+FAA+F;IAC/F,UAAU,CAAC,EAAE,cAAc,CAAC;CAC7B;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,UAAU,GAAG,eAAe,CAOlE;AAED,sEAAsE;AACtE,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,EAAE,CAMrE;AA8BD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,oBAAoB,GAAG,MAAM,EAAE,CAyCxF"}
@@ -21,6 +21,7 @@ import { registerLabelTools } from "./labels.js";
21
21
  import { registerPlanningTools } from "./planning.js";
22
22
  import { registerRewardTools } from "./rewards.js";
23
23
  import { registerTaskTools } from "./tasks.js";
24
+ import { getDefaultWriteGuard, logWrite, refusalResult } from "../utils/write-guard.js";
24
25
  export const TOOL_EFFECTS = {
25
26
  // calendar
26
27
  get_calendar_events: "read",
@@ -107,6 +108,33 @@ export function selectedTools(options) {
107
108
  .filter(([name, effect]) => effects.has(effect) || include.has(name))
108
109
  .map(([name]) => name);
109
110
  }
111
+ /**
112
+ * Wrap a non-read tool so each call is rate-checked and logged (see
113
+ * utils/write-guard.ts). Read tools are returned untouched. A refusal returns an
114
+ * MCP error result without calling the tool, so nothing is changed.
115
+ */
116
+ function guardedCallback(name, effect, callback, guard) {
117
+ if (effect === "read")
118
+ return callback;
119
+ const inner = callback;
120
+ return async (...args) => {
121
+ const verdict = await guard.admit(effect);
122
+ if (!verdict.ok) {
123
+ logWrite(name, effect, verdict.limiterError ? "limiter_error" : "refused", verdict.recent, guard.kind);
124
+ return refusalResult(verdict.reason, verdict.retryAfterSeconds, verdict.limiterError === true);
125
+ }
126
+ try {
127
+ const result = await inner(...args);
128
+ const failed = typeof result === "object" && result !== null && result.isError === true;
129
+ logWrite(name, effect, failed ? "tool_error" : "ok", verdict.recent, guard.kind);
130
+ return result;
131
+ }
132
+ catch (error) {
133
+ logWrite(name, effect, "threw", verdict.recent, guard.kind);
134
+ throw error;
135
+ }
136
+ };
137
+ }
110
138
  /**
111
139
  * Register the Skylight tools on `server`, filtered by effect, with MCP
112
140
  * annotations derived from the classification above.
@@ -114,6 +142,7 @@ export function selectedTools(options) {
114
142
  export function registerTools(server, options) {
115
143
  const allowed = new Set(selectedTools(options));
116
144
  const registered = [];
145
+ const guard = options.writeGuard ?? getDefaultWriteGuard();
117
146
  // Intercept server.tool() so the per-domain register functions stay as they
118
147
  // are: the registry decides what gets through and attaches annotations.
119
148
  const filtered = Object.create(server);
@@ -126,7 +155,7 @@ export function registerTools(server, options) {
126
155
  return undefined;
127
156
  }
128
157
  registered.push(name);
129
- const callback = rest.pop();
158
+ const callback = guardedCallback(name, effect, rest.pop(), guard);
130
159
  // Insert annotations before the callback: tool(name, description?, schema?, annotations, cb)
131
160
  return server.tool(name, ...rest, annotationsFor(effect), callback);
132
161
  });
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/tools/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAA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IAC5B,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAC9B,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC7B,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAC5B,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IAC/B,6EAA6E;IAC7E,qDAAqD;IACrD,qBAAqB,CAAC,QAAQ,CAAC,CAAC;IAEhC,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QACpB,mBAAmB,CAAC,QAAQ,CAAC,CAAC;QAC9B,iBAAiB,CAAC,QAAQ,CAAC,CAAC;QAC5B,IAAI,OAAO,CAAC,MAAM,IAAI,IAAI;YAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC3D,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC"}
@@ -0,0 +1,94 @@
1
+ /**
2
+ * A backstop on how many changes one server process will make in an hour, and a
3
+ * one-line record of each change attempt.
4
+ *
5
+ * Why it exists: an assistant that loops (or is steered into a loop) could
6
+ * otherwise create or delete hundreds of items on the family's shared display
7
+ * before anyone looks. The per-tool guards (preview, confirm, allowlist) judge one
8
+ * call at a time; this judges the rate.
9
+ *
10
+ * Where the count lives:
11
+ * - Local stdio server: in memory. It is one long-lived process, so that holds.
12
+ * - Hosted Worker: in a Durable Object (src/worker/write-limiter.ts). The first
13
+ * hosted version kept the count in module memory and a live test showed the
14
+ * Worker did not carry it from one request to the next (three calls in a row
15
+ * each read 1), so it limited nothing. This file holds the one admission rule
16
+ * both places use.
17
+ * - If the Worker has no Durable Object binding (a config from before the
18
+ * limiter), it falls back to the in-memory guard, which does NOT limit across
19
+ * requests, and every log line says so (`limiter: "memory"`).
20
+ * - Every non-read call counts, previews and failures included, so a loop of
21
+ * failing or dry-run calls is stopped too. The default is generous for a family
22
+ * (a planning session is a handful of calls). This is a backstop against a
23
+ * runaway loop, not an exact quota and not an authentication control.
24
+ * - The log line holds the tool name, its effect and the outcome only. Never
25
+ * arguments, text, ids or results: the log must be safe to paste.
26
+ */
27
+ import type { ToolEffect } from "../tools/registry.js";
28
+ export interface WriteLimits {
29
+ windowMs: number;
30
+ /** Non-read calls (write and destructive together) per window. */
31
+ maxWrites: number;
32
+ /** Destructive calls per window, counted inside maxWrites. */
33
+ maxDestructive: number;
34
+ }
35
+ export declare const DEFAULT_WRITE_LIMITS: WriteLimits;
36
+ /** `recent` is the number of changes admitted in the window, this one included when allowed. */
37
+ export type Admission = {
38
+ ok: true;
39
+ recent: number;
40
+ } | {
41
+ ok: false;
42
+ reason: string;
43
+ retryAfterSeconds: number;
44
+ recent: number;
45
+ limiterError?: true;
46
+ };
47
+ /** What the registry needs from a guard; the in-memory and the Durable Object versions both fit. */
48
+ export interface WriteGuardLike {
49
+ /** "memory" counts in this process only; "durable" counts across requests. Shown in every log line. */
50
+ readonly kind: "memory" | "durable";
51
+ admit(effect: Exclude<ToolEffect, "read">): Admission | Promise<Admission>;
52
+ }
53
+ /** What a Durable Object persists between requests. */
54
+ export interface WriteGuardState {
55
+ writes: number[];
56
+ destructive: number[];
57
+ }
58
+ export declare class WriteGuard implements WriteGuardLike {
59
+ private readonly limits;
60
+ private readonly now;
61
+ readonly kind: "memory";
62
+ private writes;
63
+ private destructive;
64
+ constructor(limits?: WriteLimits, now?: () => number);
65
+ private prune;
66
+ private retryAfter;
67
+ /** Decide, and when allowed record the attempt. Reads must not be passed in. */
68
+ admit(effect: Exclude<ToolEffect, "read">): Admission;
69
+ /** The counts, for a store that outlives the process. */
70
+ snapshot(): WriteGuardState;
71
+ /** Load counts saved by snapshot(). Anything malformed is ignored (counts start empty), never trusted. */
72
+ restore(state: unknown): void;
73
+ /** Changes admitted in the current window. */
74
+ recent(): number;
75
+ }
76
+ /** The process-wide guard. The hosted server builds a fresh MCP server per request, so this must outlive one. */
77
+ export declare function getDefaultWriteGuard(): WriteGuard;
78
+ /** Tests only. */
79
+ export declare function resetDefaultWriteGuard(): void;
80
+ export type WriteOutcome = "ok" | "tool_error" | "threw" | "refused" | "limiter_error";
81
+ /**
82
+ * One line per change attempt, to stderr (stdout carries the MCP protocol on stdio).
83
+ * No arguments, text or ids. `limiter` says where the count lives, so a Worker that
84
+ * is silently counting in memory (and so limiting nothing) is visible in the log.
85
+ */
86
+ export declare function logWrite(tool: string, effect: ToolEffect, outcome: WriteOutcome, recent: number, limiter: WriteGuardLike["kind"]): void;
87
+ export declare function refusalResult(reason: string, retryAfterSeconds: number, limiterError?: boolean): {
88
+ isError: true;
89
+ content: Array<{
90
+ type: "text";
91
+ text: string;
92
+ }>;
93
+ };
94
+ //# sourceMappingURL=write-guard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-guard.d.ts","sourceRoot":"","sources":["../../src/utils/write-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,kEAAkE;IAClE,SAAS,EAAE,MAAM,CAAC;IAClB,8DAA8D;IAC9D,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,oBAAoB,EAAE,WAIlC,CAAC;AAEF,gGAAgG;AAChG,MAAM,MAAM,SAAS,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAErJ,oGAAoG;AACpG,MAAM,WAAW,cAAc;IAC7B,uGAAuG;IACvG,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,CAAC;IACpC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG,SA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AAO,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAOhK"}
@@ -0,0 +1,108 @@
1
+ /**
2
+ * A backstop on how many changes one server process will make in an hour, and a
3
+ * one-line record of each change attempt.
4
+ *
5
+ * Why it exists: an assistant that loops (or is steered into a loop) could
6
+ * otherwise create or delete hundreds of items on the family's shared display
7
+ * before anyone looks. The per-tool guards (preview, confirm, allowlist) judge one
8
+ * call at a time; this judges the rate.
9
+ *
10
+ * Where the count lives:
11
+ * - Local stdio server: in memory. It is one long-lived process, so that holds.
12
+ * - Hosted Worker: in a Durable Object (src/worker/write-limiter.ts). The first
13
+ * hosted version kept the count in module memory and a live test showed the
14
+ * Worker did not carry it from one request to the next (three calls in a row
15
+ * each read 1), so it limited nothing. This file holds the one admission rule
16
+ * both places use.
17
+ * - If the Worker has no Durable Object binding (a config from before the
18
+ * limiter), it falls back to the in-memory guard, which does NOT limit across
19
+ * requests, and every log line says so (`limiter: "memory"`).
20
+ * - Every non-read call counts, previews and failures included, so a loop of
21
+ * failing or dry-run calls is stopped too. The default is generous for a family
22
+ * (a planning session is a handful of calls). This is a backstop against a
23
+ * runaway loop, not an exact quota and not an authentication control.
24
+ * - The log line holds the tool name, its effect and the outcome only. Never
25
+ * arguments, text, ids or results: the log must be safe to paste.
26
+ */
27
+ export const DEFAULT_WRITE_LIMITS = {
28
+ windowMs: 60 * 60 * 1000,
29
+ maxWrites: 60,
30
+ maxDestructive: 10,
31
+ };
32
+ export class WriteGuard {
33
+ limits;
34
+ now;
35
+ kind = "memory";
36
+ writes = [];
37
+ destructive = [];
38
+ constructor(limits = DEFAULT_WRITE_LIMITS, now = () => Date.now()) {
39
+ this.limits = limits;
40
+ this.now = now;
41
+ }
42
+ prune() {
43
+ const cutoff = this.now() - this.limits.windowMs;
44
+ this.writes = this.writes.filter((t) => t > cutoff);
45
+ this.destructive = this.destructive.filter((t) => t > cutoff);
46
+ }
47
+ retryAfter(times) {
48
+ const oldest = times[0] ?? this.now();
49
+ return Math.max(1, Math.ceil((oldest + this.limits.windowMs - this.now()) / 1000));
50
+ }
51
+ /** Decide, and when allowed record the attempt. Reads must not be passed in. */
52
+ admit(effect) {
53
+ this.prune();
54
+ if (effect === "destructive" && this.destructive.length >= this.limits.maxDestructive) {
55
+ return { ok: false, reason: `delete limit reached (${this.limits.maxDestructive} per hour)`, retryAfterSeconds: this.retryAfter(this.destructive), recent: this.writes.length };
56
+ }
57
+ if (this.writes.length >= this.limits.maxWrites) {
58
+ return { ok: false, reason: `change limit reached (${this.limits.maxWrites} per hour)`, retryAfterSeconds: this.retryAfter(this.writes), recent: this.writes.length };
59
+ }
60
+ const t = this.now();
61
+ this.writes.push(t);
62
+ if (effect === "destructive")
63
+ this.destructive.push(t);
64
+ return { ok: true, recent: this.writes.length };
65
+ }
66
+ /** The counts, for a store that outlives the process. */
67
+ snapshot() {
68
+ return { writes: [...this.writes], destructive: [...this.destructive] };
69
+ }
70
+ /** Load counts saved by snapshot(). Anything malformed is ignored (counts start empty), never trusted. */
71
+ restore(state) {
72
+ const clean = (v) => (Array.isArray(v) ? v.filter((n) => typeof n === "number" && Number.isFinite(n)) : []);
73
+ const s = (state ?? {});
74
+ this.writes = clean(s.writes);
75
+ this.destructive = clean(s.destructive);
76
+ }
77
+ /** Changes admitted in the current window. */
78
+ recent() {
79
+ this.prune();
80
+ return this.writes.length;
81
+ }
82
+ }
83
+ let defaultGuard = new WriteGuard();
84
+ /** The process-wide guard. The hosted server builds a fresh MCP server per request, so this must outlive one. */
85
+ export function getDefaultWriteGuard() {
86
+ return defaultGuard;
87
+ }
88
+ /** Tests only. */
89
+ export function resetDefaultWriteGuard() {
90
+ defaultGuard = new WriteGuard();
91
+ }
92
+ /**
93
+ * One line per change attempt, to stderr (stdout carries the MCP protocol on stdio).
94
+ * No arguments, text or ids. `limiter` says where the count lives, so a Worker that
95
+ * is silently counting in memory (and so limiting nothing) is visible in the log.
96
+ */
97
+ export function logWrite(tool, effect, outcome, recent, limiter) {
98
+ console.error(JSON.stringify({ event: "skylight_change", tool, effect, outcome, recent, limiter }));
99
+ }
100
+ export function refusalResult(reason, retryAfterSeconds, limiterError = false) {
101
+ const minutes = Math.ceil(retryAfterSeconds / 60);
102
+ const wait = `about ${minutes} minute${minutes === 1 ? "" : "s"}`;
103
+ const text = limiterError
104
+ ? `Nothing was changed: ${reason}, so this change was not allowed. Try again in ${wait}, and tell the owner if it keeps happening.`
105
+ : `Nothing was changed: ${reason}. This stops a runaway loop on the family's shared display. Try again in ${wait}, and tell the owner if you were not expecting to hit it.`;
106
+ return { isError: true, content: [{ type: "text", text }] };
107
+ }
108
+ //# sourceMappingURL=write-guard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-guard.js","sourceRoot":"","sources":["../../src/utils/write-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAYH,MAAM,CAAC,MAAM,oBAAoB,GAAgB;IAC/C,QAAQ,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI;IACxB,SAAS,EAAE,EAAE;IACb,cAAc,EAAE,EAAE;CACnB,CAAC;AAkBF,MAAM,OAAO,UAAU;IAMF;IACA;IANV,IAAI,GAAG,QAAiB,CAAC;IAC1B,MAAM,GAAa,EAAE,CAAC;IACtB,WAAW,GAAa,EAAE,CAAC;IAEnC,YACmB,SAAsB,oBAAoB,EAC1C,MAAoB,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;QADpC,WAAM,GAAN,MAAM,CAAoC;QAC1C,QAAG,GAAH,GAAG,CAAiC;IACpD,CAAC;IAEI,KAAK;QACX,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;QACjD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CA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EpC,iHAAiH;AACjH,MAAM,UAAU,oBAAoB;IAClC,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,kBAAkB;AAClB,MAAM,UAAU,sBAAsB;IACpC,YAAY,GAAG,IAAI,UAAU,EAAE,CAAC;AAClC,CAAC;AAID;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,MAAkB,EAAE,OAAqB,EAAE,MAAc,EAAE,OAA+B;IAC/H,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;AACtG,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,MAAc,EAAE,iBAAyB,EAAE,YAAY,GAAG,KAAK;IAC3F,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,GAAG,EAAE,CAAC,CAAC;IAClD,MAAM,IAAI,GAAG,SAAS,OAAO,UAAU,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IAClE,MAAM,IAAI,GAAG,YAAY;QACvB,CAAC,CAAC,wBAAwB,MAAM,kDAAkD,IAAI,6CAA6C;QACnI,CAAC,CAAC,wBAAwB,MAAM,4EAA4E,IAAI,2DAA2D,CAAC;IAC9K,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;AAC9D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@davidwoods/skylight-mcp",
3
- "version": "1.12.0",
3
+ "version": "1.13.1",
4
4
  "description": "Unofficial MCP server for Skylight Calendar: local (stdio) and hosted (Cloudflare Workers), with browser-paste OAuth sign-in and an encrypted credential store",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",