memorix 1.4.4 → 1.4.5
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/CHANGELOG.md +15 -0
- package/README.md +9 -2
- package/README.zh-CN.md +9 -2
- package/dist/cli/index.js +348 -127
- package/dist/index.js +35 -5
- package/dist/memcode-runtime/CHANGELOG.md +15 -0
- package/dist/sdk.js +34 -4
- package/dist/types.d.ts +1 -1
- package/docs/AGENT_OPERATOR_PLAYBOOK.md +3 -2
- package/docs/INTEGRATIONS.md +9 -2
- package/docs/KNOWN_ISSUES_AND_ROADMAP.md +1 -0
- package/docs/MEMCODE.md +1 -1
- package/docs/SETUP.md +9 -1
- package/llms-full.txt +5 -4
- package/llms.txt +1 -1
- package/package.json +1 -1
- package/plugins/claude/memorix/.claude-plugin/plugin.json +1 -1
- package/plugins/codebuddy/memorix/.codebuddy-plugin/plugin.json +1 -1
- package/plugins/codex/memorix/.codex-plugin/plugin.json +1 -1
- package/plugins/copilot/memorix/plugin.json +1 -1
- package/plugins/gemini/memorix/gemini-extension.json +1 -1
- package/plugins/omp/memorix/package.json +1 -1
- package/plugins/openclaw/memorix/.codex-plugin/plugin.json +1 -1
- package/plugins/pi/memorix/package.json +1 -1
- package/server.json +2 -2
- package/src/cli/commands/agent-integrations.ts +7 -1
- package/src/cli/commands/hooks-install.ts +2 -0
- package/src/cli/commands/hooks-preview.ts +5 -0
- package/src/cli/commands/integrate.ts +2 -0
- package/src/cli/commands/setup.ts +57 -2
- package/src/cli/commands/uninstall.ts +20 -0
- package/src/hooks/installers/index.ts +43 -2
- package/src/hooks/types.ts +2 -0
- package/src/integrations/registry.ts +9 -0
- package/src/types.ts +1 -1
- package/src/workspace/mcp-adapters/dsh.ts +147 -0
package/dist/cli/index.js
CHANGED
|
@@ -3221,7 +3221,7 @@ ${import_picocolors.default.gray(m3)} ${s4}
|
|
|
3221
3221
|
|
|
3222
3222
|
// src/cli/version.ts
|
|
3223
3223
|
function getCliVersion() {
|
|
3224
|
-
return true ? "1.4.
|
|
3224
|
+
return true ? "1.4.5" : pkg.version;
|
|
3225
3225
|
}
|
|
3226
3226
|
var init_version = __esm({
|
|
3227
3227
|
"src/cli/version.ts"() {
|
|
@@ -190538,9 +190538,116 @@ var init_trae = __esm({
|
|
|
190538
190538
|
}
|
|
190539
190539
|
});
|
|
190540
190540
|
|
|
190541
|
-
// src/workspace/mcp-adapters/
|
|
190541
|
+
// src/workspace/mcp-adapters/dsh.ts
|
|
190542
190542
|
import { homedir as homedir22 } from "os";
|
|
190543
190543
|
import { join as join19 } from "path";
|
|
190544
|
+
function resolveDshHome() {
|
|
190545
|
+
const configured = process.env.DSH_HOME?.trim();
|
|
190546
|
+
if (configured) return configured;
|
|
190547
|
+
return join19(homedir22(), ".dsh");
|
|
190548
|
+
}
|
|
190549
|
+
function isMemorixRow(row) {
|
|
190550
|
+
if (!row || typeof row !== "object" || Array.isArray(row)) return false;
|
|
190551
|
+
const record2 = row;
|
|
190552
|
+
if (record2.name !== MCP_CLIENT_PLUGIN) return false;
|
|
190553
|
+
const config2 = record2.config;
|
|
190554
|
+
return Boolean(
|
|
190555
|
+
config2 && typeof config2 === "object" && !Array.isArray(config2) && config2.serverName === "memorix"
|
|
190556
|
+
);
|
|
190557
|
+
}
|
|
190558
|
+
function rowToEntry(row) {
|
|
190559
|
+
const config2 = row.config;
|
|
190560
|
+
if (!config2 || typeof config2 !== "object") return null;
|
|
190561
|
+
const entry = {
|
|
190562
|
+
name: "memorix",
|
|
190563
|
+
command: typeof config2.command === "string" ? config2.command : "",
|
|
190564
|
+
args: Array.isArray(config2.args) ? config2.args.filter((arg) => typeof arg === "string") : []
|
|
190565
|
+
};
|
|
190566
|
+
if (typeof config2.url === "string" && config2.url) entry.url = config2.url;
|
|
190567
|
+
if (config2.env && typeof config2.env === "object" && !Array.isArray(config2.env)) {
|
|
190568
|
+
const env3 = {};
|
|
190569
|
+
for (const [key, value] of Object.entries(config2.env)) {
|
|
190570
|
+
if (typeof value === "string") env3[key] = value;
|
|
190571
|
+
}
|
|
190572
|
+
if (Object.keys(env3).length > 0) entry.env = env3;
|
|
190573
|
+
}
|
|
190574
|
+
if (config2.disabled === true) entry.disabled = true;
|
|
190575
|
+
return entry;
|
|
190576
|
+
}
|
|
190577
|
+
function patchRows(document2) {
|
|
190578
|
+
const rows = [];
|
|
190579
|
+
if (!Array.isArray(document2)) return rows;
|
|
190580
|
+
for (const item of document2) {
|
|
190581
|
+
if (!item || typeof item !== "object" || Array.isArray(item)) continue;
|
|
190582
|
+
const record2 = item;
|
|
190583
|
+
if (Array.isArray(record2.insert)) {
|
|
190584
|
+
for (const row of record2.insert) {
|
|
190585
|
+
if (row && typeof row === "object" && !Array.isArray(row)) {
|
|
190586
|
+
rows.push(row);
|
|
190587
|
+
}
|
|
190588
|
+
}
|
|
190589
|
+
continue;
|
|
190590
|
+
}
|
|
190591
|
+
rows.push(record2);
|
|
190592
|
+
}
|
|
190593
|
+
return rows;
|
|
190594
|
+
}
|
|
190595
|
+
var import_yaml4, MCP_CLIENT_PLUGIN, MEMORIX_ROW_ID, DshMCPAdapter;
|
|
190596
|
+
var init_dsh = __esm({
|
|
190597
|
+
"src/workspace/mcp-adapters/dsh.ts"() {
|
|
190598
|
+
"use strict";
|
|
190599
|
+
init_esm_shims();
|
|
190600
|
+
import_yaml4 = __toESM(require_dist(), 1);
|
|
190601
|
+
MCP_CLIENT_PLUGIN = "@deepseek-ai/dsh-mcp-client";
|
|
190602
|
+
MEMORIX_ROW_ID = "memory-memorix";
|
|
190603
|
+
DshMCPAdapter = class {
|
|
190604
|
+
source = "dsh";
|
|
190605
|
+
parse(content) {
|
|
190606
|
+
if (!content.trim()) return [];
|
|
190607
|
+
let document2;
|
|
190608
|
+
try {
|
|
190609
|
+
document2 = (0, import_yaml4.parse)(content);
|
|
190610
|
+
} catch {
|
|
190611
|
+
return [];
|
|
190612
|
+
}
|
|
190613
|
+
return patchRows(document2).filter(isMemorixRow).map(rowToEntry).filter((entry) => entry !== null);
|
|
190614
|
+
}
|
|
190615
|
+
generate(servers) {
|
|
190616
|
+
const rows = servers.filter((server) => server.name === "memorix").map((server) => {
|
|
190617
|
+
const config2 = {
|
|
190618
|
+
serverName: server.name
|
|
190619
|
+
};
|
|
190620
|
+
if (server.url) {
|
|
190621
|
+
config2.transport = "streamable-http";
|
|
190622
|
+
config2.url = server.url;
|
|
190623
|
+
if (server.headers && Object.keys(server.headers).length > 0) config2.headers = server.headers;
|
|
190624
|
+
} else {
|
|
190625
|
+
config2.transport = "stdio";
|
|
190626
|
+
config2.command = server.command;
|
|
190627
|
+
if (server.args && server.args.length > 0) config2.args = server.args;
|
|
190628
|
+
if (server.env && Object.keys(server.env).length > 0) config2.env = server.env;
|
|
190629
|
+
}
|
|
190630
|
+
const row = {
|
|
190631
|
+
id: MEMORIX_ROW_ID,
|
|
190632
|
+
name: MCP_CLIENT_PLUGIN,
|
|
190633
|
+
config: config2
|
|
190634
|
+
};
|
|
190635
|
+
if (server.disabled === true) row.disabled = true;
|
|
190636
|
+
return row;
|
|
190637
|
+
});
|
|
190638
|
+
if (rows.length === 0) return "";
|
|
190639
|
+
return (0, import_yaml4.stringify)([{ insert: rows }], { lineWidth: 0 }) + "\n";
|
|
190640
|
+
}
|
|
190641
|
+
getConfigPath(_projectRoot) {
|
|
190642
|
+
return join19(resolveDshHome(), "cordis.patch.yml");
|
|
190643
|
+
}
|
|
190644
|
+
};
|
|
190645
|
+
}
|
|
190646
|
+
});
|
|
190647
|
+
|
|
190648
|
+
// src/workspace/mcp-adapters/codebuddy.ts
|
|
190649
|
+
import { homedir as homedir23 } from "os";
|
|
190650
|
+
import { join as join20 } from "path";
|
|
190544
190651
|
var CodeBuddyMCPAdapter;
|
|
190545
190652
|
var init_codebuddy = __esm({
|
|
190546
190653
|
"src/workspace/mcp-adapters/codebuddy.ts"() {
|
|
@@ -190572,7 +190679,7 @@ var init_codebuddy = __esm({
|
|
|
190572
190679
|
return JSON.stringify({ mcpServers }, null, 2);
|
|
190573
190680
|
}
|
|
190574
190681
|
getConfigPath(projectRoot) {
|
|
190575
|
-
return projectRoot ?
|
|
190682
|
+
return projectRoot ? join20(projectRoot, ".mcp.json") : join20(homedir23(), ".codebuddy", ".mcp.json");
|
|
190576
190683
|
}
|
|
190577
190684
|
};
|
|
190578
190685
|
}
|
|
@@ -190713,6 +190820,15 @@ var init_registry2 = __esm({
|
|
|
190713
190820
|
install: "memorix setup --agent trae",
|
|
190714
190821
|
surfaces: ["MCP", "rules"]
|
|
190715
190822
|
},
|
|
190823
|
+
{
|
|
190824
|
+
agent: "dsh",
|
|
190825
|
+
name: "DeepSeek Harness",
|
|
190826
|
+
entry: "official-config",
|
|
190827
|
+
status: "ready",
|
|
190828
|
+
install: "memorix setup --agent dsh",
|
|
190829
|
+
surfaces: ["MCP", "AGENTS.md", "skills"],
|
|
190830
|
+
note: "DeepSeek Harness support writes a @deepseek-ai/dsh-mcp-client row into $DSH_HOME/cordis.patch.yml (default ~/.dsh/cordis.patch.yml), guidance into the harness AGENTS.md, and skills under $DSH_HOME/skills."
|
|
190831
|
+
},
|
|
190716
190832
|
{
|
|
190717
190833
|
agent: "memcode",
|
|
190718
190834
|
name: "memcode",
|
|
@@ -191006,9 +191122,9 @@ __export(audit_exports, {
|
|
|
191006
191122
|
});
|
|
191007
191123
|
import * as fs18 from "fs/promises";
|
|
191008
191124
|
import * as path28 from "path";
|
|
191009
|
-
import { homedir as
|
|
191125
|
+
import { homedir as homedir24 } from "os";
|
|
191010
191126
|
function getAuditFilePath() {
|
|
191011
|
-
return process.env.MEMORIX_AUDIT_FILE || path28.join(
|
|
191127
|
+
return process.env.MEMORIX_AUDIT_FILE || path28.join(homedir24(), ".memorix", "audit.json");
|
|
191012
191128
|
}
|
|
191013
191129
|
async function loadAudit() {
|
|
191014
191130
|
try {
|
|
@@ -191321,7 +191437,7 @@ async function installOfficialSkillsForAgent(agent, projectRoot, global2 = false
|
|
|
191321
191437
|
const dirs = AGENT_SKILL_DIRS[agent];
|
|
191322
191438
|
const relativeDir = global2 ? dirs?.global : dirs?.project;
|
|
191323
191439
|
if (!relativeDir) return [];
|
|
191324
|
-
const root = global2 ? os3.homedir() : projectRoot;
|
|
191440
|
+
const root = global2 ? agent === "dsh" ? process.env.DSH_HOME?.trim() || path29.join(os3.homedir(), ".dsh") : os3.homedir() : projectRoot;
|
|
191325
191441
|
const skillPaths = [];
|
|
191326
191442
|
for (const skillEntry of OFFICIAL_MEMORIX_SKILLS) {
|
|
191327
191443
|
const skillPath = path29.join(root, relativeDir, skillEntry.name, "SKILL.md");
|
|
@@ -191553,6 +191669,8 @@ function getProjectConfigPath(agent, projectRoot) {
|
|
|
191553
191669
|
return path29.join(projectRoot, "AGENTS.md");
|
|
191554
191670
|
case "trae":
|
|
191555
191671
|
return path29.join(projectRoot, ".trae", "rules", "project_rules.md");
|
|
191672
|
+
case "dsh":
|
|
191673
|
+
return path29.join(projectRoot, "AGENTS.md");
|
|
191556
191674
|
case "opencode":
|
|
191557
191675
|
return path29.join(projectRoot, ".opencode", "plugins", "memorix.js");
|
|
191558
191676
|
case "pi":
|
|
@@ -191598,6 +191716,8 @@ function getGlobalConfigPath(agent) {
|
|
|
191598
191716
|
return path29.join(home, ".omp", "agent", "packages", "memorix", "extensions", "memorix.js");
|
|
191599
191717
|
case "trae":
|
|
191600
191718
|
return path29.join(home, ".trae", "rules", "project_rules.md");
|
|
191719
|
+
case "dsh":
|
|
191720
|
+
return path29.join(process.env.DSH_HOME?.trim() || path29.join(home, ".dsh"), "AGENTS.md");
|
|
191601
191721
|
default:
|
|
191602
191722
|
return path29.join(home, ".memorix", "hooks.json");
|
|
191603
191723
|
}
|
|
@@ -191622,6 +191742,8 @@ function getAgentRulesPath(agent, root, global2 = false) {
|
|
|
191622
191742
|
return path29.join(root, ".gemini", "GEMINI.md");
|
|
191623
191743
|
case "trae":
|
|
191624
191744
|
return path29.join(root, ".trae", "rules", "project_rules.md");
|
|
191745
|
+
case "dsh":
|
|
191746
|
+
return path29.join(process.env.DSH_HOME?.trim() || path29.join(root, ".dsh"), "AGENTS.md");
|
|
191625
191747
|
default:
|
|
191626
191748
|
return path29.join(root, ".agent", "rules", "memorix.md");
|
|
191627
191749
|
}
|
|
@@ -191646,6 +191768,8 @@ function getAgentRulesPath(agent, root, global2 = false) {
|
|
|
191646
191768
|
return path29.join(root, "GEMINI.md");
|
|
191647
191769
|
case "trae":
|
|
191648
191770
|
return path29.join(root, ".trae", "rules", "project_rules.md");
|
|
191771
|
+
case "dsh":
|
|
191772
|
+
return path29.join(root, "AGENTS.md");
|
|
191649
191773
|
default:
|
|
191650
191774
|
return path29.join(root, ".agent", "rules", "memorix.md");
|
|
191651
191775
|
}
|
|
@@ -191728,6 +191852,12 @@ async function detectInstalledAgents() {
|
|
|
191728
191852
|
agents.push("trae");
|
|
191729
191853
|
} catch {
|
|
191730
191854
|
}
|
|
191855
|
+
const dshDir = process.env.DSH_HOME?.trim() || path29.join(home, ".dsh");
|
|
191856
|
+
try {
|
|
191857
|
+
await fs19.access(dshDir);
|
|
191858
|
+
agents.push("dsh");
|
|
191859
|
+
} catch {
|
|
191860
|
+
}
|
|
191731
191861
|
return agents;
|
|
191732
191862
|
}
|
|
191733
191863
|
async function installHooks(agent, projectRoot, global2 = false) {
|
|
@@ -191810,6 +191940,19 @@ async function installHooks(agent, projectRoot, global2 = false) {
|
|
|
191810
191940
|
generated: { note: "Trae has no hooks system, only rules (.trae/rules/project_rules.md) installed" }
|
|
191811
191941
|
};
|
|
191812
191942
|
}
|
|
191943
|
+
case "dsh": {
|
|
191944
|
+
const rulesPath = await installAgentRules(agent, projectRoot, global2);
|
|
191945
|
+
const skillPaths2 = await installOfficialSkillsForAgent(agent, projectRoot, global2);
|
|
191946
|
+
return {
|
|
191947
|
+
agent,
|
|
191948
|
+
configPath: rulesPath,
|
|
191949
|
+
events: [],
|
|
191950
|
+
generated: {
|
|
191951
|
+
note: "DeepSeek Harness has no hook system \u2014 installed AGENTS.md guidance and skills; the MCP row is installed by `memorix setup --agent dsh`.",
|
|
191952
|
+
...skillPaths2.length > 0 ? { skillPaths: skillPaths2, skillPath: skillPaths2[0] } : {}
|
|
191953
|
+
}
|
|
191954
|
+
};
|
|
191955
|
+
}
|
|
191813
191956
|
case "opencode": {
|
|
191814
191957
|
const pluginContent = generateOpenCodePlugin();
|
|
191815
191958
|
const pluginPath = global2 ? getGlobalConfigPath(agent) : getProjectConfigPath(agent, projectRoot);
|
|
@@ -191944,7 +192087,7 @@ async function installAgentRules(agent, projectRoot, global2 = false) {
|
|
|
191944
192087
|
const rulesPath = getAgentRulesPath(agent, rulesRoot, global2);
|
|
191945
192088
|
try {
|
|
191946
192089
|
await fs19.mkdir(path29.dirname(rulesPath), { recursive: true });
|
|
191947
|
-
if (agent === "claude" || agent === "codex" || agent === "opencode" || agent === "antigravity" || agent === "gemini-cli") {
|
|
192090
|
+
if (agent === "claude" || agent === "codex" || agent === "opencode" || agent === "antigravity" || agent === "gemini-cli" || agent === "dsh") {
|
|
191948
192091
|
try {
|
|
191949
192092
|
const existing = await fs19.readFile(rulesPath, "utf-8");
|
|
191950
192093
|
await fs19.writeFile(rulesPath, mergeMemorixRulesContent(existing, rulesContent), "utf-8");
|
|
@@ -192233,7 +192376,10 @@ var init_installers = __esm({
|
|
|
192233
192376
|
windsurf: { project: path29.join(".windsurf", "skills"), global: path29.join(".windsurf", "skills") },
|
|
192234
192377
|
kiro: { project: path29.join(".kiro", "skills"), global: path29.join(".kiro", "skills") },
|
|
192235
192378
|
opencode: { project: path29.join(".opencode", "skills"), global: path29.join(".config", "opencode", "skills") },
|
|
192236
|
-
trae: { project: path29.join(".trae", "skills"), global: path29.join(".trae", "skills") }
|
|
192379
|
+
trae: { project: path29.join(".trae", "skills"), global: path29.join(".trae", "skills") },
|
|
192380
|
+
// DSH's user skill root is <harness home>/skills; the global root below is
|
|
192381
|
+
// resolved to $DSH_HOME (or ~/.dsh) for dsh by installOfficialSkillsForAgent.
|
|
192382
|
+
dsh: { project: path29.join(".dsh", "skills"), global: "skills" }
|
|
192237
192383
|
};
|
|
192238
192384
|
PACKAGE_OWNED_HOOK_AGENTS = /* @__PURE__ */ new Set(["openclaw", "hermes", "omp"]);
|
|
192239
192385
|
}
|
|
@@ -192266,7 +192412,7 @@ __export(setup_exports, {
|
|
|
192266
192412
|
import { spawnSync } from "child_process";
|
|
192267
192413
|
import { existsSync as existsSync14 } from "fs";
|
|
192268
192414
|
import { copyFile as copyFile2, mkdir as mkdir6, readFile as readFile6, readdir as readdir3, rm as rm2, writeFile as writeFile7 } from "fs/promises";
|
|
192269
|
-
import { homedir as
|
|
192415
|
+
import { homedir as homedir26 } from "os";
|
|
192270
192416
|
import path30 from "path";
|
|
192271
192417
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
192272
192418
|
function getSetupAgentTargets() {
|
|
@@ -192390,7 +192536,7 @@ async function stripHookCaptureFromOpenClawBundle(bundlePath) {
|
|
|
192390
192536
|
function mergeHermesPluginEnabled(existingContent, pluginName) {
|
|
192391
192537
|
let config2 = {};
|
|
192392
192538
|
try {
|
|
192393
|
-
const loaded = existingContent ? (0,
|
|
192539
|
+
const loaded = existingContent ? (0, import_yaml5.parse)(existingContent) : {};
|
|
192394
192540
|
config2 = loaded && typeof loaded === "object" && !Array.isArray(loaded) ? loaded : {};
|
|
192395
192541
|
} catch {
|
|
192396
192542
|
config2 = {};
|
|
@@ -192399,7 +192545,7 @@ function mergeHermesPluginEnabled(existingContent, pluginName) {
|
|
|
192399
192545
|
const plugins = pluginsValue && typeof pluginsValue === "object" && !Array.isArray(pluginsValue) ? pluginsValue : {};
|
|
192400
192546
|
const enabled = Array.isArray(plugins.enabled) ? plugins.enabled.filter((value) => typeof value === "string") : [];
|
|
192401
192547
|
if (!enabled.includes(pluginName)) enabled.push(pluginName);
|
|
192402
|
-
return (0,
|
|
192548
|
+
return (0, import_yaml5.stringify)({
|
|
192403
192549
|
...config2,
|
|
192404
192550
|
plugins: {
|
|
192405
192551
|
...plugins,
|
|
@@ -192427,7 +192573,8 @@ function getMcpAdapter(agent) {
|
|
|
192427
192573
|
omp: new OmpMCPAdapter(),
|
|
192428
192574
|
kiro: new KiroMCPAdapter(),
|
|
192429
192575
|
opencode: new OpenCodeMCPAdapter(),
|
|
192430
|
-
trae: new TraeMCPAdapter()
|
|
192576
|
+
trae: new TraeMCPAdapter(),
|
|
192577
|
+
dsh: new DshMCPAdapter()
|
|
192431
192578
|
};
|
|
192432
192579
|
return adapters[agent];
|
|
192433
192580
|
}
|
|
@@ -192547,7 +192694,7 @@ function isOwnedLegacyCodexMcp(content) {
|
|
|
192547
192694
|
const server = new CodexMCPAdapter().parse(content).find((entry) => entry.name === "memorix");
|
|
192548
192695
|
return Boolean(server && isLegacyCodexMemorixNodeServer(server));
|
|
192549
192696
|
}
|
|
192550
|
-
async function removeLegacyCodexMemorixMcpConfig(configPath = path30.join(
|
|
192697
|
+
async function removeLegacyCodexMemorixMcpConfig(configPath = path30.join(homedir26(), ".codex", "config.toml")) {
|
|
192551
192698
|
let existingContent;
|
|
192552
192699
|
try {
|
|
192553
192700
|
existingContent = await readFile6(configPath, "utf-8");
|
|
@@ -192604,7 +192751,7 @@ async function removeOwnedLegacyCodexPluginFolder(homeDir) {
|
|
|
192604
192751
|
}
|
|
192605
192752
|
}
|
|
192606
192753
|
async function migrateLegacyCodexIntegration(options = {}) {
|
|
192607
|
-
const homeDir = options.homeDir ??
|
|
192754
|
+
const homeDir = options.homeDir ?? homedir26();
|
|
192608
192755
|
const projectRoot = options.projectRoot ?? process.cwd();
|
|
192609
192756
|
const configPath = path30.join(homeDir, ".codex", "config.toml");
|
|
192610
192757
|
let mcp = "missing";
|
|
@@ -192635,14 +192782,14 @@ async function migrateLegacyCodexIntegration(options = {}) {
|
|
|
192635
192782
|
function mergeYamlMcpConfig(existingContent, generatedContent) {
|
|
192636
192783
|
let existing = {};
|
|
192637
192784
|
try {
|
|
192638
|
-
const loaded = existingContent ? (0,
|
|
192785
|
+
const loaded = existingContent ? (0, import_yaml5.parse)(existingContent) : {};
|
|
192639
192786
|
existing = loaded && typeof loaded === "object" && !Array.isArray(loaded) ? loaded : {};
|
|
192640
192787
|
} catch {
|
|
192641
192788
|
existing = {};
|
|
192642
192789
|
}
|
|
192643
192790
|
let generated = {};
|
|
192644
192791
|
try {
|
|
192645
|
-
const loaded = (0,
|
|
192792
|
+
const loaded = (0, import_yaml5.parse)(generatedContent);
|
|
192646
192793
|
generated = loaded && typeof loaded === "object" && !Array.isArray(loaded) ? loaded : {};
|
|
192647
192794
|
} catch {
|
|
192648
192795
|
return generatedContent.endsWith("\n") ? generatedContent : `${generatedContent}
|
|
@@ -192658,7 +192805,46 @@ function mergeYamlMcpConfig(existingContent, generatedContent) {
|
|
|
192658
192805
|
...generatedServers
|
|
192659
192806
|
}
|
|
192660
192807
|
};
|
|
192661
|
-
return (0,
|
|
192808
|
+
return (0, import_yaml5.stringify)(merged, { lineWidth: 0 });
|
|
192809
|
+
}
|
|
192810
|
+
function mergeDshPatchConfig(existingContent, generatedContent) {
|
|
192811
|
+
const generatedTrimmed = generatedContent.trimEnd();
|
|
192812
|
+
if (!existingContent?.trim()) {
|
|
192813
|
+
return generatedTrimmed.endsWith("\n") ? generatedTrimmed : `${generatedTrimmed}
|
|
192814
|
+
`;
|
|
192815
|
+
}
|
|
192816
|
+
const isMemorixInsertRow = (row) => {
|
|
192817
|
+
if (!row || typeof row !== "object" || Array.isArray(row)) return false;
|
|
192818
|
+
const record2 = row;
|
|
192819
|
+
if (record2.name !== "@deepseek-ai/dsh-mcp-client") return false;
|
|
192820
|
+
const config2 = record2.config;
|
|
192821
|
+
return Boolean(
|
|
192822
|
+
config2 && typeof config2 === "object" && !Array.isArray(config2) && config2.serverName === "memorix"
|
|
192823
|
+
);
|
|
192824
|
+
};
|
|
192825
|
+
const opContainsMemorixRow = (op) => {
|
|
192826
|
+
if (!op || typeof op !== "object" || Array.isArray(op)) return false;
|
|
192827
|
+
const insert4 = op.insert;
|
|
192828
|
+
return Array.isArray(insert4) && insert4.some(isMemorixInsertRow);
|
|
192829
|
+
};
|
|
192830
|
+
let existingDocument;
|
|
192831
|
+
try {
|
|
192832
|
+
existingDocument = (0, import_yaml5.parse)(existingContent);
|
|
192833
|
+
} catch {
|
|
192834
|
+
return `${existingContent.trimEnd()}
|
|
192835
|
+
|
|
192836
|
+
${generatedTrimmed}
|
|
192837
|
+
`;
|
|
192838
|
+
}
|
|
192839
|
+
if (!Array.isArray(existingDocument)) {
|
|
192840
|
+
return `${existingContent.trimEnd()}
|
|
192841
|
+
|
|
192842
|
+
${generatedTrimmed}
|
|
192843
|
+
`;
|
|
192844
|
+
}
|
|
192845
|
+
const kept = existingDocument.filter((op) => !opContainsMemorixRow(op));
|
|
192846
|
+
const merged = [...kept, ...(0, import_yaml5.parse)(generatedContent)];
|
|
192847
|
+
return (0, import_yaml5.stringify)(merged, { lineWidth: 0 }) + "\n";
|
|
192662
192848
|
}
|
|
192663
192849
|
async function installMcpConfig(options) {
|
|
192664
192850
|
const adapter = getMcpAdapter(options.agent);
|
|
@@ -192675,7 +192861,7 @@ async function installMcpConfig(options) {
|
|
|
192675
192861
|
existingContent = null;
|
|
192676
192862
|
}
|
|
192677
192863
|
const generated = adapter.generate([server]);
|
|
192678
|
-
const content = options.agent === "codex" ? mergeTomlMcpConfig(existingContent, generated) : options.agent === "hermes" ? mergeYamlMcpConfig(existingContent, generated) : mergeJsonMcpConfig(existingContent, generated);
|
|
192864
|
+
const content = options.agent === "codex" ? mergeTomlMcpConfig(existingContent, generated) : options.agent === "hermes" ? mergeYamlMcpConfig(existingContent, generated) : options.agent === "dsh" ? mergeDshPatchConfig(existingContent, generated) : mergeJsonMcpConfig(existingContent, generated);
|
|
192679
192865
|
await mkdir6(path30.dirname(configPath), { recursive: true });
|
|
192680
192866
|
await writeFile7(configPath, content, "utf-8");
|
|
192681
192867
|
return { agent: options.agent, configPath, transport: options.mcp };
|
|
@@ -192766,7 +192952,7 @@ async function stripCodeBuddyHookCapture(pluginPath) {
|
|
|
192766
192952
|
await writeFile7(manifestPath, JSON.stringify(manifest, null, 2) + "\n", "utf-8");
|
|
192767
192953
|
}
|
|
192768
192954
|
async function installCodeBuddyPluginPackage(options = {}) {
|
|
192769
|
-
const home = options.homeDir ??
|
|
192955
|
+
const home = options.homeDir ?? homedir26();
|
|
192770
192956
|
const packageRoot = findPackageRoot();
|
|
192771
192957
|
const source = path30.join(packageRoot, "plugins", "codebuddy", "memorix");
|
|
192772
192958
|
if (!existsSync14(source)) throw new Error(`CodeBuddy plugin template not found: ${source}`);
|
|
@@ -192786,7 +192972,7 @@ async function installCodeBuddyPluginPackage(options = {}) {
|
|
|
192786
192972
|
};
|
|
192787
192973
|
}
|
|
192788
192974
|
async function installPluginPackage(options) {
|
|
192789
|
-
const home = options.homeDir ??
|
|
192975
|
+
const home = options.homeDir ?? homedir26();
|
|
192790
192976
|
const packageRoot = findPackageRoot();
|
|
192791
192977
|
const source = path30.join(packageRoot, "plugins", options.agent, "memorix");
|
|
192792
192978
|
const includeHooks = options.includeHooks ?? true;
|
|
@@ -192835,7 +193021,7 @@ async function installPluginPackage(options) {
|
|
|
192835
193021
|
};
|
|
192836
193022
|
}
|
|
192837
193023
|
async function installGeminiExtensionPackage(options = {}) {
|
|
192838
|
-
const home = options.homeDir ??
|
|
193024
|
+
const home = options.homeDir ?? homedir26();
|
|
192839
193025
|
const packageRoot = findPackageRoot();
|
|
192840
193026
|
const source = path30.join(packageRoot, "plugins", "gemini", "memorix");
|
|
192841
193027
|
if (!existsSync14(source)) {
|
|
@@ -192855,7 +193041,7 @@ async function installAntigravityPluginPackage(options = {}) {
|
|
|
192855
193041
|
if (!existsSync14(source)) {
|
|
192856
193042
|
throw new Error(`Antigravity plugin template not found: ${source}`);
|
|
192857
193043
|
}
|
|
192858
|
-
const pluginPath = options.global === false ? path30.join(options.projectRoot ?? process.cwd(), ".agents", "plugins", "memorix") : path30.join(options.homeDir ??
|
|
193044
|
+
const pluginPath = options.global === false ? path30.join(options.projectRoot ?? process.cwd(), ".agents", "plugins", "memorix") : path30.join(options.homeDir ?? homedir26(), ".gemini", "config", "plugins", "memorix");
|
|
192859
193045
|
await copyDir(source, pluginPath);
|
|
192860
193046
|
if (options.includeHooks === false) {
|
|
192861
193047
|
await rm2(path30.join(pluginPath, "hooks.json"), { force: true });
|
|
@@ -192873,7 +193059,7 @@ async function installPiPackage(options = {}) {
|
|
|
192873
193059
|
if (!existsSync14(source)) {
|
|
192874
193060
|
throw new Error(`Pi package template not found: ${source}`);
|
|
192875
193061
|
}
|
|
192876
|
-
const defaultRoot = options.global ? path30.join(options.homeDir ??
|
|
193062
|
+
const defaultRoot = options.global ? path30.join(options.homeDir ?? homedir26(), ".pi", "agent", "packages") : path30.join(process.cwd(), ".pi", "packages");
|
|
192877
193063
|
const packagePath = options.packageDir ?? path30.join(defaultRoot, "memorix");
|
|
192878
193064
|
await copyDir(source, packagePath);
|
|
192879
193065
|
await writeOfficialSkills(path30.join(packagePath, "skills"));
|
|
@@ -192885,7 +193071,7 @@ async function installPiPackage(options = {}) {
|
|
|
192885
193071
|
};
|
|
192886
193072
|
}
|
|
192887
193073
|
async function installOpenClawBundlePackage(options = {}) {
|
|
192888
|
-
const home = options.homeDir ??
|
|
193074
|
+
const home = options.homeDir ?? homedir26();
|
|
192889
193075
|
const packageRoot = findPackageRoot();
|
|
192890
193076
|
const source = path30.join(packageRoot, "plugins", "openclaw", "memorix");
|
|
192891
193077
|
if (!existsSync14(source)) {
|
|
@@ -192934,7 +193120,7 @@ async function installOmpPackage(options = {}) {
|
|
|
192934
193120
|
if (!existsSync14(source)) {
|
|
192935
193121
|
throw new Error(`Oh-my-Pi package template not found: ${source}`);
|
|
192936
193122
|
}
|
|
192937
|
-
const defaultRoot = options.global ? path30.join(options.homeDir ??
|
|
193123
|
+
const defaultRoot = options.global ? path30.join(options.homeDir ?? homedir26(), ".omp", "agent", "packages") : path30.join(process.cwd(), ".omp", "packages");
|
|
192938
193124
|
const packagePath = options.packageDir ?? path30.join(defaultRoot, "memorix");
|
|
192939
193125
|
await copyDir(source, packagePath);
|
|
192940
193126
|
await writeOfficialSkills(path30.join(packagePath, "skills"));
|
|
@@ -193208,7 +193394,7 @@ ${result.stdout || ""}`.toLowerCase();
|
|
|
193208
193394
|
}
|
|
193209
193395
|
async function installAgentSetup(agent, plan, global2) {
|
|
193210
193396
|
const { installAgentGuidance: installAgentGuidance2, installHooks: installHooks2 } = await Promise.resolve().then(() => (init_installers(), installers_exports));
|
|
193211
|
-
const targetRoot = global2 ?
|
|
193397
|
+
const targetRoot = global2 ? homedir26() : process.cwd();
|
|
193212
193398
|
const hasPluginPackage = plan.actions.includes("plugin-package") && PLUGIN_PACKAGE_AGENTS.has(agent);
|
|
193213
193399
|
const hasExtensionPackage = plan.actions.includes("extension-package") && agent === "gemini-cli";
|
|
193214
193400
|
const hasPiPackage = plan.actions.includes("pi-package") && agent === "pi";
|
|
@@ -193394,14 +193580,14 @@ function printSetupIntegrationRows() {
|
|
|
193394
193580
|
].join("\n");
|
|
193395
193581
|
ye2(table, "Memorix integrations");
|
|
193396
193582
|
}
|
|
193397
|
-
var
|
|
193583
|
+
var import_yaml5, PLUGIN_PACKAGE_AGENTS, EXTENSION_PACKAGE_AGENTS, PI_PACKAGE_AGENTS, OPENCLAW_BUNDLE_AGENTS, ANTIGRAVITY_PLUGIN_AGENTS, HERMES_PLUGIN_AGENTS, OMP_PACKAGE_AGENTS, CODEBUDDY_PLUGIN_AGENTS, PACKAGE_OWNED_INTEGRATION_AGENTS, SUPPORTED_SETUP_AGENTS, getSetupIntegrationRows2, setup_default;
|
|
193398
193584
|
var init_setup = __esm({
|
|
193399
193585
|
"src/cli/commands/setup.ts"() {
|
|
193400
193586
|
"use strict";
|
|
193401
193587
|
init_esm_shims();
|
|
193402
193588
|
init_dist2();
|
|
193403
193589
|
init_dist4();
|
|
193404
|
-
|
|
193590
|
+
import_yaml5 = __toESM(require_dist(), 1);
|
|
193405
193591
|
init_claude_code();
|
|
193406
193592
|
init_codex();
|
|
193407
193593
|
init_cursor();
|
|
@@ -193415,6 +193601,7 @@ var init_setup = __esm({
|
|
|
193415
193601
|
init_kiro();
|
|
193416
193602
|
init_opencode();
|
|
193417
193603
|
init_trae();
|
|
193604
|
+
init_dsh();
|
|
193418
193605
|
init_codebuddy();
|
|
193419
193606
|
init_registry2();
|
|
193420
193607
|
init_official_skills();
|
|
@@ -193443,6 +193630,7 @@ var init_setup = __esm({
|
|
|
193443
193630
|
"omp",
|
|
193444
193631
|
"kiro",
|
|
193445
193632
|
"trae",
|
|
193633
|
+
"dsh",
|
|
193446
193634
|
"pi"
|
|
193447
193635
|
];
|
|
193448
193636
|
getSetupIntegrationRows2 = getSetupIntegrationRows;
|
|
@@ -193454,7 +193642,7 @@ var init_setup = __esm({
|
|
|
193454
193642
|
args: {
|
|
193455
193643
|
agent: {
|
|
193456
193644
|
type: "string",
|
|
193457
|
-
description: "Target agent (claude, codex, codebuddy, opencode, cursor, windsurf, copilot, gemini-cli, antigravity, openclaw, hermes, omp, kiro, trae, pi, all)",
|
|
193645
|
+
description: "Target agent (claude, codex, codebuddy, opencode, cursor, windsurf, copilot, gemini-cli, antigravity, openclaw, hermes, omp, kiro, trae, dsh, pi, all)",
|
|
193458
193646
|
required: false
|
|
193459
193647
|
},
|
|
193460
193648
|
mcp: {
|
|
@@ -193526,6 +193714,7 @@ var init_setup = __esm({
|
|
|
193526
193714
|
{ value: "hermes", label: "Hermes Agent", hint: "plugin + hooks + commands + skills + MCP" },
|
|
193527
193715
|
{ value: "omp", label: "Oh-my-Pi", hint: "package + extension + command + MCP" },
|
|
193528
193716
|
{ value: "pi", label: "Pi coding agent", hint: "package + extension + skill" },
|
|
193717
|
+
{ value: "dsh", label: "DeepSeek Harness", hint: "MCP patch + AGENTS.md + skills" },
|
|
193529
193718
|
{ value: "opencode", label: "OpenCode", hint: "local plugin + AGENTS.md + MCP" },
|
|
193530
193719
|
{ value: "windsurf", label: "Windsurf", hint: "rules + hooks + MCP" },
|
|
193531
193720
|
{ value: "all", label: "All supported agents", hint: "install detected-compatible files" }
|
|
@@ -193585,7 +193774,7 @@ var config_path_exports = {};
|
|
|
193585
193774
|
__export(config_path_exports, {
|
|
193586
193775
|
default: () => config_path_default
|
|
193587
193776
|
});
|
|
193588
|
-
import { homedir as
|
|
193777
|
+
import { homedir as homedir27 } from "os";
|
|
193589
193778
|
var config_path_default;
|
|
193590
193779
|
var init_config_path = __esm({
|
|
193591
193780
|
"src/cli/commands/config-path.ts"() {
|
|
@@ -193603,7 +193792,7 @@ var init_config_path = __esm({
|
|
|
193603
193792
|
run: async () => {
|
|
193604
193793
|
const project = detectProject(process.cwd());
|
|
193605
193794
|
ye2([
|
|
193606
|
-
`Global: ${getGlobalConfigTomlPath(
|
|
193795
|
+
`Global: ${getGlobalConfigTomlPath(homedir27())}`,
|
|
193607
193796
|
`Project: ${project ? getProjectConfigTomlPath(project.rootPath) : "not inside a git project"}`
|
|
193608
193797
|
].join("\n"), "Memorix config");
|
|
193609
193798
|
}
|
|
@@ -193679,7 +193868,7 @@ __export(config_migrate_exports, {
|
|
|
193679
193868
|
serializeResolvedConfigToToml: () => serializeResolvedConfigToToml
|
|
193680
193869
|
});
|
|
193681
193870
|
import { mkdirSync as mkdirSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
193682
|
-
import { homedir as
|
|
193871
|
+
import { homedir as homedir28 } from "os";
|
|
193683
193872
|
import { dirname as dirname4 } from "path";
|
|
193684
193873
|
function serializeResolvedConfigToToml(config2, options = {}) {
|
|
193685
193874
|
const includeSecrets = options.includeSecrets === true;
|
|
@@ -193772,7 +193961,7 @@ var init_config_migrate = __esm({
|
|
|
193772
193961
|
v3.error("Not inside a git project. Use `memorix config migrate --global` for global config.");
|
|
193773
193962
|
return;
|
|
193774
193963
|
}
|
|
193775
|
-
const target = isGlobal ? getGlobalConfigTomlPath(
|
|
193964
|
+
const target = isGlobal ? getGlobalConfigTomlPath(homedir28()) : getProjectConfigTomlPath(project.rootPath);
|
|
193776
193965
|
const resolved = getResolvedConfig({ projectRoot: project?.rootPath ?? null });
|
|
193777
193966
|
const content = serializeResolvedConfigToToml(resolved, { includeSecrets: isGlobal });
|
|
193778
193967
|
mkdirSync2(dirname4(target), { recursive: true });
|
|
@@ -193784,8 +193973,8 @@ var init_config_migrate = __esm({
|
|
|
193784
193973
|
});
|
|
193785
193974
|
|
|
193786
193975
|
// src/cli/commands/integrate-shared.ts
|
|
193787
|
-
import { homedir as
|
|
193788
|
-
function getIntegrationTargetRoot(useGlobalDefaults, cwd, homeDir =
|
|
193976
|
+
import { homedir as homedir29 } from "os";
|
|
193977
|
+
function getIntegrationTargetRoot(useGlobalDefaults, cwd, homeDir = homedir29()) {
|
|
193789
193978
|
return useGlobalDefaults ? homeDir : cwd;
|
|
193790
193979
|
}
|
|
193791
193980
|
function getIntegrationScopeLabel(useGlobalDefaults) {
|
|
@@ -193822,7 +194011,8 @@ function getAgentLabel(agent) {
|
|
|
193822
194011
|
codex: "Codex",
|
|
193823
194012
|
antigravity: "Antigravity",
|
|
193824
194013
|
"gemini-cli": "Gemini CLI",
|
|
193825
|
-
trae: "Trae"
|
|
194014
|
+
trae: "Trae",
|
|
194015
|
+
dsh: "DeepSeek Harness"
|
|
193826
194016
|
};
|
|
193827
194017
|
return labels[agent] || agent;
|
|
193828
194018
|
}
|
|
@@ -193837,7 +194027,8 @@ function getAgentHint(agent) {
|
|
|
193837
194027
|
codex: "AGENTS.md",
|
|
193838
194028
|
antigravity: "plugin + MCP + hooks + skills",
|
|
193839
194029
|
"gemini-cli": "settings + GEMINI.md",
|
|
193840
|
-
trae: "rules"
|
|
194030
|
+
trae: "rules",
|
|
194031
|
+
dsh: "MCP patch + AGENTS.md + skills"
|
|
193841
194032
|
};
|
|
193842
194033
|
return hints[agent] || "integration files";
|
|
193843
194034
|
}
|
|
@@ -194830,7 +195021,7 @@ __export(external_provider_exports, {
|
|
|
194830
195021
|
});
|
|
194831
195022
|
import { spawn as spawn5 } from "child_process";
|
|
194832
195023
|
import { existsSync as existsSync16, readFileSync as readFileSync9 } from "fs";
|
|
194833
|
-
import { delimiter, dirname as dirname5, extname, isAbsolute as isAbsolute2, join as
|
|
195024
|
+
import { delimiter, dirname as dirname5, extname, isAbsolute as isAbsolute2, join as join23, relative as relative2, resolve as resolve3, sep as sep2 } from "path";
|
|
194834
195025
|
function boundedTimeout(value) {
|
|
194835
195026
|
if (!Number.isFinite(value)) return DEFAULT_EXTERNAL_CODEGRAPH_TIMEOUT_MS;
|
|
194836
195027
|
return Math.max(100, Math.min(Math.floor(value), MAX_EXTERNAL_CODEGRAPH_TIMEOUT_MS));
|
|
@@ -194859,10 +195050,10 @@ function resolveCommandCandidates(command) {
|
|
|
194859
195050
|
}
|
|
194860
195051
|
const names = extname(requested) ? [requested] : process.platform === "win32" ? [requested + ".exe", requested + ".cmd", requested + ".js", requested] : [requested];
|
|
194861
195052
|
const directories = [
|
|
194862
|
-
...process.platform === "win32" && process.env.LOCALAPPDATA ? [
|
|
195053
|
+
...process.platform === "win32" && process.env.LOCALAPPDATA ? [join23(process.env.LOCALAPPDATA, "codegraph", "current", "bin")] : [],
|
|
194863
195054
|
...(process.env.PATH ?? "").split(delimiter).filter(Boolean)
|
|
194864
195055
|
];
|
|
194865
|
-
return [...new Set(directories.flatMap((directory) => names.map((name) =>
|
|
195056
|
+
return [...new Set(directories.flatMap((directory) => names.map((name) => join23(directory, name))))];
|
|
194866
195057
|
}
|
|
194867
195058
|
function resolveLaunch(command) {
|
|
194868
195059
|
for (const candidate2 of resolveCommandCandidates(command)) {
|
|
@@ -194870,8 +195061,8 @@ function resolveLaunch(command) {
|
|
|
194870
195061
|
const extension3 = extname(candidate2).toLowerCase();
|
|
194871
195062
|
if (extension3 === ".cmd") {
|
|
194872
195063
|
const bundleRoot = resolve3(dirname5(candidate2), "..");
|
|
194873
|
-
const node =
|
|
194874
|
-
const entry =
|
|
195064
|
+
const node = join23(bundleRoot, "node.exe");
|
|
195065
|
+
const entry = join23(bundleRoot, "lib", "dist", "bin", "codegraph.js");
|
|
194875
195066
|
if (existsSync16(node) && existsSync16(entry)) {
|
|
194876
195067
|
return { executable: node, prefixArgs: ["--liftoff-only", entry] };
|
|
194877
195068
|
}
|
|
@@ -195002,7 +195193,7 @@ async function inspectExternalCodeGraph(input) {
|
|
|
195002
195193
|
const health2 = { state: "disabled", reason: "External CodeGraph is disabled by configuration." };
|
|
195003
195194
|
return { health: health2, quality: providerQuality({ mode, health: health2 }) };
|
|
195004
195195
|
}
|
|
195005
|
-
if (!existsSync16(
|
|
195196
|
+
if (!existsSync16(join23(input.projectRoot, ".codegraph"))) {
|
|
195006
195197
|
const health2 = { state: "not-detected", reason: "No local .codegraph index is present for this project." };
|
|
195007
195198
|
return { health: health2, quality: providerQuality({ mode, health: health2 }) };
|
|
195008
195199
|
}
|
|
@@ -200229,8 +200420,8 @@ __export(engine_exports2, {
|
|
|
200229
200420
|
SkillsEngine: () => SkillsEngine
|
|
200230
200421
|
});
|
|
200231
200422
|
import { existsSync as existsSync18, readFileSync as readFileSync10, writeFileSync as writeFileSync3, mkdirSync as mkdirSync3, readdirSync as readdirSync3 } from "fs";
|
|
200232
|
-
import { join as
|
|
200233
|
-
import { homedir as
|
|
200423
|
+
import { join as join24 } from "path";
|
|
200424
|
+
import { homedir as homedir30 } from "os";
|
|
200234
200425
|
var SKILLS_DIRS, SKILL_WORTHY_TYPES, MIN_OBS_FOR_SKILL, MIN_SCORE_FOR_SKILL, LOW_SIGNAL_TITLE_PATTERNS, LOW_SIGNAL_ENTITY_PATTERNS, COMMAND_TRACE_PATTERNS2, SkillsEngine;
|
|
200235
200426
|
var init_engine4 = __esm({
|
|
200236
200427
|
"src/skills/engine.ts"() {
|
|
@@ -200301,12 +200492,12 @@ var init_engine4 = __esm({
|
|
|
200301
200492
|
listSkills() {
|
|
200302
200493
|
const skills = [];
|
|
200303
200494
|
const seen = /* @__PURE__ */ new Set();
|
|
200304
|
-
const home =
|
|
200495
|
+
const home = homedir30();
|
|
200305
200496
|
for (const [agent, dirs] of Object.entries(SKILLS_DIRS)) {
|
|
200306
200497
|
for (const dir of dirs) {
|
|
200307
|
-
const paths = [
|
|
200498
|
+
const paths = [join24(this.projectRoot, dir)];
|
|
200308
200499
|
if (!this.skipGlobal) {
|
|
200309
|
-
paths.push(
|
|
200500
|
+
paths.push(join24(home, dir));
|
|
200310
200501
|
}
|
|
200311
200502
|
for (const skillsRoot of paths) {
|
|
200312
200503
|
if (!existsSync18(skillsRoot)) continue;
|
|
@@ -200316,7 +200507,7 @@ var init_engine4 = __esm({
|
|
|
200316
200507
|
if (!entry.isDirectory()) continue;
|
|
200317
200508
|
const name = entry.name;
|
|
200318
200509
|
if (seen.has(name)) continue;
|
|
200319
|
-
const skillMd =
|
|
200510
|
+
const skillMd = join24(skillsRoot, name, "SKILL.md");
|
|
200320
200511
|
if (!existsSync18(skillMd)) continue;
|
|
200321
200512
|
try {
|
|
200322
200513
|
const content = readFileSync10(skillMd, "utf-8");
|
|
@@ -200324,7 +200515,7 @@ var init_engine4 = __esm({
|
|
|
200324
200515
|
skills.push({
|
|
200325
200516
|
name,
|
|
200326
200517
|
description,
|
|
200327
|
-
sourcePath:
|
|
200518
|
+
sourcePath: join24(skillsRoot, name),
|
|
200328
200519
|
sourceAgent: agent,
|
|
200329
200520
|
content,
|
|
200330
200521
|
generated: false
|
|
@@ -200367,11 +200558,11 @@ var init_engine4 = __esm({
|
|
|
200367
200558
|
writeSkill(skill2, target) {
|
|
200368
200559
|
const dirs = SKILLS_DIRS[target];
|
|
200369
200560
|
if (!dirs || dirs.length === 0) return null;
|
|
200370
|
-
const targetDir =
|
|
200561
|
+
const targetDir = join24(this.projectRoot, dirs[0], skill2.name);
|
|
200371
200562
|
try {
|
|
200372
200563
|
mkdirSync3(targetDir, { recursive: true });
|
|
200373
|
-
writeFileSync3(
|
|
200374
|
-
return
|
|
200564
|
+
writeFileSync3(join24(targetDir, "SKILL.md"), skill2.content, "utf-8");
|
|
200565
|
+
return join24(dirs[0], skill2.name, "SKILL.md");
|
|
200375
200566
|
} catch {
|
|
200376
200567
|
return null;
|
|
200377
200568
|
}
|
|
@@ -201540,7 +201731,7 @@ var init_task_graph = __esm({
|
|
|
201540
201731
|
// src/orchestrate/context-collector.ts
|
|
201541
201732
|
import { execFileSync as execFileSync2 } from "child_process";
|
|
201542
201733
|
import { readFileSync as readFileSync11, existsSync as existsSync19 } from "fs";
|
|
201543
|
-
import { join as
|
|
201734
|
+
import { join as join25 } from "path";
|
|
201544
201735
|
function normalizeEntryLimit(value, fallback) {
|
|
201545
201736
|
if (!Number.isSafeInteger(value) || value < 1) return fallback;
|
|
201546
201737
|
return Math.min(value, 500);
|
|
@@ -201615,7 +201806,7 @@ function collectFileTree(projectDir2, maxEntries) {
|
|
|
201615
201806
|
}
|
|
201616
201807
|
function collectDependencies(projectDir2) {
|
|
201617
201808
|
try {
|
|
201618
|
-
const pkgPath =
|
|
201809
|
+
const pkgPath = join25(projectDir2, "package.json");
|
|
201619
201810
|
if (!existsSync19(pkgPath)) return "";
|
|
201620
201811
|
const pkg = JSON.parse(readFileSync11(pkgPath, "utf-8"));
|
|
201621
201812
|
const parts = [];
|
|
@@ -215855,8 +216046,8 @@ __export(engine_exports3, {
|
|
|
215855
216046
|
WorkspaceSyncEngine: () => WorkspaceSyncEngine
|
|
215856
216047
|
});
|
|
215857
216048
|
import { readFileSync as readFileSync13, readdirSync as readdirSync4, existsSync as existsSync22, cpSync, mkdirSync as mkdirSync5 } from "fs";
|
|
215858
|
-
import { join as
|
|
215859
|
-
import { homedir as
|
|
216049
|
+
import { join as join27 } from "path";
|
|
216050
|
+
import { homedir as homedir31 } from "os";
|
|
215860
216051
|
var WorkspaceSyncEngine;
|
|
215861
216052
|
var init_engine5 = __esm({
|
|
215862
216053
|
"src/workspace/engine.ts"() {
|
|
@@ -215928,9 +216119,9 @@ var init_engine5 = __esm({
|
|
|
215928
216119
|
const globalPath = adapter.getConfigPath();
|
|
215929
216120
|
const pathsToCheck = [configPath, globalPath];
|
|
215930
216121
|
if (target === "antigravity") {
|
|
215931
|
-
pathsToCheck.push(
|
|
215932
|
-
pathsToCheck.push(
|
|
215933
|
-
pathsToCheck.push(
|
|
216122
|
+
pathsToCheck.push(join27(this.projectRoot, ".gemini", "settings.json"));
|
|
216123
|
+
pathsToCheck.push(join27(homedir31(), ".gemini", "settings.json"));
|
|
216124
|
+
pathsToCheck.push(join27(homedir31(), ".gemini", "antigravity", "mcp_config.json"));
|
|
215934
216125
|
}
|
|
215935
216126
|
const merged = /* @__PURE__ */ new Map();
|
|
215936
216127
|
for (const path47 of pathsToCheck) {
|
|
@@ -216047,7 +216238,7 @@ var init_engine5 = __esm({
|
|
|
216047
216238
|
getTargetSkillsDir(target) {
|
|
216048
216239
|
const dirs = _WorkspaceSyncEngine.SKILLS_DIRS[target];
|
|
216049
216240
|
if (!dirs || dirs.length === 0) return null;
|
|
216050
|
-
return
|
|
216241
|
+
return join27(this.projectRoot, dirs[0]);
|
|
216051
216242
|
}
|
|
216052
216243
|
/**
|
|
216053
216244
|
* Scan all agent skills directories and collect unique skills.
|
|
@@ -216056,12 +216247,12 @@ var init_engine5 = __esm({
|
|
|
216056
216247
|
const skills = [];
|
|
216057
216248
|
const conflicts = [];
|
|
216058
216249
|
const seen = /* @__PURE__ */ new Map();
|
|
216059
|
-
const home =
|
|
216250
|
+
const home = homedir31();
|
|
216060
216251
|
for (const [agent, dirs] of Object.entries(_WorkspaceSyncEngine.SKILLS_DIRS)) {
|
|
216061
216252
|
for (const dir of dirs) {
|
|
216062
216253
|
const paths = [
|
|
216063
|
-
|
|
216064
|
-
|
|
216254
|
+
join27(this.projectRoot, dir),
|
|
216255
|
+
join27(home, dir)
|
|
216065
216256
|
];
|
|
216066
216257
|
for (const skillsRoot of paths) {
|
|
216067
216258
|
if (!existsSync22(skillsRoot)) continue;
|
|
@@ -216069,7 +216260,7 @@ var init_engine5 = __esm({
|
|
|
216069
216260
|
const entries = readdirSync4(skillsRoot, { withFileTypes: true });
|
|
216070
216261
|
for (const entry of entries) {
|
|
216071
216262
|
if (!entry.isDirectory()) continue;
|
|
216072
|
-
const skillMd =
|
|
216263
|
+
const skillMd = join27(skillsRoot, entry.name, "SKILL.md");
|
|
216073
216264
|
if (!existsSync22(skillMd)) continue;
|
|
216074
216265
|
let description = "";
|
|
216075
216266
|
try {
|
|
@@ -216081,7 +216272,7 @@ var init_engine5 = __esm({
|
|
|
216081
216272
|
const newEntry = {
|
|
216082
216273
|
name: entry.name,
|
|
216083
216274
|
description,
|
|
216084
|
-
sourcePath:
|
|
216275
|
+
sourcePath: join27(skillsRoot, entry.name),
|
|
216085
216276
|
sourceAgent: agent
|
|
216086
216277
|
};
|
|
216087
216278
|
const existing = seen.get(entry.name);
|
|
@@ -216118,7 +216309,7 @@ var init_engine5 = __esm({
|
|
|
216118
216309
|
}
|
|
216119
216310
|
for (const skill2 of skills) {
|
|
216120
216311
|
if (skill2.sourceAgent === target) continue;
|
|
216121
|
-
const dest =
|
|
216312
|
+
const dest = join27(targetDir, skill2.name);
|
|
216122
216313
|
if (existsSync22(dest)) {
|
|
216123
216314
|
skipped.push(`${skill2.name} (already exists in ${target})`);
|
|
216124
216315
|
continue;
|
|
@@ -216134,13 +216325,13 @@ var init_engine5 = __esm({
|
|
|
216134
216325
|
}
|
|
216135
216326
|
scanWorkflows() {
|
|
216136
216327
|
const workflows = [];
|
|
216137
|
-
const wfDir =
|
|
216328
|
+
const wfDir = join27(this.projectRoot, ".windsurf", "workflows");
|
|
216138
216329
|
if (!existsSync22(wfDir)) return workflows;
|
|
216139
216330
|
try {
|
|
216140
216331
|
const files = readdirSync4(wfDir).filter((f7) => f7.endsWith(".md"));
|
|
216141
216332
|
for (const file2 of files) {
|
|
216142
216333
|
try {
|
|
216143
|
-
const content = readFileSync13(
|
|
216334
|
+
const content = readFileSync13(join27(wfDir, file2), "utf-8");
|
|
216144
216335
|
workflows.push(this.workflowSyncer.parseWindsurfWorkflow(file2, content));
|
|
216145
216336
|
} catch {
|
|
216146
216337
|
}
|
|
@@ -216348,7 +216539,7 @@ __export(behavior_exports, {
|
|
|
216348
216539
|
resetBehaviorConfigCache: () => resetBehaviorConfigCache
|
|
216349
216540
|
});
|
|
216350
216541
|
import { existsSync as existsSync23, readFileSync as readFileSync14 } from "fs";
|
|
216351
|
-
import { homedir as
|
|
216542
|
+
import { homedir as homedir32 } from "os";
|
|
216352
216543
|
function isSessionInject(value) {
|
|
216353
216544
|
return value === "full" || value === "minimal" || value === "silent";
|
|
216354
216545
|
}
|
|
@@ -216366,7 +216557,7 @@ function legacyBehavior(homeDir) {
|
|
|
216366
216557
|
}
|
|
216367
216558
|
}
|
|
216368
216559
|
function getBehaviorConfig(options = {}) {
|
|
216369
|
-
const homeDir = options.homeDir ??
|
|
216560
|
+
const homeDir = options.homeDir ?? homedir32();
|
|
216370
216561
|
const projectRoot = options.projectRoot === void 0 ? detectProject()?.rootPath ?? null : options.projectRoot;
|
|
216371
216562
|
const cacheKey2 = `${homeDir}\0${projectRoot ?? ""}`;
|
|
216372
216563
|
const cached2 = cache4.get(cacheKey2);
|
|
@@ -217335,7 +217526,7 @@ async function handleApi(req, res, dataDir, projectId, projectName, baseDir, pro
|
|
|
217335
217526
|
case "/config": {
|
|
217336
217527
|
const os6 = await import("os");
|
|
217337
217528
|
const { existsSync: existsSync33 } = await import("fs");
|
|
217338
|
-
const { join:
|
|
217529
|
+
const { join: join34 } = await import("path");
|
|
217339
217530
|
let yml = {};
|
|
217340
217531
|
const configProjectRoot = effectiveProjectRoot;
|
|
217341
217532
|
try {
|
|
@@ -217360,11 +217551,11 @@ async function handleApi(req, res, dataDir, projectId, projectName, baseDir, pro
|
|
|
217360
217551
|
try {
|
|
217361
217552
|
const home = os6.homedir();
|
|
217362
217553
|
const paths = {
|
|
217363
|
-
"project memorix.yml": configProjectRoot ?
|
|
217364
|
-
"user memorix.yml":
|
|
217365
|
-
"project .env": configProjectRoot ?
|
|
217366
|
-
"user .env":
|
|
217367
|
-
"legacy config.json":
|
|
217554
|
+
"project memorix.yml": configProjectRoot ? join34(configProjectRoot, "memorix.yml") : null,
|
|
217555
|
+
"user memorix.yml": join34(home, ".memorix", "memorix.yml"),
|
|
217556
|
+
"project .env": configProjectRoot ? join34(configProjectRoot, ".env") : null,
|
|
217557
|
+
"user .env": join34(home, ".memorix", ".env"),
|
|
217558
|
+
"legacy config.json": join34(home, ".memorix", "config.json")
|
|
217368
217559
|
};
|
|
217369
217560
|
for (const [key, fpath] of Object.entries(paths)) {
|
|
217370
217561
|
if (fpath === null) {
|
|
@@ -258268,7 +258459,7 @@ The path should point to a directory containing a .git folder.`
|
|
|
258268
258459
|
};
|
|
258269
258460
|
const server = existingServer ?? new McpServer({
|
|
258270
258461
|
name: "memorix",
|
|
258271
|
-
version: true ? "1.4.
|
|
258462
|
+
version: true ? "1.4.5" : "1.0.1"
|
|
258272
258463
|
});
|
|
258273
258464
|
const originalRegisterTool = server.registerTool.bind(server);
|
|
258274
258465
|
server.registerTool = ((name, ...args) => {
|
|
@@ -260270,10 +260461,10 @@ ${Math.max(0, managedIds.size - result.resolved.length)} visible writable observ
|
|
|
260270
260461
|
);
|
|
260271
260462
|
let enableKG = isToolInProfile("create_entities", toolProfile);
|
|
260272
260463
|
try {
|
|
260273
|
-
const { homedir:
|
|
260274
|
-
const { join:
|
|
260464
|
+
const { homedir: homedir36 } = await import("os");
|
|
260465
|
+
const { join: join34 } = await import("path");
|
|
260275
260466
|
const { readFile: readFile10 } = await import("fs/promises");
|
|
260276
|
-
const raw = await readFile10(
|
|
260467
|
+
const raw = await readFile10(join34(homedir36(), ".memorix", "settings.json"), "utf-8");
|
|
260277
260468
|
const s4 = JSON.parse(raw);
|
|
260278
260469
|
if (s4.knowledgeGraph === true) enableKG = true;
|
|
260279
260470
|
} catch {
|
|
@@ -262576,8 +262767,8 @@ __export(update_checker_exports, {
|
|
|
262576
262767
|
});
|
|
262577
262768
|
import { execFile as execFile3 } from "child_process";
|
|
262578
262769
|
import { readFile as readFile7, writeFile as writeFile8, mkdir as mkdir7 } from "fs/promises";
|
|
262579
|
-
import { join as
|
|
262580
|
-
import { homedir as
|
|
262770
|
+
import { join as join28 } from "path";
|
|
262771
|
+
import { homedir as homedir33 } from "os";
|
|
262581
262772
|
function getCurrentVersion() {
|
|
262582
262773
|
try {
|
|
262583
262774
|
return getCliVersion();
|
|
@@ -262756,8 +262947,8 @@ var init_update_checker = __esm({
|
|
|
262756
262947
|
MIN_AUTO_UPDATE_TIMEOUT_MS = 5e3;
|
|
262757
262948
|
MAX_AUTO_UPDATE_TIMEOUT_MS = 30 * 60 * 1e3;
|
|
262758
262949
|
REGISTRY_URL = `https://registry.npmjs.org/${PACKAGE_NAME}/latest`;
|
|
262759
|
-
CACHE_DIR2 =
|
|
262760
|
-
CACHE_FILE2 =
|
|
262950
|
+
CACHE_DIR2 = join28(homedir33(), ".memorix");
|
|
262951
|
+
CACHE_FILE2 = join28(CACHE_DIR2, "update-check.json");
|
|
262761
262952
|
_testing = {
|
|
262762
262953
|
CACHE_FILE: CACHE_FILE2,
|
|
262763
262954
|
CHECK_INTERVAL_MS,
|
|
@@ -262813,7 +263004,7 @@ var init_serve = __esm({
|
|
|
262813
263004
|
const { StdioServerTransport: StdioServerTransport2 } = await Promise.resolve().then(() => (init_stdio2(), stdio_exports));
|
|
262814
263005
|
const { createMemorixServer: createMemorixServer2 } = await Promise.resolve().then(() => (init_server4(), server_exports2));
|
|
262815
263006
|
const { detectProject: detectProject2, findGitInSubdirs: findGitInSubdirs2, isSystemDirectory: isSystemDirectory2 } = await Promise.resolve().then(() => (init_detector(), detector_exports));
|
|
262816
|
-
const { homedir:
|
|
263007
|
+
const { homedir: homedir36 } = await import("os");
|
|
262817
263008
|
const { resolveServeProject: resolveServeProject2 } = await Promise.resolve().then(() => (init_serve_shared(), serve_shared_exports));
|
|
262818
263009
|
process.stdin.on("end", () => {
|
|
262819
263010
|
console.error("[memorix] stdin closed \u2014 exiting");
|
|
@@ -262823,7 +263014,7 @@ var init_serve = __esm({
|
|
|
262823
263014
|
try {
|
|
262824
263015
|
safeCwd = process.cwd();
|
|
262825
263016
|
} catch {
|
|
262826
|
-
safeCwd =
|
|
263017
|
+
safeCwd = homedir36();
|
|
262827
263018
|
}
|
|
262828
263019
|
const resolution = resolveServeProject2(
|
|
262829
263020
|
{
|
|
@@ -262831,7 +263022,7 @@ var init_serve = __esm({
|
|
|
262831
263022
|
envProjectRoot: process.env.MEMORIX_PROJECT_ROOT,
|
|
262832
263023
|
initCwd: process.env.INIT_CWD,
|
|
262833
263024
|
processCwd: safeCwd,
|
|
262834
|
-
homeDir:
|
|
263025
|
+
homeDir: homedir36()
|
|
262835
263026
|
},
|
|
262836
263027
|
{ detectProject: detectProject2, findGitInSubdirs: findGitInSubdirs2, isSystemDirectory: isSystemDirectory2 }
|
|
262837
263028
|
);
|
|
@@ -265122,7 +265313,7 @@ var init_serve_http = __esm({
|
|
|
265122
265313
|
const { createProjectBindingController: createProjectBindingController2 } = await Promise.resolve().then(() => (init_request_context(), request_context_exports));
|
|
265123
265314
|
const { findGitInSubdirs: findGitInSubdirs2 } = await Promise.resolve().then(() => (init_detector(), detector_exports));
|
|
265124
265315
|
const { writeFileSync: writeFileSync11, mkdirSync: mkdirSync11 } = await import("fs");
|
|
265125
|
-
const { homedir:
|
|
265316
|
+
const { homedir: homedir36 } = await import("os");
|
|
265126
265317
|
const port = parseTcpPortOrReport(args.port, 3211);
|
|
265127
265318
|
if (port === void 0) {
|
|
265128
265319
|
process.exitCode = 1;
|
|
@@ -265134,7 +265325,7 @@ var init_serve_http = __esm({
|
|
|
265134
265325
|
try {
|
|
265135
265326
|
safeCwd = process.cwd();
|
|
265136
265327
|
} catch {
|
|
265137
|
-
safeCwd =
|
|
265328
|
+
safeCwd = homedir36();
|
|
265138
265329
|
}
|
|
265139
265330
|
let projectRoot = args.cwd || process.env.MEMORIX_PROJECT_ROOT || safeCwd;
|
|
265140
265331
|
console.error(`[memorix] HTTP transport starting on ${host}:${port}`);
|
|
@@ -265844,7 +266035,7 @@ var init_serve_http = __esm({
|
|
|
265844
266035
|
const { projectId: configProjectId } = await resolveRequestProject(url2);
|
|
265845
266036
|
const os6 = await import("os");
|
|
265846
266037
|
const { existsSync: existsSync33 } = await import("fs");
|
|
265847
|
-
const { join:
|
|
266038
|
+
const { join: join34 } = await import("path");
|
|
265848
266039
|
const { loadYamlConfig: loadYamlConfig2 } = await Promise.resolve().then(() => (init_yaml_loader(), yaml_loader_exports));
|
|
265849
266040
|
const { loadFileConfig: loadFileConfig2, loadDotenv: loadDotenv2, getLoadedEnvFiles: getLoadedEnvFiles2 } = await Promise.resolve().then(() => (init_config(), config_exports));
|
|
265850
266041
|
const isStartupProject = configProjectId === defaultProject.id;
|
|
@@ -265858,11 +266049,11 @@ var init_serve_http = __esm({
|
|
|
265858
266049
|
const home = os6.homedir();
|
|
265859
266050
|
if (effectiveRoot) {
|
|
265860
266051
|
const paths = {
|
|
265861
|
-
"project memorix.yml":
|
|
265862
|
-
"user memorix.yml":
|
|
265863
|
-
"project .env":
|
|
265864
|
-
"user .env":
|
|
265865
|
-
"legacy config.json":
|
|
266052
|
+
"project memorix.yml": join34(effectiveRoot, "memorix.yml"),
|
|
266053
|
+
"user memorix.yml": join34(home, ".memorix", "memorix.yml"),
|
|
266054
|
+
"project .env": join34(effectiveRoot, ".env"),
|
|
266055
|
+
"user .env": join34(home, ".memorix", ".env"),
|
|
266056
|
+
"legacy config.json": join34(home, ".memorix", "config.json")
|
|
265866
266057
|
};
|
|
265867
266058
|
for (const [key, fpath] of Object.entries(paths)) {
|
|
265868
266059
|
files[key] = { exists: existsSync33(fpath), path: fpath };
|
|
@@ -265871,9 +266062,9 @@ var init_serve_http = __esm({
|
|
|
265871
266062
|
files["project memorix.yml"] = { exists: false, path: "unavailable", unavailable: true };
|
|
265872
266063
|
files["project .env"] = { exists: false, path: "unavailable", unavailable: true };
|
|
265873
266064
|
const userPaths = {
|
|
265874
|
-
"user memorix.yml":
|
|
265875
|
-
"user .env":
|
|
265876
|
-
"legacy config.json":
|
|
266065
|
+
"user memorix.yml": join34(home, ".memorix", "memorix.yml"),
|
|
266066
|
+
"user .env": join34(home, ".memorix", ".env"),
|
|
266067
|
+
"legacy config.json": join34(home, ".memorix", "config.json")
|
|
265877
266068
|
};
|
|
265878
266069
|
for (const [key, fpath] of Object.entries(userPaths)) {
|
|
265879
266070
|
files[key] = { exists: existsSync33(fpath), path: fpath };
|
|
@@ -268550,6 +268741,7 @@ var init_types9 = __esm({
|
|
|
268550
268741
|
hermes: "community",
|
|
268551
268742
|
opencode: "community",
|
|
268552
268743
|
trae: "community",
|
|
268744
|
+
dsh: "community",
|
|
268553
268745
|
pi: "community",
|
|
268554
268746
|
omp: "community",
|
|
268555
268747
|
antigravity: "community"
|
|
@@ -268608,7 +268800,8 @@ function getAgentLabel2(agent) {
|
|
|
268608
268800
|
openclaw: "OpenClaw",
|
|
268609
268801
|
hermes: "Hermes Agent",
|
|
268610
268802
|
omp: "Oh-my-Pi",
|
|
268611
|
-
trae: "Trae"
|
|
268803
|
+
trae: "Trae",
|
|
268804
|
+
dsh: "DeepSeek Harness"
|
|
268612
268805
|
};
|
|
268613
268806
|
return labels[agent] || agent;
|
|
268614
268807
|
}
|
|
@@ -268626,6 +268819,7 @@ function getAgentHint2(agent) {
|
|
|
268626
268819
|
hermes: "Hermes plugin hooks; use `memorix setup --agent hermes`",
|
|
268627
268820
|
omp: "Oh-my-Pi package hooks; use `memorix setup --agent omp`",
|
|
268628
268821
|
trae: ".trae/rules/project_rules.md (rules only, no hooks system)",
|
|
268822
|
+
dsh: "~/.dsh/cordis.patch.yml MCP row via `memorix setup --agent dsh` (no hooks system)",
|
|
268629
268823
|
codex: "Codex plugin hooks; use `memorix setup --agent codex`"
|
|
268630
268824
|
};
|
|
268631
268825
|
return hints[agent] || "";
|
|
@@ -268733,7 +268927,8 @@ function estimateFileSize(agent, configPath) {
|
|
|
268733
268927
|
codex: "~1KB",
|
|
268734
268928
|
antigravity: "~2KB",
|
|
268735
268929
|
opencode: "~3KB",
|
|
268736
|
-
trae: "~1KB"
|
|
268930
|
+
trae: "~1KB",
|
|
268931
|
+
dsh: "~1KB"
|
|
268737
268932
|
};
|
|
268738
268933
|
return sizes[agent] || "~2KB";
|
|
268739
268934
|
}
|
|
@@ -268751,6 +268946,8 @@ function getRulesPath(agent, cwd, global2) {
|
|
|
268751
268946
|
return path42.join(home, ".gemini", "GEMINI.md");
|
|
268752
268947
|
case "trae":
|
|
268753
268948
|
return path42.join(home, ".trae", "rules", "project_rules.md");
|
|
268949
|
+
case "dsh":
|
|
268950
|
+
return path42.join(process.env.DSH_HOME?.trim() || path42.join(home, ".dsh"), "AGENTS.md");
|
|
268754
268951
|
default:
|
|
268755
268952
|
return "";
|
|
268756
268953
|
}
|
|
@@ -268766,6 +268963,8 @@ function getRulesPath(agent, cwd, global2) {
|
|
|
268766
268963
|
return path42.join(cwd, "GEMINI.md");
|
|
268767
268964
|
case "trae":
|
|
268768
268965
|
return path42.join(cwd, ".trae", "rules", "project_rules.md");
|
|
268966
|
+
case "dsh":
|
|
268967
|
+
return path42.join(cwd, "AGENTS.md");
|
|
268769
268968
|
default:
|
|
268770
268969
|
return "";
|
|
268771
268970
|
}
|
|
@@ -271256,7 +271455,7 @@ import { spawnSync as spawnSync2 } from "child_process";
|
|
|
271256
271455
|
import { existsSync as existsSync28 } from "fs";
|
|
271257
271456
|
import { mkdir as mkdir8, readFile as readFile9, writeFile as writeFile9 } from "fs/promises";
|
|
271258
271457
|
import { basename as basename5, dirname as dirname8, resolve as resolve4 } from "path";
|
|
271259
|
-
import { homedir as
|
|
271458
|
+
import { homedir as homedir34 } from "os";
|
|
271260
271459
|
function requestedAgents(agent) {
|
|
271261
271460
|
const all = getSetupAgentTargets();
|
|
271262
271461
|
if (!agent || agent === "all") return all;
|
|
@@ -271334,16 +271533,16 @@ function asRecordArray(value) {
|
|
|
271334
271533
|
return Array.isArray(value) ? value.map(asRecord3).filter((entry) => entry !== null) : [];
|
|
271335
271534
|
}
|
|
271336
271535
|
function codexPluginPath() {
|
|
271337
|
-
return `${
|
|
271536
|
+
return `${homedir34()}/plugins/${CODEX_PLUGIN_NAME}`;
|
|
271338
271537
|
}
|
|
271339
271538
|
function codexPluginMcpPath() {
|
|
271340
271539
|
return `${codexPluginPath()}/.mcp.json`;
|
|
271341
271540
|
}
|
|
271342
271541
|
function codexMarketplacePath() {
|
|
271343
|
-
return `${
|
|
271542
|
+
return `${homedir34()}/.agents/plugins/marketplace.json`;
|
|
271344
271543
|
}
|
|
271345
271544
|
function codexConfigPath() {
|
|
271346
|
-
return `${
|
|
271545
|
+
return `${homedir34()}/.codex/config.toml`;
|
|
271347
271546
|
}
|
|
271348
271547
|
function normalizeMarketplacePath(value) {
|
|
271349
271548
|
return value.replace(/\\/g, "/").replace(/^\.\//, "");
|
|
@@ -271653,7 +271852,7 @@ function defaultClaudeProjectKey(projectRoot) {
|
|
|
271653
271852
|
return resolve4(projectRoot).replace(/\\/g, "/");
|
|
271654
271853
|
}
|
|
271655
271854
|
function getClaudeLocalConfigPath() {
|
|
271656
|
-
return `${
|
|
271855
|
+
return `${homedir34()}/.claude.json`;
|
|
271657
271856
|
}
|
|
271658
271857
|
function coerceMcpServer(name, value) {
|
|
271659
271858
|
const entry = asRecord3(value);
|
|
@@ -271834,7 +272033,9 @@ async function inspectMcp(agent, projectRoot, scope) {
|
|
|
271834
272033
|
}
|
|
271835
272034
|
}
|
|
271836
272035
|
const configPath = adapter.getConfigPath(targetScope === "project" ? projectRoot : void 0);
|
|
271837
|
-
if (targetScope === "global" && configPath === adapter.getConfigPath(projectRoot))
|
|
272036
|
+
if (targetScope === "global" && configPath === adapter.getConfigPath(projectRoot) && scope === "all") {
|
|
272037
|
+
continue;
|
|
272038
|
+
}
|
|
271838
272039
|
if (!existsSync28(configPath)) {
|
|
271839
272040
|
checks.push({
|
|
271840
272041
|
scope: targetScope,
|
|
@@ -271910,7 +272111,7 @@ async function inspectGuidance(agent, projectRoot, scope) {
|
|
|
271910
272111
|
}
|
|
271911
272112
|
const checks = [];
|
|
271912
272113
|
for (const targetScope of requestedGuidanceScopes(scope)) {
|
|
271913
|
-
const root = targetScope === "project" ? projectRoot :
|
|
272114
|
+
const root = targetScope === "project" ? projectRoot : homedir34();
|
|
271914
272115
|
const rulesPath = getAgentRulesPath(agent, root, targetScope === "global");
|
|
271915
272116
|
if (!existsSync28(rulesPath)) {
|
|
271916
272117
|
checks.push({
|
|
@@ -272126,7 +272327,8 @@ var init_agent_integrations = __esm({
|
|
|
272126
272327
|
"antigravity",
|
|
272127
272328
|
"kiro",
|
|
272128
272329
|
"opencode",
|
|
272129
|
-
"trae"
|
|
272330
|
+
"trae",
|
|
272331
|
+
"dsh"
|
|
272130
272332
|
]);
|
|
272131
272333
|
CODEX_PLUGIN_NAME = "memorix";
|
|
272132
272334
|
CODEX_PLUGIN_MARKETPLACE = "personal";
|
|
@@ -272188,8 +272390,8 @@ var init_doctor = __esm({
|
|
|
272188
272390
|
return;
|
|
272189
272391
|
}
|
|
272190
272392
|
const { existsSync: existsSync33, readFileSync: readFileSync22 } = await import("fs");
|
|
272191
|
-
const { join:
|
|
272192
|
-
const { homedir:
|
|
272393
|
+
const { join: join34, basename: basename7 } = await import("path");
|
|
272394
|
+
const { homedir: homedir36 } = await import("os");
|
|
272193
272395
|
const { execSync: execSync5 } = await import("child_process");
|
|
272194
272396
|
const report = {};
|
|
272195
272397
|
const issues = [];
|
|
@@ -272251,8 +272453,8 @@ var init_doctor = __esm({
|
|
|
272251
272453
|
}
|
|
272252
272454
|
lines.push("");
|
|
272253
272455
|
lines.push("\u250C\u2500 Runtime Mode \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");
|
|
272254
|
-
const memorixDir =
|
|
272255
|
-
const bgStatePath =
|
|
272456
|
+
const memorixDir = join34(homedir36(), ".memorix");
|
|
272457
|
+
const bgStatePath = join34(memorixDir, "background.json");
|
|
272256
272458
|
let bgRunning = false;
|
|
272257
272459
|
let bgPort = 0;
|
|
272258
272460
|
let bgPid = 0;
|
|
@@ -272349,7 +272551,7 @@ var init_doctor = __esm({
|
|
|
272349
272551
|
report.embedding = { mode, status: "temporarily_unavailable" };
|
|
272350
272552
|
}
|
|
272351
272553
|
try {
|
|
272352
|
-
const cachePath =
|
|
272554
|
+
const cachePath = join34(memorixDir, "embedding-cache.json");
|
|
272353
272555
|
if (existsSync33(cachePath)) {
|
|
272354
272556
|
const cache5 = JSON.parse(readFileSync22(cachePath, "utf-8"));
|
|
272355
272557
|
const cacheCount = Object.keys(cache5).length;
|
|
@@ -272543,7 +272745,7 @@ var init_doctor = __esm({
|
|
|
272543
272745
|
lines.push("\u250C\u2500 Conflict Check \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");
|
|
272544
272746
|
let conflictsFound = false;
|
|
272545
272747
|
if (dataDir) {
|
|
272546
|
-
const lockFile =
|
|
272748
|
+
const lockFile = join34(dataDir, ".memorix.lock");
|
|
272547
272749
|
if (existsSync33(lockFile)) {
|
|
272548
272750
|
try {
|
|
272549
272751
|
const lockData = JSON.parse(readFileSync22(lockFile, "utf-8"));
|
|
@@ -273053,6 +273255,16 @@ function checkTOML(p3) {
|
|
|
273053
273255
|
return false;
|
|
273054
273256
|
}
|
|
273055
273257
|
}
|
|
273258
|
+
function checkDshPatch(p3) {
|
|
273259
|
+
if (!exists(p3)) return false;
|
|
273260
|
+
try {
|
|
273261
|
+
const content = fs27.readFileSync(p3, "utf-8");
|
|
273262
|
+
if (!content.includes("memory-memorix")) return false;
|
|
273263
|
+
return /serverName:\s*['"]?memorix['"]?/.test(content);
|
|
273264
|
+
} catch {
|
|
273265
|
+
return false;
|
|
273266
|
+
}
|
|
273267
|
+
}
|
|
273056
273268
|
function getMCPConfigEntries(home, cwd) {
|
|
273057
273269
|
const entries = [];
|
|
273058
273270
|
entries.push({
|
|
@@ -273184,6 +273396,15 @@ function getMCPConfigEntries(home, cwd) {
|
|
|
273184
273396
|
detected: checkJSON(traeCfg),
|
|
273185
273397
|
note: 'Remove the "memorix" key from mcpServers in this file.'
|
|
273186
273398
|
});
|
|
273399
|
+
const dshPatchPath = path45.join(process.env.DSH_HOME?.trim() || path45.join(home, ".dsh"), "cordis.patch.yml");
|
|
273400
|
+
entries.push({
|
|
273401
|
+
agent: "DeepSeek Harness",
|
|
273402
|
+
path: dshPatchPath,
|
|
273403
|
+
kind: "global",
|
|
273404
|
+
format: "json",
|
|
273405
|
+
detected: checkDshPatch(dshPatchPath),
|
|
273406
|
+
note: "Remove the memory-memorix insert row from this patch file."
|
|
273407
|
+
});
|
|
273187
273408
|
return entries;
|
|
273188
273409
|
}
|
|
273189
273410
|
function checkBackground(home) {
|
|
@@ -274688,7 +274909,7 @@ var init_pipeline_trace = __esm({
|
|
|
274688
274909
|
// src/orchestrate/worktree.ts
|
|
274689
274910
|
import { execFileSync as execFileSync5 } from "child_process";
|
|
274690
274911
|
import { existsSync as existsSync30, rmSync as rmSync2 } from "fs";
|
|
274691
|
-
import { join as
|
|
274912
|
+
import { join as join32, basename as basename6 } from "path";
|
|
274692
274913
|
function runGit4(cwd, args, timeout = 5e3) {
|
|
274693
274914
|
return String(execFileSync5("git", args, {
|
|
274694
274915
|
cwd,
|
|
@@ -274727,7 +274948,7 @@ function isManagedWorktreePath(worktreePath, worktreeBase) {
|
|
|
274727
274948
|
function createWorktree(projectDir2, taskId, pipelineId) {
|
|
274728
274949
|
const shortId2 = taskId.slice(0, 8);
|
|
274729
274950
|
const shortPipeline = pipelineId.slice(0, 8);
|
|
274730
|
-
const worktreeBase =
|
|
274951
|
+
const worktreeBase = join32(projectDir2, WORKTREE_DIR, `task-${shortId2}`);
|
|
274731
274952
|
const branchBase = `pipeline/${shortPipeline}/task-${shortId2}`;
|
|
274732
274953
|
for (let attempt = 1; attempt <= 100; attempt++) {
|
|
274733
274954
|
const suffix = attempt === 1 ? "" : `-${attempt}`;
|
|
@@ -274817,7 +275038,7 @@ function listWorktrees(projectDir2) {
|
|
|
274817
275038
|
}
|
|
274818
275039
|
}
|
|
274819
275040
|
if (current) worktrees.push(current);
|
|
274820
|
-
const worktreeBase =
|
|
275041
|
+
const worktreeBase = join32(projectDir2, WORKTREE_DIR);
|
|
274821
275042
|
return worktrees.filter((w4) => isManagedWorktreePath(w4.path, worktreeBase));
|
|
274822
275043
|
} catch {
|
|
274823
275044
|
return [];
|
|
@@ -275239,16 +275460,16 @@ var init_cost_tracker = __esm({
|
|
|
275239
275460
|
|
|
275240
275461
|
// src/orchestrate/evidence.ts
|
|
275241
275462
|
import { mkdirSync as mkdirSync9, writeFileSync as writeFileSync9 } from "fs";
|
|
275242
|
-
import { join as
|
|
275463
|
+
import { join as join33 } from "path";
|
|
275243
275464
|
function writeTaskEvidence(projectDir2, pipelineId, evidence) {
|
|
275244
275465
|
try {
|
|
275245
|
-
const dir =
|
|
275466
|
+
const dir = join33(projectDir2, ".pipeline", pipelineId, "evidence", evidence.taskId.slice(0, 12));
|
|
275246
275467
|
mkdirSync9(dir, { recursive: true });
|
|
275247
275468
|
if (evidence.prompt) {
|
|
275248
|
-
safeWrite(
|
|
275469
|
+
safeWrite(join33(dir, "prompt.md"), evidence.prompt);
|
|
275249
275470
|
}
|
|
275250
275471
|
if (evidence.tailOutput) {
|
|
275251
|
-
safeWrite(
|
|
275472
|
+
safeWrite(join33(dir, "output.txt"), evidence.tailOutput);
|
|
275252
275473
|
}
|
|
275253
275474
|
if (evidence.gateResults) {
|
|
275254
275475
|
for (const g4 of evidence.gateResults) {
|
|
@@ -275257,7 +275478,7 @@ Status: ${g4.passed ? "PASS" : "FAIL"}
|
|
|
275257
275478
|
Duration: ${(g4.durationMs / 1e3).toFixed(1)}s
|
|
275258
275479
|
|
|
275259
275480
|
${g4.output}`;
|
|
275260
|
-
safeWrite(
|
|
275481
|
+
safeWrite(join33(dir, `${g4.gate}.txt`), content);
|
|
275261
275482
|
}
|
|
275262
275483
|
}
|
|
275263
275484
|
const resultJson = {
|
|
@@ -275271,7 +275492,7 @@ ${g4.output}`;
|
|
|
275271
275492
|
tokenUsage: evidence.tokenUsage,
|
|
275272
275493
|
costUSD: evidence.costUSD
|
|
275273
275494
|
};
|
|
275274
|
-
safeWrite(
|
|
275495
|
+
safeWrite(join33(dir, "result.json"), JSON.stringify(resultJson, null, 2));
|
|
275275
275496
|
return dir;
|
|
275276
275497
|
} catch {
|
|
275277
275498
|
return null;
|
|
@@ -275279,7 +275500,7 @@ ${g4.output}`;
|
|
|
275279
275500
|
}
|
|
275280
275501
|
function writePipelineSummary(projectDir2, summary) {
|
|
275281
275502
|
try {
|
|
275282
|
-
const dir =
|
|
275503
|
+
const dir = join33(projectDir2, ".pipeline", summary.pipelineId);
|
|
275283
275504
|
mkdirSync9(dir, { recursive: true });
|
|
275284
275505
|
const elapsed = (summary.elapsedMs / 1e3).toFixed(0);
|
|
275285
275506
|
const lines = [
|
|
@@ -275300,8 +275521,8 @@ function writePipelineSummary(projectDir2, summary) {
|
|
|
275300
275521
|
lines.push(`- [${status}] ${t4.taskDescription.slice(0, 80)} \u2014 ${t4.agentName}, ${dur}s${fixes}`);
|
|
275301
275522
|
}
|
|
275302
275523
|
const content = lines.join("\n") + "\n";
|
|
275303
|
-
safeWrite(
|
|
275304
|
-
return
|
|
275524
|
+
safeWrite(join33(dir, "summary.md"), content);
|
|
275525
|
+
return join33(dir, "summary.md");
|
|
275305
275526
|
} catch {
|
|
275306
275527
|
return null;
|
|
275307
275528
|
}
|