tandem-editor 0.7.0 → 0.7.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/dist/channel/index.js +0 -0
- package/dist/cli/index.js +56 -12
- package/dist/cli/index.js.map +1 -1
- package/dist/client/assets/index-DLTxaDBk.js +351 -0
- package/dist/client/index.html +1 -1
- package/dist/server/index.js +52 -7
- package/dist/server/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/client/assets/index-B1Cd5UGT.js +0 -349
package/dist/client/index.html
CHANGED
package/dist/server/index.js
CHANGED
|
@@ -113780,7 +113780,7 @@ init_annotations();
|
|
|
113780
113780
|
// src/cli/setup.ts
|
|
113781
113781
|
init_constants();
|
|
113782
113782
|
import { randomUUID as randomUUID5 } from "crypto";
|
|
113783
|
-
import { existsSync, readFileSync as readFileSync2 } from "fs";
|
|
113783
|
+
import { existsSync, readdirSync, readFileSync as readFileSync2 } from "fs";
|
|
113784
113784
|
import { copyFile, mkdir, rename, unlink, writeFile } from "fs/promises";
|
|
113785
113785
|
import { homedir as homedir2 } from "os";
|
|
113786
113786
|
import { basename, dirname as dirname2, join as join2, resolve as resolve3 } from "path";
|
|
@@ -113800,9 +113800,23 @@ var PACKAGE_ROOT = resolve3(__dirname2, "../..");
|
|
|
113800
113800
|
var CHANNEL_DIST = resolve3(PACKAGE_ROOT, "dist/channel/index.js");
|
|
113801
113801
|
var MCP_URL = `http://localhost:${DEFAULT_MCP_PORT}`;
|
|
113802
113802
|
function buildMcpEntries(channelPath, opts = {}) {
|
|
113803
|
-
const
|
|
113804
|
-
|
|
113805
|
-
|
|
113803
|
+
const isDesktop = opts.targetKind === "claude-desktop";
|
|
113804
|
+
let tandemEntry;
|
|
113805
|
+
if (isDesktop) {
|
|
113806
|
+
const env3 = { TANDEM_URL: MCP_URL };
|
|
113807
|
+
if (opts.token) {
|
|
113808
|
+
env3.TANDEM_AUTH_TOKEN = opts.token;
|
|
113809
|
+
}
|
|
113810
|
+
tandemEntry = {
|
|
113811
|
+
command: "npx",
|
|
113812
|
+
args: ["-y", "tandem-editor", "mcp-stdio"],
|
|
113813
|
+
env: env3
|
|
113814
|
+
};
|
|
113815
|
+
} else {
|
|
113816
|
+
tandemEntry = { type: "http", url: `${MCP_URL}/mcp` };
|
|
113817
|
+
if (opts.token) {
|
|
113818
|
+
tandemEntry.headers = { Authorization: `Bearer ${opts.token}` };
|
|
113819
|
+
}
|
|
113806
113820
|
}
|
|
113807
113821
|
const entries = { tandem: tandemEntry };
|
|
113808
113822
|
if (opts.withChannelShim) {
|
|
@@ -113824,7 +113838,7 @@ function detectTargets(opts = {}) {
|
|
|
113824
113838
|
const claudeCodeConfig = join2(home, ".claude.json");
|
|
113825
113839
|
const claudeCodeDir = join2(home, ".claude");
|
|
113826
113840
|
if (opts.force || existsSync(claudeCodeConfig) || existsSync(claudeCodeDir)) {
|
|
113827
|
-
targets.push({ label: "Claude Code", configPath: claudeCodeConfig });
|
|
113841
|
+
targets.push({ label: "Claude Code", configPath: claudeCodeConfig, kind: "claude-code" });
|
|
113828
113842
|
}
|
|
113829
113843
|
let desktopConfig = null;
|
|
113830
113844
|
if (process.platform === "win32") {
|
|
@@ -113842,7 +113856,33 @@ function detectTargets(opts = {}) {
|
|
|
113842
113856
|
desktopConfig = join2(home, ".config", "claude", "claude_desktop_config.json");
|
|
113843
113857
|
}
|
|
113844
113858
|
if (desktopConfig && (opts.force || existsSync(desktopConfig))) {
|
|
113845
|
-
targets.push({ label: "Claude Desktop", configPath: desktopConfig });
|
|
113859
|
+
targets.push({ label: "Claude Desktop", configPath: desktopConfig, kind: "claude-desktop" });
|
|
113860
|
+
}
|
|
113861
|
+
if (process.platform === "win32") {
|
|
113862
|
+
const localAppData = opts.localAppDataOverride ?? process.env.LOCALAPPDATA ?? join2(home, "AppData", "Local");
|
|
113863
|
+
const packagesDir = join2(localAppData, "Packages");
|
|
113864
|
+
try {
|
|
113865
|
+
const entries = readdirSync(packagesDir);
|
|
113866
|
+
for (const pkg of entries.filter((n) => n.startsWith("Claude_"))) {
|
|
113867
|
+
const msixConfig = join2(
|
|
113868
|
+
packagesDir,
|
|
113869
|
+
pkg,
|
|
113870
|
+
"LocalCache",
|
|
113871
|
+
"Roaming",
|
|
113872
|
+
"Claude",
|
|
113873
|
+
"claude_desktop_config.json"
|
|
113874
|
+
);
|
|
113875
|
+
if (opts.force || existsSync(msixConfig)) {
|
|
113876
|
+
const suffix = entries.filter((n) => n.startsWith("Claude_")).length > 1 ? ` (${pkg.slice(0, 12)}\u2026)` : "";
|
|
113877
|
+
targets.push({
|
|
113878
|
+
label: `Claude Desktop MSIX${suffix}`,
|
|
113879
|
+
configPath: msixConfig,
|
|
113880
|
+
kind: "claude-desktop"
|
|
113881
|
+
});
|
|
113882
|
+
}
|
|
113883
|
+
}
|
|
113884
|
+
} catch {
|
|
113885
|
+
}
|
|
113846
113886
|
}
|
|
113847
113887
|
return targets;
|
|
113848
113888
|
}
|
|
@@ -114157,10 +114197,15 @@ async function runSetupHandler(input, homeOverride, token) {
|
|
|
114157
114197
|
};
|
|
114158
114198
|
}
|
|
114159
114199
|
const targets = detectTargets({ homeOverride });
|
|
114160
|
-
const entries = buildMcpEntries(channelPath, { withChannelShim: true, nodeBinary, token });
|
|
114161
114200
|
const configured = [];
|
|
114162
114201
|
const errors = [];
|
|
114163
114202
|
for (const target of targets) {
|
|
114203
|
+
const entries = buildMcpEntries(channelPath, {
|
|
114204
|
+
withChannelShim: true,
|
|
114205
|
+
nodeBinary,
|
|
114206
|
+
token,
|
|
114207
|
+
targetKind: target.kind
|
|
114208
|
+
});
|
|
114164
114209
|
try {
|
|
114165
114210
|
await applyConfig(target.configPath, entries);
|
|
114166
114211
|
configured.push(target.label);
|