@mgcrea/mcp-apple-core 1.24.1 → 1.25.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/index.d.ts CHANGED
@@ -282,6 +282,69 @@ type StdioServerOptions = {
282
282
  */
283
283
  declare const runStdioServer: (opts: StdioServerOptions) => Promise<void>;
284
284
  //#endregion
285
+ //#region src/diagnostics.d.ts
286
+ /**
287
+ * The half of every surface's diagnostics report that is the same everywhere.
288
+ *
289
+ * ## Why this exists
290
+ *
291
+ * `apple_<surface>_diagnostics` is the tool an operator reaches for first, and
292
+ * the eight surfaces had four incompatible ideas of what it should say. Three of
293
+ * them — Notes, Reminders and Calendar — put their lane report under `server`
294
+ * and so could not report their own VERSION at all: the first question anyone
295
+ * asks about a misbehaving server had no answer. Four others reported a name and
296
+ * a version and then nothing about how they were configured, so `maxResults`,
297
+ * `indexMode` and the write gate were invisible on exactly the surfaces where
298
+ * "why can the model not see that tool" gets asked.
299
+ *
300
+ * Nothing here is a new fact. It is the union of what the most complete of them
301
+ * already reported, in one place, so a surface cannot quietly report less than
302
+ * its neighbour.
303
+ *
304
+ * ## What belongs here, and what does not
305
+ *
306
+ * `server` is identity: which build is running. `settings` is the configuration
307
+ * every surface has, from `BaseConfigSchema`. Everything else — lanes,
308
+ * permissions, stores, caveats — is surface-specific and stays with the surface,
309
+ * spread around this rather than folded into it.
310
+ */
311
+ type BaseDiagnosticsInput = {
312
+ build: BuildInfo;
313
+ /** The surface's own config. Only the fields every surface shares are read. */
314
+ config: {
315
+ exposePrompts: boolean;
316
+ lazyTools: boolean;
317
+ maxResults: number;
318
+ /** Surfaces with a SQLite lane. Omitted by those without one. */
319
+ indexMode?: string;
320
+ };
321
+ /**
322
+ * Passed explicitly rather than read from `config`, because it is the tool
323
+ * context that decides what was REGISTERED — and a report that read the flag
324
+ * from somewhere other than the registration would be free to disagree with
325
+ * it. Contacts' diagnostics said the surface had no mutating tool for three
326
+ * releases after two shipped.
327
+ */
328
+ allowWrites: boolean;
329
+ };
330
+ type BaseDiagnostics = {
331
+ server: {
332
+ name: string;
333
+ version: string;
334
+ gitCommit: string;
335
+ node: string;
336
+ platform: string;
337
+ };
338
+ settings: {
339
+ allowWrites: boolean;
340
+ exposePrompts: boolean;
341
+ lazyTools: boolean;
342
+ maxResults: number;
343
+ indexMode?: string;
344
+ };
345
+ };
346
+ declare const buildBaseDiagnostics: ({ build, config, allowWrites }: BaseDiagnosticsInput) => BaseDiagnostics;
347
+ //#endregion
285
348
  //#region src/codes.d.ts
286
349
  /**
287
350
  * One-time-code extraction, as a pure function over text.
@@ -376,6 +439,65 @@ type ExtractOptions = {
376
439
  */
377
440
  declare const extractCode: (text: string | null | undefined, { fromShortcode }?: ExtractOptions) => CodeMatch | null;
378
441
  //#endregion
442
+ //#region src/confine.d.ts
443
+ /**
444
+ * Write a file somewhere the caller is allowed to write it.
445
+ *
446
+ * ## Why this is shared
447
+ *
448
+ * Three surfaces save attachments — Mail, Notes and Messages — and each had its
449
+ * own copy of this, near enough identical that Messages' comment said so. All
450
+ * three had the same two holes, which is what a third copy buys you.
451
+ *
452
+ * ## The two boundaries
453
+ *
454
+ * `root` is the CONFINEMENT: a configured directory, and nothing may be written
455
+ * outside it. `directory` may only select a subdirectory of it — resolved
456
+ * *against* the root, so a relative path lands inside and an absolute one is
457
+ * caught. `name` is basename'd because it comes from message or note content,
458
+ * which is attacker-controlled in exactly the way path traversal needs.
459
+ *
460
+ * ## What the copies got wrong
461
+ *
462
+ * **The check was lexical.** `startsWith(root + sep)` compares strings, and a
463
+ * symlink is a string that points elsewhere: with any component of `directory` a
464
+ * link, the path passed and the bytes landed outside. Both the root and the
465
+ * directory are `realpath`ed here before they are compared, so the check is
466
+ * about where the write actually goes.
467
+ *
468
+ * **`existsSync` then `writeFileSync` is check-then-act.** Between the two, the
469
+ * name can be created — as a symlink to somewhere else, by anything that can
470
+ * write to that directory. Without `overwrite`, the file is created with `wx`,
471
+ * which fails if it exists rather than asking first, so the refusal and the
472
+ * write are one operation the kernel performs.
473
+ */
474
+ type ConfinedWrite = {
475
+ /** The confinement boundary. Created if it is not there. */
476
+ root: string;
477
+ /** An optional subdirectory of `root`, chosen by the caller. */
478
+ directory?: string | undefined;
479
+ /** The leaf name. Basename'd here; callers need not do it first. */
480
+ name: string;
481
+ /**
482
+ * The content, or a function that produces it. A function is called only
483
+ * once the destination has passed every check, so a refused write never pays
484
+ * for reading or extracting what it would have written — Mail's extraction
485
+ * parses the whole message file, which is a lot to spend on a traversal
486
+ * attempt.
487
+ */
488
+ bytes: Uint8Array | (() => Uint8Array);
489
+ overwrite?: boolean | undefined;
490
+ /**
491
+ * Named in the refusal, so the message says how to change the destination
492
+ * rather than only that it was refused.
493
+ */
494
+ settingName: string;
495
+ };
496
+ declare const writeConfinedFile: ({ root, directory, name, bytes, overwrite, settingName }: ConfinedWrite) => {
497
+ path: string;
498
+ bytes: number;
499
+ };
500
+ //#endregion
379
501
  //#region src/config.d.ts
380
502
  /**
381
503
  * Environment parsing shared by every server.
@@ -398,7 +520,6 @@ declare const BaseConfigSchema: z.ZodObject<{
398
520
  allowWrites: z.ZodDefault<z.ZodBoolean>;
399
521
  exposePrompts: z.ZodDefault<z.ZodBoolean>;
400
522
  lazyTools: z.ZodDefault<z.ZodBoolean>;
401
- debug: z.ZodDefault<z.ZodBoolean>;
402
523
  osascriptPath: z.ZodDefault<z.ZodString>;
403
524
  osascriptTimeoutMs: z.ZodDefault<z.ZodNumber>;
404
525
  maxResults: z.ZodDefault<z.ZodNumber>;
@@ -751,7 +872,8 @@ declare const project: <T extends Record<string, unknown>>(rows: T[], select: st
751
872
  * - `diagnostics` is the live capability report.
752
873
  * - `inventory` is the set of containers you address by name: accounts, and
753
874
  * whatever the surface calls its folders. Surfaces with no such containers
754
- * (Messages, Safari) register two resources rather than inventing a third.
875
+ * (Contacts, Messages, Safari, Maps) register two resources rather than
876
+ * inventing a third.
755
877
  */
756
878
  declare const RESOURCE_SCHEME = "cupertino";
757
879
  /** `cupertino://mail/guide`. The one place this string is built. */
@@ -801,10 +923,24 @@ declare const fingerprintSchema: (db: DatabaseSync) => string;
801
923
  * disagree about this for Mail, and hardcoding the wrong one puts every date 31
802
924
  * years out — a bug that looks like corruption rather than a unit mismatch.
803
925
  */
804
- declare const detectEpoch: (maxTimestamp: number | null, now?: number) => {
926
+ type Epoch = {
805
927
  offset: number;
806
928
  reason: string;
929
+ /**
930
+ * Whether the offset was MEASURED or fallen back to.
931
+ *
932
+ * The field that matters, and the reason it is returned here rather than
933
+ * derived by the caller. An offset of 0 means "measured as unix seconds" and
934
+ * also "nothing fitted, so unix was assumed", and rendering the second as
935
+ * though it were the first is the failure this whole module is built around.
936
+ *
937
+ * Two surfaces used to recover it by matching a REGEX against `reason` —
938
+ * prose, across a package boundary. Rewording a sentence here would have made
939
+ * both of them confidently wrong about an epoch nobody measured, silently.
940
+ */
941
+ confident: boolean;
807
942
  };
943
+ declare const detectEpoch: (maxTimestamp: number | null, now?: number) => Epoch;
808
944
  //#endregion
809
945
  //#region src/sqlite.d.ts
810
946
  /**
@@ -908,5 +1044,5 @@ declare const limitArg: z.ZodOptional<z.ZodNumber>;
908
1044
  declare const resolveLimit: (limit: number | undefined, maxResults: number, fallback?: number) => number;
909
1045
  declare const confirmArg: z.ZodLiteral<true>;
910
1046
  //#endregion
911
- export { type Aggregation, AppBusyError, AppNotRunningError, AppleAutomationError, type AxCall, type AxChannel, AxChannelError, BaseConfigSchema, type Bucket, type BuildInfo, CORE_DATA_EPOCH_OFFSET, type CodeConfidence, type CodeMatch, type DateKind, type ExecImpl, type ExtractOptions, type FileFacts, IndexUnavailableError, type Interference, type InterferenceWatch, InvalidDateError, type JxaEnvelope, type LazyToolsOptions, type Logger, type OpenOptions, type OpenedStore, type OsascriptOptions, type OsascriptRunner, OsascriptTimeoutError, type PackageIdentity, type ParsedDate, PlatformError, PreconditionError, type Projected, type PromptContext, ProtocolError, RESOURCE_SCHEME, type ReadOnlyMode, type ResourceReader, SchemaDriftError, type StdioServerOptions, type StoreFacts, type SurfaceContext, type SurfaceResourceOptions, TccDeniedError, type ToolResult, type WorkflowPrompt, WritesDisabledError, addLocalDays, assertStaticScript, columnsOf, compact, confirmArg, createOsascriptRunner, describeAggregation, describeStore, detectEpoch, endOfLocalDay, escapeLike, extractCode, fail, fingerprintSchema, groupByArg, inspectFile, interferenceNote, limitArg, mapOsaError, ok, okText, openAxChannel, openReadOnly, parseBool, parseBound, parseConfig, parseDate, parseIntOpt, parseList, project, promptArg, readPackageIdentity, registerSurfaceResources, registerWorkflowPrompt, requiredPromptArg, resolveLimit, runStdioServer, selectArg, startOfLocalDay, surfaceUri, tableMap, toFailure, toFileUri, toLocalIso, trimToolListing, trimmed, watchInterference, withBusyRetry, withLazyTools, withTrimmedListing, wrap, wrapResult };
1047
+ export { type Aggregation, AppBusyError, AppNotRunningError, AppleAutomationError, type AxCall, type AxChannel, AxChannelError, BaseConfigSchema, type BaseDiagnostics, type BaseDiagnosticsInput, type Bucket, type BuildInfo, CORE_DATA_EPOCH_OFFSET, type CodeConfidence, type CodeMatch, type ConfinedWrite, type DateKind, type Epoch, type ExecImpl, type ExtractOptions, type FileFacts, IndexUnavailableError, type Interference, type InterferenceWatch, InvalidDateError, type JxaEnvelope, type LazyToolsOptions, type Logger, type OpenOptions, type OpenedStore, type OsascriptOptions, type OsascriptRunner, OsascriptTimeoutError, type PackageIdentity, type ParsedDate, PlatformError, PreconditionError, type Projected, type PromptContext, ProtocolError, RESOURCE_SCHEME, type ReadOnlyMode, type ResourceReader, SchemaDriftError, type StdioServerOptions, type StoreFacts, type SurfaceContext, type SurfaceResourceOptions, TccDeniedError, type ToolResult, type WorkflowPrompt, WritesDisabledError, addLocalDays, assertStaticScript, buildBaseDiagnostics, columnsOf, compact, confirmArg, createOsascriptRunner, describeAggregation, describeStore, detectEpoch, endOfLocalDay, escapeLike, extractCode, fail, fingerprintSchema, groupByArg, inspectFile, interferenceNote, limitArg, mapOsaError, ok, okText, openAxChannel, openReadOnly, parseBool, parseBound, parseConfig, parseDate, parseIntOpt, parseList, project, promptArg, readPackageIdentity, registerSurfaceResources, registerWorkflowPrompt, requiredPromptArg, resolveLimit, runStdioServer, selectArg, startOfLocalDay, surfaceUri, tableMap, toFailure, toFileUri, toLocalIso, trimToolListing, trimmed, watchInterference, withBusyRetry, withLazyTools, withTrimmedListing, wrap, wrapResult, writeConfinedFile };
912
1048
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/errors.ts","../src/ax.ts","../src/build-info.ts","../src/osascript.ts","../src/cli.ts","../src/codes.ts","../src/config.ts","../src/dates.ts","../src/facade.ts","../src/fs.ts","../src/listing.ts","../src/prompts.ts","../src/query.ts","../src/resources.ts","../src/schema.ts","../src/sqlite.ts","../src/tools.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;KAqBY;;EAEV;;EAEA;;;cAIW,6BAA6B;WACtB;WACT,SAAS;EAElB,YAAY,iBAAiB,UAAU;;;cAO5B,uBAAuB;WAChB;EAElB,YAAY,SAAS;;;cAWV,2BAA2B;WACpB;EAElB,YAAY,SAAS;;;cASV,qBAAqB;WACd;EAElB,YAAY,SAAS;;;cASV,8BAA8B;WACvB;EAElB,YAAY,mBAAmB,SAAS;;;;;;;cAc7B,4BAA4B;WACrB;EAElB,YAAY,SAAS;;;cAQV,8BAA8B;WACvB;;;cAIP,yBAAyB;WAClB;;;cAIP,sBAAsB;WACf;;;cAIP,sBAAsB;WACf;;;cAIP,0BAA0B;WACnB;;;;;;;;;;;cAYP,yBAAyB;WAClB;EAElB,YAAY,eAAe,aAAa;;;;KCpF9B;;WAED;WACA,MAAM;;KAGL;;;;;;;;EAQV,KAAK,SAAS,SAAS;EACvB;;;;;;;;cASW,uBAAuB;WAChB;EAElB,YAAY,SAAS,gBAAgB;;;;;;;;;;cAiB1B,gBAAa,SACf,gBAAc,MAClB,OAAO,eACX;;;;;;;;;;;;;;;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KAQS,UAAU;EACpB,MAAM,QAAQ;;;;;;EAMd;;;;;;;;;;cAWW,UAAW,UAAU,yBAAuB,MACjD,KAAG,8BACmB,6BAE3B,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCrEA;;cAGA,aAAU,iBAAmB;KAG9B,uBAAuB;KAEvB;;EAEV;;EAEA;;EAEA;;EAEA,aAAa;;EAEb;;IAEE;IACA,MAAM;;;;cA2CG,2BAAwB,QAAY,WAAS,MAAQ;;;;;;;;;;;cCtFrD;cAEA,YAAS,IAAQ,cAAY;;cAW7B,WAAQ,IAAQ,iBAAe;;;;;;cAc/B,oBAAiB,IAAQ;;;;;;;cAgBzB,cAAW,6BACK;EAExB;EAAgB;;;;;;;;;;;;;;;;;;;KCvCT;KAEA,YAAY;EACtB,IAAI;;EAEJ;;EAEA,WAAW;;;;;;cAOA,YAAS,cAAgB;;cAIzB,aAAU;KAGX,YAAY;;EAEtB;;EAEA;;EAEA;;;;;;EAMA,aAAa,IAAI,iBAAiB;;;;;EAKlC,UAAU;;EAEV;;cAGW,eAAgB,eAAa,cAC5B,MACN,cAAY,OACZ,YAAY,OACjB,YAAY;;;KC9DH;EACV;IAAW;IAAc;;EACzB;;;;;;;;;;;cAYW,KAAE,kBAAoB;;;;;cAQtB,SAAM,iBAAmB;cAIzB,OAAI,iBAAmB,oBAAoB;;cAW3C,YAAS,iBAAmB;;cAY5B,OAAc,GAAC,UAAY,QAAQ,OAAK,QAAQ;;cAShD,aAAU,UAAoB,QAAQ,gBAAc,QAAQ;;cAS5D,UAAW,UAAU,yBAAuB,KAAO,MAAI,QAAQ;cAK/D,UAAQ,EAAA,YAAA,EAAA;;;;;;;;;;;;;cAuBR,eAAY,2BACE,oBACP;cAIP,YAAU,EAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/errors.ts","../src/ax.ts","../src/build-info.ts","../src/osascript.ts","../src/cli.ts","../src/diagnostics.ts","../src/codes.ts","../src/confine.ts","../src/config.ts","../src/dates.ts","../src/facade.ts","../src/fs.ts","../src/listing.ts","../src/prompts.ts","../src/query.ts","../src/resources.ts","../src/schema.ts","../src/sqlite.ts","../src/tools.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;KAqBY;;EAEV;;EAEA;;;cAIW,6BAA6B;WACtB;WACT,SAAS;EAElB,YAAY,iBAAiB,UAAU;;;cAO5B,uBAAuB;WAChB;EAElB,YAAY,SAAS;;;cAWV,2BAA2B;WACpB;EAElB,YAAY,SAAS;;;cASV,qBAAqB;WACd;EAElB,YAAY,SAAS;;;cASV,8BAA8B;WACvB;EAElB,YAAY,mBAAmB,SAAS;;;;;;;cAc7B,4BAA4B;WACrB;EAElB,YAAY,SAAS;;;cAQV,8BAA8B;WACvB;;;cAIP,yBAAyB;WAClB;;;cAIP,sBAAsB;WACf;;;cAIP,sBAAsB;WACf;;;cAIP,0BAA0B;WACnB;;;;;;;;;;;cAYP,yBAAyB;WAClB;EAElB,YAAY,eAAe,aAAa;;;;KCpF9B;;WAED;WACA,MAAM;;KAGL;;;;;;;;EAQV,KAAK,SAAS,SAAS;EACvB;;;;;;;;cASW,uBAAuB;WAChB;EAElB,YAAY,SAAS,gBAAgB;;;;;;;;;;cAiB1B,gBAAa,SACf,gBAAc,MAClB,OAAO,eACX;;;;;;;;;;;;;;;;;;;;KAqKS;;EAEV;EACA;EACA;;KAGU;EAAsB,SAAS,QAAQ;;;;;;;;;;;;;;;;;cAwBtC,oBAAiB,SAAa,cAAY;;;;;;;;cAiC1C,mBAAgB,OAAW;;;KC5U5B;EAAoB;EAAc;;KAElC,YAAY;EACtB;EACA;;;;;;;;;;;cAYW,sBAAmB,gBACd,KAAG,UACT,oBACT;;;KCuBS;EACV,YAAY;EACZ,WAAW;EACX,YAAY;;;KAIF,YAAY;EAClB;EAAU,MAAM;;EAIhB;EAAW;IAAS;IAAc;KAAkB;;;KAE9C;;EAEV,MAAM,GAAG,gBAAgB,qBAAqB,QAAQ;;;;;;;;KAS5C,Y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AAQ;;;;;;EAMd;;;;;;;;;;cAWW,UAAW,UAAU,yBAAuB,MACjD,KAAG,8BACmB,6BAE3B,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCpEA;;cAGA,aAAU,iBAAmB;KAG9B,uBAAuB;KAEvB;;EAEV;;EAEA;;EAEA;;EAEA,aAAa;;EAEb;;IAEE;IACA,MAAM;;;;cA2CG,2BAAwB,QAAY,WAAS,MAAQ;;;;;;;;;;;cCvFrD;cAEA,YAAS,IAAQ,cAAY;;cAW7B,WAAQ,IAAQ,iBAAe;;;;;;cAc/B,oBAAiB,IAAQ;;;;;;;KAgB1B;EACV;EACA;;;;;;;;;;;;;EAaA;;cAGW,cAAW,6BAA+B,iBAA6B;;;;;;;;;;;;;;;;;;KCtDxE;KAEA,YAAY;EACtB,IAAI;;EAEJ;;EAEA,WAAW;;;;;;cAOA,YAAS,cAAgB;;cAIzB,aAAU;KAGX,YAAY;;EAEtB;;EAEA;;EAEA;;;;;;EAMA,aAAa,IAAI,iBAAiB;;;;;EAKlC,UAAU;;EAEV;;cAGW,eAAgB,eAAa,cAC5B,MACN,cAAY,OACZ,YAAY,OACjB,YAAY;;;KC9DH;EACV;IAAW;IAAc;;EACzB;;;;;;;;;;;cAYW,KAAE,kBAAoB;;;;;cAQtB,SAAM,iBAAmB;cAIzB,OAAI,iBAAmB,oBAAoB;;cAW3C,YAAS,iBAAmB;;cAY5B,OAAc,GAAC,UAAY,QAAQ,OAAK,QAAQ;;cAShD,aAAU,UAAoB,QAAQ,gBAAc,QAAQ;;cAS5D,UAAW,UAAU,yBAAuB,KAAO,MAAI,QAAQ;cAK/D,UAAQ,EAAA,YAAA,EAAA;;;;;;;;;;;;;cAuBR,eAAY,2BACE,oBACP;cAIP,YAAU,EAAA"}
package/dist/index.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import { connect } from "node:net";
2
- import { accessSync, constants, readFileSync, statSync } from "node:fs";
2
+ import { accessSync, constants, mkdirSync, readFileSync, realpathSync, statSync, writeFileSync } from "node:fs";
3
3
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
4
  import { z } from "zod";
5
+ import { basename, join, resolve, sep } from "node:path";
5
6
  import { execFile } from "node:child_process";
6
7
  import { createHash } from "node:crypto";
7
8
  import { DatabaseSync } from "node:sqlite";
@@ -86,7 +87,7 @@ var PreconditionError = class extends AppleAutomationError {
86
87
  var InvalidDateError = class extends AppleAutomationError {
87
88
  name = "InvalidDateError";
88
89
  constructor(field, raw, reason) {
89
- super(`Could not read ${field} from ${JSON.stringify(raw)}: ${reason}. Accepted: an ISO-8601 date "2026-08-20" (a whole day, local) or date-time "2026-08-20T09:00" (local unless it carries an offset), a signed offset like "+2d", "-3h", "+45m", "+1w", "today", "yesterday", "tomorrow 09:00", "next monday" or "last friday".`, {
90
+ super(`${field}: ${JSON.stringify(raw)} could not be read as a date — ${reason}. Accepted: an ISO-8601 date "2026-08-20" (a whole day, local) or date-time "2026-08-20T09:00" (local unless it carries an offset), a signed offset like "+2d", "-3h", "+45m", "+1w", "today", "yesterday", "tomorrow 09:00", "next monday" or "last friday".`, {
90
91
  field,
91
92
  raw
92
93
  });
@@ -358,6 +359,103 @@ const readPackageIdentity = (packageJsonUrl, fallback) => {
358
359
  }
359
360
  };
360
361
  //#endregion
362
+ //#region src/config.ts
363
+ /**
364
+ * Environment parsing shared by every server.
365
+ *
366
+ * Configuration is environment-only. The sibling servers that also read a
367
+ * `~/.config/<service>/config.json` do so because they hold a private key or an
368
+ * OAuth token; these servers hold no secret at all — their access is the macOS
369
+ * permission the user granted.
370
+ */
371
+ const trimmed = (v) => {
372
+ const t = v?.trim();
373
+ return t ? t : void 0;
374
+ };
375
+ const parseBool = (v) => {
376
+ const t = trimmed(v)?.toLowerCase();
377
+ if (t === void 0) return void 0;
378
+ return t === "1" || t === "true" || t === "yes" || t === "on";
379
+ };
380
+ const parseIntOpt = (v) => {
381
+ const t = trimmed(v);
382
+ if (t === void 0) return void 0;
383
+ const n = Number(t);
384
+ return Number.isFinite(n) ? n : void 0;
385
+ };
386
+ const parseList = (v) => {
387
+ const t = trimmed(v);
388
+ if (t === void 0) return void 0;
389
+ return t.split(",").map((s) => s.trim()).filter(Boolean);
390
+ };
391
+ /**
392
+ * Settings every Apple-app server has. Extend it rather than repeating them:
393
+ *
394
+ * const ConfigSchema = BaseConfigSchema.extend({ ... }).strict();
395
+ */
396
+ const BaseConfigSchema = z.object({
397
+ allowWrites: z.boolean().default(false),
398
+ /**
399
+ * Register the workflow prompts and the surface resources.
400
+ *
401
+ * ON by default, unlike `allowWrites`, and the difference is the point: the
402
+ * write gate is a SAFETY invariant — off means a mutation cannot be reached
403
+ * even by name — while this is a COST knob, in the same family as
404
+ * `maxResults`. Conflating the two would muddy the one that matters.
405
+ *
406
+ * What it costs, measured across all seven servers with writes on: the
407
+ * prompt and resource listings come to ~3.4k tokens against ~18.5k for the
408
+ * tool definitions, so roughly 18% on top of a bill that is dominated by
409
+ * tools either way. Resource CONTENTS cost nothing until something reads
410
+ * them. The knob exists for hosts that put every listing in the prompt and
411
+ * for people counting bytes; if context is the problem, running fewer
412
+ * servers is the bigger lever by far.
413
+ *
414
+ * One flag for both, not two, because they ship as a pair: every prompt
415
+ * embeds its surface guide, and a prompt naming a `cupertino://…/guide` that
416
+ * nothing serves would be a dangling reference by configuration.
417
+ */
418
+ exposePrompts: z.boolean().default(true),
419
+ /**
420
+ * Serve a searchable index and a dispatcher instead of the full tool list.
421
+ *
422
+ * OFF by default, and a COST knob like `exposePrompts` above rather than a
423
+ * safety gate — but unlike that one it is a knob that TRADES. See
424
+ * `facade.ts` for the mechanism; the trade is that a host's permission rule
425
+ * stops naming the individual tool and starts naming a direction: one rule
426
+ * for this surface's reads, one for its writes.
427
+ *
428
+ * What it buys, measured with writes on: ~26.5k tokens of tool definitions
429
+ * across the eight servers becomes a handful per surface. What it costs
430
+ * besides the permission granularity is a round trip — a model must search
431
+ * before it can call.
432
+ *
433
+ * Worth switching on only for a client that does not already defer tool
434
+ * schemas itself. Claude Code and Claude Desktop do, and gain nothing here
435
+ * while paying both costs, which is why the app declines to write the flag
436
+ * into their config files at all.
437
+ */
438
+ lazyTools: z.boolean().default(false),
439
+ osascriptPath: z.string().default("/usr/bin/osascript"),
440
+ osascriptTimeoutMs: z.number().int().min(1e3).max(6e5).default(3e4),
441
+ maxResults: z.number().int().min(1).max(1e3).default(200)
442
+ });
443
+ /**
444
+ * Parse an env-derived object against a schema.
445
+ *
446
+ * Undefined values are dropped so zod's defaults apply, rather than failing on
447
+ * an explicitly-undefined key.
448
+ */
449
+ const parseConfig = (schema, raw) => {
450
+ const compacted = Object.fromEntries(Object.entries(raw).filter(([, v]) => v !== void 0));
451
+ const parsed = schema.safeParse(compacted);
452
+ if (!parsed.success) {
453
+ const issues = parsed.error.issues.map((i) => `${i.path.join(".")}: ${i.message}`).join("; ");
454
+ throw new Error(`Invalid configuration: ${issues}`);
455
+ }
456
+ return parsed.data;
457
+ };
458
+ //#endregion
361
459
  //#region src/listing.ts
362
460
  /**
363
461
  * Trimming the SDK's own boilerplate out of `tools/list`.
@@ -476,7 +574,7 @@ const withTrimmedListing = (transport) => {
476
574
  */
477
575
  const runStdioServer = async (opts) => {
478
576
  const { build, surface, logPrefix } = opts;
479
- const debugEnabled = Boolean(process.env[`${surface.envPrefix}_DEBUG`]);
577
+ const debugEnabled = parseBool(process.env[`${surface.envPrefix}_DEBUG`]) ?? false;
480
578
  const logger = {
481
579
  debug: (...args) => {
482
580
  if (debugEnabled) console.error(`[${logPrefix}]`, ...args);
@@ -500,6 +598,24 @@ const runStdioServer = async (opts) => {
500
598
  process.on("SIGTERM", () => shutdown("SIGTERM"));
501
599
  };
502
600
  //#endregion
601
+ //#region src/diagnostics.ts
602
+ const buildBaseDiagnostics = ({ build, config, allowWrites }) => ({
603
+ server: {
604
+ name: build.name,
605
+ version: build.version,
606
+ gitCommit: build.gitCommit,
607
+ node: process.version,
608
+ platform: process.platform
609
+ },
610
+ settings: {
611
+ allowWrites,
612
+ exposePrompts: config.exposePrompts,
613
+ lazyTools: config.lazyTools,
614
+ maxResults: config.maxResults,
615
+ ...config.indexMode === void 0 ? {} : { indexMode: config.indexMode }
616
+ }
617
+ });
618
+ //#endregion
503
619
  //#region src/codes.ts
504
620
  /**
505
621
  * One-time-code extraction, as a pure function over text.
@@ -759,102 +875,49 @@ const extractCode = (text, { fromShortcode = false } = {}) => {
759
875
  };
760
876
  };
761
877
  //#endregion
762
- //#region src/config.ts
878
+ //#region src/confine.ts
763
879
  /**
764
- * Environment parsing shared by every server.
880
+ * `realpath` for a directory that may not exist yet.
765
881
  *
766
- * Configuration is environment-only. The sibling servers that also read a
767
- * `~/.config/<service>/config.json` do so because they hold a private key or an
768
- * OAuth token; these servers hold no secret at all — their access is the macOS
769
- * permission the user granted.
882
+ * Resolving the deepest existing ancestor and re-joining what is left is what
883
+ * makes this usable before `mkdir`: a link anywhere in the existing part is
884
+ * followed, and the part that does not exist yet cannot be a link to anything.
770
885
  */
771
- const trimmed = (v) => {
772
- const t = v?.trim();
773
- return t ? t : void 0;
774
- };
775
- const parseBool = (v) => {
776
- const t = trimmed(v)?.toLowerCase();
777
- if (t === void 0) return void 0;
778
- return t === "1" || t === "true" || t === "yes" || t === "on";
779
- };
780
- const parseIntOpt = (v) => {
781
- const t = trimmed(v);
782
- if (t === void 0) return void 0;
783
- const n = Number(t);
784
- return Number.isFinite(n) ? n : void 0;
785
- };
786
- const parseList = (v) => {
787
- const t = trimmed(v);
788
- if (t === void 0) return void 0;
789
- return t.split(",").map((s) => s.trim()).filter(Boolean);
886
+ const realpathOfNearest = (path) => {
887
+ let current = resolve(path);
888
+ const trailing = [];
889
+ for (;;) try {
890
+ return join(realpathSync(current), ...trailing.toReversed());
891
+ } catch {
892
+ const parent = resolve(current, "..");
893
+ if (parent === current) return resolve(path);
894
+ trailing.push(basename(current));
895
+ current = parent;
896
+ }
790
897
  };
791
- /**
792
- * Settings every Apple-app server has. Extend it rather than repeating them:
793
- *
794
- * const ConfigSchema = BaseConfigSchema.extend({ ... }).strict();
795
- */
796
- const BaseConfigSchema = z.object({
797
- allowWrites: z.boolean().default(false),
798
- /**
799
- * Register the workflow prompts and the surface resources.
800
- *
801
- * ON by default, unlike `allowWrites`, and the difference is the point: the
802
- * write gate is a SAFETY invariant — off means a mutation cannot be reached
803
- * even by name — while this is a COST knob, in the same family as
804
- * `maxResults`. Conflating the two would muddy the one that matters.
805
- *
806
- * What it costs, measured across all seven servers with writes on: the
807
- * prompt and resource listings come to ~3.4k tokens against ~18.5k for the
808
- * tool definitions, so roughly 18% on top of a bill that is dominated by
809
- * tools either way. Resource CONTENTS cost nothing until something reads
810
- * them. The knob exists for hosts that put every listing in the prompt and
811
- * for people counting bytes; if context is the problem, running fewer
812
- * servers is the bigger lever by far.
813
- *
814
- * One flag for both, not two, because they ship as a pair: every prompt
815
- * embeds its surface guide, and a prompt naming a `cupertino://…/guide` that
816
- * nothing serves would be a dangling reference by configuration.
817
- */
818
- exposePrompts: z.boolean().default(true),
819
- /**
820
- * Serve a searchable index and a dispatcher instead of the full tool list.
821
- *
822
- * OFF by default, and a COST knob like `exposePrompts` above rather than a
823
- * safety gate — but unlike that one it is a knob that TRADES. See
824
- * `facade.ts` for the mechanism; the trade is that a host's permission rule
825
- * stops naming the individual tool and starts naming a direction: one rule
826
- * for this surface's reads, one for its writes.
827
- *
828
- * What it buys, measured with writes on: ~26.5k tokens of tool definitions
829
- * across the eight servers becomes a handful per surface. What it costs
830
- * besides the permission granularity is a round trip — a model must search
831
- * before it can call.
832
- *
833
- * Worth switching on only for a client that does not already defer tool
834
- * schemas itself. Claude Code and Claude Desktop do, and gain nothing here
835
- * while paying both costs, which is why the app declines to write the flag
836
- * into their config files at all.
837
- */
838
- lazyTools: z.boolean().default(false),
839
- debug: z.boolean().default(false),
840
- osascriptPath: z.string().default("/usr/bin/osascript"),
841
- osascriptTimeoutMs: z.number().int().min(1e3).max(6e5).default(3e4),
842
- maxResults: z.number().int().min(1).max(1e3).default(200)
843
- });
844
- /**
845
- * Parse an env-derived object against a schema.
846
- *
847
- * Undefined values are dropped so zod's defaults apply, rather than failing on
848
- * an explicitly-undefined key.
849
- */
850
- const parseConfig = (schema, raw) => {
851
- const compacted = Object.fromEntries(Object.entries(raw).filter(([, v]) => v !== void 0));
852
- const parsed = schema.safeParse(compacted);
853
- if (!parsed.success) {
854
- const issues = parsed.error.issues.map((i) => `${i.path.join(".")}: ${i.message}`).join("; ");
855
- throw new Error(`Invalid configuration: ${issues}`);
898
+ const writeConfinedFile = ({ root, directory, name, bytes, overwrite = false, settingName }) => {
899
+ const confinement = realpathOfNearest(root);
900
+ const requested = directory ? resolve(confinement, directory) : confinement;
901
+ const dir = realpathOfNearest(requested);
902
+ if (dir !== confinement && !dir.startsWith(confinement + sep)) throw new PreconditionError(`Refusing to write outside ${confinement}. Set ${settingName} to change the destination.`);
903
+ const leaf = basename(name);
904
+ const target = resolve(join(dir, leaf));
905
+ if (target !== join(dir, leaf) || !target.startsWith(dir + sep)) throw new PreconditionError(`Refusing to write outside ${dir}.`);
906
+ const data = typeof bytes === "function" ? bytes() : bytes;
907
+ mkdirSync(dir, { recursive: true });
908
+ try {
909
+ writeFileSync(target, data, {
910
+ mode: 384,
911
+ flag: overwrite ? "w" : "wx"
912
+ });
913
+ } catch (error) {
914
+ if (error.code === "EEXIST") throw new PreconditionError(`${target} already exists; refusing to overwrite it.`);
915
+ throw error;
856
916
  }
857
- return parsed.data;
917
+ return {
918
+ path: target,
919
+ bytes: data.length
920
+ };
858
921
  };
859
922
  //#endregion
860
923
  //#region src/dates.ts
@@ -1697,7 +1760,8 @@ const withBusyRetry = async (fn, delayMs = 1500) => {
1697
1760
  * - `diagnostics` is the live capability report.
1698
1761
  * - `inventory` is the set of containers you address by name: accounts, and
1699
1762
  * whatever the surface calls its folders. Surfaces with no such containers
1700
- * (Messages, Safari) register two resources rather than inventing a third.
1763
+ * (Contacts, Messages, Safari, Maps) register two resources rather than
1764
+ * inventing a third.
1701
1765
  */
1702
1766
  const RESOURCE_SCHEME = "cupertino";
1703
1767
  /** `cupertino://mail/guide`. The one place this string is built. */
@@ -1928,16 +1992,11 @@ const fingerprintSchema = (db) => {
1928
1992
  const ddl = db.prepare("SELECT sql FROM sqlite_master WHERE sql IS NOT NULL ORDER BY type, name").all();
1929
1993
  return createHash("sha256").update(ddl.map((r) => r.sql).join("\n")).digest("hex").slice(0, 12);
1930
1994
  };
1931
- /**
1932
- * Work out whether a timestamp column is Unix seconds or Core Data seconds by
1933
- * seeing which reading lands near today. Two independent prior-art projects
1934
- * disagree about this for Mail, and hardcoding the wrong one puts every date 31
1935
- * years out — a bug that looks like corruption rather than a unit mismatch.
1936
- */
1937
1995
  const detectEpoch = (maxTimestamp, now = Date.now()) => {
1938
1996
  if (maxTimestamp === null || !Number.isFinite(maxTimestamp) || maxTimestamp <= 0) return {
1939
1997
  offset: 0,
1940
- reason: "no dated rows; assuming unix seconds"
1998
+ reason: "no dated rows; assuming unix seconds",
1999
+ confident: false
1941
2000
  };
1942
2001
  const nowSec = now / 1e3;
1943
2002
  const tenYears = 315576e3;
@@ -1945,15 +2004,18 @@ const detectEpoch = (maxTimestamp, now = Date.now()) => {
1945
2004
  const asCoreData = Math.abs(nowSec - (maxTimestamp + CORE_DATA_EPOCH_OFFSET));
1946
2005
  if (asUnix < tenYears && asUnix <= asCoreData) return {
1947
2006
  offset: 0,
1948
- reason: "raw value lands within 10 years of now"
2007
+ reason: "raw value lands within 10 years of now",
2008
+ confident: true
1949
2009
  };
1950
2010
  if (asCoreData < tenYears) return {
1951
2011
  offset: CORE_DATA_EPOCH_OFFSET,
1952
- reason: "value + 978307200 lands within 10 years of now"
2012
+ reason: "value + 978307200 lands within 10 years of now",
2013
+ confident: true
1953
2014
  };
1954
2015
  return {
1955
2016
  offset: 0,
1956
- reason: `neither epoch lands near now (max=${maxTimestamp}); assuming unix`
2017
+ reason: `neither epoch lands near now (max=${maxTimestamp}); assuming unix`,
2018
+ confident: false
1957
2019
  };
1958
2020
  };
1959
2021
  //#endregion
@@ -1997,6 +2059,6 @@ const openReadOnly = (path, mode, opts = {}) => {
1997
2059
  throw new IndexUnavailableError(`Could not open ${opts.label ?? path} at ${path}: ${message}.${opts.hint ? ` ${opts.hint}` : ""}`);
1998
2060
  };
1999
2061
  //#endregion
2000
- export { AppBusyError, AppNotRunningError, AppleAutomationError, AxChannelError, BaseConfigSchema, CORE_DATA_EPOCH_OFFSET, IndexUnavailableError, InvalidDateError, OsascriptTimeoutError, PlatformError, PreconditionError, ProtocolError, RESOURCE_SCHEME, SchemaDriftError, TccDeniedError, WritesDisabledError, addLocalDays, assertStaticScript, columnsOf, compact, confirmArg, createOsascriptRunner, describeAggregation, describeStore, detectEpoch, endOfLocalDay, escapeLike, extractCode, fail, fingerprintSchema, groupByArg, inspectFile, interferenceNote, limitArg, mapOsaError, ok, okText, openAxChannel, openReadOnly, parseBool, parseBound, parseConfig, parseDate, parseIntOpt, parseList, project, promptArg, readPackageIdentity, registerSurfaceResources, registerWorkflowPrompt, requiredPromptArg, resolveLimit, runStdioServer, selectArg, startOfLocalDay, surfaceUri, tableMap, toFailure, toFileUri, toLocalIso, trimToolListing, trimmed, watchInterference, withBusyRetry, withLazyTools, withTrimmedListing, wrap, wrapResult };
2062
+ export { AppBusyError, AppNotRunningError, AppleAutomationError, AxChannelError, BaseConfigSchema, CORE_DATA_EPOCH_OFFSET, IndexUnavailableError, InvalidDateError, OsascriptTimeoutError, PlatformError, PreconditionError, ProtocolError, RESOURCE_SCHEME, SchemaDriftError, TccDeniedError, WritesDisabledError, addLocalDays, assertStaticScript, buildBaseDiagnostics, columnsOf, compact, confirmArg, createOsascriptRunner, describeAggregation, describeStore, detectEpoch, endOfLocalDay, escapeLike, extractCode, fail, fingerprintSchema, groupByArg, inspectFile, interferenceNote, limitArg, mapOsaError, ok, okText, openAxChannel, openReadOnly, parseBool, parseBound, parseConfig, parseDate, parseIntOpt, parseList, project, promptArg, readPackageIdentity, registerSurfaceResources, registerWorkflowPrompt, requiredPromptArg, resolveLimit, runStdioServer, selectArg, startOfLocalDay, surfaceUri, tableMap, toFailure, toFileUri, toLocalIso, trimToolListing, trimmed, watchInterference, withBusyRetry, withLazyTools, withTrimmedListing, wrap, wrapResult, writeConfinedFile };
2001
2063
 
2002
2064
  //# sourceMappingURL=index.js.map