memorix 1.8.5 → 1.8.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/CHANGELOG.md +18 -0
- package/README.md +4 -2
- package/assets/star-history-dark.svg +5 -5
- package/assets/star-history-light.svg +5 -5
- package/assets/star-history.json +35 -5
- package/dist/cli/index.js +309 -131
- package/dist/index.js +75 -11
- package/dist/memcode-runtime/CHANGELOG.md +18 -0
- package/dist/sdk.js +74 -10
- package/dist/types.d.ts +1 -1
- package/docs/API_REFERENCE.md +1 -1
- package/docs/DEVELOPMENT.md +2 -2
- package/docs/INTEGRATIONS.md +1 -0
- package/docs/MODULES.md +1 -1
- package/docs/README.md +3 -3
- package/docs/SETUP.md +1 -0
- package/package.json +1 -1
- package/plugins/antigravity/memorix/plugin.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/hermes/memorix/plugin.yaml +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 +1 -0
- package/src/cli/commands/hooks-install.ts +9 -2
- package/src/cli/commands/hooks-preview.ts +5 -0
- package/src/cli/commands/integrate.ts +2 -0
- package/src/cli/commands/setup.ts +11 -1
- package/src/cli/commands/uninstall.ts +24 -2
- package/src/codegraph/task-lens.ts +72 -7
- package/src/hooks/installers/index.ts +55 -0
- 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/workbuddy.ts +71 -0
package/dist/cli/index.js
CHANGED
|
@@ -3232,7 +3232,7 @@ ${import_picocolors.default.gray(m3)} ${s4}
|
|
|
3232
3232
|
|
|
3233
3233
|
// src/cli/version.ts
|
|
3234
3234
|
function getCliVersion() {
|
|
3235
|
-
return true ? "1.8.
|
|
3235
|
+
return true ? "1.8.6" : pkg.version;
|
|
3236
3236
|
}
|
|
3237
3237
|
var init_version = __esm({
|
|
3238
3238
|
"src/cli/version.ts"() {
|
|
@@ -183148,6 +183148,15 @@ __export(task_lens_exports, {
|
|
|
183148
183148
|
scoreLensSource: () => scoreLensSource,
|
|
183149
183149
|
shouldShowLensSource: () => shouldShowLensSource
|
|
183150
183150
|
});
|
|
183151
|
+
function hasSubstantiveTask(text2, keyword) {
|
|
183152
|
+
const withoutKeyword = text2.replace(
|
|
183153
|
+
new RegExp(keyword.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "gi"),
|
|
183154
|
+
" "
|
|
183155
|
+
);
|
|
183156
|
+
const residual = withoutKeyword.replace(TASK_FILLER_WORDS, " ").replace(TASK_FILLER_PHRASES, " ").replace(/[\s\p{P}]/gu, "");
|
|
183157
|
+
if (/^(?:任务|工作|一下|一起|接着)$/u.test(residual)) return false;
|
|
183158
|
+
return Array.from(residual).length >= MIN_TASK_SUBSTANCE;
|
|
183159
|
+
}
|
|
183151
183160
|
function normalizePath2(path48) {
|
|
183152
183161
|
return path48.replace(/\\/g, "/");
|
|
183153
183162
|
}
|
|
@@ -183207,8 +183216,12 @@ function resolveTaskLens(task) {
|
|
|
183207
183216
|
}
|
|
183208
183217
|
function isContinuationTask(task) {
|
|
183209
183218
|
const normalized = (task ?? "").trim().toLowerCase();
|
|
183210
|
-
|
|
183211
|
-
|
|
183219
|
+
if (normalized.length === 0) return false;
|
|
183220
|
+
if (EXPLICIT_HANDOFF_KEYWORDS.some((keyword) => containsTaskKeyword(normalized, keyword))) {
|
|
183221
|
+
return true;
|
|
183222
|
+
}
|
|
183223
|
+
return AMBIGUOUS_CONTINUATION_KEYWORDS.some(
|
|
183224
|
+
(keyword) => containsTaskKeyword(normalized, keyword) && hasSubstantiveTask(normalized, keyword)
|
|
183212
183225
|
);
|
|
183213
183226
|
}
|
|
183214
183227
|
function pathKindScore(path48, lens) {
|
|
@@ -183354,7 +183367,7 @@ function shouldShowLensSource(source, lens, task) {
|
|
|
183354
183367
|
if (lens.id === "onboarding" || lens.id === "release" || lens.id === "docs") return score >= 40;
|
|
183355
183368
|
return score > 0;
|
|
183356
183369
|
}
|
|
183357
|
-
var STOP_WORDS, LENSES, KEYWORDS,
|
|
183370
|
+
var STOP_WORDS, LENSES, KEYWORDS, EXPLICIT_HANDOFF_KEYWORDS, AMBIGUOUS_CONTINUATION_KEYWORDS, TASK_FILLER_WORDS, TASK_FILLER_PHRASES, MIN_TASK_SUBSTANCE, LENS_PRIORITY;
|
|
183358
183371
|
var init_task_lens = __esm({
|
|
183359
183372
|
"src/codegraph/task-lens.ts"() {
|
|
183360
183373
|
"use strict";
|
|
@@ -183475,18 +183488,31 @@ var init_task_lens = __esm({
|
|
|
183475
183488
|
docs: ["doc", "docs", "readme", "\u6587\u6863", "\u8BF4\u660E"],
|
|
183476
183489
|
test: ["coverage", "fixture", "smoke", "spec", "test", "tests", "testing", "vitest", "\u6D4B\u8BD5"]
|
|
183477
183490
|
};
|
|
183478
|
-
|
|
183491
|
+
EXPLICIT_HANDOFF_KEYWORDS = [
|
|
183492
|
+
"handoff",
|
|
183493
|
+
"hand off",
|
|
183494
|
+
"hand over",
|
|
183495
|
+
"previous session",
|
|
183496
|
+
"last session",
|
|
183497
|
+
"pick up where",
|
|
183498
|
+
"\u4EA4\u63A5",
|
|
183499
|
+
// 覆盖「任务交接」「工作交接」
|
|
183500
|
+
"\u63A5\u624B",
|
|
183501
|
+
"\u4E0A\u6B21\u4F1A\u8BDD",
|
|
183502
|
+
"\u4E0A\u6B21\u7684\u4F1A\u8BDD"
|
|
183503
|
+
];
|
|
183504
|
+
AMBIGUOUS_CONTINUATION_KEYWORDS = [
|
|
183479
183505
|
"continue",
|
|
183480
183506
|
"resume",
|
|
183481
|
-
"pick up",
|
|
183482
183507
|
"carry on",
|
|
183483
|
-
"
|
|
183508
|
+
"pick up",
|
|
183484
183509
|
"\u7EE7\u7EED",
|
|
183485
|
-
"\u63A5\u624B",
|
|
183486
183510
|
"\u6062\u590D",
|
|
183487
|
-
"\u5EF6\u7EED"
|
|
183488
|
-
"\u4E0A\u6B21\u4F1A\u8BDD"
|
|
183511
|
+
"\u5EF6\u7EED"
|
|
183489
183512
|
];
|
|
183513
|
+
TASK_FILLER_WORDS = /\b(?:please|task|work|the|a|an)\b/giu;
|
|
183514
|
+
TASK_FILLER_PHRASES = /(?:吧|了|呢|啊|吗|嘛|呀|哦|噢|一下|一起|接着|请|帮我)/gu;
|
|
183515
|
+
MIN_TASK_SUBSTANCE = 2;
|
|
183490
183516
|
LENS_PRIORITY = [
|
|
183491
183517
|
"bugfix",
|
|
183492
183518
|
"release",
|
|
@@ -192552,9 +192578,69 @@ var init_dsh = __esm({
|
|
|
192552
192578
|
}
|
|
192553
192579
|
});
|
|
192554
192580
|
|
|
192555
|
-
// src/workspace/mcp-adapters/
|
|
192581
|
+
// src/workspace/mcp-adapters/workbuddy.ts
|
|
192556
192582
|
import { homedir as homedir23 } from "os";
|
|
192557
192583
|
import { join as join20 } from "path";
|
|
192584
|
+
var WorkbuddyMCPAdapter;
|
|
192585
|
+
var init_workbuddy = __esm({
|
|
192586
|
+
"src/workspace/mcp-adapters/workbuddy.ts"() {
|
|
192587
|
+
"use strict";
|
|
192588
|
+
init_esm_shims();
|
|
192589
|
+
WorkbuddyMCPAdapter = class {
|
|
192590
|
+
source = "workbuddy";
|
|
192591
|
+
parse(content) {
|
|
192592
|
+
try {
|
|
192593
|
+
const config2 = JSON.parse(content);
|
|
192594
|
+
const servers = config2.mcpServers ?? {};
|
|
192595
|
+
return Object.entries(servers).map(([name, entry]) => ({
|
|
192596
|
+
name,
|
|
192597
|
+
command: entry.command ?? "",
|
|
192598
|
+
args: entry.args ?? [],
|
|
192599
|
+
...entry.env && Object.keys(entry.env).length > 0 ? { env: entry.env } : {},
|
|
192600
|
+
...entry.url ? { url: entry.url } : {},
|
|
192601
|
+
...entry.headers && Object.keys(entry.headers).length > 0 ? { headers: entry.headers } : {},
|
|
192602
|
+
...entry.disabled === true ? { disabled: true } : {}
|
|
192603
|
+
}));
|
|
192604
|
+
} catch {
|
|
192605
|
+
return [];
|
|
192606
|
+
}
|
|
192607
|
+
}
|
|
192608
|
+
generate(servers) {
|
|
192609
|
+
const mcpServers = {};
|
|
192610
|
+
for (const s4 of servers) {
|
|
192611
|
+
const entry = {};
|
|
192612
|
+
if (s4.url) {
|
|
192613
|
+
entry.url = s4.url;
|
|
192614
|
+
if (s4.headers && Object.keys(s4.headers).length > 0) {
|
|
192615
|
+
entry.headers = s4.headers;
|
|
192616
|
+
}
|
|
192617
|
+
} else {
|
|
192618
|
+
entry.command = s4.command;
|
|
192619
|
+
entry.args = s4.args;
|
|
192620
|
+
}
|
|
192621
|
+
if (s4.env && Object.keys(s4.env).length > 0) {
|
|
192622
|
+
entry.env = s4.env;
|
|
192623
|
+
}
|
|
192624
|
+
if (s4.disabled === true) {
|
|
192625
|
+
entry.disabled = true;
|
|
192626
|
+
}
|
|
192627
|
+
mcpServers[s4.name] = entry;
|
|
192628
|
+
}
|
|
192629
|
+
return JSON.stringify({ mcpServers }, null, 2) + "\n";
|
|
192630
|
+
}
|
|
192631
|
+
getConfigPath(projectRoot) {
|
|
192632
|
+
if (projectRoot) {
|
|
192633
|
+
return join20(projectRoot, ".workbuddy", "mcp.json");
|
|
192634
|
+
}
|
|
192635
|
+
return join20(homedir23(), ".workbuddy", "mcp.json");
|
|
192636
|
+
}
|
|
192637
|
+
};
|
|
192638
|
+
}
|
|
192639
|
+
});
|
|
192640
|
+
|
|
192641
|
+
// src/workspace/mcp-adapters/codebuddy.ts
|
|
192642
|
+
import { homedir as homedir24 } from "os";
|
|
192643
|
+
import { join as join21 } from "path";
|
|
192558
192644
|
var CodeBuddyMCPAdapter;
|
|
192559
192645
|
var init_codebuddy = __esm({
|
|
192560
192646
|
"src/workspace/mcp-adapters/codebuddy.ts"() {
|
|
@@ -192586,7 +192672,7 @@ var init_codebuddy = __esm({
|
|
|
192586
192672
|
return JSON.stringify({ mcpServers }, null, 2);
|
|
192587
192673
|
}
|
|
192588
192674
|
getConfigPath(projectRoot) {
|
|
192589
|
-
return projectRoot ?
|
|
192675
|
+
return projectRoot ? join21(projectRoot, ".mcp.json") : join21(homedir24(), ".codebuddy", ".mcp.json");
|
|
192590
192676
|
}
|
|
192591
192677
|
};
|
|
192592
192678
|
}
|
|
@@ -192736,6 +192822,15 @@ var init_registry2 = __esm({
|
|
|
192736
192822
|
surfaces: ["MCP", "AGENTS.md", "skills"],
|
|
192737
192823
|
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."
|
|
192738
192824
|
},
|
|
192825
|
+
{
|
|
192826
|
+
agent: "workbuddy",
|
|
192827
|
+
name: "WorkBuddy",
|
|
192828
|
+
entry: "official-config",
|
|
192829
|
+
status: "ready",
|
|
192830
|
+
install: "memorix setup --agent workbuddy",
|
|
192831
|
+
surfaces: ["MCP", "AGENTS.md"],
|
|
192832
|
+
note: "WorkBuddy support writes a memorix MCP server row into ~/.workbuddy/mcp.json (or <project>/.workbuddy/mcp.json for project installs) and guidance into AGENTS.md."
|
|
192833
|
+
},
|
|
192739
192834
|
{
|
|
192740
192835
|
agent: "memcode",
|
|
192741
192836
|
name: "memcode",
|
|
@@ -193036,9 +193131,9 @@ __export(audit_exports, {
|
|
|
193036
193131
|
});
|
|
193037
193132
|
import * as fs18 from "fs/promises";
|
|
193038
193133
|
import * as path29 from "path";
|
|
193039
|
-
import { homedir as
|
|
193134
|
+
import { homedir as homedir25 } from "os";
|
|
193040
193135
|
function getAuditFilePath() {
|
|
193041
|
-
return process.env.MEMORIX_AUDIT_FILE || path29.join(
|
|
193136
|
+
return process.env.MEMORIX_AUDIT_FILE || path29.join(homedir25(), ".memorix", "audit.json");
|
|
193042
193137
|
}
|
|
193043
193138
|
async function loadAudit() {
|
|
193044
193139
|
try {
|
|
@@ -193599,6 +193694,8 @@ function getProjectConfigPath(agent, projectRoot) {
|
|
|
193599
193694
|
return path30.join(projectRoot, ".agents", "hooks.json");
|
|
193600
193695
|
case "gemini-cli":
|
|
193601
193696
|
return path30.join(projectRoot, ".gemini", "settings.json");
|
|
193697
|
+
case "workbuddy":
|
|
193698
|
+
return "";
|
|
193602
193699
|
default:
|
|
193603
193700
|
return path30.join(projectRoot, ".memorix", "hooks.json");
|
|
193604
193701
|
}
|
|
@@ -193632,6 +193729,8 @@ function getGlobalConfigPath(agent) {
|
|
|
193632
193729
|
return path30.join(home, ".trae", "rules", "project_rules.md");
|
|
193633
193730
|
case "dsh":
|
|
193634
193731
|
return path30.join(process.env.DSH_HOME?.trim() || path30.join(home, ".dsh"), "AGENTS.md");
|
|
193732
|
+
case "workbuddy":
|
|
193733
|
+
return "";
|
|
193635
193734
|
default:
|
|
193636
193735
|
return path30.join(home, ".memorix", "hooks.json");
|
|
193637
193736
|
}
|
|
@@ -193658,6 +193757,8 @@ function getAgentRulesPath(agent, root, global2 = false) {
|
|
|
193658
193757
|
return path30.join(root, ".trae", "rules", "project_rules.md");
|
|
193659
193758
|
case "dsh":
|
|
193660
193759
|
return path30.join(process.env.DSH_HOME?.trim() || path30.join(root, ".dsh"), "AGENTS.md");
|
|
193760
|
+
case "workbuddy":
|
|
193761
|
+
return "";
|
|
193661
193762
|
default:
|
|
193662
193763
|
return path30.join(root, ".agent", "rules", "memorix.md");
|
|
193663
193764
|
}
|
|
@@ -193684,6 +193785,8 @@ function getAgentRulesPath(agent, root, global2 = false) {
|
|
|
193684
193785
|
return path30.join(root, ".trae", "rules", "project_rules.md");
|
|
193685
193786
|
case "dsh":
|
|
193686
193787
|
return path30.join(root, "AGENTS.md");
|
|
193788
|
+
case "workbuddy":
|
|
193789
|
+
return path30.join(root, "AGENTS.md");
|
|
193687
193790
|
default:
|
|
193688
193791
|
return path30.join(root, ".agent", "rules", "memorix.md");
|
|
193689
193792
|
}
|
|
@@ -193772,6 +193875,11 @@ async function detectInstalledAgents() {
|
|
|
193772
193875
|
agents.push("dsh");
|
|
193773
193876
|
} catch {
|
|
193774
193877
|
}
|
|
193878
|
+
try {
|
|
193879
|
+
await fs19.access(path30.join(home, ".workbuddy"));
|
|
193880
|
+
agents.push("workbuddy");
|
|
193881
|
+
} catch {
|
|
193882
|
+
}
|
|
193775
193883
|
return agents;
|
|
193776
193884
|
}
|
|
193777
193885
|
async function installHooks(agent, projectRoot, global2 = false) {
|
|
@@ -193785,6 +193893,16 @@ async function installHooks(agent, projectRoot, global2 = false) {
|
|
|
193785
193893
|
}
|
|
193786
193894
|
};
|
|
193787
193895
|
}
|
|
193896
|
+
if (agent === "workbuddy" && global2) {
|
|
193897
|
+
return {
|
|
193898
|
+
agent,
|
|
193899
|
+
configPath: "",
|
|
193900
|
+
events: [],
|
|
193901
|
+
generated: {
|
|
193902
|
+
note: "WorkBuddy has no hook system and no user-global guidance file \u2014 MCP only; no global guidance/hooks. Run `memorix setup --agent workbuddy` (without --global) to install project MCP config and AGENTS.md guidance."
|
|
193903
|
+
}
|
|
193904
|
+
};
|
|
193905
|
+
}
|
|
193788
193906
|
if (global2 && getGlobalConfigPath(agent) === "") {
|
|
193789
193907
|
return {
|
|
193790
193908
|
agent,
|
|
@@ -193867,6 +193985,17 @@ async function installHooks(agent, projectRoot, global2 = false) {
|
|
|
193867
193985
|
}
|
|
193868
193986
|
};
|
|
193869
193987
|
}
|
|
193988
|
+
case "workbuddy": {
|
|
193989
|
+
const rulesPath = await installAgentRules(agent, projectRoot, global2);
|
|
193990
|
+
return {
|
|
193991
|
+
agent,
|
|
193992
|
+
configPath: rulesPath,
|
|
193993
|
+
events: [],
|
|
193994
|
+
generated: {
|
|
193995
|
+
note: "WorkBuddy has no hook system \u2014 installed AGENTS.md guidance only; the MCP row is installed by `memorix setup --agent workbuddy`."
|
|
193996
|
+
}
|
|
193997
|
+
};
|
|
193998
|
+
}
|
|
193870
193999
|
case "opencode": {
|
|
193871
194000
|
const pluginContent = generateOpenCodePlugin();
|
|
193872
194001
|
const pluginPath = global2 ? getGlobalConfigPath(agent) : getProjectConfigPath(agent, projectRoot);
|
|
@@ -193996,6 +194125,7 @@ async function installHooks(agent, projectRoot, global2 = false) {
|
|
|
193996
194125
|
};
|
|
193997
194126
|
}
|
|
193998
194127
|
async function installAgentRules(agent, projectRoot, global2 = false) {
|
|
194128
|
+
if (agent === "workbuddy" && global2) return "";
|
|
193999
194129
|
const rulesContent = getAgentRulesContent(agent, global2 ? "global" : "project");
|
|
194000
194130
|
const rulesRoot = global2 ? os5.homedir() : projectRoot;
|
|
194001
194131
|
const rulesPath = getAgentRulesPath(agent, rulesRoot, global2);
|
|
@@ -194161,6 +194291,9 @@ async function uninstallHooks(agent, projectRoot, global2 = false) {
|
|
|
194161
194291
|
if (agent === "pi") {
|
|
194162
194292
|
return false;
|
|
194163
194293
|
}
|
|
194294
|
+
if (agent === "workbuddy") {
|
|
194295
|
+
return false;
|
|
194296
|
+
}
|
|
194164
194297
|
if (global2 && getGlobalConfigPath(agent) === "") {
|
|
194165
194298
|
return false;
|
|
194166
194299
|
}
|
|
@@ -194344,7 +194477,7 @@ __export(setup_exports, {
|
|
|
194344
194477
|
import { spawnSync } from "child_process";
|
|
194345
194478
|
import { existsSync as existsSync15 } from "fs";
|
|
194346
194479
|
import { copyFile as copyFile2, mkdir as mkdir6, readFile as readFile6, readdir as readdir3, rm as rm2, writeFile as writeFile7 } from "fs/promises";
|
|
194347
|
-
import { homedir as
|
|
194480
|
+
import { homedir as homedir27 } from "os";
|
|
194348
194481
|
import path31 from "path";
|
|
194349
194482
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
194350
194483
|
function getSetupAgentTargets() {
|
|
@@ -194506,7 +194639,8 @@ function getMcpAdapter(agent) {
|
|
|
194506
194639
|
kiro: new KiroMCPAdapter(),
|
|
194507
194640
|
opencode: new OpenCodeMCPAdapter(),
|
|
194508
194641
|
trae: new TraeMCPAdapter(),
|
|
194509
|
-
dsh: new DshMCPAdapter()
|
|
194642
|
+
dsh: new DshMCPAdapter(),
|
|
194643
|
+
workbuddy: new WorkbuddyMCPAdapter()
|
|
194510
194644
|
};
|
|
194511
194645
|
return adapters[agent];
|
|
194512
194646
|
}
|
|
@@ -194628,7 +194762,7 @@ function isOwnedLegacyCodexMcp(content) {
|
|
|
194628
194762
|
const server = new CodexMCPAdapter().parse(content).find((entry) => entry.name === "memorix");
|
|
194629
194763
|
return Boolean(server && isLegacyCodexMemorixNodeServer(server));
|
|
194630
194764
|
}
|
|
194631
|
-
async function removeLegacyCodexMemorixMcpConfig(configPath = path31.join(
|
|
194765
|
+
async function removeLegacyCodexMemorixMcpConfig(configPath = path31.join(homedir27(), ".codex", "config.toml")) {
|
|
194632
194766
|
let existingContent;
|
|
194633
194767
|
try {
|
|
194634
194768
|
existingContent = await readFile6(configPath, "utf-8");
|
|
@@ -194685,7 +194819,7 @@ async function removeOwnedLegacyCodexPluginFolder(homeDir) {
|
|
|
194685
194819
|
}
|
|
194686
194820
|
}
|
|
194687
194821
|
async function migrateLegacyCodexIntegration(options = {}) {
|
|
194688
|
-
const homeDir = options.homeDir ??
|
|
194822
|
+
const homeDir = options.homeDir ?? homedir27();
|
|
194689
194823
|
const projectRoot = options.projectRoot ?? process.cwd();
|
|
194690
194824
|
const configPath = path31.join(homeDir, ".codex", "config.toml");
|
|
194691
194825
|
let mcp = "missing";
|
|
@@ -194886,7 +195020,7 @@ async function stripCodeBuddyHookCapture(pluginPath) {
|
|
|
194886
195020
|
await writeFile7(manifestPath, JSON.stringify(manifest, null, 2) + "\n", "utf-8");
|
|
194887
195021
|
}
|
|
194888
195022
|
async function installCodeBuddyPluginPackage(options = {}) {
|
|
194889
|
-
const home = options.homeDir ??
|
|
195023
|
+
const home = options.homeDir ?? homedir27();
|
|
194890
195024
|
const packageRoot = findPackageRoot();
|
|
194891
195025
|
const source = path31.join(packageRoot, "plugins", "codebuddy", "memorix");
|
|
194892
195026
|
if (!existsSync15(source)) throw new Error(`CodeBuddy plugin template not found: ${source}`);
|
|
@@ -194906,7 +195040,7 @@ async function installCodeBuddyPluginPackage(options = {}) {
|
|
|
194906
195040
|
};
|
|
194907
195041
|
}
|
|
194908
195042
|
async function installPluginPackage(options) {
|
|
194909
|
-
const home = options.homeDir ??
|
|
195043
|
+
const home = options.homeDir ?? homedir27();
|
|
194910
195044
|
const packageRoot = findPackageRoot();
|
|
194911
195045
|
const source = path31.join(packageRoot, "plugins", options.agent, "memorix");
|
|
194912
195046
|
const includeHooks = options.includeHooks ?? true;
|
|
@@ -194955,7 +195089,7 @@ async function installPluginPackage(options) {
|
|
|
194955
195089
|
};
|
|
194956
195090
|
}
|
|
194957
195091
|
async function installGeminiExtensionPackage(options = {}) {
|
|
194958
|
-
const home = options.homeDir ??
|
|
195092
|
+
const home = options.homeDir ?? homedir27();
|
|
194959
195093
|
const packageRoot = findPackageRoot();
|
|
194960
195094
|
const source = path31.join(packageRoot, "plugins", "gemini", "memorix");
|
|
194961
195095
|
if (!existsSync15(source)) {
|
|
@@ -194975,7 +195109,7 @@ async function installAntigravityPluginPackage(options = {}) {
|
|
|
194975
195109
|
if (!existsSync15(source)) {
|
|
194976
195110
|
throw new Error(`Antigravity plugin template not found: ${source}`);
|
|
194977
195111
|
}
|
|
194978
|
-
const pluginPath = options.global === false ? path31.join(options.projectRoot ?? process.cwd(), ".agents", "plugins", "memorix") : path31.join(options.homeDir ??
|
|
195112
|
+
const pluginPath = options.global === false ? path31.join(options.projectRoot ?? process.cwd(), ".agents", "plugins", "memorix") : path31.join(options.homeDir ?? homedir27(), ".gemini", "config", "plugins", "memorix");
|
|
194979
195113
|
await copyDir(source, pluginPath);
|
|
194980
195114
|
if (options.includeHooks === false) {
|
|
194981
195115
|
await rm2(path31.join(pluginPath, "hooks.json"), { force: true });
|
|
@@ -194993,7 +195127,7 @@ async function installPiPackage(options = {}) {
|
|
|
194993
195127
|
if (!existsSync15(source)) {
|
|
194994
195128
|
throw new Error(`Pi package template not found: ${source}`);
|
|
194995
195129
|
}
|
|
194996
|
-
const defaultRoot = options.global ? path31.join(options.homeDir ??
|
|
195130
|
+
const defaultRoot = options.global ? path31.join(options.homeDir ?? homedir27(), ".pi", "agent", "packages") : path31.join(process.cwd(), ".pi", "packages");
|
|
194997
195131
|
const packagePath = options.packageDir ?? path31.join(defaultRoot, "memorix");
|
|
194998
195132
|
await copyDir(source, packagePath);
|
|
194999
195133
|
await writeOfficialSkills(path31.join(packagePath, "skills"));
|
|
@@ -195005,7 +195139,7 @@ async function installPiPackage(options = {}) {
|
|
|
195005
195139
|
};
|
|
195006
195140
|
}
|
|
195007
195141
|
async function installOpenClawBundlePackage(options = {}) {
|
|
195008
|
-
const home = options.homeDir ??
|
|
195142
|
+
const home = options.homeDir ?? homedir27();
|
|
195009
195143
|
const packageRoot = findPackageRoot();
|
|
195010
195144
|
const source = path31.join(packageRoot, "plugins", "openclaw", "memorix");
|
|
195011
195145
|
if (!existsSync15(source)) {
|
|
@@ -195054,7 +195188,7 @@ async function installOmpPackage(options = {}) {
|
|
|
195054
195188
|
if (!existsSync15(source)) {
|
|
195055
195189
|
throw new Error(`Oh-my-Pi package template not found: ${source}`);
|
|
195056
195190
|
}
|
|
195057
|
-
const defaultRoot = options.global ? path31.join(options.homeDir ??
|
|
195191
|
+
const defaultRoot = options.global ? path31.join(options.homeDir ?? homedir27(), ".omp", "agent", "packages") : path31.join(process.cwd(), ".omp", "packages");
|
|
195058
195192
|
const packagePath = options.packageDir ?? path31.join(defaultRoot, "memorix");
|
|
195059
195193
|
await copyDir(source, packagePath);
|
|
195060
195194
|
await writeOfficialSkills(path31.join(packagePath, "skills"));
|
|
@@ -195328,7 +195462,7 @@ ${result.stdout || ""}`.toLowerCase();
|
|
|
195328
195462
|
}
|
|
195329
195463
|
async function installAgentSetup(agent, plan, global2) {
|
|
195330
195464
|
const { installAgentGuidance: installAgentGuidance2, installHooks: installHooks2 } = await Promise.resolve().then(() => (init_installers(), installers_exports));
|
|
195331
|
-
const targetRoot = global2 ?
|
|
195465
|
+
const targetRoot = global2 ? homedir27() : process.cwd();
|
|
195332
195466
|
const hasPluginPackage = plan.actions.includes("plugin-package") && PLUGIN_PACKAGE_AGENTS.has(agent);
|
|
195333
195467
|
const hasExtensionPackage = plan.actions.includes("extension-package") && agent === "gemini-cli";
|
|
195334
195468
|
const hasPiPackage = plan.actions.includes("pi-package") && agent === "pi";
|
|
@@ -195479,7 +195613,14 @@ async function installAgentSetup(agent, plan, global2) {
|
|
|
195479
195613
|
}
|
|
195480
195614
|
} else if (plan.actions.includes("hooks")) {
|
|
195481
195615
|
const result = await installHooks2(agent, targetRoot, global2);
|
|
195482
|
-
|
|
195616
|
+
const note = result.generated?.note;
|
|
195617
|
+
if (result.configPath) {
|
|
195618
|
+
v3.success(`${agent}: integration files -> ${result.configPath}`);
|
|
195619
|
+
} else if (note) {
|
|
195620
|
+
v3.info(`${agent}: ${note}`);
|
|
195621
|
+
} else {
|
|
195622
|
+
v3.info(`${agent}: no hooks or guidance are available at this scope`);
|
|
195623
|
+
}
|
|
195483
195624
|
} else if (plan.actions.includes("project-guidance")) {
|
|
195484
195625
|
const rulesPath = await installAgentGuidance2(agent, targetRoot, global2);
|
|
195485
195626
|
v3.success(`${agent}: guidance -> ${rulesPath}`);
|
|
@@ -195536,6 +195677,7 @@ var init_setup = __esm({
|
|
|
195536
195677
|
init_opencode();
|
|
195537
195678
|
init_trae();
|
|
195538
195679
|
init_dsh();
|
|
195680
|
+
init_workbuddy();
|
|
195539
195681
|
init_codebuddy();
|
|
195540
195682
|
init_registry2();
|
|
195541
195683
|
init_official_skills();
|
|
@@ -195565,6 +195707,7 @@ var init_setup = __esm({
|
|
|
195565
195707
|
"kiro",
|
|
195566
195708
|
"trae",
|
|
195567
195709
|
"dsh",
|
|
195710
|
+
"workbuddy",
|
|
195568
195711
|
"pi"
|
|
195569
195712
|
];
|
|
195570
195713
|
getSetupIntegrationRows2 = getSetupIntegrationRows;
|
|
@@ -195708,7 +195851,7 @@ var config_path_exports = {};
|
|
|
195708
195851
|
__export(config_path_exports, {
|
|
195709
195852
|
default: () => config_path_default
|
|
195710
195853
|
});
|
|
195711
|
-
import { homedir as
|
|
195854
|
+
import { homedir as homedir28 } from "os";
|
|
195712
195855
|
var config_path_default;
|
|
195713
195856
|
var init_config_path = __esm({
|
|
195714
195857
|
"src/cli/commands/config-path.ts"() {
|
|
@@ -195726,7 +195869,7 @@ var init_config_path = __esm({
|
|
|
195726
195869
|
run: async () => {
|
|
195727
195870
|
const project = detectProject(process.cwd());
|
|
195728
195871
|
ye2([
|
|
195729
|
-
`Global: ${getGlobalConfigTomlPath(
|
|
195872
|
+
`Global: ${getGlobalConfigTomlPath(homedir28())}`,
|
|
195730
195873
|
`Project: ${project ? getProjectConfigTomlPath(project.rootPath) : "not inside a git project"}`
|
|
195731
195874
|
].join("\n"), "Memorix config");
|
|
195732
195875
|
}
|
|
@@ -195802,7 +195945,7 @@ __export(config_migrate_exports, {
|
|
|
195802
195945
|
serializeResolvedConfigToToml: () => serializeResolvedConfigToToml
|
|
195803
195946
|
});
|
|
195804
195947
|
import { mkdirSync as mkdirSync3, writeFileSync as writeFileSync3 } from "fs";
|
|
195805
|
-
import { homedir as
|
|
195948
|
+
import { homedir as homedir29 } from "os";
|
|
195806
195949
|
import { dirname as dirname4 } from "path";
|
|
195807
195950
|
function serializeResolvedConfigToToml(config2, options = {}) {
|
|
195808
195951
|
const includeSecrets = options.includeSecrets === true;
|
|
@@ -195901,7 +196044,7 @@ var init_config_migrate = __esm({
|
|
|
195901
196044
|
v3.error("Not inside a git project. Use `memorix config migrate --global` for global config.");
|
|
195902
196045
|
return;
|
|
195903
196046
|
}
|
|
195904
|
-
const target = isGlobal ? getGlobalConfigTomlPath(
|
|
196047
|
+
const target = isGlobal ? getGlobalConfigTomlPath(homedir29()) : getProjectConfigTomlPath(project.rootPath);
|
|
195905
196048
|
const resolved = getResolvedConfig({ projectRoot: project?.rootPath ?? null });
|
|
195906
196049
|
const content = serializeResolvedConfigToToml(resolved, { includeSecrets: isGlobal });
|
|
195907
196050
|
mkdirSync3(dirname4(target), { recursive: true });
|
|
@@ -195913,8 +196056,8 @@ var init_config_migrate = __esm({
|
|
|
195913
196056
|
});
|
|
195914
196057
|
|
|
195915
196058
|
// src/cli/commands/integrate-shared.ts
|
|
195916
|
-
import { homedir as
|
|
195917
|
-
function getIntegrationTargetRoot(useGlobalDefaults, cwd, homeDir =
|
|
196059
|
+
import { homedir as homedir30 } from "os";
|
|
196060
|
+
function getIntegrationTargetRoot(useGlobalDefaults, cwd, homeDir = homedir30()) {
|
|
195918
196061
|
return useGlobalDefaults ? homeDir : cwd;
|
|
195919
196062
|
}
|
|
195920
196063
|
function getIntegrationScopeLabel(useGlobalDefaults) {
|
|
@@ -195952,7 +196095,8 @@ function getAgentLabel(agent) {
|
|
|
195952
196095
|
antigravity: "Antigravity",
|
|
195953
196096
|
"gemini-cli": "Gemini CLI",
|
|
195954
196097
|
trae: "Trae",
|
|
195955
|
-
dsh: "DeepSeek Harness"
|
|
196098
|
+
dsh: "DeepSeek Harness",
|
|
196099
|
+
workbuddy: "WorkBuddy"
|
|
195956
196100
|
};
|
|
195957
196101
|
return labels[agent] || agent;
|
|
195958
196102
|
}
|
|
@@ -195968,7 +196112,8 @@ function getAgentHint(agent) {
|
|
|
195968
196112
|
antigravity: "plugin + MCP + hooks + skills",
|
|
195969
196113
|
"gemini-cli": "settings + GEMINI.md",
|
|
195970
196114
|
trae: "rules",
|
|
195971
|
-
dsh: "MCP patch + AGENTS.md + skills"
|
|
196115
|
+
dsh: "MCP patch + AGENTS.md + skills",
|
|
196116
|
+
workbuddy: "MCP + AGENTS.md"
|
|
195972
196117
|
};
|
|
195973
196118
|
return hints[agent] || "integration files";
|
|
195974
196119
|
}
|
|
@@ -197027,7 +197172,7 @@ __export(external_provider_exports, {
|
|
|
197027
197172
|
});
|
|
197028
197173
|
import { spawn as spawn5 } from "child_process";
|
|
197029
197174
|
import { existsSync as existsSync17, readFileSync as readFileSync10 } from "fs";
|
|
197030
|
-
import { delimiter, dirname as dirname5, extname, isAbsolute as isAbsolute2, join as
|
|
197175
|
+
import { delimiter, dirname as dirname5, extname, isAbsolute as isAbsolute2, join as join24, relative as relative2, resolve as resolve3, sep as sep2 } from "path";
|
|
197031
197176
|
function boundedTimeout(value) {
|
|
197032
197177
|
if (!Number.isFinite(value)) return DEFAULT_EXTERNAL_CODEGRAPH_TIMEOUT_MS;
|
|
197033
197178
|
return Math.max(100, Math.min(Math.floor(value), MAX_EXTERNAL_CODEGRAPH_TIMEOUT_MS));
|
|
@@ -197056,10 +197201,10 @@ function resolveCommandCandidates(command) {
|
|
|
197056
197201
|
}
|
|
197057
197202
|
const names = extname(requested) ? [requested] : process.platform === "win32" ? [requested + ".exe", requested + ".cmd", requested + ".js", requested] : [requested];
|
|
197058
197203
|
const directories = [
|
|
197059
|
-
...process.platform === "win32" && process.env.LOCALAPPDATA ? [
|
|
197204
|
+
...process.platform === "win32" && process.env.LOCALAPPDATA ? [join24(process.env.LOCALAPPDATA, "codegraph", "current", "bin")] : [],
|
|
197060
197205
|
...(process.env.PATH ?? "").split(delimiter).filter(Boolean)
|
|
197061
197206
|
];
|
|
197062
|
-
return [...new Set(directories.flatMap((directory) => names.map((name) =>
|
|
197207
|
+
return [...new Set(directories.flatMap((directory) => names.map((name) => join24(directory, name))))];
|
|
197063
197208
|
}
|
|
197064
197209
|
function resolveLaunch(command) {
|
|
197065
197210
|
for (const candidate2 of resolveCommandCandidates(command)) {
|
|
@@ -197067,8 +197212,8 @@ function resolveLaunch(command) {
|
|
|
197067
197212
|
const extension3 = extname(candidate2).toLowerCase();
|
|
197068
197213
|
if (extension3 === ".cmd") {
|
|
197069
197214
|
const bundleRoot = resolve3(dirname5(candidate2), "..");
|
|
197070
|
-
const node =
|
|
197071
|
-
const entry =
|
|
197215
|
+
const node = join24(bundleRoot, "node.exe");
|
|
197216
|
+
const entry = join24(bundleRoot, "lib", "dist", "bin", "codegraph.js");
|
|
197072
197217
|
if (existsSync17(node) && existsSync17(entry)) {
|
|
197073
197218
|
return { executable: node, prefixArgs: ["--liftoff-only", entry] };
|
|
197074
197219
|
}
|
|
@@ -197220,7 +197365,7 @@ async function inspectExternalCodeGraph(input) {
|
|
|
197220
197365
|
const health2 = { state: "disabled", reason: "External CodeGraph is disabled by configuration." };
|
|
197221
197366
|
return { health: health2, quality: providerQuality({ mode, health: health2 }) };
|
|
197222
197367
|
}
|
|
197223
|
-
if (!existsSync17(
|
|
197368
|
+
if (!existsSync17(join24(input.projectRoot, ".codegraph"))) {
|
|
197224
197369
|
const health2 = { state: "not-detected", reason: "No local .codegraph index is present for this project." };
|
|
197225
197370
|
return { health: health2, quality: providerQuality({ mode, health: health2 }) };
|
|
197226
197371
|
}
|
|
@@ -197255,7 +197400,7 @@ async function runExternalCodeGraphLifecycle(input) {
|
|
|
197255
197400
|
quality: providerQuality({ mode, health })
|
|
197256
197401
|
};
|
|
197257
197402
|
}
|
|
197258
|
-
const indexPath =
|
|
197403
|
+
const indexPath = join24(input.projectRoot, ".codegraph");
|
|
197259
197404
|
if (input.action === "sync" && !existsSync17(indexPath)) {
|
|
197260
197405
|
const health = { state: "not-detected", reason: "No local .codegraph index is present for this project." };
|
|
197261
197406
|
return {
|
|
@@ -203063,8 +203208,8 @@ __export(engine_exports2, {
|
|
|
203063
203208
|
SkillsEngine: () => SkillsEngine
|
|
203064
203209
|
});
|
|
203065
203210
|
import { existsSync as existsSync19, readFileSync as readFileSync11, writeFileSync as writeFileSync4, mkdirSync as mkdirSync4, readdirSync as readdirSync3 } from "fs";
|
|
203066
|
-
import { join as
|
|
203067
|
-
import { homedir as
|
|
203211
|
+
import { join as join25 } from "path";
|
|
203212
|
+
import { homedir as homedir31 } from "os";
|
|
203068
203213
|
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;
|
|
203069
203214
|
var init_engine4 = __esm({
|
|
203070
203215
|
"src/skills/engine.ts"() {
|
|
@@ -203135,12 +203280,12 @@ var init_engine4 = __esm({
|
|
|
203135
203280
|
listSkills() {
|
|
203136
203281
|
const skills = [];
|
|
203137
203282
|
const seen = /* @__PURE__ */ new Set();
|
|
203138
|
-
const home =
|
|
203283
|
+
const home = homedir31();
|
|
203139
203284
|
for (const [agent, dirs] of Object.entries(SKILLS_DIRS)) {
|
|
203140
203285
|
for (const dir of dirs) {
|
|
203141
|
-
const paths = [
|
|
203286
|
+
const paths = [join25(this.projectRoot, dir)];
|
|
203142
203287
|
if (!this.skipGlobal) {
|
|
203143
|
-
paths.push(
|
|
203288
|
+
paths.push(join25(home, dir));
|
|
203144
203289
|
}
|
|
203145
203290
|
for (const skillsRoot of paths) {
|
|
203146
203291
|
if (!existsSync19(skillsRoot)) continue;
|
|
@@ -203150,7 +203295,7 @@ var init_engine4 = __esm({
|
|
|
203150
203295
|
if (!entry.isDirectory()) continue;
|
|
203151
203296
|
const name = entry.name;
|
|
203152
203297
|
if (seen.has(name)) continue;
|
|
203153
|
-
const skillMd =
|
|
203298
|
+
const skillMd = join25(skillsRoot, name, "SKILL.md");
|
|
203154
203299
|
if (!existsSync19(skillMd)) continue;
|
|
203155
203300
|
try {
|
|
203156
203301
|
const content = readFileSync11(skillMd, "utf-8");
|
|
@@ -203158,7 +203303,7 @@ var init_engine4 = __esm({
|
|
|
203158
203303
|
skills.push({
|
|
203159
203304
|
name,
|
|
203160
203305
|
description,
|
|
203161
|
-
sourcePath:
|
|
203306
|
+
sourcePath: join25(skillsRoot, name),
|
|
203162
203307
|
sourceAgent: agent,
|
|
203163
203308
|
content,
|
|
203164
203309
|
generated: false
|
|
@@ -203201,11 +203346,11 @@ var init_engine4 = __esm({
|
|
|
203201
203346
|
writeSkill(skill2, target) {
|
|
203202
203347
|
const dirs = SKILLS_DIRS[target];
|
|
203203
203348
|
if (!dirs || dirs.length === 0) return null;
|
|
203204
|
-
const targetDir =
|
|
203349
|
+
const targetDir = join25(this.projectRoot, dirs[0], skill2.name);
|
|
203205
203350
|
try {
|
|
203206
203351
|
mkdirSync4(targetDir, { recursive: true });
|
|
203207
|
-
writeFileSync4(
|
|
203208
|
-
return
|
|
203352
|
+
writeFileSync4(join25(targetDir, "SKILL.md"), skill2.content, "utf-8");
|
|
203353
|
+
return join25(dirs[0], skill2.name, "SKILL.md");
|
|
203209
203354
|
} catch {
|
|
203210
203355
|
return null;
|
|
203211
203356
|
}
|
|
@@ -204374,7 +204519,7 @@ var init_task_graph = __esm({
|
|
|
204374
204519
|
// src/orchestrate/context-collector.ts
|
|
204375
204520
|
import { execFileSync as execFileSync2 } from "child_process";
|
|
204376
204521
|
import { readFileSync as readFileSync12, existsSync as existsSync20 } from "fs";
|
|
204377
|
-
import { join as
|
|
204522
|
+
import { join as join26 } from "path";
|
|
204378
204523
|
function normalizeEntryLimit(value, fallback) {
|
|
204379
204524
|
if (!Number.isSafeInteger(value) || value < 1) return fallback;
|
|
204380
204525
|
return Math.min(value, 500);
|
|
@@ -204449,7 +204594,7 @@ function collectFileTree(projectDir2, maxEntries) {
|
|
|
204449
204594
|
}
|
|
204450
204595
|
function collectDependencies(projectDir2) {
|
|
204451
204596
|
try {
|
|
204452
|
-
const pkgPath =
|
|
204597
|
+
const pkgPath = join26(projectDir2, "package.json");
|
|
204453
204598
|
if (!existsSync20(pkgPath)) return "";
|
|
204454
204599
|
const pkg = JSON.parse(readFileSync12(pkgPath, "utf-8"));
|
|
204455
204600
|
const parts = [];
|
|
@@ -205786,7 +205931,7 @@ var init_tool_profile = __esm({
|
|
|
205786
205931
|
function getMcpServerInfo() {
|
|
205787
205932
|
return {
|
|
205788
205933
|
name: "memorix",
|
|
205789
|
-
version: true ? "1.8.
|
|
205934
|
+
version: true ? "1.8.6" : "1.0.1"
|
|
205790
205935
|
};
|
|
205791
205936
|
}
|
|
205792
205937
|
function createMcpDiscoverResult(capabilities, serverInfo) {
|
|
@@ -219592,8 +219737,8 @@ __export(engine_exports3, {
|
|
|
219592
219737
|
WorkspaceSyncEngine: () => WorkspaceSyncEngine
|
|
219593
219738
|
});
|
|
219594
219739
|
import { readFileSync as readFileSync14, readdirSync as readdirSync4, existsSync as existsSync23, cpSync, mkdirSync as mkdirSync6 } from "fs";
|
|
219595
|
-
import { join as
|
|
219596
|
-
import { homedir as
|
|
219740
|
+
import { join as join28 } from "path";
|
|
219741
|
+
import { homedir as homedir32 } from "os";
|
|
219597
219742
|
var WorkspaceSyncEngine;
|
|
219598
219743
|
var init_engine5 = __esm({
|
|
219599
219744
|
"src/workspace/engine.ts"() {
|
|
@@ -219665,9 +219810,9 @@ var init_engine5 = __esm({
|
|
|
219665
219810
|
const globalPath = adapter.getConfigPath();
|
|
219666
219811
|
const pathsToCheck = [configPath, globalPath];
|
|
219667
219812
|
if (target === "antigravity") {
|
|
219668
|
-
pathsToCheck.push(
|
|
219669
|
-
pathsToCheck.push(
|
|
219670
|
-
pathsToCheck.push(
|
|
219813
|
+
pathsToCheck.push(join28(this.projectRoot, ".gemini", "settings.json"));
|
|
219814
|
+
pathsToCheck.push(join28(homedir32(), ".gemini", "settings.json"));
|
|
219815
|
+
pathsToCheck.push(join28(homedir32(), ".gemini", "antigravity", "mcp_config.json"));
|
|
219671
219816
|
}
|
|
219672
219817
|
const merged = /* @__PURE__ */ new Map();
|
|
219673
219818
|
for (const path48 of pathsToCheck) {
|
|
@@ -219784,7 +219929,7 @@ var init_engine5 = __esm({
|
|
|
219784
219929
|
getTargetSkillsDir(target) {
|
|
219785
219930
|
const dirs = _WorkspaceSyncEngine.SKILLS_DIRS[target];
|
|
219786
219931
|
if (!dirs || dirs.length === 0) return null;
|
|
219787
|
-
return
|
|
219932
|
+
return join28(this.projectRoot, dirs[0]);
|
|
219788
219933
|
}
|
|
219789
219934
|
/**
|
|
219790
219935
|
* Scan all agent skills directories and collect unique skills.
|
|
@@ -219793,12 +219938,12 @@ var init_engine5 = __esm({
|
|
|
219793
219938
|
const skills = [];
|
|
219794
219939
|
const conflicts = [];
|
|
219795
219940
|
const seen = /* @__PURE__ */ new Map();
|
|
219796
|
-
const home =
|
|
219941
|
+
const home = homedir32();
|
|
219797
219942
|
for (const [agent, dirs] of Object.entries(_WorkspaceSyncEngine.SKILLS_DIRS)) {
|
|
219798
219943
|
for (const dir of dirs) {
|
|
219799
219944
|
const paths = [
|
|
219800
|
-
|
|
219801
|
-
|
|
219945
|
+
join28(this.projectRoot, dir),
|
|
219946
|
+
join28(home, dir)
|
|
219802
219947
|
];
|
|
219803
219948
|
for (const skillsRoot of paths) {
|
|
219804
219949
|
if (!existsSync23(skillsRoot)) continue;
|
|
@@ -219806,7 +219951,7 @@ var init_engine5 = __esm({
|
|
|
219806
219951
|
const entries = readdirSync4(skillsRoot, { withFileTypes: true });
|
|
219807
219952
|
for (const entry of entries) {
|
|
219808
219953
|
if (!entry.isDirectory()) continue;
|
|
219809
|
-
const skillMd =
|
|
219954
|
+
const skillMd = join28(skillsRoot, entry.name, "SKILL.md");
|
|
219810
219955
|
if (!existsSync23(skillMd)) continue;
|
|
219811
219956
|
let description = "";
|
|
219812
219957
|
try {
|
|
@@ -219818,7 +219963,7 @@ var init_engine5 = __esm({
|
|
|
219818
219963
|
const newEntry = {
|
|
219819
219964
|
name: entry.name,
|
|
219820
219965
|
description,
|
|
219821
|
-
sourcePath:
|
|
219966
|
+
sourcePath: join28(skillsRoot, entry.name),
|
|
219822
219967
|
sourceAgent: agent
|
|
219823
219968
|
};
|
|
219824
219969
|
const existing = seen.get(entry.name);
|
|
@@ -219855,7 +220000,7 @@ var init_engine5 = __esm({
|
|
|
219855
220000
|
}
|
|
219856
220001
|
for (const skill2 of skills) {
|
|
219857
220002
|
if (skill2.sourceAgent === target) continue;
|
|
219858
|
-
const dest =
|
|
220003
|
+
const dest = join28(targetDir, skill2.name);
|
|
219859
220004
|
if (existsSync23(dest)) {
|
|
219860
220005
|
skipped.push(`${skill2.name} (already exists in ${target})`);
|
|
219861
220006
|
continue;
|
|
@@ -219871,13 +220016,13 @@ var init_engine5 = __esm({
|
|
|
219871
220016
|
}
|
|
219872
220017
|
scanWorkflows() {
|
|
219873
220018
|
const workflows = [];
|
|
219874
|
-
const wfDir =
|
|
220019
|
+
const wfDir = join28(this.projectRoot, ".windsurf", "workflows");
|
|
219875
220020
|
if (!existsSync23(wfDir)) return workflows;
|
|
219876
220021
|
try {
|
|
219877
220022
|
const files = readdirSync4(wfDir).filter((f7) => f7.endsWith(".md"));
|
|
219878
220023
|
for (const file2 of files) {
|
|
219879
220024
|
try {
|
|
219880
|
-
const content = readFileSync14(
|
|
220025
|
+
const content = readFileSync14(join28(wfDir, file2), "utf-8");
|
|
219881
220026
|
workflows.push(this.workflowSyncer.parseWindsurfWorkflow(file2, content));
|
|
219882
220027
|
} catch {
|
|
219883
220028
|
}
|
|
@@ -220152,7 +220297,7 @@ __export(behavior_exports, {
|
|
|
220152
220297
|
resetBehaviorConfigCache: () => resetBehaviorConfigCache
|
|
220153
220298
|
});
|
|
220154
220299
|
import { existsSync as existsSync24, readFileSync as readFileSync15 } from "fs";
|
|
220155
|
-
import { homedir as
|
|
220300
|
+
import { homedir as homedir33 } from "os";
|
|
220156
220301
|
function isSessionInject(value) {
|
|
220157
220302
|
return value === "full" || value === "minimal" || value === "silent";
|
|
220158
220303
|
}
|
|
@@ -220170,7 +220315,7 @@ function legacyBehavior(homeDir) {
|
|
|
220170
220315
|
}
|
|
220171
220316
|
}
|
|
220172
220317
|
function getBehaviorConfig(options = {}) {
|
|
220173
|
-
const homeDir = options.homeDir ??
|
|
220318
|
+
const homeDir = options.homeDir ?? homedir33();
|
|
220174
220319
|
const projectRoot = options.projectRoot === void 0 ? detectProject()?.rootPath ?? null : options.projectRoot;
|
|
220175
220320
|
const cacheKey2 = `${homeDir}\0${projectRoot ?? ""}`;
|
|
220176
220321
|
const cached2 = cache4.get(cacheKey2);
|
|
@@ -221602,7 +221747,7 @@ async function handleApi(req, res, dataDir, projectId, projectName, baseDir, pro
|
|
|
221602
221747
|
case "/config": {
|
|
221603
221748
|
const os9 = await import("os");
|
|
221604
221749
|
const { existsSync: existsSync34 } = await import("fs");
|
|
221605
|
-
const { join:
|
|
221750
|
+
const { join: join35 } = await import("path");
|
|
221606
221751
|
const configProjectRoot = effectiveProjectRoot;
|
|
221607
221752
|
const resolved = getResolvedConfig({ projectRoot: configProjectRoot });
|
|
221608
221753
|
const files = {
|
|
@@ -221617,13 +221762,13 @@ async function handleApi(req, res, dataDir, projectId, projectName, baseDir, pro
|
|
|
221617
221762
|
try {
|
|
221618
221763
|
const home = os9.homedir();
|
|
221619
221764
|
const paths = {
|
|
221620
|
-
"project memorix.yml": configProjectRoot ?
|
|
221621
|
-
"user memorix.yml":
|
|
221622
|
-
"project memorix.toml": configProjectRoot ?
|
|
221623
|
-
"user config.toml":
|
|
221624
|
-
"project .env": configProjectRoot ?
|
|
221625
|
-
"user .env":
|
|
221626
|
-
"legacy config.json":
|
|
221765
|
+
"project memorix.yml": configProjectRoot ? join35(configProjectRoot, "memorix.yml") : null,
|
|
221766
|
+
"user memorix.yml": join35(home, ".memorix", "memorix.yml"),
|
|
221767
|
+
"project memorix.toml": configProjectRoot ? join35(configProjectRoot, "memorix.toml") : null,
|
|
221768
|
+
"user config.toml": join35(home, ".memorix", "config.toml"),
|
|
221769
|
+
"project .env": configProjectRoot ? join35(configProjectRoot, ".env") : null,
|
|
221770
|
+
"user .env": join35(home, ".memorix", ".env"),
|
|
221771
|
+
"legacy config.json": join35(home, ".memorix", "config.json")
|
|
221627
221772
|
};
|
|
221628
221773
|
for (const [key, fpath] of Object.entries(paths)) {
|
|
221629
221774
|
if (fpath === null) {
|
|
@@ -264549,10 +264694,10 @@ ${Math.max(0, managedIds.size - result.resolved.length)} visible writable observ
|
|
|
264549
264694
|
);
|
|
264550
264695
|
let enableKG = isToolInProfile("create_entities", toolProfile);
|
|
264551
264696
|
try {
|
|
264552
|
-
const { homedir:
|
|
264553
|
-
const { join:
|
|
264697
|
+
const { homedir: homedir37 } = await import("os");
|
|
264698
|
+
const { join: join35 } = await import("path");
|
|
264554
264699
|
const { readFile: readFile10 } = await import("fs/promises");
|
|
264555
|
-
const raw = await readFile10(
|
|
264700
|
+
const raw = await readFile10(join35(homedir37(), ".memorix", "settings.json"), "utf-8");
|
|
264556
264701
|
const s4 = JSON.parse(raw);
|
|
264557
264702
|
if (s4.knowledgeGraph === true) enableKG = true;
|
|
264558
264703
|
} catch {
|
|
@@ -267125,8 +267270,8 @@ __export(update_checker_exports, {
|
|
|
267125
267270
|
});
|
|
267126
267271
|
import { execFile as execFile3 } from "child_process";
|
|
267127
267272
|
import { readFile as readFile7, writeFile as writeFile8, mkdir as mkdir7 } from "fs/promises";
|
|
267128
|
-
import { join as
|
|
267129
|
-
import { homedir as
|
|
267273
|
+
import { join as join29 } from "path";
|
|
267274
|
+
import { homedir as homedir34 } from "os";
|
|
267130
267275
|
function getCurrentVersion() {
|
|
267131
267276
|
try {
|
|
267132
267277
|
return getCliVersion();
|
|
@@ -267305,8 +267450,8 @@ var init_update_checker = __esm({
|
|
|
267305
267450
|
MIN_AUTO_UPDATE_TIMEOUT_MS = 5e3;
|
|
267306
267451
|
MAX_AUTO_UPDATE_TIMEOUT_MS = 30 * 60 * 1e3;
|
|
267307
267452
|
REGISTRY_URL = `https://registry.npmjs.org/${PACKAGE_NAME}/latest`;
|
|
267308
|
-
CACHE_DIR2 =
|
|
267309
|
-
CACHE_FILE2 =
|
|
267453
|
+
CACHE_DIR2 = join29(homedir34(), ".memorix");
|
|
267454
|
+
CACHE_FILE2 = join29(CACHE_DIR2, "update-check.json");
|
|
267310
267455
|
_testing = {
|
|
267311
267456
|
CACHE_FILE: CACHE_FILE2,
|
|
267312
267457
|
CHECK_INTERVAL_MS,
|
|
@@ -267364,7 +267509,7 @@ var init_serve = __esm({
|
|
|
267364
267509
|
const { serveStdio, StdioServerTransport } = await import("@modelcontextprotocol/server/stdio");
|
|
267365
267510
|
const { createModernMcpBridge: createModernMcpBridge2 } = await Promise.resolve().then(() => (init_modern_mcp_bridge(), modern_mcp_bridge_exports));
|
|
267366
267511
|
const { detectProject: detectProject2, findGitInSubdirs: findGitInSubdirs2, isSystemDirectory: isSystemDirectory2 } = await Promise.resolve().then(() => (init_detector(), detector_exports));
|
|
267367
|
-
const { homedir:
|
|
267512
|
+
const { homedir: homedir37 } = await import("os");
|
|
267368
267513
|
const { writeLastProjectRoot: writeLastProjectRoot2 } = await Promise.resolve().then(() => (init_launch_root(), launch_root_exports));
|
|
267369
267514
|
const { resolveServeProject: resolveServeProject2 } = await Promise.resolve().then(() => (init_serve_shared(), serve_shared_exports));
|
|
267370
267515
|
let stdioHandle;
|
|
@@ -267393,7 +267538,7 @@ var init_serve = __esm({
|
|
|
267393
267538
|
try {
|
|
267394
267539
|
safeCwd = process.cwd();
|
|
267395
267540
|
} catch {
|
|
267396
|
-
safeCwd =
|
|
267541
|
+
safeCwd = homedir37();
|
|
267397
267542
|
}
|
|
267398
267543
|
const resolution = resolveServeProject2(
|
|
267399
267544
|
{
|
|
@@ -267401,7 +267546,7 @@ var init_serve = __esm({
|
|
|
267401
267546
|
envProjectRoot: process.env.MEMORIX_PROJECT_ROOT,
|
|
267402
267547
|
initCwd: process.env.INIT_CWD,
|
|
267403
267548
|
processCwd: safeCwd,
|
|
267404
|
-
homeDir:
|
|
267549
|
+
homeDir: homedir37()
|
|
267405
267550
|
},
|
|
267406
267551
|
{ detectProject: detectProject2, findGitInSubdirs: findGitInSubdirs2, isSystemDirectory: isSystemDirectory2 }
|
|
267407
267552
|
);
|
|
@@ -269838,7 +269983,7 @@ var init_serve_http = __esm({
|
|
|
269838
269983
|
const { createProjectBindingController: createProjectBindingController2 } = await Promise.resolve().then(() => (init_request_context(), request_context_exports));
|
|
269839
269984
|
const { findGitInSubdirs: findGitInSubdirs2 } = await Promise.resolve().then(() => (init_detector(), detector_exports));
|
|
269840
269985
|
const { writeFileSync: writeFileSync12, mkdirSync: mkdirSync12 } = await import("fs");
|
|
269841
|
-
const { homedir:
|
|
269986
|
+
const { homedir: homedir37 } = await import("os");
|
|
269842
269987
|
const { McpBindingStore: McpBindingStore2 } = await Promise.resolve().then(() => (init_mcp_binding_store(), mcp_binding_store_exports));
|
|
269843
269988
|
const { MemoryFeedbackStore: MemoryFeedbackStore2 } = await Promise.resolve().then(() => (init_feedback(), feedback_exports));
|
|
269844
269989
|
const { createModernMcpBridge: createModernMcpBridge2 } = await Promise.resolve().then(() => (init_modern_mcp_bridge(), modern_mcp_bridge_exports));
|
|
@@ -269859,7 +270004,7 @@ var init_serve_http = __esm({
|
|
|
269859
270004
|
try {
|
|
269860
270005
|
safeCwd = process.cwd();
|
|
269861
270006
|
} catch {
|
|
269862
|
-
safeCwd =
|
|
270007
|
+
safeCwd = homedir37();
|
|
269863
270008
|
}
|
|
269864
270009
|
const { resolveServeProject: resolveServeProject2 } = await Promise.resolve().then(() => (init_serve_shared(), serve_shared_exports));
|
|
269865
270010
|
const { writeLastProjectRoot: writeLastProjectRoot2 } = await Promise.resolve().then(() => (init_launch_root(), launch_root_exports));
|
|
@@ -269870,7 +270015,7 @@ var init_serve_http = __esm({
|
|
|
269870
270015
|
cwdArg: args.cwd,
|
|
269871
270016
|
envProjectRoot: process.env.MEMORIX_PROJECT_ROOT,
|
|
269872
270017
|
processCwd: safeCwd,
|
|
269873
|
-
homeDir:
|
|
270018
|
+
homeDir: homedir37()
|
|
269874
270019
|
},
|
|
269875
270020
|
{ detectProject: detectorMod.detectProject, findGitInSubdirs: detectorMod.findGitInSubdirs, isSystemDirectory: detectorMod.isSystemDirectory }
|
|
269876
270021
|
);
|
|
@@ -270747,7 +270892,7 @@ var init_serve_http = __esm({
|
|
|
270747
270892
|
const { projectId: configProjectId } = await resolveRequestProject(url2);
|
|
270748
270893
|
const os9 = await import("os");
|
|
270749
270894
|
const { existsSync: existsSync34 } = await import("fs");
|
|
270750
|
-
const { join:
|
|
270895
|
+
const { join: join35 } = await import("path");
|
|
270751
270896
|
const { loadYamlConfig: loadYamlConfig2 } = await Promise.resolve().then(() => (init_yaml_loader(), yaml_loader_exports));
|
|
270752
270897
|
const { loadFileConfig: loadFileConfig2, loadDotenv: loadDotenv2, getLoadedEnvFiles: getLoadedEnvFiles2 } = await Promise.resolve().then(() => (init_config(), config_exports));
|
|
270753
270898
|
const isStartupProject = configProjectId === defaultProject.id;
|
|
@@ -270761,11 +270906,11 @@ var init_serve_http = __esm({
|
|
|
270761
270906
|
const home = os9.homedir();
|
|
270762
270907
|
if (effectiveRoot) {
|
|
270763
270908
|
const paths = {
|
|
270764
|
-
"project memorix.yml":
|
|
270765
|
-
"user memorix.yml":
|
|
270766
|
-
"project .env":
|
|
270767
|
-
"user .env":
|
|
270768
|
-
"legacy config.json":
|
|
270909
|
+
"project memorix.yml": join35(effectiveRoot, "memorix.yml"),
|
|
270910
|
+
"user memorix.yml": join35(home, ".memorix", "memorix.yml"),
|
|
270911
|
+
"project .env": join35(effectiveRoot, ".env"),
|
|
270912
|
+
"user .env": join35(home, ".memorix", ".env"),
|
|
270913
|
+
"legacy config.json": join35(home, ".memorix", "config.json")
|
|
270769
270914
|
};
|
|
270770
270915
|
for (const [key, fpath] of Object.entries(paths)) {
|
|
270771
270916
|
files[key] = { exists: existsSync34(fpath), path: fpath };
|
|
@@ -270774,9 +270919,9 @@ var init_serve_http = __esm({
|
|
|
270774
270919
|
files["project memorix.yml"] = { exists: false, path: "unavailable", unavailable: true };
|
|
270775
270920
|
files["project .env"] = { exists: false, path: "unavailable", unavailable: true };
|
|
270776
270921
|
const userPaths = {
|
|
270777
|
-
"user memorix.yml":
|
|
270778
|
-
"user .env":
|
|
270779
|
-
"legacy config.json":
|
|
270922
|
+
"user memorix.yml": join35(home, ".memorix", "memorix.yml"),
|
|
270923
|
+
"user .env": join35(home, ".memorix", ".env"),
|
|
270924
|
+
"legacy config.json": join35(home, ".memorix", "config.json")
|
|
270780
270925
|
};
|
|
270781
270926
|
for (const [key, fpath] of Object.entries(userPaths)) {
|
|
270782
270927
|
files[key] = { exists: existsSync34(fpath), path: fpath };
|
|
@@ -273616,6 +273761,7 @@ var init_types9 = __esm({
|
|
|
273616
273761
|
opencode: "community",
|
|
273617
273762
|
trae: "community",
|
|
273618
273763
|
dsh: "community",
|
|
273764
|
+
workbuddy: "community",
|
|
273619
273765
|
pi: "community",
|
|
273620
273766
|
omp: "community",
|
|
273621
273767
|
antigravity: "community"
|
|
@@ -273636,8 +273782,14 @@ async function installSingleAgent2(agent, cwd, global2) {
|
|
|
273636
273782
|
cwd,
|
|
273637
273783
|
global2
|
|
273638
273784
|
);
|
|
273639
|
-
|
|
273785
|
+
const note = config2.generated?.note;
|
|
273786
|
+
if (config2.configPath) {
|
|
273787
|
+
console.log(`[OK] ${agent}: hooks installed -> ${config2.configPath}`);
|
|
273788
|
+
} else {
|
|
273789
|
+
console.log(`[OK] ${agent}: no hooks installed at this scope (MCP-only integration)`);
|
|
273790
|
+
}
|
|
273640
273791
|
console.log(` Events: ${config2.events.join(", ")}`);
|
|
273792
|
+
if (!config2.configPath && note) console.log(` Note: ${note}`);
|
|
273641
273793
|
if (agent === "copilot" && process.platform === "win32") {
|
|
273642
273794
|
try {
|
|
273643
273795
|
const { execSync: execSync5 } = await import("child_process");
|
|
@@ -273653,7 +273805,6 @@ async function installSingleAgent2(agent, cwd, global2) {
|
|
|
273653
273805
|
}
|
|
273654
273806
|
}
|
|
273655
273807
|
if (agent === "copilot" && global2) {
|
|
273656
|
-
const note = config2.generated?.note;
|
|
273657
273808
|
if (note) console.warn(`[WARN] ${note}`);
|
|
273658
273809
|
}
|
|
273659
273810
|
} catch (err) {
|
|
@@ -273675,7 +273826,8 @@ function getAgentLabel2(agent) {
|
|
|
273675
273826
|
hermes: "Hermes Agent",
|
|
273676
273827
|
omp: "Oh-my-Pi",
|
|
273677
273828
|
trae: "Trae",
|
|
273678
|
-
dsh: "DeepSeek Harness"
|
|
273829
|
+
dsh: "DeepSeek Harness",
|
|
273830
|
+
workbuddy: "WorkBuddy"
|
|
273679
273831
|
};
|
|
273680
273832
|
return labels[agent] || agent;
|
|
273681
273833
|
}
|
|
@@ -273694,6 +273846,7 @@ function getAgentHint2(agent) {
|
|
|
273694
273846
|
omp: "Oh-my-Pi package hooks; use `memorix setup --agent omp`",
|
|
273695
273847
|
trae: ".trae/rules/project_rules.md (rules only, no hooks system)",
|
|
273696
273848
|
dsh: "~/.dsh/cordis.patch.yml MCP row via `memorix setup --agent dsh` (no hooks system)",
|
|
273849
|
+
workbuddy: "~/.workbuddy/mcp.json MCP row via `memorix setup --agent workbuddy` (no hooks system)",
|
|
273697
273850
|
codex: "Codex plugin hooks; use `memorix setup --agent codex`"
|
|
273698
273851
|
};
|
|
273699
273852
|
return hints[agent] || "";
|
|
@@ -273802,7 +273955,8 @@ function estimateFileSize(agent, configPath) {
|
|
|
273802
273955
|
antigravity: "~2KB",
|
|
273803
273956
|
opencode: "~3KB",
|
|
273804
273957
|
trae: "~1KB",
|
|
273805
|
-
dsh: "~1KB"
|
|
273958
|
+
dsh: "~1KB",
|
|
273959
|
+
workbuddy: "~1KB"
|
|
273806
273960
|
};
|
|
273807
273961
|
return sizes[agent] || "~2KB";
|
|
273808
273962
|
}
|
|
@@ -273822,6 +273976,8 @@ function getRulesPath(agent, cwd, global2) {
|
|
|
273822
273976
|
return path42.join(home, ".trae", "rules", "project_rules.md");
|
|
273823
273977
|
case "dsh":
|
|
273824
273978
|
return path42.join(process.env.DSH_HOME?.trim() || path42.join(home, ".dsh"), "AGENTS.md");
|
|
273979
|
+
case "workbuddy":
|
|
273980
|
+
return "";
|
|
273825
273981
|
default:
|
|
273826
273982
|
return "";
|
|
273827
273983
|
}
|
|
@@ -273839,6 +273995,8 @@ function getRulesPath(agent, cwd, global2) {
|
|
|
273839
273995
|
return path42.join(cwd, ".trae", "rules", "project_rules.md");
|
|
273840
273996
|
case "dsh":
|
|
273841
273997
|
return path42.join(cwd, "AGENTS.md");
|
|
273998
|
+
case "workbuddy":
|
|
273999
|
+
return path42.join(cwd, "AGENTS.md");
|
|
273842
274000
|
default:
|
|
273843
274001
|
return "";
|
|
273844
274002
|
}
|
|
@@ -276513,7 +276671,7 @@ import { spawnSync as spawnSync2 } from "child_process";
|
|
|
276513
276671
|
import { existsSync as existsSync29, realpathSync as realpathSync2 } from "fs";
|
|
276514
276672
|
import { mkdir as mkdir8, readFile as readFile9, writeFile as writeFile9 } from "fs/promises";
|
|
276515
276673
|
import { basename as basename5, dirname as dirname8, resolve as resolve4 } from "path";
|
|
276516
|
-
import { homedir as
|
|
276674
|
+
import { homedir as homedir35 } from "os";
|
|
276517
276675
|
function requestedAgents(agent) {
|
|
276518
276676
|
const all = getSetupAgentTargets();
|
|
276519
276677
|
if (!agent || agent === "all") return all;
|
|
@@ -276591,16 +276749,16 @@ function asRecordArray(value) {
|
|
|
276591
276749
|
return Array.isArray(value) ? value.map(asRecord3).filter((entry) => entry !== null) : [];
|
|
276592
276750
|
}
|
|
276593
276751
|
function codexPluginPath() {
|
|
276594
|
-
return `${
|
|
276752
|
+
return `${homedir35()}/plugins/${CODEX_PLUGIN_NAME}`;
|
|
276595
276753
|
}
|
|
276596
276754
|
function codexPluginMcpPath() {
|
|
276597
276755
|
return `${codexPluginPath()}/.mcp.json`;
|
|
276598
276756
|
}
|
|
276599
276757
|
function codexMarketplacePath() {
|
|
276600
|
-
return `${
|
|
276758
|
+
return `${homedir35()}/.agents/plugins/marketplace.json`;
|
|
276601
276759
|
}
|
|
276602
276760
|
function codexConfigPath() {
|
|
276603
|
-
return `${
|
|
276761
|
+
return `${homedir35()}/.codex/config.toml`;
|
|
276604
276762
|
}
|
|
276605
276763
|
function normalizeMarketplacePath(value) {
|
|
276606
276764
|
return value.replace(/\\/g, "/").replace(/^\.\//, "");
|
|
@@ -276915,7 +277073,7 @@ function canonicalProjectPath(projectRoot) {
|
|
|
276915
277073
|
return canonical.replace(/\\/g, "/");
|
|
276916
277074
|
}
|
|
276917
277075
|
function getClaudeLocalConfigPath() {
|
|
276918
|
-
return `${
|
|
277076
|
+
return `${homedir35()}/.claude.json`;
|
|
276919
277077
|
}
|
|
276920
277078
|
function coerceMcpServer(name, value) {
|
|
276921
277079
|
const entry = asRecord3(value);
|
|
@@ -277174,7 +277332,7 @@ async function inspectGuidance(agent, projectRoot, scope) {
|
|
|
277174
277332
|
}
|
|
277175
277333
|
const checks = [];
|
|
277176
277334
|
for (const targetScope of requestedGuidanceScopes(scope)) {
|
|
277177
|
-
const root = targetScope === "project" ? projectRoot :
|
|
277335
|
+
const root = targetScope === "project" ? projectRoot : homedir35();
|
|
277178
277336
|
const rulesPath = getAgentRulesPath(agent, root, targetScope === "global");
|
|
277179
277337
|
if (!existsSync29(rulesPath)) {
|
|
277180
277338
|
checks.push({
|
|
@@ -277391,7 +277549,8 @@ var init_agent_integrations = __esm({
|
|
|
277391
277549
|
"kiro",
|
|
277392
277550
|
"opencode",
|
|
277393
277551
|
"trae",
|
|
277394
|
-
"dsh"
|
|
277552
|
+
"dsh",
|
|
277553
|
+
"workbuddy"
|
|
277395
277554
|
]);
|
|
277396
277555
|
CODEX_PLUGIN_NAME = "memorix";
|
|
277397
277556
|
CODEX_PLUGIN_MARKETPLACE = "personal";
|
|
@@ -277453,8 +277612,8 @@ var init_doctor = __esm({
|
|
|
277453
277612
|
return;
|
|
277454
277613
|
}
|
|
277455
277614
|
const { existsSync: existsSync34, readFileSync: readFileSync23 } = await import("fs");
|
|
277456
|
-
const { join:
|
|
277457
|
-
const { homedir:
|
|
277615
|
+
const { join: join35, basename: basename7 } = await import("path");
|
|
277616
|
+
const { homedir: homedir37 } = await import("os");
|
|
277458
277617
|
const { execSync: execSync5 } = await import("child_process");
|
|
277459
277618
|
const report = {};
|
|
277460
277619
|
const issues = [];
|
|
@@ -277516,8 +277675,8 @@ var init_doctor = __esm({
|
|
|
277516
277675
|
}
|
|
277517
277676
|
lines.push("");
|
|
277518
277677
|
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");
|
|
277519
|
-
const memorixDir =
|
|
277520
|
-
const bgStatePath =
|
|
277678
|
+
const memorixDir = join35(homedir37(), ".memorix");
|
|
277679
|
+
const bgStatePath = join35(memorixDir, "background.json");
|
|
277521
277680
|
let bgRunning = false;
|
|
277522
277681
|
let bgPort = 0;
|
|
277523
277682
|
let bgPid = 0;
|
|
@@ -277637,7 +277796,7 @@ var init_doctor = __esm({
|
|
|
277637
277796
|
}
|
|
277638
277797
|
}
|
|
277639
277798
|
try {
|
|
277640
|
-
const cachePath =
|
|
277799
|
+
const cachePath = join35(memorixDir, "embedding-cache.json");
|
|
277641
277800
|
if (existsSync34(cachePath)) {
|
|
277642
277801
|
const cache5 = JSON.parse(readFileSync23(cachePath, "utf-8"));
|
|
277643
277802
|
const cacheCount = Object.keys(cache5).length;
|
|
@@ -277831,7 +277990,7 @@ var init_doctor = __esm({
|
|
|
277831
277990
|
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");
|
|
277832
277991
|
let conflictsFound = false;
|
|
277833
277992
|
if (dataDir) {
|
|
277834
|
-
const lockFile =
|
|
277993
|
+
const lockFile = join35(dataDir, ".memorix.lock");
|
|
277835
277994
|
if (existsSync34(lockFile)) {
|
|
277836
277995
|
try {
|
|
277837
277996
|
const lockData = JSON.parse(readFileSync23(lockFile, "utf-8"));
|
|
@@ -278334,7 +278493,8 @@ var init_purge = __esm({
|
|
|
278334
278493
|
// src/cli/commands/uninstall.ts
|
|
278335
278494
|
var uninstall_exports = {};
|
|
278336
278495
|
__export(uninstall_exports, {
|
|
278337
|
-
default: () => uninstall_default
|
|
278496
|
+
default: () => uninstall_default,
|
|
278497
|
+
getMCPConfigEntries: () => getMCPConfigEntries
|
|
278338
278498
|
});
|
|
278339
278499
|
import * as fs27 from "fs";
|
|
278340
278500
|
import * as path46 from "path";
|
|
@@ -278517,6 +278677,24 @@ function getMCPConfigEntries(home, cwd) {
|
|
|
278517
278677
|
detected: checkDshPatch(dshPatchPath),
|
|
278518
278678
|
note: "Remove the memory-memorix insert row from this patch file."
|
|
278519
278679
|
});
|
|
278680
|
+
const workbuddyCfg = path46.join(home, ".workbuddy", "mcp.json");
|
|
278681
|
+
entries.push({
|
|
278682
|
+
agent: "WorkBuddy",
|
|
278683
|
+
path: workbuddyCfg,
|
|
278684
|
+
kind: "global",
|
|
278685
|
+
format: "json",
|
|
278686
|
+
detected: checkJSON(workbuddyCfg),
|
|
278687
|
+
note: 'Remove the "memorix" key from mcpServers in this file.'
|
|
278688
|
+
});
|
|
278689
|
+
const workbuddyProjectCfg = path46.join(cwd, ".workbuddy", "mcp.json");
|
|
278690
|
+
entries.push({
|
|
278691
|
+
agent: "WorkBuddy",
|
|
278692
|
+
path: workbuddyProjectCfg,
|
|
278693
|
+
kind: "project",
|
|
278694
|
+
format: "json",
|
|
278695
|
+
detected: checkJSON(workbuddyProjectCfg),
|
|
278696
|
+
note: 'Remove the "memorix" key from mcpServers in this file.'
|
|
278697
|
+
});
|
|
278520
278698
|
return entries;
|
|
278521
278699
|
}
|
|
278522
278700
|
function checkBackground(home) {
|
|
@@ -280021,7 +280199,7 @@ var init_pipeline_trace = __esm({
|
|
|
280021
280199
|
// src/orchestrate/worktree.ts
|
|
280022
280200
|
import { execFileSync as execFileSync5 } from "child_process";
|
|
280023
280201
|
import { existsSync as existsSync31, rmSync as rmSync2 } from "fs";
|
|
280024
|
-
import { join as
|
|
280202
|
+
import { join as join33, basename as basename6 } from "path";
|
|
280025
280203
|
function runGit4(cwd, args, timeout = 5e3) {
|
|
280026
280204
|
return String(execFileSync5("git", args, {
|
|
280027
280205
|
cwd,
|
|
@@ -280060,7 +280238,7 @@ function isManagedWorktreePath(worktreePath, worktreeBase) {
|
|
|
280060
280238
|
function createWorktree(projectDir2, taskId, pipelineId) {
|
|
280061
280239
|
const shortId2 = taskId.slice(0, 8);
|
|
280062
280240
|
const shortPipeline = pipelineId.slice(0, 8);
|
|
280063
|
-
const worktreeBase =
|
|
280241
|
+
const worktreeBase = join33(projectDir2, WORKTREE_DIR, `task-${shortId2}`);
|
|
280064
280242
|
const branchBase = `pipeline/${shortPipeline}/task-${shortId2}`;
|
|
280065
280243
|
for (let attempt = 1; attempt <= 100; attempt++) {
|
|
280066
280244
|
const suffix = attempt === 1 ? "" : `-${attempt}`;
|
|
@@ -280150,7 +280328,7 @@ function listWorktrees(projectDir2) {
|
|
|
280150
280328
|
}
|
|
280151
280329
|
}
|
|
280152
280330
|
if (current) worktrees.push(current);
|
|
280153
|
-
const worktreeBase =
|
|
280331
|
+
const worktreeBase = join33(projectDir2, WORKTREE_DIR);
|
|
280154
280332
|
return worktrees.filter((w4) => isManagedWorktreePath(w4.path, worktreeBase));
|
|
280155
280333
|
} catch {
|
|
280156
280334
|
return [];
|
|
@@ -280572,16 +280750,16 @@ var init_cost_tracker = __esm({
|
|
|
280572
280750
|
|
|
280573
280751
|
// src/orchestrate/evidence.ts
|
|
280574
280752
|
import { mkdirSync as mkdirSync10, writeFileSync as writeFileSync10 } from "fs";
|
|
280575
|
-
import { join as
|
|
280753
|
+
import { join as join34 } from "path";
|
|
280576
280754
|
function writeTaskEvidence(projectDir2, pipelineId, evidence) {
|
|
280577
280755
|
try {
|
|
280578
|
-
const dir =
|
|
280756
|
+
const dir = join34(projectDir2, ".pipeline", pipelineId, "evidence", evidence.taskId.slice(0, 12));
|
|
280579
280757
|
mkdirSync10(dir, { recursive: true });
|
|
280580
280758
|
if (evidence.prompt) {
|
|
280581
|
-
safeWrite(
|
|
280759
|
+
safeWrite(join34(dir, "prompt.md"), evidence.prompt);
|
|
280582
280760
|
}
|
|
280583
280761
|
if (evidence.tailOutput) {
|
|
280584
|
-
safeWrite(
|
|
280762
|
+
safeWrite(join34(dir, "output.txt"), evidence.tailOutput);
|
|
280585
280763
|
}
|
|
280586
280764
|
if (evidence.gateResults) {
|
|
280587
280765
|
for (const g4 of evidence.gateResults) {
|
|
@@ -280590,7 +280768,7 @@ Status: ${g4.passed ? "PASS" : "FAIL"}
|
|
|
280590
280768
|
Duration: ${(g4.durationMs / 1e3).toFixed(1)}s
|
|
280591
280769
|
|
|
280592
280770
|
${g4.output}`;
|
|
280593
|
-
safeWrite(
|
|
280771
|
+
safeWrite(join34(dir, `${g4.gate}.txt`), content);
|
|
280594
280772
|
}
|
|
280595
280773
|
}
|
|
280596
280774
|
const resultJson = {
|
|
@@ -280604,7 +280782,7 @@ ${g4.output}`;
|
|
|
280604
280782
|
tokenUsage: evidence.tokenUsage,
|
|
280605
280783
|
costUSD: evidence.costUSD
|
|
280606
280784
|
};
|
|
280607
|
-
safeWrite(
|
|
280785
|
+
safeWrite(join34(dir, "result.json"), JSON.stringify(resultJson, null, 2));
|
|
280608
280786
|
return dir;
|
|
280609
280787
|
} catch {
|
|
280610
280788
|
return null;
|
|
@@ -280612,7 +280790,7 @@ ${g4.output}`;
|
|
|
280612
280790
|
}
|
|
280613
280791
|
function writePipelineSummary(projectDir2, summary) {
|
|
280614
280792
|
try {
|
|
280615
|
-
const dir =
|
|
280793
|
+
const dir = join34(projectDir2, ".pipeline", summary.pipelineId);
|
|
280616
280794
|
mkdirSync10(dir, { recursive: true });
|
|
280617
280795
|
const elapsed = (summary.elapsedMs / 1e3).toFixed(0);
|
|
280618
280796
|
const lines = [
|
|
@@ -280633,8 +280811,8 @@ function writePipelineSummary(projectDir2, summary) {
|
|
|
280633
280811
|
lines.push(`- [${status}] ${t4.taskDescription.slice(0, 80)} \u2014 ${t4.agentName}, ${dur}s${fixes}`);
|
|
280634
280812
|
}
|
|
280635
280813
|
const content = lines.join("\n") + "\n";
|
|
280636
|
-
safeWrite(
|
|
280637
|
-
return
|
|
280814
|
+
safeWrite(join34(dir, "summary.md"), content);
|
|
280815
|
+
return join34(dir, "summary.md");
|
|
280638
280816
|
} catch {
|
|
280639
280817
|
return null;
|
|
280640
280818
|
}
|