tisty-mcp 1.0.0 → 1.0.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/package.json +1 -1
- package/server/launch.mjs +14 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tisty-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Starts the MCP server of the Tisty app installed on this computer: notes, documents and tasks as plain Markdown on your own disk.",
|
|
5
5
|
"mcpName": "io.github.rgdevment/tisty",
|
|
6
6
|
"type": "module",
|
package/server/launch.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { spawn, spawnSync } from "node:child_process";
|
|
2
|
-
import { readFileSync } from "node:fs";
|
|
2
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { createInterface } from "node:readline";
|
|
@@ -8,11 +8,22 @@ export const INSTALL = "https://www.tisty.app/docs/installation/";
|
|
|
8
8
|
const { version: VERSION } = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
9
9
|
|
|
10
10
|
/** Where a Tisty install leaves its `tisty` command, most likely first; TISTY_PATH alone when it is set. */
|
|
11
|
-
export function places({
|
|
11
|
+
export function places({
|
|
12
|
+
env = process.env,
|
|
13
|
+
platform = process.platform,
|
|
14
|
+
home = homedir(),
|
|
15
|
+
windowsLocal,
|
|
16
|
+
exists = existsSync,
|
|
17
|
+
} = {}) {
|
|
12
18
|
if (env.TISTY_PATH) return [env.TISTY_PATH];
|
|
13
19
|
const paths = platform === "win32" ? path.win32 : path.posix;
|
|
20
|
+
// A PATH holds dozens of folders; asking only where a file is spares a process per folder at every start.
|
|
14
21
|
const onPath = (name) =>
|
|
15
|
-
(env.PATH ?? env.Path ?? "")
|
|
22
|
+
(env.PATH ?? env.Path ?? "")
|
|
23
|
+
.split(paths.delimiter)
|
|
24
|
+
.filter(Boolean)
|
|
25
|
+
.map((dir) => paths.join(dir, name))
|
|
26
|
+
.filter((file) => exists(file));
|
|
16
27
|
let found = [];
|
|
17
28
|
if (platform === "win32") {
|
|
18
29
|
const local = env.LOCALAPPDATA ?? path.win32.join(home, "AppData", "Local");
|