apple-numbers-mcp 1.1.12 → 1.1.13
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/build/index.js +28 -4
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -22116,8 +22116,32 @@ function withErrorHandling(handler, prefix) {
|
|
|
22116
22116
|
}
|
|
22117
22117
|
|
|
22118
22118
|
// src/tools/doctor.ts
|
|
22119
|
+
import { execFileSync as execFileSync3 } from "node:child_process";
|
|
22119
22120
|
import { existsSync as existsSync3 } from "node:fs";
|
|
22120
|
-
var NUMBERS_APP_PATHS = [
|
|
22121
|
+
var NUMBERS_APP_PATHS = [
|
|
22122
|
+
"/Applications/Numbers.app",
|
|
22123
|
+
"/System/Applications/Numbers.app",
|
|
22124
|
+
"/Applications/Numbers Creator Studio.app",
|
|
22125
|
+
"/System/Applications/Numbers Creator Studio.app"
|
|
22126
|
+
];
|
|
22127
|
+
var NUMBERS_BUNDLE_IDS = ["com.apple.Numbers", "com.apple.iWork.Numbers"];
|
|
22128
|
+
function findNumbersApp() {
|
|
22129
|
+
const byPath = NUMBERS_APP_PATHS.find((p) => existsSync3(p));
|
|
22130
|
+
if (byPath) return byPath;
|
|
22131
|
+
for (const id of NUMBERS_BUNDLE_IDS) {
|
|
22132
|
+
try {
|
|
22133
|
+
const out = execFileSync3(
|
|
22134
|
+
"osascript",
|
|
22135
|
+
["-e", `POSIX path of (path to application id "${id}")`],
|
|
22136
|
+
{ encoding: "utf8", timeout: 5e3, stdio: ["ignore", "pipe", "ignore"] }
|
|
22137
|
+
).trim();
|
|
22138
|
+
const path = out.endsWith("/") ? out.slice(0, -1) : out;
|
|
22139
|
+
if (path && existsSync3(path)) return path;
|
|
22140
|
+
} catch {
|
|
22141
|
+
}
|
|
22142
|
+
}
|
|
22143
|
+
return null;
|
|
22144
|
+
}
|
|
22121
22145
|
function runDoctor(_manager) {
|
|
22122
22146
|
const checks = [];
|
|
22123
22147
|
try {
|
|
@@ -22159,18 +22183,18 @@ function runDoctor(_manager) {
|
|
|
22159
22183
|
});
|
|
22160
22184
|
}
|
|
22161
22185
|
try {
|
|
22162
|
-
const found =
|
|
22186
|
+
const found = findNumbersApp();
|
|
22163
22187
|
if (found) {
|
|
22164
22188
|
checks.push({
|
|
22165
22189
|
name: "numbers_app",
|
|
22166
22190
|
status: "ok",
|
|
22167
|
-
detail: `Numbers
|
|
22191
|
+
detail: `Numbers present \u2014 formula and formatting tools available (${found})`
|
|
22168
22192
|
});
|
|
22169
22193
|
} else {
|
|
22170
22194
|
checks.push({
|
|
22171
22195
|
name: "numbers_app",
|
|
22172
22196
|
status: "warn",
|
|
22173
|
-
detail: "Numbers
|
|
22197
|
+
detail: "Numbers not found. Reads, exports and value/structure writes via numbers-parser still work; only the formula and formatting tools (set-formula(s), set-cell(s)-style, set-column-width/set-row-height, merge-cells/unmerge-cells) need Numbers installed."
|
|
22174
22198
|
});
|
|
22175
22199
|
}
|
|
22176
22200
|
} catch (e) {
|
package/package.json
CHANGED