@virsanghavi/axis-server 1.0.5 → 1.0.6
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/mcp-server.mjs +31 -26
- package/package.json +1 -1
package/dist/mcp-server.mjs
CHANGED
|
@@ -772,35 +772,40 @@ if (process.env.NEXT_PUBLIC_SUPABASE_URL && process.env.SUPABASE_SERVICE_ROLE_KE
|
|
|
772
772
|
);
|
|
773
773
|
}
|
|
774
774
|
async function ensureFileSystem() {
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
const axisInstructions = path3.join(axisDir, "instructions");
|
|
784
|
-
const legacyInstructions = path3.join(cwd, "agent-instructions");
|
|
785
|
-
if (fsSync.existsSync(legacyInstructions) && !fsSync.existsSync(axisDir)) {
|
|
786
|
-
logger.info("Using legacy agent-instructions directory");
|
|
787
|
-
} else {
|
|
788
|
-
await fs3.mkdir(axisInstructions, { recursive: true }).catch(() => {
|
|
775
|
+
try {
|
|
776
|
+
const fs3 = await import("fs/promises");
|
|
777
|
+
const path3 = await import("path");
|
|
778
|
+
const fsSync = await import("fs");
|
|
779
|
+
const cwd = process.cwd();
|
|
780
|
+
logger.info(`Server CWD: ${cwd}`);
|
|
781
|
+
const historyDir = path3.join(cwd, "history");
|
|
782
|
+
await fs3.mkdir(historyDir, { recursive: true }).catch(() => {
|
|
789
783
|
});
|
|
790
|
-
const
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
784
|
+
const axisDir = path3.join(cwd, ".axis");
|
|
785
|
+
const axisInstructions = path3.join(axisDir, "instructions");
|
|
786
|
+
const legacyInstructions = path3.join(cwd, "agent-instructions");
|
|
787
|
+
if (fsSync.existsSync(legacyInstructions) && !fsSync.existsSync(axisDir)) {
|
|
788
|
+
logger.info("Using legacy agent-instructions directory");
|
|
789
|
+
} else {
|
|
790
|
+
await fs3.mkdir(axisInstructions, { recursive: true }).catch(() => {
|
|
791
|
+
});
|
|
792
|
+
const defaults = [
|
|
793
|
+
["context.md", "# Project Context\n\n"],
|
|
794
|
+
["conventions.md", "# Coding Conventions\n\n"],
|
|
795
|
+
["activity.md", "# Activity Log\n\n"]
|
|
796
|
+
];
|
|
797
|
+
for (const [file, content] of defaults) {
|
|
798
|
+
const p = path3.join(axisInstructions, file);
|
|
799
|
+
try {
|
|
800
|
+
await fs3.access(p);
|
|
801
|
+
} catch {
|
|
802
|
+
await fs3.writeFile(p, content);
|
|
803
|
+
logger.info(`Created default context file: ${file}`);
|
|
804
|
+
}
|
|
802
805
|
}
|
|
803
806
|
}
|
|
807
|
+
} catch (error) {
|
|
808
|
+
logger.warn("Could not initialize local file system. Persistence features (context.md) may be disabled.", { error: String(error) });
|
|
804
809
|
}
|
|
805
810
|
}
|
|
806
811
|
var server = new Server(
|