@cleocode/adapters 2026.5.26 → 2026.5.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +109 -140
- package/dist/index.js.map +3 -3
- package/dist/providers/shared/paths.d.ts +9 -27
- package/dist/providers/shared/paths.d.ts.map +1 -1
- package/package.json +5 -4
- package/src/providers/shared/paths.ts +9 -74
package/dist/index.js
CHANGED
|
@@ -27880,38 +27880,7 @@ var init_hook_template_installer = __esm({
|
|
|
27880
27880
|
});
|
|
27881
27881
|
|
|
27882
27882
|
// packages/adapters/src/providers/shared/paths.ts
|
|
27883
|
-
import {
|
|
27884
|
-
import { join as join7 } from "node:path";
|
|
27885
|
-
function getAdapterCleoHome() {
|
|
27886
|
-
if (process.env["CLEO_HOME"]) {
|
|
27887
|
-
return process.env["CLEO_HOME"];
|
|
27888
|
-
}
|
|
27889
|
-
const home = homedir6();
|
|
27890
|
-
if (process.platform === "darwin") {
|
|
27891
|
-
return join7(home, "Library", "Application Support", "cleo");
|
|
27892
|
-
}
|
|
27893
|
-
if (process.platform === "win32") {
|
|
27894
|
-
const localAppData = process.env["LOCALAPPDATA"];
|
|
27895
|
-
if (localAppData) {
|
|
27896
|
-
return join7(localAppData, "cleo", "Data");
|
|
27897
|
-
}
|
|
27898
|
-
return join7(home, "AppData", "Local", "cleo", "Data");
|
|
27899
|
-
}
|
|
27900
|
-
const xdgData = process.env["XDG_DATA_HOME"];
|
|
27901
|
-
if (xdgData) {
|
|
27902
|
-
return join7(xdgData, "cleo");
|
|
27903
|
-
}
|
|
27904
|
-
return join7(home, ".local", "share", "cleo");
|
|
27905
|
-
}
|
|
27906
|
-
function getCleoTemplatesTildePath() {
|
|
27907
|
-
const absPath = join7(getAdapterCleoHome(), "templates");
|
|
27908
|
-
const home = homedir6();
|
|
27909
|
-
if (absPath.startsWith(home)) {
|
|
27910
|
-
const relative = absPath.slice(home.length).replace(/\\/g, "/");
|
|
27911
|
-
return `~${relative}`;
|
|
27912
|
-
}
|
|
27913
|
-
return absPath;
|
|
27914
|
-
}
|
|
27883
|
+
import { getCleoTemplatesTildePath } from "@cleocode/paths";
|
|
27915
27884
|
var init_paths2 = __esm({
|
|
27916
27885
|
"packages/adapters/src/providers/shared/paths.ts"() {
|
|
27917
27886
|
"use strict";
|
|
@@ -27927,12 +27896,12 @@ import {
|
|
|
27927
27896
|
readFileSync as readFileSync5,
|
|
27928
27897
|
writeFileSync as writeFileSync3
|
|
27929
27898
|
} from "node:fs";
|
|
27930
|
-
import { homedir as
|
|
27931
|
-
import { dirname as dirname3, join as
|
|
27899
|
+
import { homedir as homedir6 } from "node:os";
|
|
27900
|
+
import { dirname as dirname3, join as join7 } from "node:path";
|
|
27932
27901
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
27933
27902
|
function getAdapterCommandsDir() {
|
|
27934
27903
|
const thisDir = dirname3(fileURLToPath2(import.meta.url));
|
|
27935
|
-
return
|
|
27904
|
+
return join7(thisDir, "commands");
|
|
27936
27905
|
}
|
|
27937
27906
|
var INSTRUCTION_REFERENCES, ClaudeCodeInstallProvider;
|
|
27938
27907
|
var init_install = __esm({
|
|
@@ -27958,7 +27927,7 @@ var init_install = __esm({
|
|
|
27958
27927
|
const details = {};
|
|
27959
27928
|
instructionFileUpdated = this.updateInstructionFile(projectDir);
|
|
27960
27929
|
if (instructionFileUpdated) {
|
|
27961
|
-
details.instructionFile =
|
|
27930
|
+
details.instructionFile = join7(projectDir, "CLAUDE.md");
|
|
27962
27931
|
}
|
|
27963
27932
|
const commandsInstalled = this.installCommands(projectDir);
|
|
27964
27933
|
if (commandsInstalled.length > 0) {
|
|
@@ -27992,7 +27961,7 @@ var init_install = __esm({
|
|
|
27992
27961
|
* Checks for plugin enabled in ~/.claude/settings.json.
|
|
27993
27962
|
*/
|
|
27994
27963
|
async isInstalled() {
|
|
27995
|
-
const settingsPath =
|
|
27964
|
+
const settingsPath = join7(homedir6(), ".claude", "settings.json");
|
|
27996
27965
|
if (existsSync6(settingsPath)) {
|
|
27997
27966
|
try {
|
|
27998
27967
|
const settings = JSON.parse(readFileSync5(settingsPath, "utf-8"));
|
|
@@ -28021,7 +27990,7 @@ var init_install = __esm({
|
|
|
28021
27990
|
* @returns true if the file was created or modified
|
|
28022
27991
|
*/
|
|
28023
27992
|
updateInstructionFile(projectDir) {
|
|
28024
|
-
const claudeMdPath =
|
|
27993
|
+
const claudeMdPath = join7(projectDir, "CLAUDE.md");
|
|
28025
27994
|
let content = "";
|
|
28026
27995
|
let existed = false;
|
|
28027
27996
|
if (existsSync6(claudeMdPath)) {
|
|
@@ -28056,13 +28025,13 @@ var init_install = __esm({
|
|
|
28056
28025
|
if (!existsSync6(adapterCommandsDir)) {
|
|
28057
28026
|
return [];
|
|
28058
28027
|
}
|
|
28059
|
-
const targetDir =
|
|
28028
|
+
const targetDir = join7(projectDir, ".claude", "commands");
|
|
28060
28029
|
mkdirSync3(targetDir, { recursive: true });
|
|
28061
28030
|
const installed = [];
|
|
28062
28031
|
const files = readdirSync2(adapterCommandsDir).filter((f) => f.endsWith(".md"));
|
|
28063
28032
|
for (const file2 of files) {
|
|
28064
|
-
const src =
|
|
28065
|
-
const dest =
|
|
28033
|
+
const src = join7(adapterCommandsDir, file2);
|
|
28034
|
+
const dest = join7(targetDir, file2);
|
|
28066
28035
|
copyFileSync2(src, dest);
|
|
28067
28036
|
installed.push(file2);
|
|
28068
28037
|
}
|
|
@@ -28074,8 +28043,8 @@ var init_install = __esm({
|
|
|
28074
28043
|
* @returns Description of what was registered, or null if no change needed
|
|
28075
28044
|
*/
|
|
28076
28045
|
registerPlugin() {
|
|
28077
|
-
const home =
|
|
28078
|
-
const settingsPath =
|
|
28046
|
+
const home = homedir6();
|
|
28047
|
+
const settingsPath = join7(home, ".claude", "settings.json");
|
|
28079
28048
|
let settings = {};
|
|
28080
28049
|
if (existsSync6(settingsPath)) {
|
|
28081
28050
|
try {
|
|
@@ -28093,7 +28062,7 @@ var init_install = __esm({
|
|
|
28093
28062
|
}
|
|
28094
28063
|
enabledPlugins[pluginKey] = true;
|
|
28095
28064
|
settings.enabledPlugins = enabledPlugins;
|
|
28096
|
-
mkdirSync3(
|
|
28065
|
+
mkdirSync3(join7(home, ".claude"), { recursive: true });
|
|
28097
28066
|
writeFileSync3(settingsPath, JSON.stringify(settings, null, 2) + "\n", "utf-8");
|
|
28098
28067
|
return `Enabled ${pluginKey} in ~/.claude/settings.json`;
|
|
28099
28068
|
}
|
|
@@ -28118,8 +28087,8 @@ var init_install = __esm({
|
|
|
28118
28087
|
* @task T1013
|
|
28119
28088
|
*/
|
|
28120
28089
|
installHookTemplates() {
|
|
28121
|
-
const home =
|
|
28122
|
-
const hooksDir =
|
|
28090
|
+
const home = homedir6();
|
|
28091
|
+
const hooksDir = join7(home, ".claude", "hooks");
|
|
28123
28092
|
let templates;
|
|
28124
28093
|
try {
|
|
28125
28094
|
templates = installProviderHookTemplates({
|
|
@@ -28130,7 +28099,7 @@ var init_install = __esm({
|
|
|
28130
28099
|
return null;
|
|
28131
28100
|
}
|
|
28132
28101
|
const settingsEntryAdded = this.registerPreCompactHook(
|
|
28133
|
-
|
|
28102
|
+
join7(hooksDir, "precompact-safestop.sh")
|
|
28134
28103
|
);
|
|
28135
28104
|
if (templates.installedFiles.length === 0 && !settingsEntryAdded) {
|
|
28136
28105
|
return null;
|
|
@@ -28152,8 +28121,8 @@ var init_install = __esm({
|
|
|
28152
28121
|
* @task T1013
|
|
28153
28122
|
*/
|
|
28154
28123
|
registerPreCompactHook(shimPath) {
|
|
28155
|
-
const home =
|
|
28156
|
-
const settingsPath =
|
|
28124
|
+
const home = homedir6();
|
|
28125
|
+
const settingsPath = join7(home, ".claude", "settings.json");
|
|
28157
28126
|
let settings = {};
|
|
28158
28127
|
if (existsSync6(settingsPath)) {
|
|
28159
28128
|
try {
|
|
@@ -28183,7 +28152,7 @@ var init_install = __esm({
|
|
|
28183
28152
|
});
|
|
28184
28153
|
hooks.PreCompact = preCompactEntries;
|
|
28185
28154
|
settings.hooks = hooks;
|
|
28186
|
-
mkdirSync3(
|
|
28155
|
+
mkdirSync3(join7(home, ".claude"), { recursive: true });
|
|
28187
28156
|
writeFileSync3(settingsPath, JSON.stringify(settings, null, 2) + "\n", "utf-8");
|
|
28188
28157
|
return true;
|
|
28189
28158
|
}
|
|
@@ -28357,7 +28326,7 @@ var init_spawn2 = __esm({
|
|
|
28357
28326
|
|
|
28358
28327
|
// packages/adapters/src/providers/claude-code/task-sync.ts
|
|
28359
28328
|
import { readFile as readFile2, stat } from "node:fs/promises";
|
|
28360
|
-
import { join as
|
|
28329
|
+
import { join as join8 } from "node:path";
|
|
28361
28330
|
function parseTaskId(content) {
|
|
28362
28331
|
const match = content.match(/^\[T(\d+)\]/);
|
|
28363
28332
|
return match ? `T${match[1]}` : null;
|
|
@@ -28378,7 +28347,7 @@ function mapStatus(twStatus) {
|
|
|
28378
28347
|
}
|
|
28379
28348
|
}
|
|
28380
28349
|
function getTodoWriteFilePath(projectDir) {
|
|
28381
|
-
return
|
|
28350
|
+
return join8(projectDir, ".cleo", "sync", "todowrite-state.json");
|
|
28382
28351
|
}
|
|
28383
28352
|
var ClaudeCodeTaskSyncProvider;
|
|
28384
28353
|
var init_task_sync = __esm({
|
|
@@ -28451,8 +28420,8 @@ var init_transport = __esm({
|
|
|
28451
28420
|
// packages/adapters/src/providers/claude-code/adapter.ts
|
|
28452
28421
|
import { exec as exec2 } from "node:child_process";
|
|
28453
28422
|
import { existsSync as existsSync7 } from "node:fs";
|
|
28454
|
-
import { homedir as
|
|
28455
|
-
import { join as
|
|
28423
|
+
import { homedir as homedir7 } from "node:os";
|
|
28424
|
+
import { join as join9 } from "node:path";
|
|
28456
28425
|
import { promisify as promisify3 } from "node:util";
|
|
28457
28426
|
var execAsync2, ClaudeCodeAdapter;
|
|
28458
28427
|
var init_adapter = __esm({
|
|
@@ -28609,7 +28578,7 @@ var init_adapter = __esm({
|
|
|
28609
28578
|
} catch {
|
|
28610
28579
|
details.cliAvailable = false;
|
|
28611
28580
|
}
|
|
28612
|
-
const claudeConfigDir =
|
|
28581
|
+
const claudeConfigDir = join9(homedir7(), ".claude");
|
|
28613
28582
|
const configExists = existsSync7(claudeConfigDir);
|
|
28614
28583
|
details.configDirExists = configExists;
|
|
28615
28584
|
const entrypointSet = process.env.CLAUDE_CODE_ENTRYPOINT !== void 0;
|
|
@@ -28640,10 +28609,10 @@ var init_adapter = __esm({
|
|
|
28640
28609
|
|
|
28641
28610
|
// packages/adapters/src/providers/claude-code/statusline.ts
|
|
28642
28611
|
import { existsSync as existsSync8, readFileSync as readFileSync6 } from "node:fs";
|
|
28643
|
-
import { homedir as
|
|
28644
|
-
import { join as
|
|
28612
|
+
import { homedir as homedir8 } from "node:os";
|
|
28613
|
+
import { join as join10 } from "node:path";
|
|
28645
28614
|
function getClaudeSettingsPath() {
|
|
28646
|
-
return process.env["CLAUDE_SETTINGS"] ??
|
|
28615
|
+
return process.env["CLAUDE_SETTINGS"] ?? join10(process.env["CLAUDE_HOME"] ?? join10(homedir8(), ".claude"), "settings.json");
|
|
28647
28616
|
}
|
|
28648
28617
|
function checkStatuslineIntegration() {
|
|
28649
28618
|
const settingsPath = getClaudeSettingsPath();
|
|
@@ -28657,7 +28626,7 @@ function checkStatuslineIntegration() {
|
|
|
28657
28626
|
if (cmd.includes("context-monitor.sh") || cmd.includes("cleo-statusline") || cmd.includes(".context-state.json") || cmd.includes("context-states")) {
|
|
28658
28627
|
return "configured";
|
|
28659
28628
|
}
|
|
28660
|
-
const scriptPath = cmd.startsWith("~") ? cmd.replace("~",
|
|
28629
|
+
const scriptPath = cmd.startsWith("~") ? cmd.replace("~", homedir8()) : cmd;
|
|
28661
28630
|
if (existsSync8(scriptPath)) {
|
|
28662
28631
|
try {
|
|
28663
28632
|
const content = readFileSync6(scriptPath, "utf-8");
|
|
@@ -28674,7 +28643,7 @@ function getStatuslineConfig(cleoHome) {
|
|
|
28674
28643
|
return {
|
|
28675
28644
|
statusLine: {
|
|
28676
28645
|
type: "command",
|
|
28677
|
-
command:
|
|
28646
|
+
command: join10(cleoHome, "lib", "session", "context-monitor.sh")
|
|
28678
28647
|
}
|
|
28679
28648
|
};
|
|
28680
28649
|
}
|
|
@@ -28886,7 +28855,7 @@ var init_hooks2 = __esm({
|
|
|
28886
28855
|
|
|
28887
28856
|
// packages/adapters/src/providers/cursor/install.ts
|
|
28888
28857
|
import { existsSync as existsSync12, mkdirSync as mkdirSync4, readFileSync as readFileSync8, writeFileSync as writeFileSync5 } from "node:fs";
|
|
28889
|
-
import { join as
|
|
28858
|
+
import { join as join16 } from "node:path";
|
|
28890
28859
|
var INSTRUCTION_REFERENCES3, CursorInstallProvider;
|
|
28891
28860
|
var init_install2 = __esm({
|
|
28892
28861
|
"packages/adapters/src/providers/cursor/install.ts"() {
|
|
@@ -28937,11 +28906,11 @@ var init_install2 = __esm({
|
|
|
28937
28906
|
* Checks for .cursor/rules/cleo.mdc or .cursorrules with CLEO references.
|
|
28938
28907
|
*/
|
|
28939
28908
|
async isInstalled() {
|
|
28940
|
-
const mdcPath =
|
|
28909
|
+
const mdcPath = join16(process.cwd(), ".cursor", "rules", "cleo.mdc");
|
|
28941
28910
|
if (existsSync12(mdcPath)) {
|
|
28942
28911
|
return true;
|
|
28943
28912
|
}
|
|
28944
|
-
const rulesPath =
|
|
28913
|
+
const rulesPath = join16(process.cwd(), ".cursorrules");
|
|
28945
28914
|
if (existsSync12(rulesPath)) {
|
|
28946
28915
|
try {
|
|
28947
28916
|
const content = readFileSync8(rulesPath, "utf-8");
|
|
@@ -28987,7 +28956,7 @@ var init_install2 = __esm({
|
|
|
28987
28956
|
* @returns true if the file was modified
|
|
28988
28957
|
*/
|
|
28989
28958
|
updateLegacyRules(projectDir) {
|
|
28990
|
-
const rulesPath =
|
|
28959
|
+
const rulesPath = join16(projectDir, ".cursorrules");
|
|
28991
28960
|
if (!existsSync12(rulesPath)) {
|
|
28992
28961
|
return false;
|
|
28993
28962
|
}
|
|
@@ -29010,8 +28979,8 @@ var init_install2 = __esm({
|
|
|
29010
28979
|
* @returns true if the file was created or modified
|
|
29011
28980
|
*/
|
|
29012
28981
|
updateModernRules(projectDir) {
|
|
29013
|
-
const rulesDir =
|
|
29014
|
-
const mdcPath =
|
|
28982
|
+
const rulesDir = join16(projectDir, ".cursor", "rules");
|
|
28983
|
+
const mdcPath = join16(rulesDir, "cleo.mdc");
|
|
29015
28984
|
const expectedContent = [
|
|
29016
28985
|
"---",
|
|
29017
28986
|
"description: CLEO task management protocol references",
|
|
@@ -29037,10 +29006,10 @@ var init_install2 = __esm({
|
|
|
29037
29006
|
*/
|
|
29038
29007
|
getUpdatedFileList(projectDir) {
|
|
29039
29008
|
const files = [];
|
|
29040
|
-
if (existsSync12(
|
|
29041
|
-
files.push(
|
|
29009
|
+
if (existsSync12(join16(projectDir, ".cursorrules"))) {
|
|
29010
|
+
files.push(join16(projectDir, ".cursorrules"));
|
|
29042
29011
|
}
|
|
29043
|
-
files.push(
|
|
29012
|
+
files.push(join16(projectDir, ".cursor", "rules", "cleo.mdc"));
|
|
29044
29013
|
return files;
|
|
29045
29014
|
}
|
|
29046
29015
|
/**
|
|
@@ -29062,7 +29031,7 @@ var init_install2 = __esm({
|
|
|
29062
29031
|
* @task T1013
|
|
29063
29032
|
*/
|
|
29064
29033
|
installHookTemplates(projectDir) {
|
|
29065
|
-
const hooksDir =
|
|
29034
|
+
const hooksDir = join16(projectDir, ".cursor", "hooks");
|
|
29066
29035
|
let templates;
|
|
29067
29036
|
try {
|
|
29068
29037
|
templates = installProviderHookTemplates({
|
|
@@ -29074,7 +29043,7 @@ var init_install2 = __esm({
|
|
|
29074
29043
|
}
|
|
29075
29044
|
const hooksJsonEntryAdded = this.registerPreCompactHook(
|
|
29076
29045
|
projectDir,
|
|
29077
|
-
|
|
29046
|
+
join16(hooksDir, "precompact.sh")
|
|
29078
29047
|
);
|
|
29079
29048
|
if (templates.installedFiles.length === 0 && !hooksJsonEntryAdded) {
|
|
29080
29049
|
return null;
|
|
@@ -29095,7 +29064,7 @@ var init_install2 = __esm({
|
|
|
29095
29064
|
* @task T1013
|
|
29096
29065
|
*/
|
|
29097
29066
|
registerPreCompactHook(projectDir, shimPath) {
|
|
29098
|
-
const hooksJsonPath =
|
|
29067
|
+
const hooksJsonPath = join16(projectDir, ".cursor", "hooks.json");
|
|
29099
29068
|
let config2 = {};
|
|
29100
29069
|
if (existsSync12(hooksJsonPath)) {
|
|
29101
29070
|
try {
|
|
@@ -29118,7 +29087,7 @@ var init_install2 = __esm({
|
|
|
29118
29087
|
});
|
|
29119
29088
|
hooks.preCompact = entries;
|
|
29120
29089
|
config2.hooks = hooks;
|
|
29121
|
-
mkdirSync4(
|
|
29090
|
+
mkdirSync4(join16(projectDir, ".cursor"), { recursive: true });
|
|
29122
29091
|
writeFileSync5(hooksJsonPath, JSON.stringify(config2, null, 2) + "\n", "utf-8");
|
|
29123
29092
|
return true;
|
|
29124
29093
|
}
|
|
@@ -29128,7 +29097,7 @@ var init_install2 = __esm({
|
|
|
29128
29097
|
|
|
29129
29098
|
// packages/adapters/src/providers/cursor/adapter.ts
|
|
29130
29099
|
import { existsSync as existsSync13 } from "node:fs";
|
|
29131
|
-
import { join as
|
|
29100
|
+
import { join as join17 } from "node:path";
|
|
29132
29101
|
var CursorAdapter;
|
|
29133
29102
|
var init_adapter2 = __esm({
|
|
29134
29103
|
"packages/adapters/src/providers/cursor/adapter.ts"() {
|
|
@@ -29222,14 +29191,14 @@ var init_adapter2 = __esm({
|
|
|
29222
29191
|
}
|
|
29223
29192
|
let configExists = false;
|
|
29224
29193
|
if (this.projectDir) {
|
|
29225
|
-
const cursorConfigDir =
|
|
29194
|
+
const cursorConfigDir = join17(this.projectDir, ".cursor");
|
|
29226
29195
|
configExists = existsSync13(cursorConfigDir);
|
|
29227
29196
|
details.configDirExists = configExists;
|
|
29228
29197
|
}
|
|
29229
29198
|
const editorEnvSet = process.env.CURSOR_EDITOR !== void 0;
|
|
29230
29199
|
details.editorEnvSet = editorEnvSet;
|
|
29231
29200
|
if (this.projectDir) {
|
|
29232
|
-
const legacyRulesExist = existsSync13(
|
|
29201
|
+
const legacyRulesExist = existsSync13(join17(this.projectDir, ".cursorrules"));
|
|
29233
29202
|
details.legacyRulesExist = legacyRulesExist;
|
|
29234
29203
|
}
|
|
29235
29204
|
const healthy = configExists || editorEnvSet;
|
|
@@ -29434,7 +29403,7 @@ var init_hooks3 = __esm({
|
|
|
29434
29403
|
|
|
29435
29404
|
// packages/adapters/src/providers/opencode/install.ts
|
|
29436
29405
|
import { existsSync as existsSync18, mkdirSync as mkdirSync5, readFileSync as readFileSync11, writeFileSync as writeFileSync8 } from "node:fs";
|
|
29437
|
-
import { join as
|
|
29406
|
+
import { join as join23 } from "node:path";
|
|
29438
29407
|
var INSTRUCTION_REFERENCES6, OpenCodeInstallProvider;
|
|
29439
29408
|
var init_install3 = __esm({
|
|
29440
29409
|
"packages/adapters/src/providers/opencode/install.ts"() {
|
|
@@ -29459,7 +29428,7 @@ var init_install3 = __esm({
|
|
|
29459
29428
|
const details = {};
|
|
29460
29429
|
instructionFileUpdated = this.updateInstructionFile(projectDir);
|
|
29461
29430
|
if (instructionFileUpdated) {
|
|
29462
|
-
details.instructionFile =
|
|
29431
|
+
details.instructionFile = join23(projectDir, "AGENTS.md");
|
|
29463
29432
|
}
|
|
29464
29433
|
const hookResult = this.installHookTemplates(projectDir);
|
|
29465
29434
|
if (hookResult) {
|
|
@@ -29485,7 +29454,7 @@ var init_install3 = __esm({
|
|
|
29485
29454
|
* Checks for CLEO references in AGENTS.md.
|
|
29486
29455
|
*/
|
|
29487
29456
|
async isInstalled() {
|
|
29488
|
-
const agentsMdPath =
|
|
29457
|
+
const agentsMdPath = join23(process.cwd(), "AGENTS.md");
|
|
29489
29458
|
if (existsSync18(agentsMdPath)) {
|
|
29490
29459
|
try {
|
|
29491
29460
|
const content = readFileSync11(agentsMdPath, "utf-8");
|
|
@@ -29513,7 +29482,7 @@ var init_install3 = __esm({
|
|
|
29513
29482
|
* @returns true if the file was created or modified
|
|
29514
29483
|
*/
|
|
29515
29484
|
updateInstructionFile(projectDir) {
|
|
29516
|
-
const agentsMdPath =
|
|
29485
|
+
const agentsMdPath = join23(projectDir, "AGENTS.md");
|
|
29517
29486
|
let content = "";
|
|
29518
29487
|
let existed = false;
|
|
29519
29488
|
if (existsSync18(agentsMdPath)) {
|
|
@@ -29555,8 +29524,8 @@ var init_install3 = __esm({
|
|
|
29555
29524
|
* @task T1013
|
|
29556
29525
|
*/
|
|
29557
29526
|
installHookTemplates(projectDir) {
|
|
29558
|
-
const pluginsDir =
|
|
29559
|
-
const hooksDir =
|
|
29527
|
+
const pluginsDir = join23(projectDir, ".opencode", "plugins");
|
|
29528
|
+
const hooksDir = join23(pluginsDir, "hooks");
|
|
29560
29529
|
let templates;
|
|
29561
29530
|
try {
|
|
29562
29531
|
templates = installProviderHookTemplates({
|
|
@@ -29568,7 +29537,7 @@ var init_install3 = __esm({
|
|
|
29568
29537
|
}
|
|
29569
29538
|
let pluginWritten = false;
|
|
29570
29539
|
try {
|
|
29571
|
-
pluginWritten = this.writePrecompactPlugin(pluginsDir,
|
|
29540
|
+
pluginWritten = this.writePrecompactPlugin(pluginsDir, join23(hooksDir, "precompact.sh"));
|
|
29572
29541
|
} catch {
|
|
29573
29542
|
}
|
|
29574
29543
|
if (templates.installedFiles.length === 0 && !pluginWritten) {
|
|
@@ -29592,7 +29561,7 @@ var init_install3 = __esm({
|
|
|
29592
29561
|
* @task T1013
|
|
29593
29562
|
*/
|
|
29594
29563
|
writePrecompactPlugin(pluginsDir, shimPath) {
|
|
29595
|
-
const pluginPath =
|
|
29564
|
+
const pluginPath = join23(pluginsDir, "cleo-precompact.js");
|
|
29596
29565
|
const generated = [
|
|
29597
29566
|
"// CLEO PreCompact plugin for OpenCode (generated by @cleocode/adapters).",
|
|
29598
29567
|
"// Bridges the canonical CAAMP `PreCompact` event",
|
|
@@ -29637,7 +29606,7 @@ var init_install3 = __esm({
|
|
|
29637
29606
|
// packages/adapters/src/providers/opencode/spawn.ts
|
|
29638
29607
|
import { exec as exec9, spawn as nodeSpawn4 } from "node:child_process";
|
|
29639
29608
|
import { mkdir as mkdir2, readFile as readFile4, writeFile as writeFile2 } from "node:fs/promises";
|
|
29640
|
-
import { join as
|
|
29609
|
+
import { join as join24 } from "node:path";
|
|
29641
29610
|
import { promisify as promisify10 } from "node:util";
|
|
29642
29611
|
function buildOpenCodeAgentMarkdown(description, instructions) {
|
|
29643
29612
|
const normalizedDesc = description.replace(/\s+/g, " ").trim();
|
|
@@ -29653,8 +29622,8 @@ function buildOpenCodeAgentMarkdown(description, instructions) {
|
|
|
29653
29622
|
].join("\n");
|
|
29654
29623
|
}
|
|
29655
29624
|
async function ensureSubagentDefinition(workingDirectory, enrichedInstructions) {
|
|
29656
|
-
const agentDir =
|
|
29657
|
-
const agentPath =
|
|
29625
|
+
const agentDir = join24(workingDirectory, ".opencode", "agent");
|
|
29626
|
+
const agentPath = join24(agentDir, `${OPENCODE_SUBAGENT_NAME}.md`);
|
|
29658
29627
|
const description = "CLEO task executor with protocol compliance and CANT context.";
|
|
29659
29628
|
const instructions = enrichedInstructions ?? [
|
|
29660
29629
|
"# CLEO Subagent",
|
|
@@ -29829,7 +29798,7 @@ var init_spawn3 = __esm({
|
|
|
29829
29798
|
// packages/adapters/src/providers/opencode/adapter.ts
|
|
29830
29799
|
import { exec as exec10 } from "node:child_process";
|
|
29831
29800
|
import { existsSync as existsSync19 } from "node:fs";
|
|
29832
|
-
import { join as
|
|
29801
|
+
import { join as join25 } from "node:path";
|
|
29833
29802
|
import { promisify as promisify11 } from "node:util";
|
|
29834
29803
|
var execAsync10, OpenCodeAdapter;
|
|
29835
29804
|
var init_adapter3 = __esm({
|
|
@@ -29941,7 +29910,7 @@ var init_adapter3 = __esm({
|
|
|
29941
29910
|
details.cliAvailable = false;
|
|
29942
29911
|
}
|
|
29943
29912
|
if (this.projectDir) {
|
|
29944
|
-
const openCodeConfigDir =
|
|
29913
|
+
const openCodeConfigDir = join25(this.projectDir, ".opencode");
|
|
29945
29914
|
const configExists = existsSync19(openCodeConfigDir);
|
|
29946
29915
|
details.configDirExists = configExists;
|
|
29947
29916
|
}
|
|
@@ -30152,20 +30121,20 @@ var init_hooks4 = __esm({
|
|
|
30152
30121
|
|
|
30153
30122
|
// packages/adapters/src/providers/pi/install.ts
|
|
30154
30123
|
import { existsSync as existsSync20, mkdirSync as mkdirSync6, readFileSync as readFileSync12, writeFileSync as writeFileSync9 } from "node:fs";
|
|
30155
|
-
import { homedir as
|
|
30156
|
-
import { join as
|
|
30124
|
+
import { homedir as homedir14 } from "node:os";
|
|
30125
|
+
import { join as join26 } from "node:path";
|
|
30157
30126
|
function getPiAgentDir() {
|
|
30158
30127
|
const env = process.env["PI_CODING_AGENT_DIR"];
|
|
30159
30128
|
if (env !== void 0 && env.length > 0) {
|
|
30160
|
-
if (env === "~") return
|
|
30161
|
-
if (env.startsWith("~/")) return
|
|
30129
|
+
if (env === "~") return homedir14();
|
|
30130
|
+
if (env.startsWith("~/")) return join26(homedir14(), env.slice(2));
|
|
30162
30131
|
return env;
|
|
30163
30132
|
}
|
|
30164
30133
|
const piHome = process.env["PI_HOME"];
|
|
30165
30134
|
if (piHome !== void 0 && piHome.length > 0) {
|
|
30166
|
-
return
|
|
30135
|
+
return join26(piHome, "agent");
|
|
30167
30136
|
}
|
|
30168
|
-
return
|
|
30137
|
+
return join26(homedir14(), ".pi", "agent");
|
|
30169
30138
|
}
|
|
30170
30139
|
var INSTRUCTION_REFERENCES7, PiInstallProvider;
|
|
30171
30140
|
var init_install4 = __esm({
|
|
@@ -30189,14 +30158,14 @@ var init_install4 = __esm({
|
|
|
30189
30158
|
const details = {};
|
|
30190
30159
|
const projectUpdated = this.updateInstructionFile(projectDir, "AGENTS.md");
|
|
30191
30160
|
if (projectUpdated) {
|
|
30192
|
-
details.instructionFile =
|
|
30161
|
+
details.instructionFile = join26(projectDir, "AGENTS.md");
|
|
30193
30162
|
}
|
|
30194
30163
|
let globalUpdated = false;
|
|
30195
30164
|
try {
|
|
30196
30165
|
const globalDir = getPiAgentDir();
|
|
30197
30166
|
globalUpdated = this.updateInstructionFile(globalDir, "AGENTS.md");
|
|
30198
30167
|
if (globalUpdated) {
|
|
30199
|
-
details.globalInstructionFile =
|
|
30168
|
+
details.globalInstructionFile = join26(globalDir, "AGENTS.md");
|
|
30200
30169
|
}
|
|
30201
30170
|
} catch {
|
|
30202
30171
|
}
|
|
@@ -30221,7 +30190,7 @@ var init_install4 = __esm({
|
|
|
30221
30190
|
* Checks for CLEO references in the project AGENTS.md.
|
|
30222
30191
|
*/
|
|
30223
30192
|
async isInstalled() {
|
|
30224
|
-
const agentsMdPath =
|
|
30193
|
+
const agentsMdPath = join26(process.cwd(), "AGENTS.md");
|
|
30225
30194
|
if (existsSync20(agentsMdPath)) {
|
|
30226
30195
|
try {
|
|
30227
30196
|
const content = readFileSync12(agentsMdPath, "utf-8");
|
|
@@ -30232,7 +30201,7 @@ var init_install4 = __esm({
|
|
|
30232
30201
|
}
|
|
30233
30202
|
}
|
|
30234
30203
|
try {
|
|
30235
|
-
const globalPath =
|
|
30204
|
+
const globalPath = join26(getPiAgentDir(), "AGENTS.md");
|
|
30236
30205
|
if (existsSync20(globalPath)) {
|
|
30237
30206
|
const content = readFileSync12(globalPath, "utf-8");
|
|
30238
30207
|
if (INSTRUCTION_REFERENCES7.some((ref) => content.includes(ref))) {
|
|
@@ -30261,7 +30230,7 @@ var init_install4 = __esm({
|
|
|
30261
30230
|
* @returns true if the file was created or modified
|
|
30262
30231
|
*/
|
|
30263
30232
|
updateInstructionFile(dir, filename) {
|
|
30264
|
-
const filePath =
|
|
30233
|
+
const filePath = join26(dir, filename);
|
|
30265
30234
|
let content = "";
|
|
30266
30235
|
let existed = false;
|
|
30267
30236
|
if (existsSync20(filePath)) {
|
|
@@ -30441,21 +30410,21 @@ var init_spawn4 = __esm({
|
|
|
30441
30410
|
// packages/adapters/src/providers/pi/adapter.ts
|
|
30442
30411
|
import { exec as exec12 } from "node:child_process";
|
|
30443
30412
|
import { existsSync as existsSync21 } from "node:fs";
|
|
30444
|
-
import { homedir as
|
|
30445
|
-
import { join as
|
|
30413
|
+
import { homedir as homedir15 } from "node:os";
|
|
30414
|
+
import { join as join27 } from "node:path";
|
|
30446
30415
|
import { promisify as promisify13 } from "node:util";
|
|
30447
30416
|
function getPiAgentDir2() {
|
|
30448
30417
|
const env = process.env["PI_CODING_AGENT_DIR"];
|
|
30449
30418
|
if (env !== void 0 && env.length > 0) {
|
|
30450
|
-
if (env === "~") return
|
|
30451
|
-
if (env.startsWith("~/")) return
|
|
30419
|
+
if (env === "~") return homedir15();
|
|
30420
|
+
if (env.startsWith("~/")) return join27(homedir15(), env.slice(2));
|
|
30452
30421
|
return env;
|
|
30453
30422
|
}
|
|
30454
30423
|
const piHome = process.env["PI_HOME"];
|
|
30455
30424
|
if (piHome !== void 0 && piHome.length > 0) {
|
|
30456
|
-
return
|
|
30425
|
+
return join27(piHome, "agent");
|
|
30457
30426
|
}
|
|
30458
|
-
return
|
|
30427
|
+
return join27(homedir15(), ".pi", "agent");
|
|
30459
30428
|
}
|
|
30460
30429
|
var execAsync12, PiAdapter;
|
|
30461
30430
|
var init_adapter4 = __esm({
|
|
@@ -30577,7 +30546,7 @@ var init_adapter4 = __esm({
|
|
|
30577
30546
|
details.agentDirExists = agentDirExists;
|
|
30578
30547
|
details.agentDir = agentDir;
|
|
30579
30548
|
if (this.projectDir) {
|
|
30580
|
-
const projectPiDir =
|
|
30549
|
+
const projectPiDir = join27(this.projectDir, ".pi");
|
|
30581
30550
|
details.projectPiDirExists = existsSync21(projectPiDir);
|
|
30582
30551
|
}
|
|
30583
30552
|
details.piCodingAgentDirSet = process.env["PI_CODING_AGENT_DIR"] !== void 0;
|
|
@@ -30752,14 +30721,14 @@ var ClaudeSDKAdapter = class {
|
|
|
30752
30721
|
|
|
30753
30722
|
// packages/adapters/src/providers/claude-sdk/mcp-registry.ts
|
|
30754
30723
|
import { existsSync as existsSync9 } from "node:fs";
|
|
30755
|
-
import { join as
|
|
30724
|
+
import { join as join11 } from "node:path";
|
|
30756
30725
|
var CLEO_MCP_CANDIDATES = [
|
|
30757
30726
|
{ name: "brain", binary: "cleo-mcp-brain" },
|
|
30758
30727
|
{ name: "nexus", binary: "cleo-mcp-nexus" },
|
|
30759
30728
|
{ name: "tasks", binary: "cleo-mcp-tasks" }
|
|
30760
30729
|
];
|
|
30761
30730
|
function findInNodeModules(binary, workingDir) {
|
|
30762
|
-
const binPath =
|
|
30731
|
+
const binPath = join11(workingDir, "node_modules", ".bin", binary);
|
|
30763
30732
|
if (existsSync9(binPath)) {
|
|
30764
30733
|
return binPath;
|
|
30765
30734
|
}
|
|
@@ -30791,17 +30760,17 @@ function createAdapter2() {
|
|
|
30791
30760
|
// packages/adapters/src/providers/codex/adapter.ts
|
|
30792
30761
|
import { exec as exec3 } from "node:child_process";
|
|
30793
30762
|
import { existsSync as existsSync11 } from "node:fs";
|
|
30794
|
-
import { homedir as
|
|
30795
|
-
import { join as
|
|
30763
|
+
import { homedir as homedir10 } from "node:os";
|
|
30764
|
+
import { join as join15 } from "node:path";
|
|
30796
30765
|
import { promisify as promisify4 } from "node:util";
|
|
30797
30766
|
|
|
30798
30767
|
// packages/adapters/src/providers/codex/hooks.ts
|
|
30799
|
-
import { homedir as
|
|
30800
|
-
import { join as
|
|
30768
|
+
import { homedir as homedir9 } from "node:os";
|
|
30769
|
+
import { join as join13 } from "node:path";
|
|
30801
30770
|
|
|
30802
30771
|
// packages/adapters/src/providers/shared/transcript-reader.ts
|
|
30803
30772
|
import { readdir as readdir2, readFile as readFile3 } from "node:fs/promises";
|
|
30804
|
-
import { join as
|
|
30773
|
+
import { join as join12 } from "node:path";
|
|
30805
30774
|
function parseTranscriptLines(raw) {
|
|
30806
30775
|
const turns = [];
|
|
30807
30776
|
const lines = raw.split("\n").filter((l) => l.trim());
|
|
@@ -30826,7 +30795,7 @@ async function readLatestTranscript(providerDir) {
|
|
|
30826
30795
|
if (!entry.isFile()) continue;
|
|
30827
30796
|
const name15 = entry.name;
|
|
30828
30797
|
if (name15.endsWith(".json") || name15.endsWith(".jsonl")) {
|
|
30829
|
-
allFiles.push(
|
|
30798
|
+
allFiles.push(join12(providerDir, name15));
|
|
30830
30799
|
}
|
|
30831
30800
|
}
|
|
30832
30801
|
} catch {
|
|
@@ -30916,14 +30885,14 @@ var CodexHookProvider = class {
|
|
|
30916
30885
|
* @task T162 @epic T134
|
|
30917
30886
|
*/
|
|
30918
30887
|
async getTranscript(_sessionId, _projectDir) {
|
|
30919
|
-
return readLatestTranscript(
|
|
30888
|
+
return readLatestTranscript(join13(homedir9(), ".codex"));
|
|
30920
30889
|
}
|
|
30921
30890
|
};
|
|
30922
30891
|
|
|
30923
30892
|
// packages/adapters/src/providers/codex/install.ts
|
|
30924
30893
|
init_paths2();
|
|
30925
30894
|
import { existsSync as existsSync10, readFileSync as readFileSync7, writeFileSync as writeFileSync4 } from "node:fs";
|
|
30926
|
-
import { join as
|
|
30895
|
+
import { join as join14 } from "node:path";
|
|
30927
30896
|
var INSTRUCTION_REFERENCES2 = [
|
|
30928
30897
|
`@${getCleoTemplatesTildePath()}/CLEO-INJECTION.md`,
|
|
30929
30898
|
"@.cleo/memory-bridge.md"
|
|
@@ -30943,7 +30912,7 @@ var CodexInstallProvider = class {
|
|
|
30943
30912
|
const details = {};
|
|
30944
30913
|
instructionFileUpdated = this.updateInstructionFile(projectDir);
|
|
30945
30914
|
if (instructionFileUpdated) {
|
|
30946
|
-
details.instructionFile =
|
|
30915
|
+
details.instructionFile = join14(projectDir, "AGENTS.md");
|
|
30947
30916
|
}
|
|
30948
30917
|
return {
|
|
30949
30918
|
success: true,
|
|
@@ -30967,7 +30936,7 @@ var CodexInstallProvider = class {
|
|
|
30967
30936
|
* @task T162
|
|
30968
30937
|
*/
|
|
30969
30938
|
async isInstalled() {
|
|
30970
|
-
const agentsMdPath =
|
|
30939
|
+
const agentsMdPath = join14(process.cwd(), "AGENTS.md");
|
|
30971
30940
|
if (existsSync10(agentsMdPath)) {
|
|
30972
30941
|
try {
|
|
30973
30942
|
const content = readFileSync7(agentsMdPath, "utf-8");
|
|
@@ -30997,7 +30966,7 @@ var CodexInstallProvider = class {
|
|
|
30997
30966
|
* @returns true if the file was created or modified
|
|
30998
30967
|
*/
|
|
30999
30968
|
updateInstructionFile(projectDir) {
|
|
31000
|
-
const agentsMdPath =
|
|
30969
|
+
const agentsMdPath = join14(projectDir, "AGENTS.md");
|
|
31001
30970
|
let content = "";
|
|
31002
30971
|
let existed = false;
|
|
31003
30972
|
if (existsSync10(agentsMdPath)) {
|
|
@@ -31105,7 +31074,7 @@ var CodexAdapter = class {
|
|
|
31105
31074
|
} catch {
|
|
31106
31075
|
details.cliAvailable = false;
|
|
31107
31076
|
}
|
|
31108
|
-
const codexConfigDir =
|
|
31077
|
+
const codexConfigDir = join15(homedir10(), ".codex");
|
|
31109
31078
|
const configExists = existsSync11(codexConfigDir);
|
|
31110
31079
|
details.configDirExists = configExists;
|
|
31111
31080
|
const healthy = cliAvailable;
|
|
@@ -31149,13 +31118,13 @@ init_cursor();
|
|
|
31149
31118
|
// packages/adapters/src/providers/gemini-cli/adapter.ts
|
|
31150
31119
|
import { exec as exec5 } from "node:child_process";
|
|
31151
31120
|
import { existsSync as existsSync15 } from "node:fs";
|
|
31152
|
-
import { homedir as
|
|
31153
|
-
import { join as
|
|
31121
|
+
import { homedir as homedir12 } from "node:os";
|
|
31122
|
+
import { join as join20 } from "node:path";
|
|
31154
31123
|
import { promisify as promisify6 } from "node:util";
|
|
31155
31124
|
|
|
31156
31125
|
// packages/adapters/src/providers/gemini-cli/hooks.ts
|
|
31157
|
-
import { homedir as
|
|
31158
|
-
import { join as
|
|
31126
|
+
import { homedir as homedir11 } from "node:os";
|
|
31127
|
+
import { join as join18 } from "node:path";
|
|
31159
31128
|
var GEMINI_CLI_EVENT_MAP = {
|
|
31160
31129
|
SessionStart: "SessionStart",
|
|
31161
31130
|
SessionEnd: "SessionEnd",
|
|
@@ -31233,13 +31202,13 @@ var GeminiCliHookProvider = class {
|
|
|
31233
31202
|
* @task T161 @epic T134
|
|
31234
31203
|
*/
|
|
31235
31204
|
async getTranscript(_sessionId, _projectDir) {
|
|
31236
|
-
return readLatestTranscript(
|
|
31205
|
+
return readLatestTranscript(join18(homedir11(), ".gemini"));
|
|
31237
31206
|
}
|
|
31238
31207
|
};
|
|
31239
31208
|
|
|
31240
31209
|
// packages/adapters/src/providers/gemini-cli/install.ts
|
|
31241
31210
|
import { existsSync as existsSync14, readFileSync as readFileSync9, writeFileSync as writeFileSync6 } from "node:fs";
|
|
31242
|
-
import { join as
|
|
31211
|
+
import { join as join19 } from "node:path";
|
|
31243
31212
|
var INSTRUCTION_REFERENCES4 = ["@~/.cleo/templates/CLEO-INJECTION.md", "@.cleo/memory-bridge.md"];
|
|
31244
31213
|
var GeminiCliInstallProvider = class {
|
|
31245
31214
|
/**
|
|
@@ -31256,7 +31225,7 @@ var GeminiCliInstallProvider = class {
|
|
|
31256
31225
|
const details = {};
|
|
31257
31226
|
instructionFileUpdated = this.updateInstructionFile(projectDir);
|
|
31258
31227
|
if (instructionFileUpdated) {
|
|
31259
|
-
details.instructionFile =
|
|
31228
|
+
details.instructionFile = join19(projectDir, "AGENTS.md");
|
|
31260
31229
|
}
|
|
31261
31230
|
return {
|
|
31262
31231
|
success: true,
|
|
@@ -31280,7 +31249,7 @@ var GeminiCliInstallProvider = class {
|
|
|
31280
31249
|
* @task T161
|
|
31281
31250
|
*/
|
|
31282
31251
|
async isInstalled() {
|
|
31283
|
-
const agentsMdPath =
|
|
31252
|
+
const agentsMdPath = join19(process.cwd(), "AGENTS.md");
|
|
31284
31253
|
if (existsSync14(agentsMdPath)) {
|
|
31285
31254
|
try {
|
|
31286
31255
|
const content = readFileSync9(agentsMdPath, "utf-8");
|
|
@@ -31310,7 +31279,7 @@ var GeminiCliInstallProvider = class {
|
|
|
31310
31279
|
* @returns true if the file was created or modified
|
|
31311
31280
|
*/
|
|
31312
31281
|
updateInstructionFile(projectDir) {
|
|
31313
|
-
const agentsMdPath =
|
|
31282
|
+
const agentsMdPath = join19(projectDir, "AGENTS.md");
|
|
31314
31283
|
let content = "";
|
|
31315
31284
|
let existed = false;
|
|
31316
31285
|
if (existsSync14(agentsMdPath)) {
|
|
@@ -31429,7 +31398,7 @@ var GeminiCliAdapter = class {
|
|
|
31429
31398
|
} catch {
|
|
31430
31399
|
details.cliAvailable = false;
|
|
31431
31400
|
}
|
|
31432
|
-
const geminiConfigDir =
|
|
31401
|
+
const geminiConfigDir = join20(homedir12(), ".gemini");
|
|
31433
31402
|
const configExists = existsSync15(geminiConfigDir);
|
|
31434
31403
|
details.configDirExists = configExists;
|
|
31435
31404
|
const healthy = cliAvailable;
|
|
@@ -31470,8 +31439,8 @@ function createAdapter5() {
|
|
|
31470
31439
|
// packages/adapters/src/providers/kimi/adapter.ts
|
|
31471
31440
|
import { exec as exec7 } from "node:child_process";
|
|
31472
31441
|
import { existsSync as existsSync17 } from "node:fs";
|
|
31473
|
-
import { homedir as
|
|
31474
|
-
import { join as
|
|
31442
|
+
import { homedir as homedir13 } from "node:os";
|
|
31443
|
+
import { join as join22 } from "node:path";
|
|
31475
31444
|
import { promisify as promisify8 } from "node:util";
|
|
31476
31445
|
|
|
31477
31446
|
// packages/adapters/src/providers/kimi/hooks.ts
|
|
@@ -31531,7 +31500,7 @@ var KimiHookProvider = class {
|
|
|
31531
31500
|
|
|
31532
31501
|
// packages/adapters/src/providers/kimi/install.ts
|
|
31533
31502
|
import { existsSync as existsSync16, readFileSync as readFileSync10, writeFileSync as writeFileSync7 } from "node:fs";
|
|
31534
|
-
import { join as
|
|
31503
|
+
import { join as join21 } from "node:path";
|
|
31535
31504
|
var INSTRUCTION_REFERENCES5 = ["@~/.cleo/templates/CLEO-INJECTION.md", "@.cleo/memory-bridge.md"];
|
|
31536
31505
|
var KimiInstallProvider = class {
|
|
31537
31506
|
/**
|
|
@@ -31548,7 +31517,7 @@ var KimiInstallProvider = class {
|
|
|
31548
31517
|
const details = {};
|
|
31549
31518
|
instructionFileUpdated = this.updateInstructionFile(projectDir);
|
|
31550
31519
|
if (instructionFileUpdated) {
|
|
31551
|
-
details.instructionFile =
|
|
31520
|
+
details.instructionFile = join21(projectDir, "AGENTS.md");
|
|
31552
31521
|
}
|
|
31553
31522
|
return {
|
|
31554
31523
|
success: true,
|
|
@@ -31572,7 +31541,7 @@ var KimiInstallProvider = class {
|
|
|
31572
31541
|
* @task T163
|
|
31573
31542
|
*/
|
|
31574
31543
|
async isInstalled() {
|
|
31575
|
-
const agentsMdPath =
|
|
31544
|
+
const agentsMdPath = join21(process.cwd(), "AGENTS.md");
|
|
31576
31545
|
if (existsSync16(agentsMdPath)) {
|
|
31577
31546
|
try {
|
|
31578
31547
|
const content = readFileSync10(agentsMdPath, "utf-8");
|
|
@@ -31602,7 +31571,7 @@ var KimiInstallProvider = class {
|
|
|
31602
31571
|
* @returns true if the file was created or modified
|
|
31603
31572
|
*/
|
|
31604
31573
|
updateInstructionFile(projectDir) {
|
|
31605
|
-
const agentsMdPath =
|
|
31574
|
+
const agentsMdPath = join21(projectDir, "AGENTS.md");
|
|
31606
31575
|
let content = "";
|
|
31607
31576
|
let existed = false;
|
|
31608
31577
|
if (existsSync16(agentsMdPath)) {
|
|
@@ -31708,7 +31677,7 @@ var KimiAdapter = class {
|
|
|
31708
31677
|
} catch {
|
|
31709
31678
|
details.cliAvailable = false;
|
|
31710
31679
|
}
|
|
31711
|
-
const kimiConfigDir =
|
|
31680
|
+
const kimiConfigDir = join22(homedir13(), ".kimi");
|
|
31712
31681
|
const configExists = existsSync17(kimiConfigDir);
|
|
31713
31682
|
details.configDirExists = configExists;
|
|
31714
31683
|
const healthy = cliAvailable;
|
|
@@ -31752,7 +31721,7 @@ init_hook_template_installer();
|
|
|
31752
31721
|
|
|
31753
31722
|
// packages/adapters/src/registry.ts
|
|
31754
31723
|
import { readFileSync as readFileSync13 } from "node:fs";
|
|
31755
|
-
import { dirname as dirname4, join as
|
|
31724
|
+
import { dirname as dirname4, join as join28, resolve as resolve2 } from "node:path";
|
|
31756
31725
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
31757
31726
|
var PROVIDER_IDS = ["claude-code", "opencode", "cursor", "pi"];
|
|
31758
31727
|
function getProviderManifests() {
|
|
@@ -31760,7 +31729,7 @@ function getProviderManifests() {
|
|
|
31760
31729
|
const baseDir = resolve2(dirname4(fileURLToPath3(import.meta.url)), "providers");
|
|
31761
31730
|
for (const providerId of PROVIDER_IDS) {
|
|
31762
31731
|
try {
|
|
31763
|
-
const manifestPath =
|
|
31732
|
+
const manifestPath = join28(baseDir, providerId, "manifest.json");
|
|
31764
31733
|
const raw = readFileSync13(manifestPath, "utf-8");
|
|
31765
31734
|
manifests.push(JSON.parse(raw));
|
|
31766
31735
|
} catch {
|