@a-company/paradigm 3.25.2 → 3.28.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/conductor-HLWYWUVH.js +88 -0
- package/dist/index.js +4 -0
- package/dist/mcp.js +320 -19
- package/dist/university-ui/assets/{index-BPzqnvrg.js → index-TcsCEBMo.js} +2 -2
- package/dist/university-ui/assets/{index-BPzqnvrg.js.map → index-TcsCEBMo.js.map} +1 -1
- package/dist/university-ui/index.html +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
log
|
|
4
|
+
} from "./chunk-4NCFWYGG.js";
|
|
5
|
+
import "./chunk-ZXMDA7VB.js";
|
|
6
|
+
|
|
7
|
+
// src/commands/conductor.ts
|
|
8
|
+
import { execSync, spawn } from "child_process";
|
|
9
|
+
import * as fs from "fs";
|
|
10
|
+
import * as path from "path";
|
|
11
|
+
import { fileURLToPath } from "url";
|
|
12
|
+
import chalk from "chalk";
|
|
13
|
+
var __filename = fileURLToPath(import.meta.url);
|
|
14
|
+
var __dirname = path.dirname(__filename);
|
|
15
|
+
async function conductorCommand(options) {
|
|
16
|
+
const cmdLog = log.command("conductor");
|
|
17
|
+
const conductorDir = findConductorDir();
|
|
18
|
+
if (!conductorDir) {
|
|
19
|
+
cmdLog.error("Could not locate packages/conductor/");
|
|
20
|
+
console.log(chalk.gray(" Ensure the Paradigm monorepo is intact."));
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
const buildDir = path.join(conductorDir, ".build", "release");
|
|
24
|
+
const binaryPath = path.join(buildDir, "conductor");
|
|
25
|
+
const needsBuild = options.build || !fs.existsSync(binaryPath);
|
|
26
|
+
if (needsBuild) {
|
|
27
|
+
cmdLog.info("Building Conductor\u2026");
|
|
28
|
+
try {
|
|
29
|
+
const buildCmd = "swift build -c release";
|
|
30
|
+
execSync(buildCmd, {
|
|
31
|
+
cwd: conductorDir,
|
|
32
|
+
stdio: options.verbose ? "inherit" : "pipe"
|
|
33
|
+
});
|
|
34
|
+
cmdLog.success("Build complete");
|
|
35
|
+
} catch (error) {
|
|
36
|
+
cmdLog.error("Build failed");
|
|
37
|
+
const errMsg = error.message || "";
|
|
38
|
+
if (errMsg.includes("xcode-select")) {
|
|
39
|
+
console.log(chalk.gray(" Xcode Command Line Tools are required."));
|
|
40
|
+
console.log(chalk.gray(" Install with: xcode-select --install"));
|
|
41
|
+
} else {
|
|
42
|
+
console.log(chalk.gray(` ${errMsg.slice(0, 200)}`));
|
|
43
|
+
}
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
cmdLog.info("Launching Conductor\u2026");
|
|
48
|
+
const child = spawn(binaryPath, [], {
|
|
49
|
+
detached: true,
|
|
50
|
+
stdio: "ignore"
|
|
51
|
+
});
|
|
52
|
+
child.unref();
|
|
53
|
+
console.log(chalk.cyan("\n Paradigm Conductor is running."));
|
|
54
|
+
console.log(chalk.gray(" Look for the waveform icon in your menu bar."));
|
|
55
|
+
console.log(chalk.gray(" Quit via the menu bar icon or Cmd+Q.\n"));
|
|
56
|
+
}
|
|
57
|
+
function findConductorDir() {
|
|
58
|
+
let dir = path.resolve(__dirname, "..");
|
|
59
|
+
for (let i = 0; i < 5; i++) {
|
|
60
|
+
const candidate = path.join(dir, "packages", "conductor");
|
|
61
|
+
if (fs.existsSync(path.join(candidate, "Package.swift"))) {
|
|
62
|
+
return candidate;
|
|
63
|
+
}
|
|
64
|
+
dir = path.dirname(dir);
|
|
65
|
+
}
|
|
66
|
+
const cwdCandidate = path.join(process.cwd(), "packages", "conductor");
|
|
67
|
+
if (fs.existsSync(path.join(cwdCandidate, "Package.swift"))) {
|
|
68
|
+
return cwdCandidate;
|
|
69
|
+
}
|
|
70
|
+
if (fs.existsSync(path.join(process.cwd(), "Package.swift"))) {
|
|
71
|
+
const basename2 = path.basename(process.cwd());
|
|
72
|
+
if (basename2 === "conductor") {
|
|
73
|
+
return process.cwd();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
let cwdDir = process.cwd();
|
|
77
|
+
for (let i = 0; i < 5; i++) {
|
|
78
|
+
cwdDir = path.dirname(cwdDir);
|
|
79
|
+
const candidate = path.join(cwdDir, "packages", "conductor");
|
|
80
|
+
if (fs.existsSync(path.join(candidate, "Package.swift"))) {
|
|
81
|
+
return candidate;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
export {
|
|
87
|
+
conductorCommand
|
|
88
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -747,6 +747,10 @@ sentinelCmd.command("defend [path]", { isDefault: true }).description("Launch th
|
|
|
747
747
|
const { sentinelCommand } = await import("./sentinel-FUR3QKCJ.js");
|
|
748
748
|
await sentinelCommand(path2, options);
|
|
749
749
|
});
|
|
750
|
+
program.command("conductor").description("Launch Paradigm Conductor \u2014 multimodal mission control for Claude Code sessions").option("--build", "Force rebuild the native binary").option("-v, --verbose", "Show build output").action(async (options) => {
|
|
751
|
+
const { conductorCommand } = await import("./conductor-HLWYWUVH.js");
|
|
752
|
+
await conductorCommand(options);
|
|
753
|
+
});
|
|
750
754
|
program.command("university").description("Launch Paradigm University - interactive learning platform & PLSAT certification").option("-p, --port <port>", "Port to run on", "3839").option("--no-open", "Don't open browser automatically").action(async (options) => {
|
|
751
755
|
const { universityCommand } = await import("./university-A66BMZ4Z.js");
|
|
752
756
|
await universityCommand(void 0, options);
|
package/dist/mcp.js
CHANGED
|
@@ -2026,8 +2026,8 @@ function registerResources(server, getContext2) {
|
|
|
2026
2026
|
}
|
|
2027
2027
|
|
|
2028
2028
|
// ../paradigm-mcp/src/tools/index.ts
|
|
2029
|
-
import * as
|
|
2030
|
-
import * as
|
|
2029
|
+
import * as os4 from "os";
|
|
2030
|
+
import * as path29 from "path";
|
|
2031
2031
|
import {
|
|
2032
2032
|
ListToolsRequestSchema,
|
|
2033
2033
|
CallToolRequestSchema
|
|
@@ -2791,7 +2791,7 @@ function navigateExplore(config, target, rootDir) {
|
|
|
2791
2791
|
}
|
|
2792
2792
|
if (result.paths.length === 0) {
|
|
2793
2793
|
const areaSymbols = Object.entries(config.symbols).filter(
|
|
2794
|
-
([sym,
|
|
2794
|
+
([sym, path30]) => sym.toLowerCase().includes(targetLower) || path30.toLowerCase().includes(targetLower)
|
|
2795
2795
|
).slice(0, 10);
|
|
2796
2796
|
result.paths = [...new Set(areaSymbols.map(([, p]) => p))];
|
|
2797
2797
|
result.symbols = areaSymbols.map(([s]) => s);
|
|
@@ -11289,8 +11289,8 @@ function generateRunId() {
|
|
|
11289
11289
|
var TEMPLATE_REGEX = /\{\{([^}]+)\}\}/g;
|
|
11290
11290
|
function interpolate(value, scope) {
|
|
11291
11291
|
if (typeof value === "string") {
|
|
11292
|
-
return value.replace(TEMPLATE_REGEX, (_match,
|
|
11293
|
-
const resolved = resolvePath(
|
|
11292
|
+
return value.replace(TEMPLATE_REGEX, (_match, path30) => {
|
|
11293
|
+
const resolved = resolvePath(path30.trim(), scope);
|
|
11294
11294
|
return resolved !== void 0 ? String(resolved) : _match;
|
|
11295
11295
|
});
|
|
11296
11296
|
}
|
|
@@ -11323,8 +11323,8 @@ function resolvePath(dotPath, scope) {
|
|
|
11323
11323
|
return void 0;
|
|
11324
11324
|
}
|
|
11325
11325
|
}
|
|
11326
|
-
function deepGet(obj,
|
|
11327
|
-
const parts =
|
|
11326
|
+
function deepGet(obj, path30) {
|
|
11327
|
+
const parts = path30.split(/[.\[\]]+/).filter(Boolean);
|
|
11328
11328
|
let current = obj;
|
|
11329
11329
|
for (const part of parts) {
|
|
11330
11330
|
if (current == null || typeof current !== "object") return void 0;
|
|
@@ -11560,11 +11560,11 @@ async function runPersonaObject(rootDir, persona, options) {
|
|
|
11560
11560
|
}
|
|
11561
11561
|
async function runChain(rootDir, chainId, options) {
|
|
11562
11562
|
const start = Date.now();
|
|
11563
|
-
const
|
|
11564
|
-
const
|
|
11563
|
+
const fs26 = await import("fs");
|
|
11564
|
+
const path30 = await import("path");
|
|
11565
11565
|
const yaml15 = await import("js-yaml");
|
|
11566
|
-
const chainPath =
|
|
11567
|
-
if (!
|
|
11566
|
+
const chainPath = path30.join(rootDir, ".paradigm", "personas", "chains", `${chainId}.yaml`);
|
|
11567
|
+
if (!fs26.existsSync(chainPath)) {
|
|
11568
11568
|
return {
|
|
11569
11569
|
chain_id: chainId,
|
|
11570
11570
|
status: "error",
|
|
@@ -11573,7 +11573,7 @@ async function runChain(rootDir, chainId, options) {
|
|
|
11573
11573
|
duration_ms: Date.now() - start
|
|
11574
11574
|
};
|
|
11575
11575
|
}
|
|
11576
|
-
const chain = yaml15.load(
|
|
11576
|
+
const chain = yaml15.load(fs26.readFileSync(chainPath, "utf8"));
|
|
11577
11577
|
let permutation;
|
|
11578
11578
|
if (options.permutation && chain.permutations) {
|
|
11579
11579
|
permutation = chain.permutations.find((p) => p.id === options.permutation);
|
|
@@ -11677,8 +11677,8 @@ function validateInterpolation(persona) {
|
|
|
11677
11677
|
const serialized = JSON.stringify(step);
|
|
11678
11678
|
const templates = serialized.match(TEMPLATE_REGEX) || [];
|
|
11679
11679
|
for (const template of templates) {
|
|
11680
|
-
const
|
|
11681
|
-
const [namespace, ...rest] =
|
|
11680
|
+
const path30 = template.replace("{{", "").replace("}}", "").trim();
|
|
11681
|
+
const [namespace, ...rest] = path30.split(".");
|
|
11682
11682
|
const key = rest.join(".");
|
|
11683
11683
|
switch (namespace) {
|
|
11684
11684
|
case "fixtures":
|
|
@@ -13743,9 +13743,298 @@ async function handlePipelineTool(name, args, ctx) {
|
|
|
13743
13743
|
}
|
|
13744
13744
|
}
|
|
13745
13745
|
|
|
13746
|
-
// ../paradigm-mcp/src/tools/
|
|
13746
|
+
// ../paradigm-mcp/src/tools/conductor.ts
|
|
13747
|
+
import { execSync as execSync6 } from "child_process";
|
|
13748
|
+
|
|
13749
|
+
// ../paradigm-mcp/src/utils/conductor-loader.ts
|
|
13750
|
+
import * as fs25 from "fs";
|
|
13747
13751
|
import * as path27 from "path";
|
|
13752
|
+
import * as os3 from "os";
|
|
13748
13753
|
import { execSync as execSync5 } from "child_process";
|
|
13754
|
+
var CONDUCTOR_DIR = path27.join(os3.homedir(), ".conductor");
|
|
13755
|
+
var SESSIONS_DIR = path27.join(CONDUCTOR_DIR, "sessions");
|
|
13756
|
+
function ensureSessionsDir() {
|
|
13757
|
+
if (!fs25.existsSync(SESSIONS_DIR)) {
|
|
13758
|
+
fs25.mkdirSync(SESSIONS_DIR, { recursive: true });
|
|
13759
|
+
}
|
|
13760
|
+
}
|
|
13761
|
+
function registerConductorSession(session) {
|
|
13762
|
+
ensureSessionsDir();
|
|
13763
|
+
const entry = {
|
|
13764
|
+
...session,
|
|
13765
|
+
registeredAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
13766
|
+
};
|
|
13767
|
+
const filePath = path27.join(SESSIONS_DIR, `${session.pid}.json`);
|
|
13768
|
+
fs25.writeFileSync(filePath, JSON.stringify(entry, null, 2), "utf-8");
|
|
13769
|
+
return entry;
|
|
13770
|
+
}
|
|
13771
|
+
function unregisterConductorSession(pid) {
|
|
13772
|
+
const filePath = path27.join(SESSIONS_DIR, `${pid}.json`);
|
|
13773
|
+
if (fs25.existsSync(filePath)) {
|
|
13774
|
+
fs25.unlinkSync(filePath);
|
|
13775
|
+
return true;
|
|
13776
|
+
}
|
|
13777
|
+
return false;
|
|
13778
|
+
}
|
|
13779
|
+
function listConductorSessions() {
|
|
13780
|
+
ensureSessionsDir();
|
|
13781
|
+
const files = fs25.readdirSync(SESSIONS_DIR).filter((f) => f.endsWith(".json"));
|
|
13782
|
+
const sessions = [];
|
|
13783
|
+
for (const file of files) {
|
|
13784
|
+
try {
|
|
13785
|
+
const content = fs25.readFileSync(path27.join(SESSIONS_DIR, file), "utf-8");
|
|
13786
|
+
const session = JSON.parse(content);
|
|
13787
|
+
sessions.push(session);
|
|
13788
|
+
} catch {
|
|
13789
|
+
}
|
|
13790
|
+
}
|
|
13791
|
+
return sessions;
|
|
13792
|
+
}
|
|
13793
|
+
function cleanStaleSessions() {
|
|
13794
|
+
const sessions = listConductorSessions();
|
|
13795
|
+
let cleaned = 0;
|
|
13796
|
+
for (const session of sessions) {
|
|
13797
|
+
if (!isProcessAlive(session.pid)) {
|
|
13798
|
+
unregisterConductorSession(session.pid);
|
|
13799
|
+
cleaned++;
|
|
13800
|
+
}
|
|
13801
|
+
}
|
|
13802
|
+
return cleaned;
|
|
13803
|
+
}
|
|
13804
|
+
function isProcessAlive(pid) {
|
|
13805
|
+
try {
|
|
13806
|
+
process.kill(pid, 0);
|
|
13807
|
+
return true;
|
|
13808
|
+
} catch {
|
|
13809
|
+
return false;
|
|
13810
|
+
}
|
|
13811
|
+
}
|
|
13812
|
+
function detectTerminalBundleId() {
|
|
13813
|
+
try {
|
|
13814
|
+
const script = `
|
|
13815
|
+
tell application "System Events"
|
|
13816
|
+
set frontApp to first application process whose frontmost is true
|
|
13817
|
+
return bundle identifier of frontApp
|
|
13818
|
+
end tell
|
|
13819
|
+
`;
|
|
13820
|
+
const result = execSync5(`osascript -e '${script}'`, {
|
|
13821
|
+
encoding: "utf-8",
|
|
13822
|
+
timeout: 3e3
|
|
13823
|
+
}).trim();
|
|
13824
|
+
return result || void 0;
|
|
13825
|
+
} catch {
|
|
13826
|
+
return void 0;
|
|
13827
|
+
}
|
|
13828
|
+
}
|
|
13829
|
+
function detectGitBranch(cwd) {
|
|
13830
|
+
try {
|
|
13831
|
+
return execSync5("git rev-parse --abbrev-ref HEAD", {
|
|
13832
|
+
cwd,
|
|
13833
|
+
encoding: "utf-8",
|
|
13834
|
+
timeout: 3e3
|
|
13835
|
+
}).trim() || void 0;
|
|
13836
|
+
} catch {
|
|
13837
|
+
return void 0;
|
|
13838
|
+
}
|
|
13839
|
+
}
|
|
13840
|
+
function autoRegisterWithConductor(projectDir2) {
|
|
13841
|
+
try {
|
|
13842
|
+
const pid = process.pid;
|
|
13843
|
+
const terminal = detectTerminalBundleId();
|
|
13844
|
+
const branch = detectGitBranch(projectDir2);
|
|
13845
|
+
let parentPid;
|
|
13846
|
+
try {
|
|
13847
|
+
const ppid = execSync5(`ps -o ppid= -p ${pid}`, {
|
|
13848
|
+
encoding: "utf-8",
|
|
13849
|
+
timeout: 3e3
|
|
13850
|
+
}).trim();
|
|
13851
|
+
parentPid = parseInt(ppid, 10);
|
|
13852
|
+
if (isNaN(parentPid)) parentPid = void 0;
|
|
13853
|
+
} catch {
|
|
13854
|
+
}
|
|
13855
|
+
registerConductorSession({
|
|
13856
|
+
pid,
|
|
13857
|
+
parentPid,
|
|
13858
|
+
projectDir: projectDir2,
|
|
13859
|
+
terminal,
|
|
13860
|
+
branch
|
|
13861
|
+
});
|
|
13862
|
+
const cleanup = () => {
|
|
13863
|
+
try {
|
|
13864
|
+
unregisterConductorSession(pid);
|
|
13865
|
+
} catch {
|
|
13866
|
+
}
|
|
13867
|
+
};
|
|
13868
|
+
process.on("exit", cleanup);
|
|
13869
|
+
process.on("SIGTERM", () => {
|
|
13870
|
+
cleanup();
|
|
13871
|
+
process.exit(0);
|
|
13872
|
+
});
|
|
13873
|
+
console.error(`[paradigm-mcp] Auto-registered with Conductor (PID ${pid})`);
|
|
13874
|
+
} catch {
|
|
13875
|
+
console.error("[paradigm-mcp] Auto-registration with Conductor skipped (non-fatal)");
|
|
13876
|
+
}
|
|
13877
|
+
}
|
|
13878
|
+
|
|
13879
|
+
// ../paradigm-mcp/src/tools/conductor.ts
|
|
13880
|
+
function getConductorToolsList() {
|
|
13881
|
+
return [
|
|
13882
|
+
{
|
|
13883
|
+
name: "paradigm_conductor_register",
|
|
13884
|
+
description: 'Register this Claude Code session with Paradigm Conductor. Makes the session visible in the Conductor overlay for voice/gesture/gaze dispatch. Call this when the user says "/conduct" or wants to surface a session to Conductor. ~100 tokens.',
|
|
13885
|
+
inputSchema: {
|
|
13886
|
+
type: "object",
|
|
13887
|
+
properties: {
|
|
13888
|
+
label: {
|
|
13889
|
+
type: "string",
|
|
13890
|
+
description: 'Human-readable label for this session (e.g., "backend refactor", "auth feature")'
|
|
13891
|
+
},
|
|
13892
|
+
terminal: {
|
|
13893
|
+
type: "string",
|
|
13894
|
+
description: 'Terminal bundle ID (e.g., "com.mitchellh.ghostty"). Auto-detected if omitted.'
|
|
13895
|
+
}
|
|
13896
|
+
},
|
|
13897
|
+
required: []
|
|
13898
|
+
},
|
|
13899
|
+
annotations: {
|
|
13900
|
+
title: "Register with Conductor",
|
|
13901
|
+
readOnlyHint: false,
|
|
13902
|
+
destructiveHint: false,
|
|
13903
|
+
idempotentHint: true,
|
|
13904
|
+
openWorldHint: false
|
|
13905
|
+
}
|
|
13906
|
+
},
|
|
13907
|
+
{
|
|
13908
|
+
name: "paradigm_conductor_unregister",
|
|
13909
|
+
description: "Unregister this Claude Code session from Paradigm Conductor. Removes it from the Conductor overlay. Call when ending a session or when the user wants to hide from Conductor. ~50 tokens.",
|
|
13910
|
+
inputSchema: {
|
|
13911
|
+
type: "object",
|
|
13912
|
+
properties: {},
|
|
13913
|
+
required: []
|
|
13914
|
+
},
|
|
13915
|
+
annotations: {
|
|
13916
|
+
title: "Unregister from Conductor",
|
|
13917
|
+
readOnlyHint: false,
|
|
13918
|
+
destructiveHint: false,
|
|
13919
|
+
idempotentHint: true,
|
|
13920
|
+
openWorldHint: false
|
|
13921
|
+
}
|
|
13922
|
+
},
|
|
13923
|
+
{
|
|
13924
|
+
name: "paradigm_conductor_list",
|
|
13925
|
+
description: "List all Claude Code sessions currently registered with Paradigm Conductor. Shows PIDs, project dirs, and labels. ~150 tokens.",
|
|
13926
|
+
inputSchema: {
|
|
13927
|
+
type: "object",
|
|
13928
|
+
properties: {
|
|
13929
|
+
clean: {
|
|
13930
|
+
type: "boolean",
|
|
13931
|
+
description: "If true, clean up stale sessions (dead PIDs) before listing"
|
|
13932
|
+
}
|
|
13933
|
+
},
|
|
13934
|
+
required: []
|
|
13935
|
+
},
|
|
13936
|
+
annotations: {
|
|
13937
|
+
title: "List Conductor sessions",
|
|
13938
|
+
readOnlyHint: true,
|
|
13939
|
+
destructiveHint: false,
|
|
13940
|
+
idempotentHint: true,
|
|
13941
|
+
openWorldHint: false
|
|
13942
|
+
}
|
|
13943
|
+
}
|
|
13944
|
+
];
|
|
13945
|
+
}
|
|
13946
|
+
async function handleConductorTool(name, args, ctx) {
|
|
13947
|
+
switch (name) {
|
|
13948
|
+
case "paradigm_conductor_register": {
|
|
13949
|
+
const pid = process.pid;
|
|
13950
|
+
const projectDir2 = ctx.rootDir;
|
|
13951
|
+
const terminal = args.terminal || detectTerminalBundleId();
|
|
13952
|
+
const branch = detectGitBranch(projectDir2);
|
|
13953
|
+
let parentPid;
|
|
13954
|
+
try {
|
|
13955
|
+
const ppid = execSync6(`ps -o ppid= -p ${pid}`, {
|
|
13956
|
+
encoding: "utf-8",
|
|
13957
|
+
timeout: 3e3
|
|
13958
|
+
}).trim();
|
|
13959
|
+
parentPid = parseInt(ppid, 10);
|
|
13960
|
+
if (isNaN(parentPid)) parentPid = void 0;
|
|
13961
|
+
} catch {
|
|
13962
|
+
}
|
|
13963
|
+
const session = registerConductorSession({
|
|
13964
|
+
pid,
|
|
13965
|
+
parentPid,
|
|
13966
|
+
projectDir: projectDir2,
|
|
13967
|
+
terminal,
|
|
13968
|
+
label: args.label,
|
|
13969
|
+
branch
|
|
13970
|
+
});
|
|
13971
|
+
const lines = [
|
|
13972
|
+
`\u2713 Registered with Conductor`,
|
|
13973
|
+
``,
|
|
13974
|
+
` PID: ${session.pid}`,
|
|
13975
|
+
` Project: ${session.projectDir}`
|
|
13976
|
+
];
|
|
13977
|
+
if (session.branch) lines.push(` Branch: ${session.branch}`);
|
|
13978
|
+
if (session.label) lines.push(` Label: ${session.label}`);
|
|
13979
|
+
if (session.terminal) lines.push(` Terminal: ${session.terminal}`);
|
|
13980
|
+
lines.push(` File: ~/.conductor/sessions/${session.pid}.json`);
|
|
13981
|
+
lines.push(``);
|
|
13982
|
+
lines.push(`This session is now visible in Paradigm Conductor.`);
|
|
13983
|
+
lines.push(`Conductor will auto-discover it via the registration file.`);
|
|
13984
|
+
return { text: lines.join("\n"), handled: true };
|
|
13985
|
+
}
|
|
13986
|
+
case "paradigm_conductor_unregister": {
|
|
13987
|
+
const pid = process.pid;
|
|
13988
|
+
const removed = unregisterConductorSession(pid);
|
|
13989
|
+
if (removed) {
|
|
13990
|
+
return {
|
|
13991
|
+
text: `\u2713 Unregistered from Conductor (PID ${pid}).
|
|
13992
|
+
This session is no longer visible in the Conductor overlay.`,
|
|
13993
|
+
handled: true
|
|
13994
|
+
};
|
|
13995
|
+
} else {
|
|
13996
|
+
return {
|
|
13997
|
+
text: `Session (PID ${pid}) was not registered with Conductor.`,
|
|
13998
|
+
handled: true
|
|
13999
|
+
};
|
|
14000
|
+
}
|
|
14001
|
+
}
|
|
14002
|
+
case "paradigm_conductor_list": {
|
|
14003
|
+
if (args.clean) {
|
|
14004
|
+
const cleaned = cleanStaleSessions();
|
|
14005
|
+
if (cleaned > 0) {
|
|
14006
|
+
}
|
|
14007
|
+
}
|
|
14008
|
+
const sessions = listConductorSessions();
|
|
14009
|
+
if (sessions.length === 0) {
|
|
14010
|
+
return {
|
|
14011
|
+
text: "No sessions registered with Conductor.\nUse paradigm_conductor_register or /conduct to register.",
|
|
14012
|
+
handled: true
|
|
14013
|
+
};
|
|
14014
|
+
}
|
|
14015
|
+
const lines = [`${sessions.length} session(s) registered with Conductor:
|
|
14016
|
+
`];
|
|
14017
|
+
for (const s of sessions) {
|
|
14018
|
+
const parts = [` PID ${s.pid}`];
|
|
14019
|
+
if (s.label) parts.push(`"${s.label}"`);
|
|
14020
|
+
parts.push(`\u2014 ${s.projectDir}`);
|
|
14021
|
+
if (s.branch) parts.push(`(${s.branch})`);
|
|
14022
|
+
lines.push(parts.join(" "));
|
|
14023
|
+
}
|
|
14024
|
+
if (args.clean) {
|
|
14025
|
+
lines.push(`
|
|
14026
|
+
(Stale sessions cleaned)`);
|
|
14027
|
+
}
|
|
14028
|
+
return { text: lines.join("\n"), handled: true };
|
|
14029
|
+
}
|
|
14030
|
+
default:
|
|
14031
|
+
return { text: "", handled: false };
|
|
14032
|
+
}
|
|
14033
|
+
}
|
|
14034
|
+
|
|
14035
|
+
// ../paradigm-mcp/src/tools/fallback-grep.ts
|
|
14036
|
+
import * as path28 from "path";
|
|
14037
|
+
import { execSync as execSync7 } from "child_process";
|
|
13749
14038
|
function grepForReferences(rootDir, symbol, options = {}) {
|
|
13750
14039
|
const { maxResults = 20 } = options;
|
|
13751
14040
|
const results = [];
|
|
@@ -13759,7 +14048,7 @@ function grepForReferences(rootDir, symbol, options = {}) {
|
|
|
13759
14048
|
let output = "";
|
|
13760
14049
|
for (const cmd of grepCommands) {
|
|
13761
14050
|
try {
|
|
13762
|
-
output =
|
|
14051
|
+
output = execSync7(cmd, { encoding: "utf8", maxBuffer: 1024 * 1024 });
|
|
13763
14052
|
if (output.trim()) break;
|
|
13764
14053
|
} catch {
|
|
13765
14054
|
continue;
|
|
@@ -13773,7 +14062,7 @@ function grepForReferences(rootDir, symbol, options = {}) {
|
|
|
13773
14062
|
const match = line.match(/^(.+?):(\d+):(.*)$/);
|
|
13774
14063
|
if (match) {
|
|
13775
14064
|
const [, filePath, lineNum, content] = match;
|
|
13776
|
-
const relativePath =
|
|
14065
|
+
const relativePath = path28.relative(rootDir, filePath);
|
|
13777
14066
|
let context2 = "unknown";
|
|
13778
14067
|
if (relativePath.includes(".purpose") || relativePath.includes("portal.yaml")) {
|
|
13779
14068
|
context2 = "purpose";
|
|
@@ -14042,6 +14331,8 @@ function registerTools(server, getContext2, reloadContext2) {
|
|
|
14042
14331
|
...getHeatmapToolsList(),
|
|
14043
14332
|
// Pipeline tools
|
|
14044
14333
|
...getPipelineToolsList(),
|
|
14334
|
+
// Conductor session registration tools
|
|
14335
|
+
...getConductorToolsList(),
|
|
14045
14336
|
// Plugin update check
|
|
14046
14337
|
{
|
|
14047
14338
|
name: "paradigm_plugin_check",
|
|
@@ -14432,7 +14723,7 @@ function registerTools(server, getContext2, reloadContext2) {
|
|
|
14432
14723
|
const symbols = getSymbolsByType(ctx.index, type);
|
|
14433
14724
|
examples[type] = symbols.slice(0, 3).map((s) => s.symbol);
|
|
14434
14725
|
}
|
|
14435
|
-
const platform2 =
|
|
14726
|
+
const platform2 = os4.platform();
|
|
14436
14727
|
const isWindows = platform2 === "win32";
|
|
14437
14728
|
const shell = isWindows ? "PowerShell/CMD" : platform2 === "darwin" ? "zsh/bash" : "bash";
|
|
14438
14729
|
let protocols;
|
|
@@ -14675,7 +14966,7 @@ Update command:
|
|
|
14675
14966
|
const { rebuildStaticFiles: rebuildStaticFiles2 } = await import("./reindex-YG3KIXAK.js");
|
|
14676
14967
|
const memberResults = [];
|
|
14677
14968
|
for (const member of ctx.workspace.config.members) {
|
|
14678
|
-
const memberAbsPath =
|
|
14969
|
+
const memberAbsPath = path29.resolve(path29.dirname(ctx.workspace.workspacePath), member.path);
|
|
14679
14970
|
try {
|
|
14680
14971
|
const result = await rebuildStaticFiles2(memberAbsPath);
|
|
14681
14972
|
memberResults.push({
|
|
@@ -14890,6 +15181,15 @@ Update command:
|
|
|
14890
15181
|
};
|
|
14891
15182
|
}
|
|
14892
15183
|
}
|
|
15184
|
+
if (name.startsWith("paradigm_conductor_")) {
|
|
15185
|
+
const result = await handleConductorTool(name, args, ctx);
|
|
15186
|
+
if (result.handled) {
|
|
15187
|
+
trackToolCall(result.text.length, name);
|
|
15188
|
+
return {
|
|
15189
|
+
content: [{ type: "text", text: result.text }]
|
|
15190
|
+
};
|
|
15191
|
+
}
|
|
15192
|
+
}
|
|
14893
15193
|
if (name === "paradigm_reindex") {
|
|
14894
15194
|
const reload = reloadContext2 || (async () => {
|
|
14895
15195
|
});
|
|
@@ -14941,6 +15241,7 @@ async function main() {
|
|
|
14941
15241
|
console.error(`[paradigm-mcp] Error loading project:`, error);
|
|
14942
15242
|
process.exit(1);
|
|
14943
15243
|
}
|
|
15244
|
+
autoRegisterWithConductor(projectDir);
|
|
14944
15245
|
const server = new Server(
|
|
14945
15246
|
{
|
|
14946
15247
|
name: "paradigm",
|