syntaur 0.1.11 → 0.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/dist/dashboard/server.d.ts +2 -0
- package/dist/dashboard/server.js +3 -8
- package/dist/dashboard/server.js.map +1 -1
- package/dist/index.js +32 -35
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3921,9 +3921,9 @@ async function initCommand(options) {
|
|
|
3921
3921
|
console.log("\nSyntaur initialized successfully.");
|
|
3922
3922
|
}
|
|
3923
3923
|
async function seedDefaultPlaybooks(playbooksDir2) {
|
|
3924
|
-
const
|
|
3925
|
-
const
|
|
3926
|
-
const examplesDir = resolve3(
|
|
3924
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
3925
|
+
const packageRoot = resolve3(dirname2(__filename), "..");
|
|
3926
|
+
const examplesDir = resolve3(packageRoot, "examples", "playbooks");
|
|
3927
3927
|
if (!await fileExists(examplesDir)) return 0;
|
|
3928
3928
|
const entries = await readdir2(examplesDir, { withFileTypes: true });
|
|
3929
3929
|
let count = 0;
|
|
@@ -4907,17 +4907,16 @@ Use --slug to specify a different slug.`
|
|
|
4907
4907
|
init_config2();
|
|
4908
4908
|
import { spawn } from "child_process";
|
|
4909
4909
|
import { createServer as createNetServer } from "net";
|
|
4910
|
-
import { resolve as resolve18, dirname as
|
|
4911
|
-
import { fileURLToPath as
|
|
4910
|
+
import { resolve as resolve18, dirname as dirname4 } from "path";
|
|
4911
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
4912
4912
|
|
|
4913
4913
|
// src/dashboard/server.ts
|
|
4914
4914
|
init_api();
|
|
4915
4915
|
import express from "express";
|
|
4916
4916
|
import { createServer } from "http";
|
|
4917
|
-
import { resolve as resolve17
|
|
4917
|
+
import { resolve as resolve17 } from "path";
|
|
4918
4918
|
import { homedir as homedir2 } from "os";
|
|
4919
4919
|
import { writeFile as writeFile3, unlink as unlink3 } from "fs/promises";
|
|
4920
|
-
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
4921
4920
|
import { WebSocketServer, WebSocket } from "ws";
|
|
4922
4921
|
|
|
4923
4922
|
// src/dashboard/watcher.ts
|
|
@@ -7078,11 +7077,8 @@ async function reconcile(serversDir2, missionsDir, excludePids) {
|
|
|
7078
7077
|
}
|
|
7079
7078
|
|
|
7080
7079
|
// src/dashboard/server.ts
|
|
7081
|
-
var __filename = fileURLToPath2(import.meta.url);
|
|
7082
|
-
var __dirname = dirname4(__filename);
|
|
7083
|
-
var packageRoot = resolve17(__dirname, "..", "..");
|
|
7084
7080
|
function createDashboardServer(options) {
|
|
7085
|
-
const { port, missionsDir, serversDir: serversDir2, playbooksDir: playbooksDir2, todosDir: todosDir2, serveStaticUi } = options;
|
|
7081
|
+
const { port, missionsDir, serversDir: serversDir2, playbooksDir: playbooksDir2, todosDir: todosDir2, serveStaticUi, dashboardDistPath } = options;
|
|
7086
7082
|
const app = express();
|
|
7087
7083
|
const server = createServer(app);
|
|
7088
7084
|
const wss = new WebSocketServer({ noServer: true });
|
|
@@ -7303,8 +7299,7 @@ function createDashboardServer(options) {
|
|
|
7303
7299
|
app.use("/api/agent-sessions", createAgentSessionsRouter(missionsDir, broadcast));
|
|
7304
7300
|
app.use("/api/playbooks", createPlaybooksRouter(playbooksDir2));
|
|
7305
7301
|
app.use("/api/todos", createTodosRouter(todosDir2, broadcast));
|
|
7306
|
-
if (serveStaticUi) {
|
|
7307
|
-
const dashboardDistPath = resolve17(packageRoot, "dashboard", "dist");
|
|
7302
|
+
if (serveStaticUi && dashboardDistPath) {
|
|
7308
7303
|
app.use(express.static(dashboardDistPath));
|
|
7309
7304
|
app.get("{*path}", async (_req, res) => {
|
|
7310
7305
|
const indexPath = resolve17(dashboardDistPath, "index.html");
|
|
@@ -7434,20 +7429,22 @@ async function dashboardCommand(options) {
|
|
|
7434
7429
|
}
|
|
7435
7430
|
port = availablePort;
|
|
7436
7431
|
}
|
|
7432
|
+
const thisFile = fileURLToPath2(import.meta.url);
|
|
7433
|
+
const packageRoot = resolve18(dirname4(thisFile), "..");
|
|
7434
|
+
const dashboardDist = resolve18(packageRoot, "dashboard", "dist");
|
|
7437
7435
|
const server = createDashboardServer({
|
|
7438
7436
|
port,
|
|
7439
7437
|
missionsDir,
|
|
7440
7438
|
serversDir: serversDir(),
|
|
7441
7439
|
playbooksDir: playbooksDir(),
|
|
7442
7440
|
todosDir: todosDir(),
|
|
7443
|
-
serveStaticUi: mode === "static"
|
|
7441
|
+
serveStaticUi: mode === "static",
|
|
7442
|
+
dashboardDistPath: dashboardDist
|
|
7444
7443
|
});
|
|
7445
7444
|
await server.start();
|
|
7446
7445
|
let viteProcess = null;
|
|
7447
7446
|
if (mode === "dev") {
|
|
7448
|
-
const
|
|
7449
|
-
const packageRoot2 = resolve18(dirname5(thisFile), "..");
|
|
7450
|
-
const dashboardDir = resolve18(packageRoot2, "dashboard");
|
|
7447
|
+
const dashboardDir = resolve18(packageRoot, "dashboard");
|
|
7451
7448
|
const viteBin = resolve18(dashboardDir, "node_modules", ".bin", "vite");
|
|
7452
7449
|
if (!await fileExists(viteBin)) {
|
|
7453
7450
|
console.error(
|
|
@@ -7815,14 +7812,14 @@ import {
|
|
|
7815
7812
|
} from "fs/promises";
|
|
7816
7813
|
import { existsSync } from "fs";
|
|
7817
7814
|
import { homedir as homedir3 } from "os";
|
|
7818
|
-
import { basename, dirname as
|
|
7815
|
+
import { basename, dirname as dirname6, isAbsolute as isAbsolute2, relative as relative2, resolve as resolve28 } from "path";
|
|
7819
7816
|
|
|
7820
7817
|
// src/utils/package-root.ts
|
|
7821
7818
|
init_fs();
|
|
7822
|
-
import { dirname as
|
|
7823
|
-
import { fileURLToPath as
|
|
7819
|
+
import { dirname as dirname5, resolve as resolve27 } from "path";
|
|
7820
|
+
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
7824
7821
|
async function findPackageRoot(expectedRelativePath) {
|
|
7825
|
-
let currentDir =
|
|
7822
|
+
let currentDir = dirname5(fileURLToPath3(import.meta.url));
|
|
7826
7823
|
while (true) {
|
|
7827
7824
|
const candidate = resolve27(currentDir, expectedRelativePath);
|
|
7828
7825
|
if (await fileExists(candidate)) {
|
|
@@ -7866,8 +7863,8 @@ function getClaudeInstalledPluginsPath() {
|
|
|
7866
7863
|
function getInstallMarkerPath(targetDir) {
|
|
7867
7864
|
return resolve28(targetDir, INSTALL_MARKER_FILENAME);
|
|
7868
7865
|
}
|
|
7869
|
-
async function readPackageManifest(
|
|
7870
|
-
const raw = await readFile12(resolve28(
|
|
7866
|
+
async function readPackageManifest(packageRoot) {
|
|
7867
|
+
const raw = await readFile12(resolve28(packageRoot, "package.json"), "utf-8");
|
|
7871
7868
|
return JSON.parse(raw);
|
|
7872
7869
|
}
|
|
7873
7870
|
async function readJsonFileIfExists(pathValue) {
|
|
@@ -7914,7 +7911,7 @@ async function getInstallStatus(targetDir, pluginKind) {
|
|
|
7914
7911
|
const info = await lstat(targetDir);
|
|
7915
7912
|
if (info.isSymbolicLink()) {
|
|
7916
7913
|
const symlinkTarget = await readlink(targetDir);
|
|
7917
|
-
const resolvedTarget = resolve28(
|
|
7914
|
+
const resolvedTarget = resolve28(dirname6(targetDir), symlinkTarget);
|
|
7918
7915
|
const manifestName2 = await readPluginManifestName(resolvedTarget, pluginKind);
|
|
7919
7916
|
return {
|
|
7920
7917
|
exists: true,
|
|
@@ -7951,15 +7948,15 @@ async function writeInstallMetadata(targetDir, pluginKind, installMode, packageM
|
|
|
7951
7948
|
);
|
|
7952
7949
|
}
|
|
7953
7950
|
async function installCopy(paths, pluginKind) {
|
|
7954
|
-
await ensureDir(
|
|
7951
|
+
await ensureDir(dirname6(paths.targetDir));
|
|
7955
7952
|
await cp(paths.sourceDir, paths.targetDir, { recursive: true });
|
|
7956
7953
|
const packageManifest = await readPackageManifest(paths.packageRoot);
|
|
7957
7954
|
await writeInstallMetadata(paths.targetDir, pluginKind, "copy", packageManifest);
|
|
7958
7955
|
}
|
|
7959
7956
|
async function installLink(paths) {
|
|
7960
|
-
await ensureDir(
|
|
7957
|
+
await ensureDir(dirname6(paths.targetDir));
|
|
7961
7958
|
await rm2(paths.targetDir, { recursive: true, force: true });
|
|
7962
|
-
await ensureDir(
|
|
7959
|
+
await ensureDir(dirname6(paths.targetDir));
|
|
7963
7960
|
await symlink(resolve28(paths.sourceDir), paths.targetDir, "dir");
|
|
7964
7961
|
}
|
|
7965
7962
|
async function removeInstallMarker(targetDir) {
|
|
@@ -7977,10 +7974,10 @@ function normalizeAbsoluteInstallPath(pathValue, label) {
|
|
|
7977
7974
|
return resolve28(expanded);
|
|
7978
7975
|
}
|
|
7979
7976
|
async function resolvePluginPaths(pluginKind, targetDir) {
|
|
7980
|
-
const
|
|
7977
|
+
const packageRoot = await findPackageRoot(getPluginRelativePath(pluginKind));
|
|
7981
7978
|
return {
|
|
7982
|
-
packageRoot
|
|
7983
|
-
sourceDir: resolve28(
|
|
7979
|
+
packageRoot,
|
|
7980
|
+
sourceDir: resolve28(packageRoot, getPluginRelativePath(pluginKind)),
|
|
7984
7981
|
targetDir: targetDir ?? getDefaultPluginTargetDir(pluginKind)
|
|
7985
7982
|
};
|
|
7986
7983
|
}
|
|
@@ -8014,7 +8011,7 @@ async function readClaudeMarketplaceFile(manifestPath) {
|
|
|
8014
8011
|
};
|
|
8015
8012
|
}
|
|
8016
8013
|
async function writeClaudeMarketplaceFile(manifestPath, marketplace) {
|
|
8017
|
-
await ensureDir(
|
|
8014
|
+
await ensureDir(dirname6(manifestPath));
|
|
8018
8015
|
await writeFile4(manifestPath, `${JSON.stringify(marketplace, null, 2)}
|
|
8019
8016
|
`, "utf-8");
|
|
8020
8017
|
}
|
|
@@ -8149,11 +8146,11 @@ async function getPreferredClaudeMarketplace() {
|
|
|
8149
8146
|
}
|
|
8150
8147
|
async function detectClaudeMarketplaceForTarget(targetDir) {
|
|
8151
8148
|
const normalizedTargetDir = normalizeAbsoluteInstallPath(targetDir, "Claude plugin target");
|
|
8152
|
-
const pluginsDir =
|
|
8149
|
+
const pluginsDir = dirname6(normalizedTargetDir);
|
|
8153
8150
|
if (basename(pluginsDir) !== "plugins") {
|
|
8154
8151
|
return null;
|
|
8155
8152
|
}
|
|
8156
|
-
const rootDir =
|
|
8153
|
+
const rootDir = dirname6(pluginsDir);
|
|
8157
8154
|
const manifestPath = resolve28(rootDir, ".claude-plugin", "marketplace.json");
|
|
8158
8155
|
if (!await fileExists(manifestPath)) {
|
|
8159
8156
|
return null;
|
|
@@ -8319,7 +8316,7 @@ async function installManagedPlugin(options) {
|
|
|
8319
8316
|
};
|
|
8320
8317
|
}
|
|
8321
8318
|
function buildMarketplaceSourcePath(pluginTargetDir, marketplacePath) {
|
|
8322
|
-
const relPath = relative2(
|
|
8319
|
+
const relPath = relative2(dirname6(marketplacePath), pluginTargetDir).replaceAll("\\", "/");
|
|
8323
8320
|
if (relPath === "") {
|
|
8324
8321
|
return ".";
|
|
8325
8322
|
}
|
|
@@ -8356,7 +8353,7 @@ async function readMarketplaceFile(marketplacePath) {
|
|
|
8356
8353
|
};
|
|
8357
8354
|
}
|
|
8358
8355
|
async function writeMarketplaceFile(marketplacePath, marketplace) {
|
|
8359
|
-
await ensureDir(
|
|
8356
|
+
await ensureDir(dirname6(marketplacePath));
|
|
8360
8357
|
await writeFile4(marketplacePath, `${JSON.stringify(marketplace, null, 2)}
|
|
8361
8358
|
`, "utf-8");
|
|
8362
8359
|
}
|