oh-my-opencode 5.0.0-beta.87 → 5.0.0-beta.88
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/cli/index.js +90 -73
- package/dist/cli-node/index.js +90 -73
- package/dist/index.js +368 -347
- package/dist/skills/browser/runtime/omowright/manifest.json +1 -1
- package/dist/skills/frontend/references/design/ambience-skill.md +2 -1
- package/dist/skills/frontend/references/design/design-system-architecture.md +30 -7
- package/dist/skills/frontend/references/design/interaction-skill.md +17 -5
- package/package.json +14 -14
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
- package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +5 -5
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-recording-spawn-admission.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/package-lock.json +12 -12
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/skills/browser/runtime/omowright/manifest.json +1 -1
- package/packages/omo-codex/plugin/skills/frontend/references/design/ambience-skill.md +2 -1
- package/packages/omo-codex/plugin/skills/frontend/references/design/design-system-architecture.md +30 -7
- package/packages/omo-codex/plugin/skills/frontend/references/design/interaction-skill.md +17 -5
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +2 -2
- package/packages/shared-skills/skills/browser/runtime/omowright/manifest.json +1 -1
- package/packages/shared-skills/skills/frontend/references/design/ambience-skill.md +2 -1
- package/packages/shared-skills/skills/frontend/references/design/design-system-architecture.md +30 -7
- package/packages/shared-skills/skills/frontend/references/design/interaction-skill.md +17 -5
package/dist/index.js
CHANGED
|
@@ -89866,7 +89866,7 @@ import { existsSync as existsSync36 } from "fs";
|
|
|
89866
89866
|
// packages/omo-opencode/src/hooks/comment-checker/cli.ts
|
|
89867
89867
|
init_bun_spawn_shim();
|
|
89868
89868
|
init_bun_which_shim();
|
|
89869
|
-
import { join as
|
|
89869
|
+
import { join as join45 } from "path";
|
|
89870
89870
|
import { existsSync as existsSync35 } from "fs";
|
|
89871
89871
|
import * as fs6 from "fs";
|
|
89872
89872
|
import { tmpdir as tmpdir4 } from "os";
|
|
@@ -90007,9 +90007,45 @@ function joinPatchLines(lines) {
|
|
|
90007
90007
|
`)}
|
|
90008
90008
|
`;
|
|
90009
90009
|
}
|
|
90010
|
+
// packages/comment-checker-core/src/release.ts
|
|
90011
|
+
import { join as join42 } from "path";
|
|
90012
|
+
var COMMENT_CHECKER_RELEASE_VERSION = "0.8.0";
|
|
90013
|
+
var COMMENT_CHECKER_RELEASE_REPO = "code-yeongyu/go-claude-code-comment-checker";
|
|
90014
|
+
var RELEASE_PLATFORMS = {
|
|
90015
|
+
"darwin-arm64": { os: "darwin", arch: "arm64", ext: "tar.gz" },
|
|
90016
|
+
"darwin-x64": { os: "darwin", arch: "amd64", ext: "tar.gz" },
|
|
90017
|
+
"linux-arm64": { os: "linux", arch: "arm64", ext: "tar.gz" },
|
|
90018
|
+
"linux-x64": { os: "linux", arch: "amd64", ext: "tar.gz" },
|
|
90019
|
+
"win32-x64": { os: "windows", arch: "amd64", ext: "zip" }
|
|
90020
|
+
};
|
|
90021
|
+
function resolveCommentCheckerReleaseAsset(platform, arch, version = COMMENT_CHECKER_RELEASE_VERSION) {
|
|
90022
|
+
const target = RELEASE_PLATFORMS[`${platform}-${arch}`];
|
|
90023
|
+
if (target === undefined)
|
|
90024
|
+
return null;
|
|
90025
|
+
const assetName = `comment-checker_v${version}_${target.os}_${target.arch}.${target.ext}`;
|
|
90026
|
+
return {
|
|
90027
|
+
os: target.os,
|
|
90028
|
+
arch: target.arch,
|
|
90029
|
+
ext: target.ext,
|
|
90030
|
+
assetName,
|
|
90031
|
+
url: `https://github.com/${COMMENT_CHECKER_RELEASE_REPO}/releases/download/v${version}/${assetName}`
|
|
90032
|
+
};
|
|
90033
|
+
}
|
|
90034
|
+
function commentCheckerBinaryName(platform) {
|
|
90035
|
+
return platform === "win32" ? "comment-checker.exe" : "comment-checker";
|
|
90036
|
+
}
|
|
90037
|
+
function commentCheckerCacheDir(input) {
|
|
90038
|
+
if (input.platform === "win32") {
|
|
90039
|
+
const localAppData = input.env.LOCALAPPDATA || input.env.APPDATA;
|
|
90040
|
+
const base = localAppData || join42(input.homedir, "AppData", "Local");
|
|
90041
|
+
return join42(base, input.cacheDirName, "bin");
|
|
90042
|
+
}
|
|
90043
|
+
const base = input.env.XDG_CACHE_HOME || join42(input.homedir, ".cache");
|
|
90044
|
+
return join42(base, input.cacheDirName, "bin");
|
|
90045
|
+
}
|
|
90010
90046
|
// packages/comment-checker-core/src/runner.ts
|
|
90011
90047
|
import { createRequire } from "module";
|
|
90012
|
-
import { dirname as dirname13, join as
|
|
90048
|
+
import { dirname as dirname13, join as join43 } from "path";
|
|
90013
90049
|
var EMPTY_RESULT = { hasComments: false, message: "" };
|
|
90014
90050
|
function normalizeMessage(message) {
|
|
90015
90051
|
return message.replace(/\r\n/g, `
|
|
@@ -90035,7 +90071,7 @@ function resolveCommentCheckerBinary(input) {
|
|
|
90035
90071
|
try {
|
|
90036
90072
|
const require2 = createRequire(input.importMetaUrl);
|
|
90037
90073
|
const packageJsonPath = require2.resolve(`${packageName}/package.json`);
|
|
90038
|
-
const binaryPath =
|
|
90074
|
+
const binaryPath = join43(dirname13(packageJsonPath), "bin", input.binaryName);
|
|
90039
90075
|
return input.existsSync(binaryPath) ? binaryPath : null;
|
|
90040
90076
|
} catch (error) {
|
|
90041
90077
|
if (error instanceof Error || typeof error === "object" && error !== null && "name" in error && error.name === "ResolveMessage") {
|
|
@@ -90103,12 +90139,12 @@ async function runCommentChecker(input, options) {
|
|
|
90103
90139
|
}
|
|
90104
90140
|
// packages/omo-opencode/src/hooks/comment-checker/downloader.ts
|
|
90105
90141
|
import { existsSync as existsSync34, appendFileSync as appendFileSync2 } from "fs";
|
|
90106
|
-
import { join as
|
|
90142
|
+
import { join as join44 } from "path";
|
|
90107
90143
|
import { homedir as homedir10, tmpdir as tmpdir3 } from "os";
|
|
90108
90144
|
init_logger2();
|
|
90109
90145
|
init_plugin_identity();
|
|
90110
90146
|
var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
|
|
90111
|
-
var DEBUG_FILE =
|
|
90147
|
+
var DEBUG_FILE = join44(tmpdir3(), "comment-checker-debug.log");
|
|
90112
90148
|
function debugLog(...args) {
|
|
90113
90149
|
if (DEBUG) {
|
|
90114
90150
|
const msg = `[${new Date().toISOString()}] [comment-checker:downloader] ${args.map((a) => typeof a === "object" ? JSON.stringify(a, null, 2) : String(a)).join(" ")}
|
|
@@ -90116,54 +90152,39 @@ function debugLog(...args) {
|
|
|
90116
90152
|
appendFileSync2(DEBUG_FILE, msg);
|
|
90117
90153
|
}
|
|
90118
90154
|
}
|
|
90119
|
-
var REPO = "code-yeongyu/go-claude-code-comment-checker";
|
|
90120
|
-
var COMMENT_CHECKER_VERSION = "0.8.0";
|
|
90121
|
-
var PLATFORM_MAP = {
|
|
90122
|
-
"darwin-arm64": { os: "darwin", arch: "arm64", ext: "tar.gz" },
|
|
90123
|
-
"darwin-x64": { os: "darwin", arch: "amd64", ext: "tar.gz" },
|
|
90124
|
-
"linux-arm64": { os: "linux", arch: "arm64", ext: "tar.gz" },
|
|
90125
|
-
"linux-x64": { os: "linux", arch: "amd64", ext: "tar.gz" },
|
|
90126
|
-
"win32-x64": { os: "windows", arch: "amd64", ext: "zip" }
|
|
90127
|
-
};
|
|
90128
90155
|
function getCacheDir2() {
|
|
90129
|
-
|
|
90130
|
-
|
|
90131
|
-
|
|
90132
|
-
|
|
90133
|
-
|
|
90134
|
-
|
|
90135
|
-
const base = xdgCache || join43(homedir10(), ".cache");
|
|
90136
|
-
return join43(base, CACHE_DIR_NAME, "bin");
|
|
90156
|
+
return commentCheckerCacheDir({
|
|
90157
|
+
platform: process.platform,
|
|
90158
|
+
env: process.env,
|
|
90159
|
+
homedir: homedir10(),
|
|
90160
|
+
cacheDirName: CACHE_DIR_NAME
|
|
90161
|
+
});
|
|
90137
90162
|
}
|
|
90138
90163
|
function getBinaryName() {
|
|
90139
|
-
return process.platform
|
|
90164
|
+
return commentCheckerBinaryName(process.platform);
|
|
90140
90165
|
}
|
|
90141
90166
|
function getCachedBinaryPath2() {
|
|
90142
90167
|
return getCachedBinaryPath(getCacheDir2(), getBinaryName());
|
|
90143
90168
|
}
|
|
90144
90169
|
async function downloadCommentChecker() {
|
|
90145
|
-
const
|
|
90146
|
-
|
|
90147
|
-
|
|
90148
|
-
debugLog(`Unsupported platform: ${platformKey}`);
|
|
90170
|
+
const asset = resolveCommentCheckerReleaseAsset(process.platform, process.arch);
|
|
90171
|
+
if (!asset) {
|
|
90172
|
+
debugLog(`Unsupported platform: ${process.platform}-${process.arch}`);
|
|
90149
90173
|
return null;
|
|
90150
90174
|
}
|
|
90151
90175
|
const cacheDir = getCacheDir2();
|
|
90152
90176
|
const binaryName = getBinaryName();
|
|
90153
|
-
const binaryPath =
|
|
90177
|
+
const binaryPath = join44(cacheDir, binaryName);
|
|
90154
90178
|
if (existsSync34(binaryPath)) {
|
|
90155
90179
|
debugLog("Binary already cached at:", binaryPath);
|
|
90156
90180
|
return binaryPath;
|
|
90157
90181
|
}
|
|
90158
|
-
const
|
|
90159
|
-
const { os, arch, ext } = platformInfo;
|
|
90160
|
-
const assetName = `comment-checker_v${version}_${os}_${arch}.${ext}`;
|
|
90161
|
-
const downloadUrl = `https://github.com/${REPO}/releases/download/v${version}/${assetName}`;
|
|
90182
|
+
const { assetName, url: downloadUrl, ext } = asset;
|
|
90162
90183
|
debugLog(`Downloading from: ${downloadUrl}`);
|
|
90163
90184
|
log2(`[${PUBLISHED_PACKAGE_NAME}] Downloading comment-checker binary...`);
|
|
90164
90185
|
try {
|
|
90165
90186
|
ensureCacheDir(cacheDir);
|
|
90166
|
-
const archivePath =
|
|
90187
|
+
const archivePath = join44(cacheDir, assetName);
|
|
90167
90188
|
await downloadArchive(downloadUrl, archivePath);
|
|
90168
90189
|
debugLog(`Downloaded archive to: ${archivePath}`);
|
|
90169
90190
|
if (ext === "tar.gz") {
|
|
@@ -90195,7 +90216,7 @@ async function ensureCommentCheckerBinary() {
|
|
|
90195
90216
|
|
|
90196
90217
|
// packages/omo-opencode/src/hooks/comment-checker/cli.ts
|
|
90197
90218
|
var DEBUG2 = process.env.COMMENT_CHECKER_DEBUG === "1";
|
|
90198
|
-
var DEBUG_FILE2 =
|
|
90219
|
+
var DEBUG_FILE2 = join45(tmpdir4(), "comment-checker-debug.log");
|
|
90199
90220
|
function debugLog2(...args) {
|
|
90200
90221
|
if (DEBUG2) {
|
|
90201
90222
|
const msg = `[${new Date().toISOString()}] [comment-checker:cli] ${args.map((a) => typeof a === "object" ? JSON.stringify(a, null, 2) : String(a)).join(" ")}
|
|
@@ -90467,9 +90488,9 @@ function ensureCommentCheckerInitialization(initializer) {
|
|
|
90467
90488
|
// packages/omo-opencode/src/hooks/comment-checker/hook.ts
|
|
90468
90489
|
import * as fs7 from "fs";
|
|
90469
90490
|
import { tmpdir as tmpdir5 } from "os";
|
|
90470
|
-
import { join as
|
|
90491
|
+
import { join as join46 } from "path";
|
|
90471
90492
|
var DEBUG3 = process.env.COMMENT_CHECKER_DEBUG === "1";
|
|
90472
|
-
var DEBUG_FILE3 =
|
|
90493
|
+
var DEBUG_FILE3 = join46(tmpdir5(), "comment-checker-debug.log");
|
|
90473
90494
|
function debugLog3(...args) {
|
|
90474
90495
|
if (DEBUG3) {
|
|
90475
90496
|
const msg = `[${new Date().toISOString()}] [comment-checker:hook] ${args.map((a) => typeof a === "object" ? JSON.stringify(a, null, 2) : String(a)).join(" ")}
|
|
@@ -90650,7 +90671,7 @@ function createAgentsMdCache() {
|
|
|
90650
90671
|
}
|
|
90651
90672
|
// packages/rules-engine/src/agents-md.ts
|
|
90652
90673
|
import { existsSync as existsSync37, realpathSync as realpathSync7, statSync as statSync5 } from "fs";
|
|
90653
|
-
import { dirname as dirname14, isAbsolute as isAbsolute6, join as
|
|
90674
|
+
import { dirname as dirname14, isAbsolute as isAbsolute6, join as join47, relative as relative7, resolve as resolve10 } from "path";
|
|
90654
90675
|
|
|
90655
90676
|
// packages/rules-engine/src/constants.ts
|
|
90656
90677
|
var PROJECT_MARKERS = [".git", "pyproject.toml", "package.json", "Cargo.toml", "go.mod", ".venv"];
|
|
@@ -90699,7 +90720,7 @@ async function findAgentsMdUp(input) {
|
|
|
90699
90720
|
while (true) {
|
|
90700
90721
|
const isRootDir = current === rootDir;
|
|
90701
90722
|
if (!(skipRoot && isRootDir)) {
|
|
90702
|
-
const agentsPath = resolveAgentsFilePath(
|
|
90723
|
+
const agentsPath = resolveAgentsFilePath(join47(current, AGENTS_FILENAME), rootDir);
|
|
90703
90724
|
if (agentsPath)
|
|
90704
90725
|
found.push(agentsPath);
|
|
90705
90726
|
}
|
|
@@ -90742,7 +90763,7 @@ function isSameOrChildPath(childPath, parentPath) {
|
|
|
90742
90763
|
// packages/rules-engine/src/finder.ts
|
|
90743
90764
|
import { existsSync as existsSync39, statSync as statSync6 } from "fs";
|
|
90744
90765
|
import { homedir as homedir11 } from "os";
|
|
90745
|
-
import { dirname as dirname16, isAbsolute as isAbsolute8, join as
|
|
90766
|
+
import { dirname as dirname16, isAbsolute as isAbsolute8, join as join49, relative as relative9, resolve as resolve11 } from "path";
|
|
90746
90767
|
|
|
90747
90768
|
// packages/rules-engine/src/ordering.ts
|
|
90748
90769
|
function sortCandidates(candidates) {
|
|
@@ -90761,7 +90782,7 @@ function compareString(left, right) {
|
|
|
90761
90782
|
|
|
90762
90783
|
// packages/rules-engine/src/scanner.ts
|
|
90763
90784
|
import { existsSync as existsSync38, readdirSync as readdirSync10, realpathSync as realpathSync8 } from "fs";
|
|
90764
|
-
import { basename as basename8, dirname as dirname15, isAbsolute as isAbsolute7, join as
|
|
90785
|
+
import { basename as basename8, dirname as dirname15, isAbsolute as isAbsolute7, join as join48, relative as relative8 } from "path";
|
|
90765
90786
|
function isGitHubInstructionsDir(dir) {
|
|
90766
90787
|
const normalizedDir = dir.replaceAll("\\", "/");
|
|
90767
90788
|
return normalizedDir.includes(".github/instructions") || normalizedDir.endsWith(".github/instructions");
|
|
@@ -90780,7 +90801,7 @@ function safeRealpathSync(filePath) {
|
|
|
90780
90801
|
const parentPath = dirname15(filePath);
|
|
90781
90802
|
if (parentPath === filePath)
|
|
90782
90803
|
return filePath;
|
|
90783
|
-
return
|
|
90804
|
+
return join48(safeRealpathSync(parentPath), basename8(filePath));
|
|
90784
90805
|
}
|
|
90785
90806
|
}
|
|
90786
90807
|
function isPathWithinRoot(candidate, root) {
|
|
@@ -90804,7 +90825,7 @@ function findRuleFilesRecursive(dir, results, visited = new Set, boundaryRoot) {
|
|
|
90804
90825
|
return;
|
|
90805
90826
|
}
|
|
90806
90827
|
for (const entry of entries) {
|
|
90807
|
-
const fullPath =
|
|
90828
|
+
const fullPath = join48(dir, entry.name);
|
|
90808
90829
|
if (entry.isDirectory()) {
|
|
90809
90830
|
if (!EXCLUDED_DIRS2.has(entry.name))
|
|
90810
90831
|
findRuleFilesRecursive(fullPath, results, visited, effectiveBoundary);
|
|
@@ -90860,7 +90881,7 @@ function addProjectRuleCandidates(projectRoot, startDir, candidates, seenRealPat
|
|
|
90860
90881
|
while (true) {
|
|
90861
90882
|
for (const [parent, subdir] of PROJECT_RULE_SUBDIRS) {
|
|
90862
90883
|
const source = `${parent}/${subdir}`;
|
|
90863
|
-
const ruleDir =
|
|
90884
|
+
const ruleDir = join49(currentDir, parent, subdir);
|
|
90864
90885
|
for (const entry of scanDirectoryWithCache(ruleDir, cache, projectRootRealPath)) {
|
|
90865
90886
|
if (seenRealPaths.has(entry.realPath))
|
|
90866
90887
|
continue;
|
|
@@ -90888,7 +90909,7 @@ function addProjectRuleCandidates(projectRoot, startDir, candidates, seenRealPat
|
|
|
90888
90909
|
function addProjectSingleFileCandidates(projectRoot, candidates, seenRealPaths) {
|
|
90889
90910
|
const projectRootRealPath = safeRealpathSync(projectRoot);
|
|
90890
90911
|
for (const ruleFile of PROJECT_RULE_FILES) {
|
|
90891
|
-
const filePath =
|
|
90912
|
+
const filePath = join49(projectRoot, ruleFile);
|
|
90892
90913
|
const realPath = validFileRealPath(filePath, projectRootRealPath);
|
|
90893
90914
|
if (realPath === null || seenRealPaths.has(realPath))
|
|
90894
90915
|
continue;
|
|
@@ -90905,9 +90926,9 @@ function addProjectSingleFileCandidates(projectRoot, candidates, seenRealPaths)
|
|
|
90905
90926
|
}
|
|
90906
90927
|
}
|
|
90907
90928
|
function addUserRuleCandidates(homeDir, skipClaudeUserRules, candidates, seenRealPaths, cache) {
|
|
90908
|
-
const userRuleDirs = OPENCODE_USER_RULE_DIRS.map((dir) => [
|
|
90929
|
+
const userRuleDirs = OPENCODE_USER_RULE_DIRS.map((dir) => [join49(homeDir, dir), `~/${dir}`]);
|
|
90909
90930
|
if (!skipClaudeUserRules)
|
|
90910
|
-
userRuleDirs.push([
|
|
90931
|
+
userRuleDirs.push([join49(homeDir, USER_RULE_DIR), "~/.claude/rules"]);
|
|
90911
90932
|
for (const [userRuleDir, source] of userRuleDirs) {
|
|
90912
90933
|
for (const entry of scanDirectoryWithCache(userRuleDir, cache)) {
|
|
90913
90934
|
if (seenRealPaths.has(entry.realPath))
|
|
@@ -91042,7 +91063,7 @@ function toPosix(path) {
|
|
|
91042
91063
|
}
|
|
91043
91064
|
// packages/rules-engine/src/project-root.ts
|
|
91044
91065
|
import { existsSync as existsSync40, statSync as statSync7 } from "fs";
|
|
91045
|
-
import { dirname as dirname17, join as
|
|
91066
|
+
import { dirname as dirname17, join as join50 } from "path";
|
|
91046
91067
|
var projectRootCache = new Map;
|
|
91047
91068
|
function clearProjectRootCache() {
|
|
91048
91069
|
projectRootCache.clear();
|
|
@@ -91089,7 +91110,7 @@ function resolveStartDir(startPath) {
|
|
|
91089
91110
|
}
|
|
91090
91111
|
}
|
|
91091
91112
|
function hasProjectMarker(directory) {
|
|
91092
|
-
return PROJECT_MARKERS.some((marker) => existsSync40(
|
|
91113
|
+
return PROJECT_MARKERS.some((marker) => existsSync40(join50(directory, marker)));
|
|
91093
91114
|
}
|
|
91094
91115
|
// packages/agents-md-core/src/constants.ts
|
|
91095
91116
|
var TRUNCATION_NOTICE_PREFIX = `
|
|
@@ -91181,8 +91202,8 @@ async function processFilePathForAgentsInjection(input) {
|
|
|
91181
91202
|
}
|
|
91182
91203
|
}
|
|
91183
91204
|
// packages/omo-opencode/src/hooks/directory-agents-injector/constants.ts
|
|
91184
|
-
import { join as
|
|
91185
|
-
var AGENTS_INJECTOR_STORAGE =
|
|
91205
|
+
import { join as join51 } from "path";
|
|
91206
|
+
var AGENTS_INJECTOR_STORAGE = join51(OPENCODE_STORAGE, "directory-agents");
|
|
91186
91207
|
|
|
91187
91208
|
// packages/omo-opencode/src/shared/session-injected-paths.ts
|
|
91188
91209
|
import {
|
|
@@ -91192,9 +91213,9 @@ import {
|
|
|
91192
91213
|
unlinkSync as unlinkSync6,
|
|
91193
91214
|
writeFileSync as writeFileSync7
|
|
91194
91215
|
} from "fs";
|
|
91195
|
-
import { join as
|
|
91216
|
+
import { join as join52 } from "path";
|
|
91196
91217
|
function createInjectedPathsStorage(storageDir) {
|
|
91197
|
-
const getStoragePath = (sessionID) =>
|
|
91218
|
+
const getStoragePath = (sessionID) => join52(storageDir, `${sessionID}.json`);
|
|
91198
91219
|
const loadInjectedPaths = (sessionID) => {
|
|
91199
91220
|
const filePath = getStoragePath(sessionID);
|
|
91200
91221
|
if (!existsSync41(filePath))
|
|
@@ -91292,11 +91313,11 @@ import { dirname as dirname20 } from "path";
|
|
|
91292
91313
|
|
|
91293
91314
|
// packages/omo-opencode/src/hooks/directory-readme-injector/finder.ts
|
|
91294
91315
|
import { access as access2 } from "fs/promises";
|
|
91295
|
-
import { dirname as dirname19, isAbsolute as isAbsolute10, join as
|
|
91316
|
+
import { dirname as dirname19, isAbsolute as isAbsolute10, join as join54, resolve as resolve13 } from "path";
|
|
91296
91317
|
|
|
91297
91318
|
// packages/omo-opencode/src/hooks/directory-readme-injector/constants.ts
|
|
91298
|
-
import { join as
|
|
91299
|
-
var README_INJECTOR_STORAGE =
|
|
91319
|
+
import { join as join53 } from "path";
|
|
91320
|
+
var README_INJECTOR_STORAGE = join53(OPENCODE_STORAGE, "directory-readme");
|
|
91300
91321
|
var README_FILENAME = "README.md";
|
|
91301
91322
|
|
|
91302
91323
|
// packages/omo-opencode/src/hooks/directory-readme-injector/finder.ts
|
|
@@ -91311,7 +91332,7 @@ async function findReadmeMdUp(input) {
|
|
|
91311
91332
|
const found = [];
|
|
91312
91333
|
let current = input.startDir;
|
|
91313
91334
|
while (true) {
|
|
91314
|
-
const readmePath =
|
|
91335
|
+
const readmePath = join54(current, README_FILENAME);
|
|
91315
91336
|
try {
|
|
91316
91337
|
await access2(readmePath);
|
|
91317
91338
|
found.push(readmePath);
|
|
@@ -91776,7 +91797,7 @@ function incrementEmptyContentAttempt(autoCompactState, sessionID) {
|
|
|
91776
91797
|
|
|
91777
91798
|
// packages/omo-opencode/src/hooks/anthropic-context-window-limit-recovery/tool-result-storage.ts
|
|
91778
91799
|
import { existsSync as existsSync43, readdirSync as readdirSync12, readFileSync as readFileSync25, rmSync as rmSync3, writeFileSync as writeFileSync8 } from "fs";
|
|
91779
|
-
import { join as
|
|
91800
|
+
import { join as join55 } from "path";
|
|
91780
91801
|
|
|
91781
91802
|
// packages/omo-opencode/src/hooks/anthropic-context-window-limit-recovery/message-storage-directory.ts
|
|
91782
91803
|
import { existsSync as existsSync42, readdirSync as readdirSync11 } from "fs";
|
|
@@ -91804,14 +91825,14 @@ function findToolResultsBySize(sessionID) {
|
|
|
91804
91825
|
const messageIds = getMessageIds(sessionID);
|
|
91805
91826
|
const results = [];
|
|
91806
91827
|
for (const messageID of messageIds) {
|
|
91807
|
-
const partDir =
|
|
91828
|
+
const partDir = join55(PART_STORAGE, messageID);
|
|
91808
91829
|
if (!existsSync43(partDir))
|
|
91809
91830
|
continue;
|
|
91810
91831
|
for (const file of readdirSync12(partDir)) {
|
|
91811
91832
|
if (!file.endsWith(".json"))
|
|
91812
91833
|
continue;
|
|
91813
91834
|
try {
|
|
91814
|
-
const partPath =
|
|
91835
|
+
const partPath = join55(partDir, file);
|
|
91815
91836
|
const content = readFileSync25(partPath, "utf-8");
|
|
91816
91837
|
const part = JSON.parse(content);
|
|
91817
91838
|
if (part.type === "tool" && part.state?.output && !part.truncated) {
|
|
@@ -92043,11 +92064,11 @@ var META_TYPES = new Set(["step-start", "step-finish"]);
|
|
|
92043
92064
|
|
|
92044
92065
|
// packages/omo-opencode/src/hooks/anthropic-context-window-limit-recovery/storage/parts-reader.ts
|
|
92045
92066
|
import { existsSync as existsSync44, readdirSync as readdirSync13, readFileSync as readFileSync26 } from "fs";
|
|
92046
|
-
import { join as
|
|
92067
|
+
import { join as join56 } from "path";
|
|
92047
92068
|
function readParts(messageID) {
|
|
92048
92069
|
if (isSqliteBackend())
|
|
92049
92070
|
return [];
|
|
92050
|
-
const partDir =
|
|
92071
|
+
const partDir = join56(PART_STORAGE, messageID);
|
|
92051
92072
|
if (!existsSync44(partDir))
|
|
92052
92073
|
return [];
|
|
92053
92074
|
const parts = [];
|
|
@@ -92055,7 +92076,7 @@ function readParts(messageID) {
|
|
|
92055
92076
|
if (!file.endsWith(".json"))
|
|
92056
92077
|
continue;
|
|
92057
92078
|
try {
|
|
92058
|
-
const content = readFileSync26(
|
|
92079
|
+
const content = readFileSync26(join56(partDir, file), "utf-8");
|
|
92059
92080
|
parts.push(JSON.parse(content));
|
|
92060
92081
|
} catch (error) {
|
|
92061
92082
|
if (!(error instanceof Error)) {
|
|
@@ -92092,7 +92113,7 @@ function messageHasContent(messageID) {
|
|
|
92092
92113
|
|
|
92093
92114
|
// packages/omo-opencode/src/hooks/anthropic-context-window-limit-recovery/storage/messages-reader.ts
|
|
92094
92115
|
import { existsSync as existsSync45, readdirSync as readdirSync14, readFileSync as readFileSync27 } from "fs";
|
|
92095
|
-
import { join as
|
|
92116
|
+
import { join as join57 } from "path";
|
|
92096
92117
|
function readMessages(sessionID) {
|
|
92097
92118
|
if (isSqliteBackend())
|
|
92098
92119
|
return [];
|
|
@@ -92104,7 +92125,7 @@ function readMessages(sessionID) {
|
|
|
92104
92125
|
if (!file.endsWith(".json"))
|
|
92105
92126
|
continue;
|
|
92106
92127
|
try {
|
|
92107
|
-
const content = readFileSync27(
|
|
92128
|
+
const content = readFileSync27(join57(messageDir, file), "utf-8");
|
|
92108
92129
|
messages.push(JSON.parse(content));
|
|
92109
92130
|
} catch (error) {
|
|
92110
92131
|
if (!(error instanceof Error)) {
|
|
@@ -92158,13 +92179,13 @@ function findEmptyMessageByIndex(sessionID, targetIndex) {
|
|
|
92158
92179
|
|
|
92159
92180
|
// packages/omo-opencode/src/hooks/anthropic-context-window-limit-recovery/storage/empty-text.ts
|
|
92160
92181
|
import { existsSync as existsSync46, readdirSync as readdirSync15, readFileSync as readFileSync28, writeFileSync as writeFileSync9 } from "fs";
|
|
92161
|
-
import { join as
|
|
92182
|
+
import { join as join58 } from "path";
|
|
92162
92183
|
function replaceEmptyTextParts(messageID, replacementText) {
|
|
92163
92184
|
if (isSqliteBackend()) {
|
|
92164
92185
|
log2("[auto-compact] Disabled on SQLite backend: replaceEmptyTextParts (use async variant)");
|
|
92165
92186
|
return false;
|
|
92166
92187
|
}
|
|
92167
|
-
const partDir =
|
|
92188
|
+
const partDir = join58(PART_STORAGE, messageID);
|
|
92168
92189
|
if (!existsSync46(partDir))
|
|
92169
92190
|
return false;
|
|
92170
92191
|
let anyReplaced = false;
|
|
@@ -92172,7 +92193,7 @@ function replaceEmptyTextParts(messageID, replacementText) {
|
|
|
92172
92193
|
if (!file.endsWith(".json"))
|
|
92173
92194
|
continue;
|
|
92174
92195
|
try {
|
|
92175
|
-
const filePath =
|
|
92196
|
+
const filePath = join58(partDir, file);
|
|
92176
92197
|
const content = readFileSync28(filePath, "utf-8");
|
|
92177
92198
|
const part = JSON.parse(content);
|
|
92178
92199
|
if (part.type === "text") {
|
|
@@ -92261,7 +92282,7 @@ async function findMessagesWithEmptyTextPartsFromSDK(client, sessionID) {
|
|
|
92261
92282
|
|
|
92262
92283
|
// packages/omo-opencode/src/hooks/anthropic-context-window-limit-recovery/storage/text-part-injector.ts
|
|
92263
92284
|
import { existsSync as existsSync47, mkdirSync as mkdirSync10, writeFileSync as writeFileSync10 } from "fs";
|
|
92264
|
-
import { join as
|
|
92285
|
+
import { join as join59 } from "path";
|
|
92265
92286
|
|
|
92266
92287
|
// packages/omo-opencode/src/hooks/anthropic-context-window-limit-recovery/storage/part-id.ts
|
|
92267
92288
|
function generatePartId2() {
|
|
@@ -92276,7 +92297,7 @@ function injectTextPart(sessionID, messageID, text) {
|
|
|
92276
92297
|
log2("[auto-compact] Disabled on SQLite backend: injectTextPart (use async variant)");
|
|
92277
92298
|
return false;
|
|
92278
92299
|
}
|
|
92279
|
-
const partDir =
|
|
92300
|
+
const partDir = join59(PART_STORAGE, messageID);
|
|
92280
92301
|
if (!existsSync47(partDir)) {
|
|
92281
92302
|
mkdirSync10(partDir, { recursive: true });
|
|
92282
92303
|
}
|
|
@@ -92290,7 +92311,7 @@ function injectTextPart(sessionID, messageID, text) {
|
|
|
92290
92311
|
synthetic: true
|
|
92291
92312
|
};
|
|
92292
92313
|
try {
|
|
92293
|
-
writeFileSync10(
|
|
92314
|
+
writeFileSync10(join59(partDir, `${partId}.json`), JSON.stringify(part, null, 2));
|
|
92294
92315
|
return true;
|
|
92295
92316
|
} catch (error) {
|
|
92296
92317
|
if (!(error instanceof Error)) {
|
|
@@ -93005,7 +93026,7 @@ async function executeCompact(sessionID, msg, autoCompactState, client, director
|
|
|
93005
93026
|
|
|
93006
93027
|
// packages/omo-opencode/src/hooks/anthropic-context-window-limit-recovery/pruning-deduplication.ts
|
|
93007
93028
|
import { readdirSync as readdirSync16, readFileSync as readFileSync29 } from "fs";
|
|
93008
|
-
import { join as
|
|
93029
|
+
import { join as join60 } from "path";
|
|
93009
93030
|
|
|
93010
93031
|
// packages/omo-opencode/src/hooks/anthropic-context-window-limit-recovery/pruning-types.ts
|
|
93011
93032
|
var CHARS_PER_TOKEN = 4;
|
|
@@ -93041,7 +93062,7 @@ function readMessages2(sessionID) {
|
|
|
93041
93062
|
try {
|
|
93042
93063
|
const files = readdirSync16(messageDir).filter((f) => f.endsWith(".json"));
|
|
93043
93064
|
for (const file of files) {
|
|
93044
|
-
const content = readFileSync29(
|
|
93065
|
+
const content = readFileSync29(join60(messageDir, file), "utf-8");
|
|
93045
93066
|
const data = JSON.parse(content);
|
|
93046
93067
|
if (data.parts) {
|
|
93047
93068
|
messages.push(data);
|
|
@@ -93157,10 +93178,10 @@ function findToolOutput(messages, callID) {
|
|
|
93157
93178
|
|
|
93158
93179
|
// packages/omo-opencode/src/hooks/anthropic-context-window-limit-recovery/pruning-tool-output-truncation.ts
|
|
93159
93180
|
import { existsSync as existsSync48, readdirSync as readdirSync17, readFileSync as readFileSync30 } from "fs";
|
|
93160
|
-
import { join as
|
|
93181
|
+
import { join as join61 } from "path";
|
|
93161
93182
|
init_logger2();
|
|
93162
93183
|
function getPartStorage() {
|
|
93163
|
-
return
|
|
93184
|
+
return join61(getOpenCodeStorageDir(), "part");
|
|
93164
93185
|
}
|
|
93165
93186
|
function getMessageIds2(sessionID) {
|
|
93166
93187
|
const messageDir = getMessageDir(sessionID);
|
|
@@ -93185,13 +93206,13 @@ async function truncateToolOutputsByCallId(sessionID, callIds, client) {
|
|
|
93185
93206
|
return { truncatedCount: 0 };
|
|
93186
93207
|
let truncatedCount = 0;
|
|
93187
93208
|
for (const messageID of messageIds) {
|
|
93188
|
-
const partDir =
|
|
93209
|
+
const partDir = join61(getPartStorage(), messageID);
|
|
93189
93210
|
if (!existsSync48(partDir))
|
|
93190
93211
|
continue;
|
|
93191
93212
|
for (const file of readdirSync17(partDir)) {
|
|
93192
93213
|
if (!file.endsWith(".json"))
|
|
93193
93214
|
continue;
|
|
93194
|
-
const partPath =
|
|
93215
|
+
const partPath = join61(partDir, file);
|
|
93195
93216
|
try {
|
|
93196
93217
|
const content = readFileSync30(partPath, "utf-8");
|
|
93197
93218
|
const part = JSON.parse(content);
|
|
@@ -94141,7 +94162,7 @@ function createModelFallbackHook(args) {
|
|
|
94141
94162
|
};
|
|
94142
94163
|
}
|
|
94143
94164
|
// packages/omo-opencode/src/hooks/claude-code-hooks/config.ts
|
|
94144
|
-
import { join as
|
|
94165
|
+
import { join as join62 } from "path";
|
|
94145
94166
|
import { existsSync as existsSync49 } from "fs";
|
|
94146
94167
|
init_logger2();
|
|
94147
94168
|
var CONFIG_CACHE_TTL_MS = 30000;
|
|
@@ -94178,9 +94199,9 @@ function normalizeHooksConfig(raw) {
|
|
|
94178
94199
|
function getClaudeSettingsPaths(customPath) {
|
|
94179
94200
|
const claudeConfigDir = getClaudeConfigDir();
|
|
94180
94201
|
const paths = [
|
|
94181
|
-
|
|
94182
|
-
|
|
94183
|
-
|
|
94202
|
+
join62(claudeConfigDir, "settings.json"),
|
|
94203
|
+
join62(process.cwd(), ".claude", "settings.json"),
|
|
94204
|
+
join62(process.cwd(), ".claude", "settings.local.json")
|
|
94184
94205
|
];
|
|
94185
94206
|
if (customPath && existsSync49(customPath)) {
|
|
94186
94207
|
paths.unshift(customPath);
|
|
@@ -94319,14 +94340,14 @@ async function loadClaudeHooksConfig(customSettingsPath) {
|
|
|
94319
94340
|
// packages/omo-opencode/src/hooks/claude-code-hooks/config-loader.ts
|
|
94320
94341
|
init_logger2();
|
|
94321
94342
|
import { existsSync as existsSync50 } from "fs";
|
|
94322
|
-
import { join as
|
|
94343
|
+
import { join as join63 } from "path";
|
|
94323
94344
|
var CONFIG_CACHE_TTL_MS2 = 30000;
|
|
94324
94345
|
var configCache2 = new Map;
|
|
94325
94346
|
function getUserConfigPaths() {
|
|
94326
|
-
return getOpenCodeConfigDirs({ binary: "opencode" }).map((dir) =>
|
|
94347
|
+
return getOpenCodeConfigDirs({ binary: "opencode" }).map((dir) => join63(dir, "opencode-cc-plugin.json"));
|
|
94327
94348
|
}
|
|
94328
94349
|
function getProjectConfigPath() {
|
|
94329
|
-
return
|
|
94350
|
+
return join63(process.cwd(), ".opencode", "opencode-cc-plugin.json");
|
|
94330
94351
|
}
|
|
94331
94352
|
function getCacheKey2() {
|
|
94332
94353
|
return `${process.cwd()}::${getUserConfigPaths().join("|")}`;
|
|
@@ -94677,13 +94698,13 @@ ${USER_PROMPT_SUBMIT_TAG_CLOSE}`);
|
|
|
94677
94698
|
}
|
|
94678
94699
|
|
|
94679
94700
|
// packages/omo-opencode/src/hooks/claude-code-hooks/transcript.ts
|
|
94680
|
-
import { join as
|
|
94701
|
+
import { join as join64 } from "path";
|
|
94681
94702
|
import { mkdirSync as mkdirSync11, appendFileSync as appendFileSync5, existsSync as existsSync51, writeFileSync as writeFileSync11, unlinkSync as unlinkSync7 } from "fs";
|
|
94682
94703
|
import { tmpdir as tmpdir6 } from "os";
|
|
94683
94704
|
import { randomUUID as randomUUID4 } from "crypto";
|
|
94684
|
-
var TRANSCRIPT_DIR =
|
|
94705
|
+
var TRANSCRIPT_DIR = join64(getClaudeConfigDir(), "transcripts");
|
|
94685
94706
|
function getTranscriptPath(sessionId) {
|
|
94686
|
-
return
|
|
94707
|
+
return join64(TRANSCRIPT_DIR, `${sessionId}.jsonl`);
|
|
94687
94708
|
}
|
|
94688
94709
|
function ensureTranscriptDir() {
|
|
94689
94710
|
if (!existsSync51(TRANSCRIPT_DIR)) {
|
|
@@ -94850,7 +94871,7 @@ async function buildTranscriptFromSession(client, sessionId, directory, currentT
|
|
|
94850
94871
|
}
|
|
94851
94872
|
}
|
|
94852
94873
|
}
|
|
94853
|
-
const tempPath =
|
|
94874
|
+
const tempPath = join64(tmpdir6(), `opencode-transcript-${sessionId}-${randomUUID4()}.jsonl`);
|
|
94854
94875
|
writeFileSync11(tempPath, allEntries.join(`
|
|
94855
94876
|
`) + `
|
|
94856
94877
|
`);
|
|
@@ -94866,7 +94887,7 @@ async function buildTranscriptFromSession(client, sessionId, directory, currentT
|
|
|
94866
94887
|
logTranscriptError("[transcript] failed to build transcript from session", { thrown: error });
|
|
94867
94888
|
}
|
|
94868
94889
|
try {
|
|
94869
|
-
const tempPath =
|
|
94890
|
+
const tempPath = join64(tmpdir6(), `opencode-transcript-${sessionId}-${randomUUID4()}.jsonl`);
|
|
94870
94891
|
writeFileSync11(tempPath, buildCurrentEntry(currentToolName, currentToolInput) + `
|
|
94871
94892
|
`);
|
|
94872
94893
|
return tempPath;
|
|
@@ -94895,10 +94916,10 @@ function deleteTempTranscript(path) {
|
|
|
94895
94916
|
}
|
|
94896
94917
|
|
|
94897
94918
|
// packages/omo-opencode/src/hooks/claude-code-hooks/todo.ts
|
|
94898
|
-
import { join as
|
|
94899
|
-
var TODO_DIR =
|
|
94919
|
+
import { join as join65 } from "path";
|
|
94920
|
+
var TODO_DIR = join65(getClaudeConfigDir(), "todos");
|
|
94900
94921
|
function getTodoPath(sessionId) {
|
|
94901
|
-
return
|
|
94922
|
+
return join65(TODO_DIR, `${sessionId}-agent-${sessionId}.json`);
|
|
94902
94923
|
}
|
|
94903
94924
|
|
|
94904
94925
|
// packages/omo-opencode/src/hooks/claude-code-hooks/stop.ts
|
|
@@ -96027,9 +96048,9 @@ function readCurrentTopLevelTask(planPath) {
|
|
|
96027
96048
|
}
|
|
96028
96049
|
// packages/boulder-state/src/storage/path.ts
|
|
96029
96050
|
import { existsSync as existsSync53 } from "fs";
|
|
96030
|
-
import { isAbsolute as isAbsolute11, join as
|
|
96051
|
+
import { isAbsolute as isAbsolute11, join as join66, relative as relative12, resolve as resolve14 } from "path";
|
|
96031
96052
|
function getBoulderFilePath(directory) {
|
|
96032
|
-
return
|
|
96053
|
+
return join66(directory, BOULDER_DIR, BOULDER_FILE);
|
|
96033
96054
|
}
|
|
96034
96055
|
function resolveTrackedPath(baseDirectory, trackedPath) {
|
|
96035
96056
|
return isAbsolute11(trackedPath) ? resolve14(trackedPath) : resolve14(baseDirectory, trackedPath);
|
|
@@ -96054,17 +96075,17 @@ function resolveBoulderPlanPathForWork(directory, work) {
|
|
|
96054
96075
|
}
|
|
96055
96076
|
// packages/boulder-state/src/storage/plan-progress.ts
|
|
96056
96077
|
import { existsSync as existsSync54, readFileSync as readFileSync32, readdirSync as readdirSync18, statSync as statSync8 } from "fs";
|
|
96057
|
-
import { basename as basename10, join as
|
|
96078
|
+
import { basename as basename10, join as join67 } from "path";
|
|
96058
96079
|
var LEGACY_PROMETHEUS_PLANS_DIR = ".sisyphus/plans";
|
|
96059
96080
|
var PROMETHEUS_PLAN_DIRS = [PROMETHEUS_PLANS_DIR, LEGACY_PROMETHEUS_PLANS_DIR];
|
|
96060
96081
|
function findPrometheusPlans(directory) {
|
|
96061
96082
|
try {
|
|
96062
96083
|
return PROMETHEUS_PLAN_DIRS.flatMap((planDir) => {
|
|
96063
|
-
const plansDir =
|
|
96084
|
+
const plansDir = join67(directory, planDir);
|
|
96064
96085
|
if (!existsSync54(plansDir)) {
|
|
96065
96086
|
return [];
|
|
96066
96087
|
}
|
|
96067
|
-
return readdirSync18(plansDir).filter((file) => file.endsWith(".md")).map((file) =>
|
|
96088
|
+
return readdirSync18(plansDir).filter((file) => file.endsWith(".md")).map((file) => join67(plansDir, file));
|
|
96068
96089
|
}).sort((left, right) => statSync8(right).mtimeMs - statSync8(left).mtimeMs);
|
|
96069
96090
|
} catch {
|
|
96070
96091
|
return [];
|
|
@@ -96338,14 +96359,14 @@ function getTaskSessionState(directory, taskKey) {
|
|
|
96338
96359
|
}
|
|
96339
96360
|
// packages/boulder-state/src/storage/write-state.ts
|
|
96340
96361
|
import { existsSync as existsSync56, mkdirSync as mkdirSync12, unlinkSync as unlinkSync8, writeFileSync as writeFileSync12 } from "fs";
|
|
96341
|
-
import { dirname as dirname21, join as
|
|
96362
|
+
import { dirname as dirname21, join as join68 } from "path";
|
|
96342
96363
|
function writeBoulderState(directory, state) {
|
|
96343
96364
|
const filePath = getBoulderFilePath(directory);
|
|
96344
96365
|
try {
|
|
96345
96366
|
const dir = dirname21(filePath);
|
|
96346
96367
|
if (!existsSync56(dir)) {
|
|
96347
96368
|
mkdirSync12(dir, { recursive: true });
|
|
96348
|
-
writeFileSync12(
|
|
96369
|
+
writeFileSync12(join68(dir, ".gitignore"), ["*", "!/rules/", "!/rules/**", ""].join(`
|
|
96349
96370
|
`), "utf-8");
|
|
96350
96371
|
}
|
|
96351
96372
|
const stateToWrite = { ...state };
|
|
@@ -96573,7 +96594,7 @@ function appendSessionIdForWork(directory, workId, sessionId, origin = "direct")
|
|
|
96573
96594
|
}
|
|
96574
96595
|
// packages/boulder-state/src/storage/stale-work.ts
|
|
96575
96596
|
import { readdirSync as readdirSync19, statSync as statSync9 } from "fs";
|
|
96576
|
-
import { join as
|
|
96597
|
+
import { join as join69 } from "path";
|
|
96577
96598
|
var DEFAULT_STALE_WORK_THRESHOLD_MS = 6 * 60 * 60 * 1000;
|
|
96578
96599
|
var STALE_WORK_THRESHOLD_ENV_KEY = "OMO_BOULDER_STALE_WORK_THRESHOLD_MS";
|
|
96579
96600
|
var SESSION_TRANSCRIPT_SUFFIX = ".jsonl";
|
|
@@ -96681,14 +96702,14 @@ function findNewestSessionTranscriptMs(input) {
|
|
|
96681
96702
|
for (const entry of entries) {
|
|
96682
96703
|
if (entry.isFile) {
|
|
96683
96704
|
if (isTranscriptOf(entry.name, sessionIds)) {
|
|
96684
|
-
newest = newestMs([newest, mtimeMs(
|
|
96705
|
+
newest = newestMs([newest, mtimeMs(join69(input.sessionsDirectory, entry.name))]);
|
|
96685
96706
|
}
|
|
96686
96707
|
continue;
|
|
96687
96708
|
}
|
|
96688
96709
|
if (!entry.isDirectory || !matchesSessionCwd(entry.name, needles)) {
|
|
96689
96710
|
continue;
|
|
96690
96711
|
}
|
|
96691
|
-
const sessionDirectory =
|
|
96712
|
+
const sessionDirectory = join69(input.sessionsDirectory, entry.name);
|
|
96692
96713
|
let fileNames;
|
|
96693
96714
|
try {
|
|
96694
96715
|
fileNames = readdirSync19(sessionDirectory);
|
|
@@ -96697,7 +96718,7 @@ function findNewestSessionTranscriptMs(input) {
|
|
|
96697
96718
|
}
|
|
96698
96719
|
for (const fileName of fileNames) {
|
|
96699
96720
|
if (isTranscriptOf(fileName, sessionIds)) {
|
|
96700
|
-
newest = newestMs([newest, mtimeMs(
|
|
96721
|
+
newest = newestMs([newest, mtimeMs(join69(sessionDirectory, fileName))]);
|
|
96701
96722
|
}
|
|
96702
96723
|
}
|
|
96703
96724
|
}
|
|
@@ -96955,15 +96976,15 @@ import {
|
|
|
96955
96976
|
writeFileSync as writeFileSync13,
|
|
96956
96977
|
unlinkSync as unlinkSync9
|
|
96957
96978
|
} from "fs";
|
|
96958
|
-
import { join as
|
|
96979
|
+
import { join as join71 } from "path";
|
|
96959
96980
|
|
|
96960
96981
|
// packages/omo-opencode/src/hooks/rules-injector/constants.ts
|
|
96961
|
-
import { join as
|
|
96962
|
-
var RULES_INJECTOR_STORAGE =
|
|
96982
|
+
import { join as join70 } from "path";
|
|
96983
|
+
var RULES_INJECTOR_STORAGE = join70(OPENCODE_STORAGE, "rules-injector");
|
|
96963
96984
|
|
|
96964
96985
|
// packages/omo-opencode/src/hooks/rules-injector/storage.ts
|
|
96965
96986
|
function getStoragePath(sessionID) {
|
|
96966
|
-
return
|
|
96987
|
+
return join71(RULES_INJECTOR_STORAGE, `${sessionID}.json`);
|
|
96967
96988
|
}
|
|
96968
96989
|
function loadInjectedRules(sessionID) {
|
|
96969
96990
|
const filePath = getStoragePath(sessionID);
|
|
@@ -97715,7 +97736,7 @@ function getCachedVersion(options = {}) {
|
|
|
97715
97736
|
// package.json
|
|
97716
97737
|
var package_default = {
|
|
97717
97738
|
name: "oh-my-opencode",
|
|
97718
|
-
version: "5.0.0-beta.
|
|
97739
|
+
version: "5.0.0-beta.88",
|
|
97719
97740
|
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
97720
97741
|
main: "./dist/index.js",
|
|
97721
97742
|
types: "dist/index.d.ts",
|
|
@@ -97898,7 +97919,7 @@ var package_default = {
|
|
|
97898
97919
|
zod: "^4.6.5"
|
|
97899
97920
|
},
|
|
97900
97921
|
devDependencies: {
|
|
97901
|
-
"@code-yeongyu/senpi": "2026.9.23-
|
|
97922
|
+
"@code-yeongyu/senpi": "2026.9.23-5",
|
|
97902
97923
|
"@oh-my-opencode/agents-md-core": "workspace:*",
|
|
97903
97924
|
"@oh-my-opencode/ast-grep-mcp": "workspace:*",
|
|
97904
97925
|
"@oh-my-opencode/boulder-state": "workspace:*",
|
|
@@ -97939,18 +97960,18 @@ var package_default = {
|
|
|
97939
97960
|
typescript: "^7.0.2"
|
|
97940
97961
|
},
|
|
97941
97962
|
optionalDependencies: {
|
|
97942
|
-
"oh-my-opencode-darwin-arm64": "5.0.0-beta.
|
|
97943
|
-
"oh-my-opencode-darwin-x64": "5.0.0-beta.
|
|
97944
|
-
"oh-my-opencode-darwin-x64-baseline": "5.0.0-beta.
|
|
97945
|
-
"oh-my-opencode-linux-arm64": "5.0.0-beta.
|
|
97946
|
-
"oh-my-opencode-linux-arm64-musl": "5.0.0-beta.
|
|
97947
|
-
"oh-my-opencode-linux-x64": "5.0.0-beta.
|
|
97948
|
-
"oh-my-opencode-linux-x64-baseline": "5.0.0-beta.
|
|
97949
|
-
"oh-my-opencode-linux-x64-musl": "5.0.0-beta.
|
|
97950
|
-
"oh-my-opencode-linux-x64-musl-baseline": "5.0.0-beta.
|
|
97951
|
-
"oh-my-opencode-windows-arm64": "5.0.0-beta.
|
|
97952
|
-
"oh-my-opencode-windows-x64": "5.0.0-beta.
|
|
97953
|
-
"oh-my-opencode-windows-x64-baseline": "5.0.0-beta.
|
|
97963
|
+
"oh-my-opencode-darwin-arm64": "5.0.0-beta.88",
|
|
97964
|
+
"oh-my-opencode-darwin-x64": "5.0.0-beta.88",
|
|
97965
|
+
"oh-my-opencode-darwin-x64-baseline": "5.0.0-beta.88",
|
|
97966
|
+
"oh-my-opencode-linux-arm64": "5.0.0-beta.88",
|
|
97967
|
+
"oh-my-opencode-linux-arm64-musl": "5.0.0-beta.88",
|
|
97968
|
+
"oh-my-opencode-linux-x64": "5.0.0-beta.88",
|
|
97969
|
+
"oh-my-opencode-linux-x64-baseline": "5.0.0-beta.88",
|
|
97970
|
+
"oh-my-opencode-linux-x64-musl": "5.0.0-beta.88",
|
|
97971
|
+
"oh-my-opencode-linux-x64-musl-baseline": "5.0.0-beta.88",
|
|
97972
|
+
"oh-my-opencode-windows-arm64": "5.0.0-beta.88",
|
|
97973
|
+
"oh-my-opencode-windows-x64": "5.0.0-beta.88",
|
|
97974
|
+
"oh-my-opencode-windows-x64-baseline": "5.0.0-beta.88"
|
|
97954
97975
|
},
|
|
97955
97976
|
overrides: {
|
|
97956
97977
|
"@earendil-works/pi-agent-core": "0.84.2",
|
|
@@ -98132,7 +98153,7 @@ function syncCachePackageJsonToIntent(pluginInfo) {
|
|
|
98132
98153
|
}
|
|
98133
98154
|
// packages/omo-opencode/src/hooks/auto-update-checker/hook/background-update-check.ts
|
|
98134
98155
|
import { existsSync as existsSync66 } from "fs";
|
|
98135
|
-
import { dirname as dirname25, join as
|
|
98156
|
+
import { dirname as dirname25, join as join78 } from "path";
|
|
98136
98157
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
98137
98158
|
// packages/omo-opencode/src/cli/config-manager/add-plugin-to-opencode-config.ts
|
|
98138
98159
|
init_main();
|
|
@@ -99148,12 +99169,12 @@ function spawnWithWindowsHide(command, options) {
|
|
|
99148
99169
|
}
|
|
99149
99170
|
// packages/omo-opencode/src/cli/config-manager/bun-install.ts
|
|
99150
99171
|
import { existsSync as existsSync64 } from "fs";
|
|
99151
|
-
import { join as
|
|
99172
|
+
import { join as join76 } from "path";
|
|
99152
99173
|
init_logger2();
|
|
99153
99174
|
var BUN_INSTALL_TIMEOUT_SECONDS = 60;
|
|
99154
99175
|
var BUN_INSTALL_TIMEOUT_MS = BUN_INSTALL_TIMEOUT_SECONDS * 1000;
|
|
99155
99176
|
function getDefaultWorkspaceDir() {
|
|
99156
|
-
return
|
|
99177
|
+
return join76(getOpenCodeCacheDir(), "packages");
|
|
99157
99178
|
}
|
|
99158
99179
|
function readProcessOutput(stream) {
|
|
99159
99180
|
if (!stream) {
|
|
@@ -99417,7 +99438,7 @@ function getCacheWorkspaceDir(deps) {
|
|
|
99417
99438
|
}
|
|
99418
99439
|
var defaultDeps2 = {
|
|
99419
99440
|
existsSync: existsSync66,
|
|
99420
|
-
join:
|
|
99441
|
+
join: join78,
|
|
99421
99442
|
runBunInstallWithDetails,
|
|
99422
99443
|
log: log2,
|
|
99423
99444
|
getOpenCodeCacheDir,
|
|
@@ -99789,7 +99810,7 @@ v${latestVersion} available. Restart OpenCode to apply.` : "OpenCode is now on S
|
|
|
99789
99810
|
// packages/omo-opencode/src/hooks/ast-grep-sg-provision/hook.ts
|
|
99790
99811
|
init_src();
|
|
99791
99812
|
import { homedir as homedir15 } from "os";
|
|
99792
|
-
import { join as
|
|
99813
|
+
import { join as join79 } from "path";
|
|
99793
99814
|
var provisionedTargets = new Set;
|
|
99794
99815
|
function defaultSchedule(task) {
|
|
99795
99816
|
const timer = setTimeout(() => {
|
|
@@ -99816,7 +99837,7 @@ var defaultDeps4 = {
|
|
|
99816
99837
|
function createAstGrepSgProvisionHook(depsOverride = {}) {
|
|
99817
99838
|
const deps = { ...defaultDeps4, ...depsOverride };
|
|
99818
99839
|
const platform = deps.platform ?? process.platform;
|
|
99819
|
-
const targetDir = astGrepRuntimeDir(
|
|
99840
|
+
const targetDir = astGrepRuntimeDir(join79(deps.homeDir(), ".omo"), platform, deps.arch ?? process.arch);
|
|
99820
99841
|
return {
|
|
99821
99842
|
event(input) {
|
|
99822
99843
|
try {
|
|
@@ -99843,11 +99864,11 @@ import {
|
|
|
99843
99864
|
writeFileSync as writeFileSync16,
|
|
99844
99865
|
unlinkSync as unlinkSync12
|
|
99845
99866
|
} from "fs";
|
|
99846
|
-
import { join as
|
|
99867
|
+
import { join as join81 } from "path";
|
|
99847
99868
|
|
|
99848
99869
|
// packages/omo-opencode/src/hooks/agent-usage-reminder/constants.ts
|
|
99849
|
-
import { join as
|
|
99850
|
-
var AGENT_USAGE_REMINDER_STORAGE =
|
|
99870
|
+
import { join as join80 } from "path";
|
|
99871
|
+
var AGENT_USAGE_REMINDER_STORAGE = join80(OPENCODE_STORAGE, "agent-usage-reminder");
|
|
99851
99872
|
var TARGET_TOOLS = new Set([
|
|
99852
99873
|
"grep",
|
|
99853
99874
|
"safe_grep",
|
|
@@ -99891,7 +99912,7 @@ ALWAYS prefer: Multiple parallel task calls > Direct tool calls
|
|
|
99891
99912
|
|
|
99892
99913
|
// packages/omo-opencode/src/hooks/agent-usage-reminder/storage.ts
|
|
99893
99914
|
function getStoragePath2(sessionID) {
|
|
99894
|
-
return
|
|
99915
|
+
return join81(AGENT_USAGE_REMINDER_STORAGE, `${sessionID}.json`);
|
|
99895
99916
|
}
|
|
99896
99917
|
function loadAgentUsageState(sessionID) {
|
|
99897
99918
|
const filePath = getStoragePath2(sessionID);
|
|
@@ -105322,11 +105343,11 @@ import {
|
|
|
105322
105343
|
writeFileSync as writeFileSync17,
|
|
105323
105344
|
unlinkSync as unlinkSync13
|
|
105324
105345
|
} from "fs";
|
|
105325
|
-
import { join as
|
|
105346
|
+
import { join as join83 } from "path";
|
|
105326
105347
|
|
|
105327
105348
|
// packages/omo-opencode/src/hooks/interactive-bash-session/constants.ts
|
|
105328
|
-
import { join as
|
|
105329
|
-
var INTERACTIVE_BASH_SESSION_STORAGE =
|
|
105349
|
+
import { join as join82 } from "path";
|
|
105350
|
+
var INTERACTIVE_BASH_SESSION_STORAGE = join82(OPENCODE_STORAGE, "interactive-bash-session");
|
|
105330
105351
|
var OMO_SESSION_PREFIX = "omo-";
|
|
105331
105352
|
function buildSessionReminderMessage(sessions) {
|
|
105332
105353
|
if (sessions.length === 0)
|
|
@@ -105338,7 +105359,7 @@ function buildSessionReminderMessage(sessions) {
|
|
|
105338
105359
|
|
|
105339
105360
|
// packages/omo-opencode/src/hooks/interactive-bash-session/storage.ts
|
|
105340
105361
|
function getStoragePath3(sessionID) {
|
|
105341
|
-
return
|
|
105362
|
+
return join83(INTERACTIVE_BASH_SESSION_STORAGE, `${sessionID}.json`);
|
|
105342
105363
|
}
|
|
105343
105364
|
function loadInteractiveBashSessionState(sessionID) {
|
|
105344
105365
|
const filePath = getStoragePath3(sessionID);
|
|
@@ -106558,12 +106579,12 @@ init_logger2();
|
|
|
106558
106579
|
init_logger2();
|
|
106559
106580
|
// packages/omo-opencode/src/hooks/goal/controller.ts
|
|
106560
106581
|
import { mkdirSync as mkdirSync18, writeFileSync as writeFileSync19 } from "fs";
|
|
106561
|
-
import { dirname as dirname27, join as
|
|
106582
|
+
import { dirname as dirname27, join as join85 } from "path";
|
|
106562
106583
|
|
|
106563
106584
|
// packages/omo-opencode/src/hooks/goal/store.ts
|
|
106564
106585
|
import { randomUUID as randomUUID8 } from "crypto";
|
|
106565
106586
|
import { mkdirSync as mkdirSync17, readFileSync as readFileSync45, renameSync as renameSync7, unlinkSync as unlinkSync14, writeFileSync as writeFileSync18 } from "fs";
|
|
106566
|
-
import { join as
|
|
106587
|
+
import { join as join84 } from "path";
|
|
106567
106588
|
|
|
106568
106589
|
// packages/omo-opencode/src/hooks/goal/types.ts
|
|
106569
106590
|
import { z as z52 } from "zod";
|
|
@@ -106601,7 +106622,7 @@ var GoalToolResponseSchema = z52.object({
|
|
|
106601
106622
|
// packages/omo-opencode/src/hooks/goal/store.ts
|
|
106602
106623
|
var STORE_VERSION = 1;
|
|
106603
106624
|
function goalFilePath(ref) {
|
|
106604
|
-
return
|
|
106625
|
+
return join84(ref.baseDir, `${encodeURIComponent(ref.sessionID)}.json`);
|
|
106605
106626
|
}
|
|
106606
106627
|
function ensureGoalStoreDir(baseDir) {
|
|
106607
106628
|
mkdirSync17(baseDir, { recursive: true });
|
|
@@ -106722,9 +106743,9 @@ function validateObjective(objective) {
|
|
|
106722
106743
|
// packages/omo-opencode/src/hooks/goal/controller.ts
|
|
106723
106744
|
function createGoalController(options) {
|
|
106724
106745
|
const { projectDir } = options;
|
|
106725
|
-
const baseDir =
|
|
106746
|
+
const baseDir = join85(projectDir, ".omo", "goal");
|
|
106726
106747
|
const storeRef = (sessionID) => ({ baseDir, sessionID });
|
|
106727
|
-
const tuiMirrorPath = (sessionID) =>
|
|
106748
|
+
const tuiMirrorPath = (sessionID) => join85(projectDir, ".omo", "ulw-loop", sessionID, "goals.json");
|
|
106728
106749
|
const writeTuiMirror = (sessionID, goal) => {
|
|
106729
106750
|
const path = tuiMirrorPath(sessionID);
|
|
106730
106751
|
const snapshot = {
|
|
@@ -107157,7 +107178,7 @@ import { dirname as dirname33 } from "path";
|
|
|
107157
107178
|
init_resolve_commands_in_text();
|
|
107158
107179
|
// packages/skills-loader-core/src/features/opencode-skill-loader/loader.ts
|
|
107159
107180
|
init_src();
|
|
107160
|
-
import { join as
|
|
107181
|
+
import { join as join92 } from "path";
|
|
107161
107182
|
|
|
107162
107183
|
// packages/shared-skills/index.mjs
|
|
107163
107184
|
import { existsSync as existsSync69 } from "fs";
|
|
@@ -107170,21 +107191,21 @@ function sharedSkillsRootPath() {
|
|
|
107170
107191
|
|
|
107171
107192
|
// packages/skills-loader-core/src/shared/claude-config-dir.ts
|
|
107172
107193
|
init_src();
|
|
107173
|
-
import { join as
|
|
107194
|
+
import { join as join86 } from "path";
|
|
107174
107195
|
function getClaudeConfigDir2() {
|
|
107175
107196
|
const envConfigDir = process.env.CLAUDE_CONFIG_DIR;
|
|
107176
107197
|
if (envConfigDir) {
|
|
107177
107198
|
return envConfigDir;
|
|
107178
107199
|
}
|
|
107179
|
-
return
|
|
107200
|
+
return join86(getHomeDirectory(), ".claude");
|
|
107180
107201
|
}
|
|
107181
107202
|
// packages/skills-loader-core/src/shared/opencode-command-dirs.ts
|
|
107182
|
-
import { basename as basename11, dirname as dirname28, join as
|
|
107203
|
+
import { basename as basename11, dirname as dirname28, join as join88 } from "path";
|
|
107183
107204
|
|
|
107184
107205
|
// packages/skills-loader-core/src/shared/opencode-config-dir.ts
|
|
107185
107206
|
import { existsSync as existsSync70, realpathSync as realpathSync12 } from "fs";
|
|
107186
107207
|
import { homedir as homedir17 } from "os";
|
|
107187
|
-
import { join as
|
|
107208
|
+
import { join as join87, posix as posix8, resolve as resolve16, win32 as win327 } from "path";
|
|
107188
107209
|
|
|
107189
107210
|
// packages/skills-loader-core/src/shared/plugin-identity.ts
|
|
107190
107211
|
init_src();
|
|
@@ -107217,15 +107238,15 @@ function getTauriConfigDir2(identifier) {
|
|
|
107217
107238
|
const platform = process.platform;
|
|
107218
107239
|
switch (platform) {
|
|
107219
107240
|
case "darwin":
|
|
107220
|
-
return
|
|
107241
|
+
return join87(homedir17(), "Library", "Application Support", identifier);
|
|
107221
107242
|
case "win32": {
|
|
107222
|
-
const appData = process.env.APPDATA ||
|
|
107243
|
+
const appData = process.env.APPDATA || join87(homedir17(), "AppData", "Roaming");
|
|
107223
107244
|
return win327.join(appData, identifier);
|
|
107224
107245
|
}
|
|
107225
107246
|
case "linux":
|
|
107226
107247
|
default: {
|
|
107227
|
-
const xdgConfig = process.env.XDG_CONFIG_HOME ||
|
|
107228
|
-
return
|
|
107248
|
+
const xdgConfig = process.env.XDG_CONFIG_HOME || join87(homedir17(), ".config");
|
|
107249
|
+
return join87(xdgConfig, identifier);
|
|
107229
107250
|
}
|
|
107230
107251
|
}
|
|
107231
107252
|
}
|
|
@@ -107268,8 +107289,8 @@ function getWslLinuxHomeDir2(windowsConfigRoot) {
|
|
|
107268
107289
|
function getCliDefaultConfigDir2() {
|
|
107269
107290
|
const envXdgConfig = process.env.XDG_CONFIG_HOME?.trim();
|
|
107270
107291
|
const shouldIgnoreWindowsXdg = envXdgConfig !== undefined && envXdgConfig.length > 0 && isWslEnvironment2() && isWindowsUserConfigRoot2(envXdgConfig);
|
|
107271
|
-
const xdgConfig = shouldIgnoreWindowsXdg ? posix8.join(getWslLinuxHomeDir2(envXdgConfig) ?? "/home", ".config") : envXdgConfig ||
|
|
107272
|
-
const configDir = isWslEnvironment2() ? posix8.join(xdgConfig, "opencode") :
|
|
107292
|
+
const xdgConfig = shouldIgnoreWindowsXdg ? posix8.join(getWslLinuxHomeDir2(envXdgConfig) ?? "/home", ".config") : envXdgConfig || join87(homedir17(), ".config");
|
|
107293
|
+
const configDir = isWslEnvironment2() ? posix8.join(xdgConfig, "opencode") : join87(xdgConfig, "opencode");
|
|
107273
107294
|
return resolveConfigPath2(configDir);
|
|
107274
107295
|
}
|
|
107275
107296
|
function getCliCustomConfigDir2() {
|
|
@@ -107302,8 +107323,8 @@ function getOpenCodeConfigDir2(options) {
|
|
|
107302
107323
|
const tauriDir = process.platform === "win32" ? win327.isAbsolute(tauriDirBase) ? win327.normalize(tauriDirBase) : win327.resolve(tauriDirBase) : resolveConfigPath2(tauriDirBase);
|
|
107303
107324
|
if (checkExisting) {
|
|
107304
107325
|
const legacyDir = getCliConfigDir2();
|
|
107305
|
-
const legacyConfig =
|
|
107306
|
-
const legacyConfigC =
|
|
107326
|
+
const legacyConfig = join87(legacyDir, "opencode.json");
|
|
107327
|
+
const legacyConfigC = join87(legacyDir, "opencode.jsonc");
|
|
107307
107328
|
if (existsSync70(legacyConfig) || existsSync70(legacyConfigC)) {
|
|
107308
107329
|
return legacyDir;
|
|
107309
107330
|
}
|
|
@@ -107325,9 +107346,9 @@ function getOpenCodeSkillDirs(options) {
|
|
|
107325
107346
|
...configDirs.flatMap((configDir) => {
|
|
107326
107347
|
const parentConfigDir = getParentOpencodeConfigDir2(configDir);
|
|
107327
107348
|
return [
|
|
107328
|
-
|
|
107329
|
-
|
|
107330
|
-
...parentConfigDir ? [
|
|
107349
|
+
join88(configDir, "skills"),
|
|
107350
|
+
join88(configDir, "skill"),
|
|
107351
|
+
...parentConfigDir ? [join88(parentConfigDir, "skills"), join88(parentConfigDir, "skill")] : []
|
|
107331
107352
|
];
|
|
107332
107353
|
})
|
|
107333
107354
|
]));
|
|
@@ -107335,7 +107356,7 @@ function getOpenCodeSkillDirs(options) {
|
|
|
107335
107356
|
// packages/skills-loader-core/src/shared/project-discovery-dirs.ts
|
|
107336
107357
|
import { execFileSync as execFileSync4 } from "child_process";
|
|
107337
107358
|
import { existsSync as existsSync71, realpathSync as realpathSync13 } from "fs";
|
|
107338
|
-
import { dirname as dirname29, join as
|
|
107359
|
+
import { dirname as dirname29, join as join89, resolve as resolve17, win32 as win328 } from "path";
|
|
107339
107360
|
var worktreePathCache2 = new Map;
|
|
107340
107361
|
function normalizePath4(path) {
|
|
107341
107362
|
const resolvedPath = process.platform !== "win32" && win328.isAbsolute(path) ? path : resolve17(path);
|
|
@@ -107370,7 +107391,7 @@ function findAncestorDirectories2(startDirectory, targetPaths, stopDirectory) {
|
|
|
107370
107391
|
const stopDirectoryKey = resolvedStopDirectory ? pathKey3(resolvedStopDirectory) : undefined;
|
|
107371
107392
|
while (true) {
|
|
107372
107393
|
for (const targetPath of targetPaths) {
|
|
107373
|
-
const candidateDirectory =
|
|
107394
|
+
const candidateDirectory = join89(currentDirectory, ...targetPath);
|
|
107374
107395
|
if (!existsSync71(candidateDirectory)) {
|
|
107375
107396
|
continue;
|
|
107376
107397
|
}
|
|
@@ -107525,7 +107546,7 @@ function deduplicateSkillsByName(skills) {
|
|
|
107525
107546
|
// packages/skills-loader-core/src/features/opencode-skill-loader/skill-directory-loader.ts
|
|
107526
107547
|
init_src();
|
|
107527
107548
|
import * as fs17 from "fs/promises";
|
|
107528
|
-
import { join as
|
|
107549
|
+
import { join as join91 } from "path";
|
|
107529
107550
|
|
|
107530
107551
|
// packages/skills-loader-core/src/features/opencode-skill-loader/loaded-skill-from-path.ts
|
|
107531
107552
|
init_src();
|
|
@@ -107545,7 +107566,7 @@ function parseAllowedTools(allowedTools) {
|
|
|
107545
107566
|
// packages/skills-loader-core/src/features/opencode-skill-loader/skill-mcp-config.ts
|
|
107546
107567
|
init_js_yaml();
|
|
107547
107568
|
import * as fs15 from "fs/promises";
|
|
107548
|
-
import { join as
|
|
107569
|
+
import { join as join90 } from "path";
|
|
107549
107570
|
function parseSkillMcpConfigFromFrontmatter(content) {
|
|
107550
107571
|
const frontmatterMatch = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
|
|
107551
107572
|
if (!frontmatterMatch)
|
|
@@ -107564,7 +107585,7 @@ function parseSkillMcpConfigFromFrontmatter(content) {
|
|
|
107564
107585
|
return;
|
|
107565
107586
|
}
|
|
107566
107587
|
async function loadMcpJsonFromDir(skillDir) {
|
|
107567
|
-
const mcpJsonPath =
|
|
107588
|
+
const mcpJsonPath = join90(skillDir, "mcp.json");
|
|
107568
107589
|
try {
|
|
107569
107590
|
const content = await fs15.readFile(mcpJsonPath, "utf-8");
|
|
107570
107591
|
const parsed = JSON.parse(content);
|
|
@@ -107680,10 +107701,10 @@ async function loadSkillsFromDir(options) {
|
|
|
107680
107701
|
const directories = entries.filter((entry) => !entry.name.startsWith(".") && (entry.isDirectory() || entry.isSymbolicLink()));
|
|
107681
107702
|
const files = entries.filter((entry) => !entry.name.startsWith(".") && !entry.isDirectory() && !entry.isSymbolicLink() && isMarkdownFile(entry));
|
|
107682
107703
|
for (const entry of directories) {
|
|
107683
|
-
const entryPath =
|
|
107704
|
+
const entryPath = join91(options.skillsDir, entry.name);
|
|
107684
107705
|
const resolvedPath = await resolveSymlinkAsync(entryPath);
|
|
107685
107706
|
const dirName = entry.name;
|
|
107686
|
-
const skillMdPath =
|
|
107707
|
+
const skillMdPath = join91(resolvedPath, "SKILL.md");
|
|
107687
107708
|
if (await canAccessFile(skillMdPath)) {
|
|
107688
107709
|
const skill = await loadSkillFromPath({
|
|
107689
107710
|
skillPath: skillMdPath,
|
|
@@ -107697,7 +107718,7 @@ async function loadSkillsFromDir(options) {
|
|
|
107697
107718
|
}
|
|
107698
107719
|
continue;
|
|
107699
107720
|
}
|
|
107700
|
-
const namedSkillMdPath =
|
|
107721
|
+
const namedSkillMdPath = join91(resolvedPath, `${dirName}.md`);
|
|
107701
107722
|
if (await canAccessFile(namedSkillMdPath)) {
|
|
107702
107723
|
const skill = await loadSkillFromPath({
|
|
107703
107724
|
skillPath: namedSkillMdPath,
|
|
@@ -107728,7 +107749,7 @@ async function loadSkillsFromDir(options) {
|
|
|
107728
107749
|
}
|
|
107729
107750
|
}
|
|
107730
107751
|
for (const entry of files) {
|
|
107731
|
-
const entryPath =
|
|
107752
|
+
const entryPath = join91(options.skillsDir, entry.name);
|
|
107732
107753
|
const baseName = inferSkillNameFromFileName(entryPath);
|
|
107733
107754
|
const skill = await loadSkillFromPath({
|
|
107734
107755
|
skillPath: entryPath,
|
|
@@ -107746,7 +107767,7 @@ async function loadSkillsFromDir(options) {
|
|
|
107746
107767
|
|
|
107747
107768
|
// packages/skills-loader-core/src/features/opencode-skill-loader/loader.ts
|
|
107748
107769
|
async function loadUserSkills() {
|
|
107749
|
-
const userSkillsDir =
|
|
107770
|
+
const userSkillsDir = join92(getClaudeConfigDir2(), "skills");
|
|
107750
107771
|
const skills = await loadSkillsFromDir({ skillsDir: userSkillsDir, scope: "user" });
|
|
107751
107772
|
return skillsToCommandDefinitionRecord(skills);
|
|
107752
107773
|
}
|
|
@@ -107771,7 +107792,7 @@ async function loadProjectAgentsSkills(directory) {
|
|
|
107771
107792
|
return skillsToCommandDefinitionRecord(deduplicateSkillsByName(allSkills.flat()));
|
|
107772
107793
|
}
|
|
107773
107794
|
async function loadGlobalAgentsSkills(homeDirectory = getHomeDirectory()) {
|
|
107774
|
-
const agentsGlobalDir =
|
|
107795
|
+
const agentsGlobalDir = join92(homeDirectory, ".agents", "skills");
|
|
107775
107796
|
const skills = await loadSkillsFromDir({ skillsDir: agentsGlobalDir, scope: "user" });
|
|
107776
107797
|
return skillsToCommandDefinitionRecord(skills);
|
|
107777
107798
|
}
|
|
@@ -107826,7 +107847,7 @@ async function discoverSkills(options = {}) {
|
|
|
107826
107847
|
]);
|
|
107827
107848
|
}
|
|
107828
107849
|
async function discoverUserClaudeSkills() {
|
|
107829
|
-
const userSkillsDir =
|
|
107850
|
+
const userSkillsDir = join92(getClaudeConfigDir2(), "skills");
|
|
107830
107851
|
return loadSkillsFromDir({ skillsDir: userSkillsDir, scope: "user" });
|
|
107831
107852
|
}
|
|
107832
107853
|
async function discoverProjectClaudeSkills(directory) {
|
|
@@ -107853,16 +107874,16 @@ async function discoverProjectAgentsSkills(directory) {
|
|
|
107853
107874
|
return deduplicateSkillsByName(allSkills.flat());
|
|
107854
107875
|
}
|
|
107855
107876
|
async function discoverGlobalAgentsSkills(homeDirectory = getHomeDirectory()) {
|
|
107856
|
-
const agentsGlobalDir =
|
|
107877
|
+
const agentsGlobalDir = join92(homeDirectory, ".agents", "skills");
|
|
107857
107878
|
return loadSkillsFromDir({ skillsDir: agentsGlobalDir, scope: "user" });
|
|
107858
107879
|
}
|
|
107859
107880
|
// packages/skills-loader-core/src/features/opencode-skill-loader/merger/builtin-skill-converter.ts
|
|
107860
107881
|
import { existsSync as existsSync72 } from "fs";
|
|
107861
|
-
import { join as
|
|
107882
|
+
import { join as join93 } from "path";
|
|
107862
107883
|
function resolveBuiltinSkillPath(builtin) {
|
|
107863
107884
|
if (builtin.resolvedPath !== undefined)
|
|
107864
107885
|
return builtin.resolvedPath;
|
|
107865
|
-
const sharedSkillPath =
|
|
107886
|
+
const sharedSkillPath = join93(sharedSkillsRootPath(), builtin.name);
|
|
107866
107887
|
return existsSync72(sharedSkillPath) ? sharedSkillPath : undefined;
|
|
107867
107888
|
}
|
|
107868
107889
|
function builtinToLoadedSkill(builtin) {
|
|
@@ -108315,7 +108336,7 @@ playwright-cli close
|
|
|
108315
108336
|
};
|
|
108316
108337
|
// packages/skills-loader-core/src/features/builtin-skills/skill-file-loader.ts
|
|
108317
108338
|
import { readFileSync as readFileSync47 } from "fs";
|
|
108318
|
-
import { join as
|
|
108339
|
+
import { join as join94 } from "path";
|
|
108319
108340
|
init_src();
|
|
108320
108341
|
function createSharedSkillTemplateLoader(readFile = readFileSync47, skillsRootPath = sharedSkillsRootPath()) {
|
|
108321
108342
|
const cache = new Map;
|
|
@@ -108324,7 +108345,7 @@ function createSharedSkillTemplateLoader(readFile = readFileSync47, skillsRootPa
|
|
|
108324
108345
|
if (cached !== undefined)
|
|
108325
108346
|
return cached;
|
|
108326
108347
|
try {
|
|
108327
|
-
const { body } = parseFrontmatter(readFile(
|
|
108348
|
+
const { body } = parseFrontmatter(readFile(join94(skillsRootPath, skillName, "SKILL.md"), "utf8"));
|
|
108328
108349
|
cache.set(skillName, body);
|
|
108329
108350
|
return body;
|
|
108330
108351
|
} catch (error) {
|
|
@@ -109461,7 +109482,7 @@ var gitMasterSkill = {
|
|
|
109461
109482
|
template: GIT_MASTER_TEMPLATE
|
|
109462
109483
|
};
|
|
109463
109484
|
// packages/skills-loader-core/src/features/builtin-skills/skills/dev-browser.ts
|
|
109464
|
-
import { dirname as dirname31, join as
|
|
109485
|
+
import { dirname as dirname31, join as join95 } from "path";
|
|
109465
109486
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
109466
109487
|
var CURRENT_DIR = dirname31(fileURLToPath6(import.meta.url));
|
|
109467
109488
|
var devBrowserSkill = {
|
|
@@ -109681,7 +109702,7 @@ console.log({
|
|
|
109681
109702
|
await client.disconnect();
|
|
109682
109703
|
EOF
|
|
109683
109704
|
\`\`\``,
|
|
109684
|
-
resolvedPath:
|
|
109705
|
+
resolvedPath: join95(CURRENT_DIR, "..", "dev-browser")
|
|
109685
109706
|
};
|
|
109686
109707
|
// packages/skills-loader-core/src/features/builtin-skills/skills/review-work.ts
|
|
109687
109708
|
var reviewWorkSkill = {
|
|
@@ -110623,7 +110644,7 @@ init_src();
|
|
|
110623
110644
|
var import_picomatch2 = __toESM(require_picomatch2(), 1);
|
|
110624
110645
|
import * as fs18 from "fs/promises";
|
|
110625
110646
|
import { homedir as homedir19 } from "os";
|
|
110626
|
-
import { dirname as dirname32, extname, isAbsolute as isAbsolute13, join as
|
|
110647
|
+
import { dirname as dirname32, extname, isAbsolute as isAbsolute13, join as join96, relative as relative13 } from "path";
|
|
110627
110648
|
var MAX_RECURSIVE_DEPTH = 10;
|
|
110628
110649
|
function isHttpUrl(path) {
|
|
110629
110650
|
return path.startsWith("http://") || path.startsWith("https://");
|
|
@@ -110633,12 +110654,12 @@ function toAbsolutePath(path, configDir) {
|
|
|
110633
110654
|
return homedir19();
|
|
110634
110655
|
}
|
|
110635
110656
|
if (path.startsWith("~/")) {
|
|
110636
|
-
return
|
|
110657
|
+
return join96(homedir19(), path.slice(2));
|
|
110637
110658
|
}
|
|
110638
110659
|
if (isAbsolute13(path)) {
|
|
110639
110660
|
return path;
|
|
110640
110661
|
}
|
|
110641
|
-
return
|
|
110662
|
+
return join96(configDir, path);
|
|
110642
110663
|
}
|
|
110643
110664
|
function isMarkdownPath(path) {
|
|
110644
110665
|
return extname(path).toLowerCase() === ".md";
|
|
@@ -110768,7 +110789,7 @@ function readOpencodeConfigSkills(directory) {
|
|
|
110768
110789
|
}
|
|
110769
110790
|
// packages/omo-opencode/src/tools/slashcommand/command-discovery.ts
|
|
110770
110791
|
import { existsSync as existsSync75, readdirSync as readdirSync22, readFileSync as readFileSync50, statSync as statSync12 } from "fs";
|
|
110771
|
-
import { basename as basename13, join as
|
|
110792
|
+
import { basename as basename13, join as join98 } from "path";
|
|
110772
110793
|
init_logger2();
|
|
110773
110794
|
|
|
110774
110795
|
// packages/omo-opencode/src/features/builtin-commands/templates/goal.ts
|
|
@@ -112297,12 +112318,12 @@ function discoverCommandsFromDir(commandsDir, scope, prefix = "") {
|
|
|
112297
112318
|
if (entry.name.startsWith("."))
|
|
112298
112319
|
continue;
|
|
112299
112320
|
const nestedPrefix = prefix ? `${prefix}${NESTED_COMMAND_SEPARATOR}${entry.name}` : entry.name;
|
|
112300
|
-
commands.push(...discoverCommandsFromDir(
|
|
112321
|
+
commands.push(...discoverCommandsFromDir(join98(commandsDir, entry.name), scope, nestedPrefix));
|
|
112301
112322
|
continue;
|
|
112302
112323
|
}
|
|
112303
112324
|
if (!isMarkdownFile(entry))
|
|
112304
112325
|
continue;
|
|
112305
|
-
const commandPath =
|
|
112326
|
+
const commandPath = join98(commandsDir, entry.name);
|
|
112306
112327
|
const baseCommandName = basename13(entry.name, ".md");
|
|
112307
112328
|
const commandName = prefix ? `${prefix}${NESTED_COMMAND_SEPARATOR}${baseCommandName}` : baseCommandName;
|
|
112308
112329
|
try {
|
|
@@ -112361,8 +112382,8 @@ function deduplicateCommandInfosByName(commands) {
|
|
|
112361
112382
|
return deduplicatedCommands;
|
|
112362
112383
|
}
|
|
112363
112384
|
function discoverCommandsSync(directory, options) {
|
|
112364
|
-
const userCommandsDir =
|
|
112365
|
-
const projectCommandsDir =
|
|
112385
|
+
const userCommandsDir = join98(getClaudeConfigDir(), "commands");
|
|
112386
|
+
const projectCommandsDir = join98(directory ?? process.cwd(), ".claude", "commands");
|
|
112366
112387
|
const opencodeGlobalDirs = getOpenCodeCommandDirs({ binary: "opencode" });
|
|
112367
112388
|
const opencodeProjectDirs = findProjectOpencodeCommandDirs(directory ?? process.cwd());
|
|
112368
112389
|
const userCommands = discoverCommandsFromDir(userCommandsDir, "user");
|
|
@@ -113063,7 +113084,7 @@ to continue: task(task_id="${taskId}", load_skills=[], run_in_background=true, p
|
|
|
113063
113084
|
// packages/omo-senpi/src/components/agent-home/resolve-agent-home.ts
|
|
113064
113085
|
import { existsSync as existsSync76 } from "fs";
|
|
113065
113086
|
import { homedir as homedir20 } from "os";
|
|
113066
|
-
import { join as
|
|
113087
|
+
import { join as join99, resolve as resolve20 } from "path";
|
|
113067
113088
|
var AGENT_DIR_ENV_NAMES = [
|
|
113068
113089
|
"OMO_CODING_AGENT_DIR",
|
|
113069
113090
|
"SENPI_CODING_AGENT_DIR",
|
|
@@ -113077,16 +113098,16 @@ function resolveAgentHome(options) {
|
|
|
113077
113098
|
if (configured)
|
|
113078
113099
|
return resolve20(configured);
|
|
113079
113100
|
}
|
|
113080
|
-
const brandedHome =
|
|
113081
|
-
const canonical =
|
|
113082
|
-
if (exists(
|
|
113101
|
+
const brandedHome = join99(homeDir, ".omo");
|
|
113102
|
+
const canonical = join99(brandedHome, "agent");
|
|
113103
|
+
if (exists(join99(canonical, AGENT_HOME_SENTINEL)))
|
|
113083
113104
|
return canonical;
|
|
113084
|
-
if (exists(
|
|
113105
|
+
if (exists(join99(brandedHome, AGENT_HOME_SENTINEL)))
|
|
113085
113106
|
return brandedHome;
|
|
113086
|
-
return
|
|
113107
|
+
return join99(homeDir, ".senpi", "agent");
|
|
113087
113108
|
}
|
|
113088
113109
|
function resolveAgentSessionsDirectory(options) {
|
|
113089
|
-
return
|
|
113110
|
+
return join99(resolveAgentHome(options), "sessions");
|
|
113090
113111
|
}
|
|
113091
113112
|
|
|
113092
113113
|
// packages/omo-opencode/src/hooks/ulw-execute/ulw-execute-hook.ts
|
|
@@ -113205,7 +113226,7 @@ ${completionInstruction}`;
|
|
|
113205
113226
|
// packages/omo-opencode/src/hooks/ulw-execute/notepad-scaffold.ts
|
|
113206
113227
|
init_logger2();
|
|
113207
113228
|
import { mkdirSync as mkdirSync19, writeFileSync as writeFileSync20 } from "fs";
|
|
113208
|
-
import { join as
|
|
113229
|
+
import { join as join100 } from "path";
|
|
113209
113230
|
var NOTEPAD_FILES = [
|
|
113210
113231
|
"learnings.md",
|
|
113211
113232
|
"decisions.md",
|
|
@@ -113239,14 +113260,14 @@ ${NOTEPAD_FOOTER}
|
|
|
113239
113260
|
}
|
|
113240
113261
|
function ensureNotepadScaffold(params) {
|
|
113241
113262
|
const { directory, planName, timestamp = new Date().toISOString() } = params;
|
|
113242
|
-
const notepadDir =
|
|
113263
|
+
const notepadDir = join100(directory, ".omo", "notepads", planName);
|
|
113243
113264
|
mkdirSync19(notepadDir, { recursive: true });
|
|
113244
113265
|
const created = [];
|
|
113245
113266
|
const skipped = [];
|
|
113246
113267
|
for (const fileName of NOTEPAD_FILES) {
|
|
113247
113268
|
const header = buildHeader(fileName, planName, timestamp);
|
|
113248
113269
|
try {
|
|
113249
|
-
writeFileSync20(
|
|
113270
|
+
writeFileSync20(join100(notepadDir, fileName), header, { flag: "wx" });
|
|
113250
113271
|
created.push(fileName);
|
|
113251
113272
|
} catch (err) {
|
|
113252
113273
|
if (err.code === "EEXIST") {
|
|
@@ -114560,7 +114581,7 @@ async function isSessionInBoulderLineage(input) {
|
|
|
114560
114581
|
|
|
114561
114582
|
// packages/omo-opencode/src/hooks/atlas/session-last-agent.ts
|
|
114562
114583
|
import { readFileSync as readFileSync51, readdirSync as readdirSync23 } from "fs";
|
|
114563
|
-
import { join as
|
|
114584
|
+
import { join as join101 } from "path";
|
|
114564
114585
|
var defaultSessionLastAgentDeps = {
|
|
114565
114586
|
getMessageDir,
|
|
114566
114587
|
isSqliteBackend,
|
|
@@ -114620,7 +114641,7 @@ async function getLastAgentFromSession(sessionID, client, deps = {}) {
|
|
|
114620
114641
|
try {
|
|
114621
114642
|
const messages = readdirSync23(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
|
|
114622
114643
|
try {
|
|
114623
|
-
const content = readFileSync51(
|
|
114644
|
+
const content = readFileSync51(join101(messageDir, fileName), "utf-8");
|
|
114624
114645
|
const parsed = JSON.parse(content);
|
|
114625
114646
|
return {
|
|
114626
114647
|
fileName,
|
|
@@ -120249,7 +120270,7 @@ function createRuntimeFallbackHook(ctx, options, factoryOverrides = {}) {
|
|
|
120249
120270
|
}
|
|
120250
120271
|
// packages/omo-opencode/src/hooks/write-existing-file-guard/hook.ts
|
|
120251
120272
|
import { existsSync as existsSync82, realpathSync as realpathSync15 } from "fs";
|
|
120252
|
-
import { basename as basename14, dirname as dirname34, isAbsolute as isAbsolute15, join as
|
|
120273
|
+
import { basename as basename14, dirname as dirname34, isAbsolute as isAbsolute15, join as join102, normalize as normalize2, relative as relative15, resolve as resolve24 } from "path";
|
|
120253
120274
|
|
|
120254
120275
|
// packages/omo-opencode/src/hooks/write-existing-file-guard/tool-execute-before-handler.ts
|
|
120255
120276
|
import { existsSync as existsSync81 } from "fs";
|
|
@@ -120438,7 +120459,7 @@ function toCanonicalPath2(absolutePath) {
|
|
|
120438
120459
|
} else {
|
|
120439
120460
|
const absoluteDir = dirname34(absolutePath);
|
|
120440
120461
|
const resolvedDir = existsSync82(absoluteDir) ? realpathSync15.native(absoluteDir) : absoluteDir;
|
|
120441
|
-
canonicalPath =
|
|
120462
|
+
canonicalPath = join102(resolvedDir, basename14(absolutePath));
|
|
120442
120463
|
}
|
|
120443
120464
|
return normalize2(canonicalPath);
|
|
120444
120465
|
}
|
|
@@ -123200,12 +123221,12 @@ init_plugin_identity();
|
|
|
123200
123221
|
|
|
123201
123222
|
// packages/omo-opencode/src/hooks/legacy-plugin-toast/auto-migrate.ts
|
|
123202
123223
|
import { existsSync as existsSync83, readFileSync as readFileSync55 } from "fs";
|
|
123203
|
-
import { join as
|
|
123224
|
+
import { join as join103 } from "path";
|
|
123204
123225
|
init_plugin_identity();
|
|
123205
123226
|
function detectOpenCodeConfigPath(overrideConfigDir) {
|
|
123206
123227
|
if (overrideConfigDir) {
|
|
123207
|
-
const jsoncPath =
|
|
123208
|
-
const jsonPath =
|
|
123228
|
+
const jsoncPath = join103(overrideConfigDir, "opencode.jsonc");
|
|
123229
|
+
const jsonPath = join103(overrideConfigDir, "opencode.json");
|
|
123209
123230
|
if (existsSync83(jsoncPath))
|
|
123210
123231
|
return jsoncPath;
|
|
123211
123232
|
if (existsSync83(jsonPath))
|
|
@@ -123368,7 +123389,7 @@ function decideNativeEditionNudge(input) {
|
|
|
123368
123389
|
// packages/omo-opencode/src/hooks/native-edition-nudge/hook.ts
|
|
123369
123390
|
import { existsSync as existsSync84 } from "fs";
|
|
123370
123391
|
import { homedir as homedir21 } from "os";
|
|
123371
|
-
import { join as
|
|
123392
|
+
import { join as join105 } from "path";
|
|
123372
123393
|
|
|
123373
123394
|
// packages/omo-opencode/src/cli/native-edition-hint.ts
|
|
123374
123395
|
var NATIVE_EDITION_INSTALL_COMMAND = "bun add -g omo-ai@beta";
|
|
@@ -123378,7 +123399,7 @@ init_logger2();
|
|
|
123378
123399
|
|
|
123379
123400
|
// packages/omo-opencode/src/hooks/native-edition-nudge/state.ts
|
|
123380
123401
|
import { mkdirSync as mkdirSync20, readFileSync as readFileSync56, unlinkSync as unlinkSync15, writeFileSync as writeFileSync21 } from "fs";
|
|
123381
|
-
import { join as
|
|
123402
|
+
import { join as join104 } from "path";
|
|
123382
123403
|
var NUDGE_STATE_FILE = "native-nudge.json";
|
|
123383
123404
|
function isDecision(value) {
|
|
123384
123405
|
return value === "none" || value === "snoozed" || value === "never" || value === "migrated";
|
|
@@ -123412,7 +123433,7 @@ function parseNudgeState(raw) {
|
|
|
123412
123433
|
};
|
|
123413
123434
|
}
|
|
123414
123435
|
function createNudgeStateStore(stateDir) {
|
|
123415
|
-
const path =
|
|
123436
|
+
const path = join104(stateDir, NUDGE_STATE_FILE);
|
|
123416
123437
|
return {
|
|
123417
123438
|
read: () => {
|
|
123418
123439
|
let raw;
|
|
@@ -123434,7 +123455,7 @@ function createNudgeStateStore(stateDir) {
|
|
|
123434
123455
|
}
|
|
123435
123456
|
},
|
|
123436
123457
|
probeWritable: () => {
|
|
123437
|
-
const probe =
|
|
123458
|
+
const probe = join104(stateDir, `.${NUDGE_STATE_FILE}.probe`);
|
|
123438
123459
|
try {
|
|
123439
123460
|
mkdirSync20(stateDir, { recursive: true });
|
|
123440
123461
|
writeFileSync21(probe, "", { mode: 384 });
|
|
@@ -123454,10 +123475,10 @@ var NATIVE_NUDGE_TOAST_TITLE = "Try OmO Native: no host app needed";
|
|
|
123454
123475
|
var NATIVE_NUDGE_TOAST_MESSAGE = `Same agent, one binary, nothing else to keep updated.
|
|
123455
123476
|
Install: ${NATIVE_EDITION_INSTALL_COMMAND}`;
|
|
123456
123477
|
function nativeEditionStateDir() {
|
|
123457
|
-
return
|
|
123478
|
+
return join105(getUserConfigDir(), "oh-my-openagent");
|
|
123458
123479
|
}
|
|
123459
123480
|
function detectNativeEdition() {
|
|
123460
|
-
return existsSync84(
|
|
123481
|
+
return existsSync84(join105(homedir21(), ".omo", "agent"));
|
|
123461
123482
|
}
|
|
123462
123483
|
function defaultInteractive() {
|
|
123463
123484
|
if (process.env["CI"] !== undefined && process.env["CI"] !== "")
|
|
@@ -123964,18 +123985,18 @@ tool.schema = z53;
|
|
|
123964
123985
|
// packages/omo-opencode/src/shared/ripgrep-cli.ts
|
|
123965
123986
|
import { spawnSync as spawnSync2 } from "child_process";
|
|
123966
123987
|
import { existsSync as existsSync87 } from "fs";
|
|
123967
|
-
import { dirname as dirname35, join as
|
|
123988
|
+
import { dirname as dirname35, join as join107 } from "path";
|
|
123968
123989
|
|
|
123969
123990
|
// packages/omo-opencode/src/tools/grep/downloader.ts
|
|
123970
123991
|
import { existsSync as existsSync86, readdirSync as readdirSync24 } from "fs";
|
|
123971
|
-
import { join as
|
|
123992
|
+
import { join as join106 } from "path";
|
|
123972
123993
|
init_plugin_identity();
|
|
123973
123994
|
function findFileRecursive(dir, filename) {
|
|
123974
123995
|
try {
|
|
123975
123996
|
const entries = readdirSync24(dir, { withFileTypes: true, recursive: true });
|
|
123976
123997
|
for (const entry of entries) {
|
|
123977
123998
|
if (entry.isFile() && entry.name === filename) {
|
|
123978
|
-
return
|
|
123999
|
+
return join106(entry.parentPath ?? dir, entry.name);
|
|
123979
124000
|
}
|
|
123980
124001
|
}
|
|
123981
124002
|
} catch (error) {
|
|
@@ -123999,11 +124020,11 @@ function getPlatformKey() {
|
|
|
123999
124020
|
}
|
|
124000
124021
|
function getInstallDir() {
|
|
124001
124022
|
const homeDir = process.env.HOME || process.env.USERPROFILE || ".";
|
|
124002
|
-
return
|
|
124023
|
+
return join106(homeDir, ".cache", CACHE_DIR_NAME, "bin");
|
|
124003
124024
|
}
|
|
124004
124025
|
function getRgPath() {
|
|
124005
124026
|
const isWindows = process.platform === "win32";
|
|
124006
|
-
return
|
|
124027
|
+
return join106(getInstallDir(), isWindows ? "rg.exe" : "rg");
|
|
124007
124028
|
}
|
|
124008
124029
|
async function extractTarGz2(archivePath, destDir) {
|
|
124009
124030
|
const platformKey = getPlatformKey();
|
|
@@ -124020,7 +124041,7 @@ async function extractZip2(archivePath, destDir) {
|
|
|
124020
124041
|
const binaryName = process.platform === "win32" ? "rg.exe" : "rg";
|
|
124021
124042
|
const foundPath = findFileRecursive(destDir, binaryName);
|
|
124022
124043
|
if (foundPath) {
|
|
124023
|
-
const destPath =
|
|
124044
|
+
const destPath = join106(destDir, binaryName);
|
|
124024
124045
|
if (foundPath !== destPath) {
|
|
124025
124046
|
const { renameSync } = await import("fs");
|
|
124026
124047
|
renameSync(foundPath, destPath);
|
|
@@ -124041,7 +124062,7 @@ async function downloadAndInstallRipgrep() {
|
|
|
124041
124062
|
ensureCacheDir(installDir);
|
|
124042
124063
|
const filename = `ripgrep-${RG_VERSION}-${config.platform}.${config.extension}`;
|
|
124043
124064
|
const url = `https://github.com/BurntSushi/ripgrep/releases/download/${RG_VERSION}/${filename}`;
|
|
124044
|
-
const archivePath =
|
|
124065
|
+
const archivePath = join106(installDir, filename);
|
|
124045
124066
|
try {
|
|
124046
124067
|
await downloadArchive(url, archivePath);
|
|
124047
124068
|
if (config.extension === "tar.gz") {
|
|
@@ -124106,12 +124127,12 @@ function getOpenCodeBundledRg() {
|
|
|
124106
124127
|
const isWindows = process.platform === "win32";
|
|
124107
124128
|
const rgName = isWindows ? "rg.exe" : "rg";
|
|
124108
124129
|
const candidates = [
|
|
124109
|
-
|
|
124110
|
-
|
|
124111
|
-
|
|
124112
|
-
|
|
124113
|
-
|
|
124114
|
-
|
|
124130
|
+
join107(getOpenCodeCacheDir(), "bin", rgName),
|
|
124131
|
+
join107(getDataDir(), "opencode", "bin", rgName),
|
|
124132
|
+
join107(execDir, rgName),
|
|
124133
|
+
join107(execDir, "bin", rgName),
|
|
124134
|
+
join107(execDir, "..", "bin", rgName),
|
|
124135
|
+
join107(execDir, "..", "libexec", rgName)
|
|
124115
124136
|
];
|
|
124116
124137
|
for (const candidate of candidates) {
|
|
124117
124138
|
if (existsSync87(candidate)) {
|
|
@@ -125288,9 +125309,9 @@ function createSkillTool(options) {
|
|
|
125288
125309
|
}
|
|
125289
125310
|
var skill = createSkillTool({ directory: process.cwd() });
|
|
125290
125311
|
// packages/omo-opencode/src/tools/session-manager/constants.ts
|
|
125291
|
-
import { join as
|
|
125292
|
-
var TODO_DIR2 =
|
|
125293
|
-
var TRANSCRIPT_DIR2 =
|
|
125312
|
+
import { join as join108 } from "path";
|
|
125313
|
+
var TODO_DIR2 = join108(getClaudeConfigDir(), "todos");
|
|
125314
|
+
var TRANSCRIPT_DIR2 = join108(getClaudeConfigDir(), "transcripts");
|
|
125294
125315
|
var SESSION_LIST_DESCRIPTION = `List all OpenCode sessions with optional filtering.
|
|
125295
125316
|
|
|
125296
125317
|
Returns a list of available session IDs with metadata including message count, date range, and agents used.
|
|
@@ -125365,7 +125386,7 @@ Has Transcript: Yes (234 entries)`;
|
|
|
125365
125386
|
// packages/omo-opencode/src/tools/session-manager/file-storage.ts
|
|
125366
125387
|
import { existsSync as existsSync88 } from "fs";
|
|
125367
125388
|
import { readdir as readdir6, readFile as readFile8 } from "fs/promises";
|
|
125368
|
-
import { join as
|
|
125389
|
+
import { join as join109 } from "path";
|
|
125369
125390
|
|
|
125370
125391
|
// packages/omo-opencode/src/tools/session-manager/directory-filter.ts
|
|
125371
125392
|
import { normalize as normalize4, parse as parse3, sep as sep3 } from "path";
|
|
@@ -125397,13 +125418,13 @@ async function getFileMainSessions(directory) {
|
|
|
125397
125418
|
for (const projectDir of projectDirs) {
|
|
125398
125419
|
if (!projectDir.isDirectory())
|
|
125399
125420
|
continue;
|
|
125400
|
-
const projectPath =
|
|
125421
|
+
const projectPath = join109(SESSION_STORAGE, projectDir.name);
|
|
125401
125422
|
const sessionFiles = await readdir6(projectPath);
|
|
125402
125423
|
for (const file of sessionFiles) {
|
|
125403
125424
|
if (!file.endsWith(".json"))
|
|
125404
125425
|
continue;
|
|
125405
125426
|
try {
|
|
125406
|
-
const content = await readFile8(
|
|
125427
|
+
const content = await readFile8(join109(projectPath, file), "utf-8");
|
|
125407
125428
|
const meta = JSON.parse(content);
|
|
125408
125429
|
if (meta.parentID)
|
|
125409
125430
|
continue;
|
|
@@ -125432,7 +125453,7 @@ async function getFileAllSessions() {
|
|
|
125432
125453
|
for (const entry of entries) {
|
|
125433
125454
|
if (!entry.isDirectory())
|
|
125434
125455
|
continue;
|
|
125435
|
-
const sessionPath =
|
|
125456
|
+
const sessionPath = join109(dir, entry.name);
|
|
125436
125457
|
const files = await readdir6(sessionPath);
|
|
125437
125458
|
if (files.some((file) => file.endsWith(".json"))) {
|
|
125438
125459
|
sessions.push(entry.name);
|
|
@@ -125462,7 +125483,7 @@ async function getFileSessionMessages(sessionID) {
|
|
|
125462
125483
|
if (!file.endsWith(".json"))
|
|
125463
125484
|
continue;
|
|
125464
125485
|
try {
|
|
125465
|
-
const content = await readFile8(
|
|
125486
|
+
const content = await readFile8(join109(messageDir, file), "utf-8");
|
|
125466
125487
|
const meta = JSON.parse(content);
|
|
125467
125488
|
const parts = await readParts2(meta.id);
|
|
125468
125489
|
messages.push({
|
|
@@ -125490,7 +125511,7 @@ async function getFileSessionMessages(sessionID) {
|
|
|
125490
125511
|
});
|
|
125491
125512
|
}
|
|
125492
125513
|
async function readParts2(messageID) {
|
|
125493
|
-
const partDir =
|
|
125514
|
+
const partDir = join109(PART_STORAGE, messageID);
|
|
125494
125515
|
if (!existsSync88(partDir))
|
|
125495
125516
|
return [];
|
|
125496
125517
|
const parts = [];
|
|
@@ -125500,7 +125521,7 @@ async function readParts2(messageID) {
|
|
|
125500
125521
|
if (!file.endsWith(".json"))
|
|
125501
125522
|
continue;
|
|
125502
125523
|
try {
|
|
125503
|
-
const content = await readFile8(
|
|
125524
|
+
const content = await readFile8(join109(partDir, file), "utf-8");
|
|
125504
125525
|
parts.push(JSON.parse(content));
|
|
125505
125526
|
} catch (error) {
|
|
125506
125527
|
ignoreFileStorageError(error);
|
|
@@ -125521,7 +125542,7 @@ async function getFileSessionTodos(sessionID) {
|
|
|
125521
125542
|
const todoFiles = allFiles.filter((file) => file === `${sessionID}.json`);
|
|
125522
125543
|
for (const file of todoFiles) {
|
|
125523
125544
|
try {
|
|
125524
|
-
const content = await readFile8(
|
|
125545
|
+
const content = await readFile8(join109(TODO_DIR2, file), "utf-8");
|
|
125525
125546
|
const data = JSON.parse(content);
|
|
125526
125547
|
if (!Array.isArray(data))
|
|
125527
125548
|
continue;
|
|
@@ -125545,7 +125566,7 @@ async function getFileSessionTodos(sessionID) {
|
|
|
125545
125566
|
async function getFileSessionTranscript(sessionID) {
|
|
125546
125567
|
if (!existsSync88(TRANSCRIPT_DIR2))
|
|
125547
125568
|
return 0;
|
|
125548
|
-
const transcriptFile =
|
|
125569
|
+
const transcriptFile = join109(TRANSCRIPT_DIR2, `${sessionID}.jsonl`);
|
|
125549
125570
|
if (!existsSync88(transcriptFile))
|
|
125550
125571
|
return 0;
|
|
125551
125572
|
try {
|
|
@@ -127409,22 +127430,22 @@ Other built-in agents, custom agents, and task categories are intentionally not
|
|
|
127409
127430
|
Pass \`session_id=<id>\` to continue previous agent with full context. Nested subagent depth is tracked automatically and blocked past the configured limit. Prompts MUST be in English. Use \`background_output\` for async results.`;
|
|
127410
127431
|
// packages/claude-code-compat-core/src/features/claude-code-agent-loader/loader.ts
|
|
127411
127432
|
import { existsSync as existsSync93, readdirSync as readdirSync25 } from "fs";
|
|
127412
|
-
import { join as
|
|
127433
|
+
import { join as join115 } from "path";
|
|
127413
127434
|
|
|
127414
127435
|
// packages/claude-code-compat-core/src/shared/claude-config-dir.ts
|
|
127415
127436
|
import { homedir as homedir22 } from "os";
|
|
127416
|
-
import { join as
|
|
127437
|
+
import { join as join110 } from "path";
|
|
127417
127438
|
function getClaudeConfigDir3() {
|
|
127418
127439
|
const envConfigDir = process.env.CLAUDE_CONFIG_DIR;
|
|
127419
127440
|
if (envConfigDir) {
|
|
127420
127441
|
return envConfigDir;
|
|
127421
127442
|
}
|
|
127422
|
-
return
|
|
127443
|
+
return join110(process.env.HOME || process.env.USERPROFILE || homedir22(), ".claude");
|
|
127423
127444
|
}
|
|
127424
127445
|
// packages/claude-code-compat-core/src/shared/opencode-config-dir.ts
|
|
127425
127446
|
import { existsSync as existsSync89, realpathSync as realpathSync16 } from "fs";
|
|
127426
127447
|
import { homedir as homedir23 } from "os";
|
|
127427
|
-
import { join as
|
|
127448
|
+
import { join as join111, posix as posix10, resolve as resolve29, win32 as win3211 } from "path";
|
|
127428
127449
|
var TAURI_APP_IDENTIFIER3 = "ai.opencode.desktop";
|
|
127429
127450
|
var TAURI_APP_IDENTIFIER_DEV3 = "ai.opencode.desktop.dev";
|
|
127430
127451
|
function isDevBuild3(version) {
|
|
@@ -127436,15 +127457,15 @@ function getTauriConfigDir3(identifier) {
|
|
|
127436
127457
|
const platform = process.platform;
|
|
127437
127458
|
switch (platform) {
|
|
127438
127459
|
case "darwin":
|
|
127439
|
-
return
|
|
127460
|
+
return join111(homedir23(), "Library", "Application Support", identifier);
|
|
127440
127461
|
case "win32": {
|
|
127441
|
-
const appData = process.env.APPDATA ||
|
|
127462
|
+
const appData = process.env.APPDATA || join111(homedir23(), "AppData", "Roaming");
|
|
127442
127463
|
return win3211.join(appData, identifier);
|
|
127443
127464
|
}
|
|
127444
127465
|
case "linux":
|
|
127445
127466
|
default: {
|
|
127446
|
-
const xdgConfig = process.env.XDG_CONFIG_HOME ||
|
|
127447
|
-
return
|
|
127467
|
+
const xdgConfig = process.env.XDG_CONFIG_HOME || join111(homedir23(), ".config");
|
|
127468
|
+
return join111(xdgConfig, identifier);
|
|
127448
127469
|
}
|
|
127449
127470
|
}
|
|
127450
127471
|
}
|
|
@@ -127487,8 +127508,8 @@ function getWslLinuxHomeDir3(windowsConfigRoot) {
|
|
|
127487
127508
|
function getCliDefaultConfigDir3() {
|
|
127488
127509
|
const envXdgConfig = process.env.XDG_CONFIG_HOME?.trim();
|
|
127489
127510
|
const shouldIgnoreWindowsXdg = envXdgConfig !== undefined && envXdgConfig.length > 0 && isWslEnvironment3() && isWindowsUserConfigRoot3(envXdgConfig);
|
|
127490
|
-
const xdgConfig = shouldIgnoreWindowsXdg ? posix10.join(getWslLinuxHomeDir3(envXdgConfig) ?? "/home", ".config") : envXdgConfig ||
|
|
127491
|
-
const configDir = isWslEnvironment3() ? posix10.join(xdgConfig, "opencode") :
|
|
127511
|
+
const xdgConfig = shouldIgnoreWindowsXdg ? posix10.join(getWslLinuxHomeDir3(envXdgConfig) ?? "/home", ".config") : envXdgConfig || join111(homedir23(), ".config");
|
|
127512
|
+
const configDir = isWslEnvironment3() ? posix10.join(xdgConfig, "opencode") : join111(xdgConfig, "opencode");
|
|
127492
127513
|
return resolveConfigPath3(configDir);
|
|
127493
127514
|
}
|
|
127494
127515
|
function getCliCustomConfigDir3() {
|
|
@@ -127521,8 +127542,8 @@ function getOpenCodeConfigDir3(options) {
|
|
|
127521
127542
|
const tauriDir = process.platform === "win32" ? win3211.isAbsolute(tauriDirBase) ? win3211.normalize(tauriDirBase) : win3211.resolve(tauriDirBase) : resolveConfigPath3(tauriDirBase);
|
|
127522
127543
|
if (checkExisting) {
|
|
127523
127544
|
const legacyDir = getCliConfigDir3();
|
|
127524
|
-
const legacyConfig =
|
|
127525
|
-
const legacyConfigC =
|
|
127545
|
+
const legacyConfig = join111(legacyDir, "opencode.json");
|
|
127546
|
+
const legacyConfigC = join111(legacyDir, "opencode.jsonc");
|
|
127526
127547
|
if (existsSync89(legacyConfig) || existsSync89(legacyConfigC)) {
|
|
127527
127548
|
return legacyDir;
|
|
127528
127549
|
}
|
|
@@ -127533,10 +127554,10 @@ function getOpenCodeConfigDir3(options) {
|
|
|
127533
127554
|
init_src();
|
|
127534
127555
|
// packages/claude-code-compat-core/src/shared/resolve-agent-definition-paths.ts
|
|
127535
127556
|
import { homedir as homedir24 } from "os";
|
|
127536
|
-
import { isAbsolute as isAbsolute16, join as
|
|
127557
|
+
import { isAbsolute as isAbsolute16, join as join112, resolve as resolve30 } from "path";
|
|
127537
127558
|
function resolveAgentDefinitionPaths(paths, baseDir, containmentDir) {
|
|
127538
127559
|
return paths.flatMap((p) => {
|
|
127539
|
-
const expanded = p.startsWith("~/") ?
|
|
127560
|
+
const expanded = p.startsWith("~/") ? join112(homedir24(), p.slice(2)) : p;
|
|
127540
127561
|
const resolved = isAbsolute16(expanded) ? expanded : resolve30(baseDir, expanded);
|
|
127541
127562
|
if (containmentDir !== null && !isWithinProject(resolved, containmentDir)) {
|
|
127542
127563
|
log4(`agent_definitions path rejected (outside project boundary): ${p} -> ${resolved}`);
|
|
@@ -127564,7 +127585,7 @@ var EXCLUDED_DIR_NAMES2 = [
|
|
|
127564
127585
|
];
|
|
127565
127586
|
var EXCLUDED_DIRS3 = Object.freeze(new Set(EXCLUDED_DIR_NAMES2));
|
|
127566
127587
|
// packages/claude-code-compat-core/src/shared/opencode-command-dirs.ts
|
|
127567
|
-
import { basename as basename15, dirname as dirname38, join as
|
|
127588
|
+
import { basename as basename15, dirname as dirname38, join as join113 } from "path";
|
|
127568
127589
|
function getParentOpencodeConfigDir3(configDir) {
|
|
127569
127590
|
const parentDir = dirname38(configDir);
|
|
127570
127591
|
if (basename15(parentDir) !== "profiles") {
|
|
@@ -127578,9 +127599,9 @@ function getOpenCodeCommandDirs2(options) {
|
|
|
127578
127599
|
...configDirs.flatMap((configDir) => {
|
|
127579
127600
|
const parentConfigDir = getParentOpencodeConfigDir3(configDir);
|
|
127580
127601
|
return [
|
|
127581
|
-
|
|
127582
|
-
|
|
127583
|
-
...parentConfigDir ? [
|
|
127602
|
+
join113(configDir, "commands"),
|
|
127603
|
+
join113(configDir, "command"),
|
|
127604
|
+
...parentConfigDir ? [join113(parentConfigDir, "commands"), join113(parentConfigDir, "command")] : []
|
|
127584
127605
|
];
|
|
127585
127606
|
})
|
|
127586
127607
|
]));
|
|
@@ -127588,7 +127609,7 @@ function getOpenCodeCommandDirs2(options) {
|
|
|
127588
127609
|
// packages/claude-code-compat-core/src/shared/project-discovery-dirs.ts
|
|
127589
127610
|
import { execFileSync as execFileSync6 } from "child_process";
|
|
127590
127611
|
import { existsSync as existsSync90, realpathSync as realpathSync17 } from "fs";
|
|
127591
|
-
import { dirname as dirname39, join as
|
|
127612
|
+
import { dirname as dirname39, join as join114, resolve as resolve31, win32 as win3212 } from "path";
|
|
127592
127613
|
var worktreePathCache3 = new Map;
|
|
127593
127614
|
function normalizePath6(path) {
|
|
127594
127615
|
const resolvedPath = process.platform !== "win32" && win3212.isAbsolute(path) ? path : resolve31(path);
|
|
@@ -127647,7 +127668,7 @@ function detectWorktreePath4(directory) {
|
|
|
127647
127668
|
function findGitMarkerAncestor(directory) {
|
|
127648
127669
|
let currentDirectory = normalizePath6(directory);
|
|
127649
127670
|
while (true) {
|
|
127650
|
-
if (existsSync90(
|
|
127671
|
+
if (existsSync90(join114(currentDirectory, ".git"))) {
|
|
127651
127672
|
return currentDirectory;
|
|
127652
127673
|
}
|
|
127653
127674
|
const parentDirectory = dirname39(currentDirectory);
|
|
@@ -127665,7 +127686,7 @@ function findAncestorDirectories3(startDirectory, targetPaths, stopDirectory) {
|
|
|
127665
127686
|
const stopDirectoryKey = resolvedStopDirectory ? pathKey4(resolvedStopDirectory) : undefined;
|
|
127666
127687
|
while (true) {
|
|
127667
127688
|
for (const targetPath of targetPaths) {
|
|
127668
|
-
const candidateDirectory =
|
|
127689
|
+
const candidateDirectory = join114(currentDirectory, ...targetPath);
|
|
127669
127690
|
if (!existsSync90(candidateDirectory)) {
|
|
127670
127691
|
continue;
|
|
127671
127692
|
}
|
|
@@ -127813,7 +127834,7 @@ function loadAgentsFromDir(agentsDir, scope, anthropicProvider) {
|
|
|
127813
127834
|
for (const entry of entries) {
|
|
127814
127835
|
if (!isMarkdownFile(entry))
|
|
127815
127836
|
continue;
|
|
127816
|
-
const agentPath =
|
|
127837
|
+
const agentPath = join115(agentsDir, entry.name);
|
|
127817
127838
|
const agent = parseMarkdownAgentFile(agentPath, scope, anthropicProvider);
|
|
127818
127839
|
if (agent) {
|
|
127819
127840
|
agents.push(agent);
|
|
@@ -127822,7 +127843,7 @@ function loadAgentsFromDir(agentsDir, scope, anthropicProvider) {
|
|
|
127822
127843
|
return agents;
|
|
127823
127844
|
}
|
|
127824
127845
|
function loadUserAgents(anthropicProvider) {
|
|
127825
|
-
const userAgentsDir =
|
|
127846
|
+
const userAgentsDir = join115(getClaudeConfigDir3(), "agents");
|
|
127826
127847
|
const agents = loadAgentsFromDir(userAgentsDir, "user", anthropicProvider);
|
|
127827
127848
|
const result = Object.create(null);
|
|
127828
127849
|
for (const agent of agents) {
|
|
@@ -127831,7 +127852,7 @@ function loadUserAgents(anthropicProvider) {
|
|
|
127831
127852
|
return result;
|
|
127832
127853
|
}
|
|
127833
127854
|
function loadProjectAgents(directory, anthropicProvider) {
|
|
127834
|
-
const projectAgentsDir =
|
|
127855
|
+
const projectAgentsDir = join115(directory ?? process.cwd(), ".claude", "agents");
|
|
127835
127856
|
const agents = loadAgentsFromDir(projectAgentsDir, "project", anthropicProvider);
|
|
127836
127857
|
const result = Object.create(null);
|
|
127837
127858
|
for (const agent of agents) {
|
|
@@ -127843,7 +127864,7 @@ function loadOpencodeGlobalAgents() {
|
|
|
127843
127864
|
const result = Object.create(null);
|
|
127844
127865
|
const configDirs = getOpenCodeConfigDirs3({ binary: "opencode" });
|
|
127845
127866
|
for (const configDir of configDirs) {
|
|
127846
|
-
const opencodeAgentsDir =
|
|
127867
|
+
const opencodeAgentsDir = join115(configDir, "agents");
|
|
127847
127868
|
const agents = loadAgentsFromDir(opencodeAgentsDir, "opencode");
|
|
127848
127869
|
for (const agent of agents) {
|
|
127849
127870
|
if (!(agent.name in result)) {
|
|
@@ -127854,7 +127875,7 @@ function loadOpencodeGlobalAgents() {
|
|
|
127854
127875
|
return result;
|
|
127855
127876
|
}
|
|
127856
127877
|
function loadOpencodeProjectAgents(directory) {
|
|
127857
|
-
const opencodeProjectDir =
|
|
127878
|
+
const opencodeProjectDir = join115(directory ?? process.cwd(), ".opencode", "agents");
|
|
127858
127879
|
const agents = loadAgentsFromDir(opencodeProjectDir, "opencode-project");
|
|
127859
127880
|
const result = Object.create(null);
|
|
127860
127881
|
for (const agent of agents) {
|
|
@@ -128684,7 +128705,7 @@ import { pathToFileURL } from "url";
|
|
|
128684
128705
|
import * as childProcess2 from "child_process";
|
|
128685
128706
|
import { existsSync as existsSync95, mkdtempSync, readFileSync as readFileSync61, rmSync as rmSync5, unlinkSync as unlinkSync16, writeFileSync as writeFileSync23 } from "fs";
|
|
128686
128707
|
import { tmpdir as tmpdir7 } from "os";
|
|
128687
|
-
import { dirname as dirname41, join as
|
|
128708
|
+
import { dirname as dirname41, join as join117 } from "path";
|
|
128688
128709
|
var SUPPORTED_FORMATS = new Set([
|
|
128689
128710
|
"image/jpeg",
|
|
128690
128711
|
"image/png",
|
|
@@ -128735,8 +128756,8 @@ function convertImageToJpeg(inputPath, mimeType) {
|
|
|
128735
128756
|
if (!existsSync95(inputPath)) {
|
|
128736
128757
|
throw new Error(`File not found: ${inputPath}`);
|
|
128737
128758
|
}
|
|
128738
|
-
const tempDir = mkdtempSync(
|
|
128739
|
-
const outputPath =
|
|
128759
|
+
const tempDir = mkdtempSync(join117(tmpdir7(), "opencode-img-"));
|
|
128760
|
+
const outputPath = join117(tempDir, "converted.jpg");
|
|
128740
128761
|
log2(`[image-converter] Converting ${mimeType} to JPEG: ${inputPath}`);
|
|
128741
128762
|
try {
|
|
128742
128763
|
if (process.platform === "darwin") {
|
|
@@ -128800,9 +128821,9 @@ function cleanupConvertedImage(filePath) {
|
|
|
128800
128821
|
}
|
|
128801
128822
|
}
|
|
128802
128823
|
function convertBase64ImageToJpeg(base64Data, mimeType) {
|
|
128803
|
-
const tempDir = mkdtempSync(
|
|
128824
|
+
const tempDir = mkdtempSync(join117(tmpdir7(), "opencode-b64-"));
|
|
128804
128825
|
const inputExt = mimeType.split("/")[1] || "bin";
|
|
128805
|
-
const inputPath =
|
|
128826
|
+
const inputPath = join117(tempDir, `input.${inputExt}`);
|
|
128806
128827
|
const tempFiles = [inputPath];
|
|
128807
128828
|
try {
|
|
128808
128829
|
const cleanBase64 = base64Data.replace(/^data:[^;]+;base64,/, "");
|
|
@@ -133087,7 +133108,7 @@ function isExplicitSyncRun(runInBackground) {
|
|
|
133087
133108
|
return runInBackground === false || runInBackground === "false";
|
|
133088
133109
|
}
|
|
133089
133110
|
// packages/omo-opencode/src/tools/task/task-create.ts
|
|
133090
|
-
import { join as
|
|
133111
|
+
import { join as join119 } from "path";
|
|
133091
133112
|
|
|
133092
133113
|
// packages/omo-opencode/src/tools/task/types.ts
|
|
133093
133114
|
import { z as z54 } from "zod";
|
|
@@ -133142,7 +133163,7 @@ var TaskDeleteInputSchema = z54.object({
|
|
|
133142
133163
|
});
|
|
133143
133164
|
|
|
133144
133165
|
// packages/omo-opencode/src/features/claude-tasks/storage.ts
|
|
133145
|
-
import { join as
|
|
133166
|
+
import { join as join118, dirname as dirname42, basename as basename18, isAbsolute as isAbsolute17 } from "path";
|
|
133146
133167
|
import { existsSync as existsSync96, mkdirSync as mkdirSync21, readFileSync as readFileSync63, writeFileSync as writeFileSync24, renameSync as renameSync8, unlinkSync as unlinkSync17, readdirSync as readdirSync26 } from "fs";
|
|
133147
133168
|
import { randomUUID as randomUUID9 } from "crypto";
|
|
133148
133169
|
function ignoreClaudeTaskStorageError(error) {
|
|
@@ -133154,11 +133175,11 @@ function getTaskDir(config = {}) {
|
|
|
133154
133175
|
const tasksConfig = config.sisyphus?.tasks;
|
|
133155
133176
|
const storagePath = tasksConfig?.storage_path;
|
|
133156
133177
|
if (storagePath) {
|
|
133157
|
-
return isAbsolute17(storagePath) ? storagePath :
|
|
133178
|
+
return isAbsolute17(storagePath) ? storagePath : join118(process.cwd(), storagePath);
|
|
133158
133179
|
}
|
|
133159
133180
|
const configDir = getOpenCodeConfigDir({ binary: "opencode" });
|
|
133160
133181
|
const listId = resolveTaskListId(config);
|
|
133161
|
-
return
|
|
133182
|
+
return join118(configDir, "tasks", listId);
|
|
133162
133183
|
}
|
|
133163
133184
|
function sanitizePathSegment(value) {
|
|
133164
133185
|
return value.replace(/[^a-zA-Z0-9_-]/g, "-") || "default";
|
|
@@ -133237,7 +133258,7 @@ function generateTaskId() {
|
|
|
133237
133258
|
return `T-${randomUUID9()}`;
|
|
133238
133259
|
}
|
|
133239
133260
|
async function acquireLock2(dirPath, options = {}) {
|
|
133240
|
-
const lockPath =
|
|
133261
|
+
const lockPath = join118(dirPath, ".lock");
|
|
133241
133262
|
const lockId = randomUUID9();
|
|
133242
133263
|
const waitTimeoutMs = options.waitTimeoutMs ?? resolveLockWaitTimeoutMs();
|
|
133243
133264
|
const baseRetryDelayMs = options.retryDelayMs ?? DEFAULT_LOCK_RETRY_DELAY_MS;
|
|
@@ -133488,7 +133509,7 @@ async function handleCreate(args, config, ctx, context) {
|
|
|
133488
133509
|
threadID: context.sessionID
|
|
133489
133510
|
};
|
|
133490
133511
|
validatedTask = TaskObjectSchema.parse(task);
|
|
133491
|
-
writeJsonAtomic(
|
|
133512
|
+
writeJsonAtomic(join119(taskDir, `${taskId}.json`), validatedTask);
|
|
133492
133513
|
} finally {
|
|
133493
133514
|
lock.release();
|
|
133494
133515
|
}
|
|
@@ -133510,7 +133531,7 @@ async function handleCreate(args, config, ctx, context) {
|
|
|
133510
133531
|
}
|
|
133511
133532
|
}
|
|
133512
133533
|
// packages/omo-opencode/src/tools/task/task-get.ts
|
|
133513
|
-
import { join as
|
|
133534
|
+
import { join as join120 } from "path";
|
|
133514
133535
|
var TASK_ID_PATTERN = /^T-[A-Za-z0-9-]+$/;
|
|
133515
133536
|
function parseTaskId(id) {
|
|
133516
133537
|
if (!TASK_ID_PATTERN.test(id))
|
|
@@ -133535,7 +133556,7 @@ Returns null if the task does not exist or the file is invalid.`,
|
|
|
133535
133556
|
return JSON.stringify({ error: "invalid_task_id" });
|
|
133536
133557
|
}
|
|
133537
133558
|
const taskDir = getTaskDir(config);
|
|
133538
|
-
const taskPath =
|
|
133559
|
+
const taskPath = join120(taskDir, `${taskId}.json`);
|
|
133539
133560
|
const task = readJsonSafe(taskPath, TaskObjectSchema);
|
|
133540
133561
|
return JSON.stringify({ task: task ?? null });
|
|
133541
133562
|
} catch (error) {
|
|
@@ -133548,7 +133569,7 @@ Returns null if the task does not exist or the file is invalid.`,
|
|
|
133548
133569
|
});
|
|
133549
133570
|
}
|
|
133550
133571
|
// packages/omo-opencode/src/tools/task/task-list.ts
|
|
133551
|
-
import { join as
|
|
133572
|
+
import { join as join121 } from "path";
|
|
133552
133573
|
import { existsSync as existsSync97, readdirSync as readdirSync27 } from "fs";
|
|
133553
133574
|
function createTaskList(config) {
|
|
133554
133575
|
return tool({
|
|
@@ -133569,7 +133590,7 @@ Returns summary format: id, subject, status, owner, blockedBy (not full descript
|
|
|
133569
133590
|
}
|
|
133570
133591
|
const allTasks = [];
|
|
133571
133592
|
for (const fileId of files) {
|
|
133572
|
-
const task = readJsonSafe(
|
|
133593
|
+
const task = readJsonSafe(join121(taskDir, `${fileId}.json`), TaskObjectSchema);
|
|
133573
133594
|
if (task) {
|
|
133574
133595
|
allTasks.push(task);
|
|
133575
133596
|
}
|
|
@@ -133597,7 +133618,7 @@ Returns summary format: id, subject, status, owner, blockedBy (not full descript
|
|
|
133597
133618
|
});
|
|
133598
133619
|
}
|
|
133599
133620
|
// packages/omo-opencode/src/tools/task/task-update.ts
|
|
133600
|
-
import { join as
|
|
133621
|
+
import { join as join122 } from "path";
|
|
133601
133622
|
var TASK_ID_PATTERN2 = /^T-[A-Za-z0-9-]+$/;
|
|
133602
133623
|
function parseTaskId2(id) {
|
|
133603
133624
|
if (!TASK_ID_PATTERN2.test(id))
|
|
@@ -133684,7 +133705,7 @@ async function handleUpdate(args, config, ctx, context) {
|
|
|
133684
133705
|
}
|
|
133685
133706
|
let updatedTask = null;
|
|
133686
133707
|
try {
|
|
133687
|
-
updatedTask = applyTaskUpdate(
|
|
133708
|
+
updatedTask = applyTaskUpdate(join122(taskDir, `${taskId}.json`), validatedArgs);
|
|
133688
133709
|
} finally {
|
|
133689
133710
|
lock.release();
|
|
133690
133711
|
}
|
|
@@ -135558,7 +135579,7 @@ function createHooks(args) {
|
|
|
135558
135579
|
};
|
|
135559
135580
|
}
|
|
135560
135581
|
// packages/omo-opencode/src/features/background-agent/manager.ts
|
|
135561
|
-
import { join as
|
|
135582
|
+
import { join as join124 } from "path";
|
|
135562
135583
|
|
|
135563
135584
|
// packages/omo-opencode/src/features/background-agent/abort-with-timeout.ts
|
|
135564
135585
|
function getAbortResponseError(response) {
|
|
@@ -135846,7 +135867,7 @@ function writeBackgroundTaskMarker(input) {
|
|
|
135846
135867
|
|
|
135847
135868
|
// packages/omo-opencode/src/features/background-agent/compaction-aware-message-resolver.ts
|
|
135848
135869
|
import { readdirSync as readdirSync28, readFileSync as readFileSync64 } from "fs";
|
|
135849
|
-
import { join as
|
|
135870
|
+
import { join as join123 } from "path";
|
|
135850
135871
|
function hasFullAgentAndModel(message) {
|
|
135851
135872
|
return !!message.agent && !isCompactionAgent(message.agent) && !!message.model?.providerID && !!message.model?.modelID;
|
|
135852
135873
|
}
|
|
@@ -135930,7 +135951,7 @@ function findNearestMessageExcludingCompaction(messageDir, sessionID) {
|
|
|
135930
135951
|
const messages = [];
|
|
135931
135952
|
for (const file of files) {
|
|
135932
135953
|
try {
|
|
135933
|
-
const content = readFileSync64(
|
|
135954
|
+
const content = readFileSync64(join123(messageDir, file), "utf-8");
|
|
135934
135955
|
const parsed = JSON.parse(content);
|
|
135935
135956
|
if (hasCompactionPartInStorage(parsed.id) || isCompactionAgent(parsed.agent)) {
|
|
135936
135957
|
continue;
|
|
@@ -140728,7 +140749,7 @@ The task was re-queued on a fallback model after a retryable failure.
|
|
|
140728
140749
|
parentSessionID: task.parentSessionId
|
|
140729
140750
|
});
|
|
140730
140751
|
}
|
|
140731
|
-
const messageDir =
|
|
140752
|
+
const messageDir = join124(MESSAGE_STORAGE, task.parentSessionId);
|
|
140732
140753
|
const currentMessage = messageDir ? findNearestMessageExcludingCompaction(messageDir, task.parentSessionId) : null;
|
|
140733
140754
|
agent = currentMessage?.agent ?? task.parentAgent;
|
|
140734
140755
|
model = currentMessage?.model?.providerID && currentMessage?.model?.modelID ? { providerID: currentMessage.model.providerID, modelID: currentMessage.model.modelID } : undefined;
|
|
@@ -142415,12 +142436,12 @@ import {
|
|
|
142415
142436
|
unlinkSync as unlinkSync18,
|
|
142416
142437
|
writeFileSync as writeFileSync26
|
|
142417
142438
|
} from "fs";
|
|
142418
|
-
import { basename as basename19, dirname as dirname43, join as
|
|
142439
|
+
import { basename as basename19, dirname as dirname43, join as join127 } from "path";
|
|
142419
142440
|
|
|
142420
142441
|
// packages/mcp-client-core/src/config-dir.ts
|
|
142421
142442
|
import { existsSync as existsSync98, realpathSync as realpathSync18 } from "fs";
|
|
142422
142443
|
import { homedir as homedir25 } from "os";
|
|
142423
|
-
import { join as
|
|
142444
|
+
import { join as join125, resolve as resolve32 } from "path";
|
|
142424
142445
|
function resolveConfigPath4(pathValue) {
|
|
142425
142446
|
const resolvedPath = resolve32(pathValue);
|
|
142426
142447
|
if (!existsSync98(resolvedPath))
|
|
@@ -142438,13 +142459,13 @@ function getOpenCodeCliConfigDir(env = process.env) {
|
|
|
142438
142459
|
if (customConfigDir) {
|
|
142439
142460
|
return resolveConfigPath4(customConfigDir);
|
|
142440
142461
|
}
|
|
142441
|
-
const xdgConfigDir = env["XDG_CONFIG_HOME"]?.trim() ||
|
|
142442
|
-
return resolveConfigPath4(
|
|
142462
|
+
const xdgConfigDir = env["XDG_CONFIG_HOME"]?.trim() || join125(homedir25(), ".config");
|
|
142463
|
+
return resolveConfigPath4(join125(xdgConfigDir, "opencode"));
|
|
142443
142464
|
}
|
|
142444
142465
|
|
|
142445
142466
|
// packages/mcp-client-core/src/mcp-oauth/storage-index.ts
|
|
142446
142467
|
import { chmodSync as chmodSync3, existsSync as existsSync99, readFileSync as readFileSync65, renameSync as renameSync9, writeFileSync as writeFileSync25 } from "fs";
|
|
142447
|
-
import { join as
|
|
142468
|
+
import { join as join126 } from "path";
|
|
142448
142469
|
var INDEX_FILE_NAME = "index.json";
|
|
142449
142470
|
function isTokenIndex(value) {
|
|
142450
142471
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
@@ -142452,7 +142473,7 @@ function isTokenIndex(value) {
|
|
|
142452
142473
|
return Object.values(value).every((entry) => typeof entry === "string");
|
|
142453
142474
|
}
|
|
142454
142475
|
function getIndexPath(storageDir) {
|
|
142455
|
-
return
|
|
142476
|
+
return join126(storageDir, INDEX_FILE_NAME);
|
|
142456
142477
|
}
|
|
142457
142478
|
function readTokenIndex(storageDir) {
|
|
142458
142479
|
const indexPath = getIndexPath(storageDir);
|
|
@@ -142489,16 +142510,16 @@ function saveTokenIndexEntry(storageDir, hash, key) {
|
|
|
142489
142510
|
var STORAGE_DIR_NAME = "mcp-oauth";
|
|
142490
142511
|
var LEGACY_STORAGE_FILE_NAME = "mcp-oauth.json";
|
|
142491
142512
|
function getMcpOauthStorageDir() {
|
|
142492
|
-
return
|
|
142513
|
+
return join127(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
|
|
142493
142514
|
}
|
|
142494
142515
|
function getMcpOauthServerHash(serverHost, resource) {
|
|
142495
142516
|
return createHash4("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
|
|
142496
142517
|
}
|
|
142497
142518
|
function getMcpOauthStoragePath(serverHost, resource) {
|
|
142498
|
-
return
|
|
142519
|
+
return join127(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
|
|
142499
142520
|
}
|
|
142500
142521
|
function getLegacyStoragePath() {
|
|
142501
|
-
return
|
|
142522
|
+
return join127(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
|
|
142502
142523
|
}
|
|
142503
142524
|
function normalizeHost(serverHost) {
|
|
142504
142525
|
let host = serverHost.trim();
|
|
@@ -148082,9 +148103,9 @@ import { dirname as dirname44 } from "path";
|
|
|
148082
148103
|
import { createHash as createHash6 } from "crypto";
|
|
148083
148104
|
import { realpathSync as realpathSync19 } from "fs";
|
|
148084
148105
|
import { homedir as homedir26 } from "os";
|
|
148085
|
-
import { join as
|
|
148106
|
+
import { join as join128, resolve as resolve33 } from "path";
|
|
148086
148107
|
function mirrorStorageDir() {
|
|
148087
|
-
return
|
|
148108
|
+
return join128(process.env.XDG_DATA_HOME ?? join128(homedir26(), ".local", "share"), "opencode", "storage", "oh-my-openagent", MIRROR_DIR_NAME);
|
|
148088
148109
|
}
|
|
148089
148110
|
function canonicalProjectDir(projectDir) {
|
|
148090
148111
|
try {
|
|
@@ -148098,7 +148119,7 @@ function canonicalProjectDir(projectDir) {
|
|
|
148098
148119
|
}
|
|
148099
148120
|
function mirrorFilePath(projectDir) {
|
|
148100
148121
|
const projectHash = createHash6("sha1").update(canonicalProjectDir(projectDir)).digest("hex").slice(0, 16);
|
|
148101
|
-
return
|
|
148122
|
+
return join128(mirrorStorageDir(), `${projectHash}.json`);
|
|
148102
148123
|
}
|
|
148103
148124
|
|
|
148104
148125
|
// packages/omo-opencode/src/features/tui-sidebar/snapshot-schema.ts
|
|
@@ -148157,7 +148178,7 @@ function writeMirror(projectDir, snapshot) {
|
|
|
148157
148178
|
|
|
148158
148179
|
// packages/omo-opencode/src/features/tui-sidebar/loop-reader.ts
|
|
148159
148180
|
import { readdirSync as readdirSync30, readFileSync as readFileSync68, statSync as statSync14 } from "fs";
|
|
148160
|
-
import { join as
|
|
148181
|
+
import { join as join129 } from "path";
|
|
148161
148182
|
import { z as z59 } from "zod";
|
|
148162
148183
|
var CriterionSchema = z59.object({
|
|
148163
148184
|
status: z59.string()
|
|
@@ -148187,7 +148208,7 @@ function enumerateCandidates(projectDir) {
|
|
|
148187
148208
|
return [...currentLoopCandidates(projectDir), legacyLoopCandidate(projectDir)].filter((candidate) => candidate !== null);
|
|
148188
148209
|
}
|
|
148189
148210
|
function currentLoopCandidates(projectDir) {
|
|
148190
|
-
const loopRoot =
|
|
148211
|
+
const loopRoot = join129(projectDir, ".omo", "ulw-loop");
|
|
148191
148212
|
let entries;
|
|
148192
148213
|
try {
|
|
148193
148214
|
entries = readdirSync30(loopRoot, { withFileTypes: true });
|
|
@@ -148197,10 +148218,10 @@ function currentLoopCandidates(projectDir) {
|
|
|
148197
148218
|
}
|
|
148198
148219
|
throw error;
|
|
148199
148220
|
}
|
|
148200
|
-
return entries.filter((entry) => entry.isDirectory()).map((entry) => statCandidate(
|
|
148221
|
+
return entries.filter((entry) => entry.isDirectory()).map((entry) => statCandidate(join129(loopRoot, entry.name, "goals.json"))).filter((candidate) => candidate !== null);
|
|
148201
148222
|
}
|
|
148202
148223
|
function legacyLoopCandidate(projectDir) {
|
|
148203
|
-
return statCandidate(
|
|
148224
|
+
return statCandidate(join129(projectDir, ".omo", "loop", "goals.json"));
|
|
148204
148225
|
}
|
|
148205
148226
|
function statCandidate(path) {
|
|
148206
148227
|
try {
|
|
@@ -150995,25 +151016,25 @@ import {
|
|
|
150995
151016
|
// packages/openclaw-core/src/reply-listener-paths.ts
|
|
150996
151017
|
import { existsSync as existsSync101, mkdirSync as mkdirSync24 } from "fs";
|
|
150997
151018
|
import { homedir as homedir27 } from "os";
|
|
150998
|
-
import { join as
|
|
151019
|
+
import { join as join130 } from "path";
|
|
150999
151020
|
var REPLY_LISTENER_SECURE_FILE_MODE = 384;
|
|
151000
151021
|
function resolveReplyListenerHomeDir() {
|
|
151001
151022
|
return process.env.HOME ?? process.env.USERPROFILE ?? homedir27();
|
|
151002
151023
|
}
|
|
151003
151024
|
function getReplyListenerStateDir() {
|
|
151004
|
-
return
|
|
151025
|
+
return join130(resolveReplyListenerHomeDir(), ".omo", "openclaw", "state");
|
|
151005
151026
|
}
|
|
151006
151027
|
function getReplyListenerPidFilePath() {
|
|
151007
|
-
return
|
|
151028
|
+
return join130(getReplyListenerStateDir(), "reply-listener.pid");
|
|
151008
151029
|
}
|
|
151009
151030
|
function getReplyListenerStateFilePath() {
|
|
151010
|
-
return
|
|
151031
|
+
return join130(getReplyListenerStateDir(), "reply-listener-state.json");
|
|
151011
151032
|
}
|
|
151012
151033
|
function getReplyListenerConfigFilePath() {
|
|
151013
|
-
return
|
|
151034
|
+
return join130(getReplyListenerStateDir(), "reply-listener-config.json");
|
|
151014
151035
|
}
|
|
151015
151036
|
function getReplyListenerLogFilePath() {
|
|
151016
|
-
return
|
|
151037
|
+
return join130(getReplyListenerStateDir(), "reply-listener.log");
|
|
151017
151038
|
}
|
|
151018
151039
|
function ensureReplyListenerStateDir() {
|
|
151019
151040
|
const stateDir = getReplyListenerStateDir();
|
|
@@ -151073,7 +151094,7 @@ import { constants as constants24, closeSync as closeSync5, openSync as openSync
|
|
|
151073
151094
|
|
|
151074
151095
|
// packages/openclaw-core/src/session-registry-paths.ts
|
|
151075
151096
|
init_src();
|
|
151076
|
-
import { join as
|
|
151097
|
+
import { join as join131 } from "path";
|
|
151077
151098
|
var SECURE_FILE_MODE = 384;
|
|
151078
151099
|
var MAX_AGE_MS = 24 * 60 * 60 * 1000;
|
|
151079
151100
|
var LOCK_TIMEOUT_MS = 2000;
|
|
@@ -151084,16 +151105,16 @@ var cachedRegistryPaths = null;
|
|
|
151084
151105
|
function resolveRegistryPaths() {
|
|
151085
151106
|
if (cachedRegistryPaths !== null)
|
|
151086
151107
|
return cachedRegistryPaths;
|
|
151087
|
-
const openClawStorageDir =
|
|
151108
|
+
const openClawStorageDir = join131(getOpenCodeStorageDir2(), "openclaw");
|
|
151088
151109
|
cachedRegistryPaths = {
|
|
151089
151110
|
openClawStorageDir,
|
|
151090
|
-
registryPath:
|
|
151091
|
-
registryLockPath:
|
|
151111
|
+
registryPath: join131(openClawStorageDir, "reply-session-registry.jsonl"),
|
|
151112
|
+
registryLockPath: join131(openClawStorageDir, "reply-session-registry.lock")
|
|
151092
151113
|
};
|
|
151093
151114
|
return cachedRegistryPaths;
|
|
151094
151115
|
}
|
|
151095
151116
|
function getOpenCodeStorageDir2() {
|
|
151096
|
-
return
|
|
151117
|
+
return join131(resolveXdgDataDir("opencode"), "opencode", "storage");
|
|
151097
151118
|
}
|
|
151098
151119
|
function getRegistryPath() {
|
|
151099
151120
|
return resolveRegistryPaths().registryPath;
|
|
@@ -151513,7 +151534,7 @@ function getReplyListenerRuntimeSignature(config) {
|
|
|
151513
151534
|
// packages/openclaw-core/src/reply-listener-poll-loop.ts
|
|
151514
151535
|
var PRUNE_INTERVAL_MS = 60 * 60 * 1000;
|
|
151515
151536
|
// packages/openclaw-core/src/reply-listener-start.ts
|
|
151516
|
-
import { dirname as dirname46, join as
|
|
151537
|
+
import { dirname as dirname46, join as join133 } from "path";
|
|
151517
151538
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
151518
151539
|
|
|
151519
151540
|
// packages/openclaw-core/src/reply-listener-spawn.ts
|
|
@@ -151522,7 +151543,7 @@ init_runtime();
|
|
|
151522
151543
|
// packages/openclaw-core/src/reply-listener-process.ts
|
|
151523
151544
|
init_runtime();
|
|
151524
151545
|
import { readFileSync as readFileSync72 } from "fs";
|
|
151525
|
-
import { join as
|
|
151546
|
+
import { join as join132 } from "path";
|
|
151526
151547
|
var REPLY_LISTENER_DAEMON_IDENTITY_MARKER = "--openclaw-reply-listener-daemon";
|
|
151527
151548
|
var REPLY_LISTENER_DAEMON_ENV_ALLOWLIST = [
|
|
151528
151549
|
"PATH",
|
|
@@ -151558,7 +151579,7 @@ var REPLY_LISTENER_DAEMON_ENV_ALLOWLIST = [
|
|
|
151558
151579
|
];
|
|
151559
151580
|
async function windowsProcessCommandLineHasMarker(pid, deps) {
|
|
151560
151581
|
const systemRoot = process.env.SystemRoot ?? process.env.SYSTEMROOT ?? "C:\\Windows";
|
|
151561
|
-
const powershell =
|
|
151582
|
+
const powershell = join132(systemRoot, "System32", "WindowsPowerShell", "v1.0", "powershell.exe");
|
|
151562
151583
|
const processInfo = deps.spawn([
|
|
151563
151584
|
powershell,
|
|
151564
151585
|
"-NoProfile",
|
|
@@ -151775,7 +151796,7 @@ function createStartFailureResult(message, state) {
|
|
|
151775
151796
|
}
|
|
151776
151797
|
function resolveReplyListenerDaemonScript(currentFileUrl) {
|
|
151777
151798
|
const currentFilePath = fileURLToPath7(currentFileUrl);
|
|
151778
|
-
return currentFilePath.endsWith(".ts") ?
|
|
151799
|
+
return currentFilePath.endsWith(".ts") ? join133(dirname46(currentFilePath), "daemon.ts") : join133(dirname46(currentFilePath), "daemon.js");
|
|
151779
151800
|
}
|
|
151780
151801
|
async function startReplyListener(config) {
|
|
151781
151802
|
const normalizedConfig = getNormalizedReplyListenerConfig(config);
|
|
@@ -152199,12 +152220,12 @@ async function createRuntimeSkillSourceServer(options, runtimeEnv = runtime6) {
|
|
|
152199
152220
|
}
|
|
152200
152221
|
// packages/claude-code-compat-core/src/features/claude-code-mcp-loader/loader.ts
|
|
152201
152222
|
import { existsSync as existsSync106, readFileSync as readFileSync73 } from "fs";
|
|
152202
|
-
import { join as
|
|
152223
|
+
import { join as join134 } from "path";
|
|
152203
152224
|
import { homedir as homedir28 } from "os";
|
|
152204
152225
|
function resolveMcpLoaderContext(options = {}) {
|
|
152205
152226
|
const cwd = options.cwd ?? process.cwd();
|
|
152206
152227
|
const homeDir = options.homeDir ?? getHomeDir();
|
|
152207
|
-
const claudeConfigDir = options.claudeConfigDir ?? (options.homeDir === undefined ? getClaudeConfigDir3() :
|
|
152228
|
+
const claudeConfigDir = options.claudeConfigDir ?? (options.homeDir === undefined ? getClaudeConfigDir3() : join134(homeDir, ".claude"));
|
|
152208
152229
|
return { cwd, homeDir, claudeConfigDir };
|
|
152209
152230
|
}
|
|
152210
152231
|
var mcpLoaderInternals = {
|
|
@@ -152213,10 +152234,10 @@ var mcpLoaderInternals = {
|
|
|
152213
152234
|
function getMcpConfigPaths(context) {
|
|
152214
152235
|
const { claudeConfigDir, homeDir, cwd } = context;
|
|
152215
152236
|
return [
|
|
152216
|
-
{ path:
|
|
152217
|
-
{ path:
|
|
152218
|
-
{ path:
|
|
152219
|
-
{ path:
|
|
152237
|
+
{ path: join134(homeDir, ".claude.json"), scope: "user" },
|
|
152238
|
+
{ path: join134(claudeConfigDir, ".mcp.json"), scope: "user" },
|
|
152239
|
+
{ path: join134(cwd, ".mcp.json"), scope: "project" },
|
|
152240
|
+
{ path: join134(cwd, ".claude", ".mcp.json"), scope: "local" }
|
|
152220
152241
|
];
|
|
152221
152242
|
}
|
|
152222
152243
|
function getHomeDir() {
|
|
@@ -161744,13 +161765,13 @@ createHephaestusAgent.mode = MODE9;
|
|
|
161744
161765
|
// packages/omo-opencode/src/agents/builtin-agents/resolve-file-uri.ts
|
|
161745
161766
|
import { existsSync as existsSync107, readFileSync as readFileSync74 } from "fs";
|
|
161746
161767
|
import { homedir as homedir29 } from "os";
|
|
161747
|
-
import { isAbsolute as isAbsolute18, join as
|
|
161768
|
+
import { isAbsolute as isAbsolute18, join as join135, resolve as resolve34 } from "path";
|
|
161748
161769
|
init_logger2();
|
|
161749
161770
|
var ALLOWED_HOME_SUBDIRS = [
|
|
161750
|
-
|
|
161751
|
-
|
|
161752
|
-
|
|
161753
|
-
|
|
161771
|
+
join135(homedir29(), ".config", "opencode"),
|
|
161772
|
+
join135(homedir29(), ".config", "oh-my-openagent"),
|
|
161773
|
+
join135(homedir29(), ".omo"),
|
|
161774
|
+
join135(homedir29(), ".opencode")
|
|
161754
161775
|
];
|
|
161755
161776
|
function isWithinAllowedPaths(filePath, projectRoot) {
|
|
161756
161777
|
if (isWithinProject(filePath, projectRoot))
|
|
@@ -164508,7 +164529,7 @@ async function applyAgentConfig(params) {
|
|
|
164508
164529
|
}
|
|
164509
164530
|
// packages/claude-code-compat-core/src/features/claude-code-command-loader/loader.ts
|
|
164510
164531
|
import { promises as fs21 } from "fs";
|
|
164511
|
-
import { join as
|
|
164532
|
+
import { join as join136, basename as basename21 } from "path";
|
|
164512
164533
|
|
|
164513
164534
|
// packages/claude-code-compat-core/src/features/claude-code-command-loader/loader-cache.ts
|
|
164514
164535
|
var commandLoaderCache = new Map;
|
|
@@ -164556,7 +164577,7 @@ async function loadCommandsFromDir(commandsDir, scope, visited = new Set, prefix
|
|
|
164556
164577
|
continue;
|
|
164557
164578
|
if (entry.name.startsWith("."))
|
|
164558
164579
|
continue;
|
|
164559
|
-
const subDirPath =
|
|
164580
|
+
const subDirPath = join136(commandsDir, entry.name);
|
|
164560
164581
|
const subPrefix = prefix ? `${prefix}/${entry.name}` : entry.name;
|
|
164561
164582
|
const subCommands = await loadCommandsFromDir(subDirPath, scope, visited, subPrefix);
|
|
164562
164583
|
commands.push(...subCommands);
|
|
@@ -164564,7 +164585,7 @@ async function loadCommandsFromDir(commandsDir, scope, visited = new Set, prefix
|
|
|
164564
164585
|
}
|
|
164565
164586
|
if (!isMarkdownFile(entry))
|
|
164566
164587
|
continue;
|
|
164567
|
-
const commandPath =
|
|
164588
|
+
const commandPath = join136(commandsDir, entry.name);
|
|
164568
164589
|
const baseCommandName = basename21(entry.name, ".md");
|
|
164569
164590
|
const commandName = prefix ? `${prefix}/${baseCommandName}` : baseCommandName;
|
|
164570
164591
|
try {
|
|
@@ -164627,12 +164648,12 @@ function commandsToRecord(commands) {
|
|
|
164627
164648
|
return result;
|
|
164628
164649
|
}
|
|
164629
164650
|
async function loadUserCommands() {
|
|
164630
|
-
const userCommandsDir =
|
|
164651
|
+
const userCommandsDir = join136(getClaudeConfigDir3(), "commands");
|
|
164631
164652
|
const commands = await loadCommandsFromDir(userCommandsDir, "user");
|
|
164632
164653
|
return commandsToRecord(commands);
|
|
164633
164654
|
}
|
|
164634
164655
|
async function loadProjectCommands(directory) {
|
|
164635
|
-
const projectCommandsDir =
|
|
164656
|
+
const projectCommandsDir = join136(directory ?? process.cwd(), ".claude", "commands");
|
|
164636
164657
|
const commands = await loadCommandsFromDir(projectCommandsDir, "project");
|
|
164637
164658
|
return commandsToRecord(commands);
|
|
164638
164659
|
}
|
|
@@ -172574,7 +172595,7 @@ function createChatHeadersHandler(args) {
|
|
|
172574
172595
|
}
|
|
172575
172596
|
|
|
172576
172597
|
// packages/omo-opencode/src/plugin/ultrawork-db-model-override.ts
|
|
172577
|
-
import { join as
|
|
172598
|
+
import { join as join137 } from "path";
|
|
172578
172599
|
import { existsSync as existsSync109 } from "fs";
|
|
172579
172600
|
async function importBunSqlite() {
|
|
172580
172601
|
if (typeof globalThis.Bun === "undefined") {
|
|
@@ -172591,7 +172612,7 @@ async function importBunSqlite() {
|
|
|
172591
172612
|
}
|
|
172592
172613
|
}
|
|
172593
172614
|
function getDbPath() {
|
|
172594
|
-
return
|
|
172615
|
+
return join137(getDataDir(), "opencode", "opencode.db");
|
|
172595
172616
|
}
|
|
172596
172617
|
var MAX_MICROTASK_RETRIES = 10;
|
|
172597
172618
|
function logCaughtDbError(message, metadata, error) {
|
|
@@ -175526,7 +175547,7 @@ function processKillErrorMeansAlive(error) {
|
|
|
175526
175547
|
// packages/utils/src/process-sweep/lsp-daemon-family.ts
|
|
175527
175548
|
import { readFileSync as readFileSync76, readdirSync as readdirSync31 } from "fs";
|
|
175528
175549
|
import { homedir as homedir30 } from "os";
|
|
175529
|
-
import { basename as basename23, join as
|
|
175550
|
+
import { basename as basename23, join as join138, resolve as resolve37 } from "path";
|
|
175530
175551
|
|
|
175531
175552
|
// packages/utils/src/process-sweep/lsp-daemon-owner-attestation.ts
|
|
175532
175553
|
import { readFile as readFile13 } from "fs/promises";
|
|
@@ -175643,7 +175664,7 @@ function resolveLspDaemonBaseDir(options = {}) {
|
|
|
175643
175664
|
if (override !== undefined && override.trim().length > 0)
|
|
175644
175665
|
return resolve37(override);
|
|
175645
175666
|
const homeDir = options.homeDir ?? env["HOME"] ?? env["USERPROFILE"] ?? homedir30();
|
|
175646
|
-
return
|
|
175667
|
+
return join138(homeDir, ".omo", "lsp-daemon");
|
|
175647
175668
|
}
|
|
175648
175669
|
var VERSION_ENTRY_PATTERN = /^v([A-Za-z0-9][A-Za-z0-9._+-]{0,127})$/;
|
|
175649
175670
|
function listLspDaemonVersionDirs(baseDir) {
|
|
@@ -175662,12 +175683,12 @@ function listLspDaemonVersionDirs(baseDir) {
|
|
|
175662
175683
|
const version = VERSION_ENTRY_PATTERN.exec(entry.name)?.[1];
|
|
175663
175684
|
if (version === undefined)
|
|
175664
175685
|
continue;
|
|
175665
|
-
versions.push({ dir:
|
|
175686
|
+
versions.push({ dir: join138(baseDir, entry.name), version });
|
|
175666
175687
|
}
|
|
175667
175688
|
return versions.sort((left, right) => left.version.localeCompare(right.version));
|
|
175668
175689
|
}
|
|
175669
175690
|
function readLspDaemonOwnerTarget(versionDir) {
|
|
175670
|
-
const ownerPath =
|
|
175691
|
+
const ownerPath = join138(versionDir, "daemon.owner");
|
|
175671
175692
|
let raw;
|
|
175672
175693
|
try {
|
|
175673
175694
|
raw = requireOwnerText(ownerPath);
|
|
@@ -175678,7 +175699,7 @@ function readLspDaemonOwnerTarget(versionDir) {
|
|
|
175678
175699
|
const owner = parseLspDaemonOwner(JSON.parse(raw));
|
|
175679
175700
|
if (owner === null)
|
|
175680
175701
|
return null;
|
|
175681
|
-
return { authPath:
|
|
175702
|
+
return { authPath: join138(versionDir, "daemon.auth"), owner, ownerPath, pid: owner.pid };
|
|
175682
175703
|
} catch {
|
|
175683
175704
|
return null;
|
|
175684
175705
|
}
|
|
@@ -175753,33 +175774,33 @@ function matchLspDaemonProxyCommand(command, roots, platform) {
|
|
|
175753
175774
|
// packages/utils/src/process-sweep/roots.ts
|
|
175754
175775
|
import { existsSync as existsSync110, readdirSync as readdirSync32, realpathSync as realpathSync20 } from "fs";
|
|
175755
175776
|
import { homedir as homedir31 } from "os";
|
|
175756
|
-
import { join as
|
|
175777
|
+
import { join as join139, resolve as resolve38 } from "path";
|
|
175757
175778
|
function discoverOmoOwnedRoots(options = {}) {
|
|
175758
175779
|
const env = options.env ?? process.env;
|
|
175759
175780
|
const homeDir = options.homeDir ?? env["HOME"] ?? env["USERPROFILE"] ?? homedir31();
|
|
175760
175781
|
const roots = new Set;
|
|
175761
|
-
addRoot(roots,
|
|
175782
|
+
addRoot(roots, join139(homeDir, ".claude", "omo"));
|
|
175762
175783
|
addRoot(roots, options.pluginRoot);
|
|
175763
175784
|
for (const root of options.extraRoots ?? [])
|
|
175764
175785
|
addRoot(roots, root);
|
|
175765
|
-
for (const root of readCodexPluginCacheRoots(options.codexHome ?? env["CODEX_HOME"] ??
|
|
175786
|
+
for (const root of readCodexPluginCacheRoots(options.codexHome ?? env["CODEX_HOME"] ?? join139(homeDir, ".codex"))) {
|
|
175766
175787
|
addRoot(roots, root);
|
|
175767
175788
|
}
|
|
175768
175789
|
return [...roots];
|
|
175769
175790
|
}
|
|
175770
175791
|
function readCodexPluginCacheRoots(codexHome) {
|
|
175771
|
-
const cacheRoot =
|
|
175792
|
+
const cacheRoot = join139(codexHome, "plugins", "cache");
|
|
175772
175793
|
if (!existsSync110(cacheRoot))
|
|
175773
175794
|
return [];
|
|
175774
175795
|
const roots = [];
|
|
175775
175796
|
for (const publisher of safeReadDir(cacheRoot)) {
|
|
175776
175797
|
if (!OMO_CODEX_PLUGIN_CACHE_PUBLISHERS.has(publisher))
|
|
175777
175798
|
continue;
|
|
175778
|
-
const omoRoot =
|
|
175799
|
+
const omoRoot = join139(cacheRoot, publisher, "omo");
|
|
175779
175800
|
if (!existsSync110(omoRoot))
|
|
175780
175801
|
continue;
|
|
175781
175802
|
for (const version of safeReadDir(omoRoot))
|
|
175782
|
-
roots.push(
|
|
175803
|
+
roots.push(join139(omoRoot, version));
|
|
175783
175804
|
}
|
|
175784
175805
|
return roots;
|
|
175785
175806
|
}
|
|
@@ -175817,7 +175838,7 @@ function isNonFatalFsError(error) {
|
|
|
175817
175838
|
var OMO_CODEX_PLUGIN_CACHE_PUBLISHERS = new Set(["sisyphuslabs"]);
|
|
175818
175839
|
|
|
175819
175840
|
// packages/utils/src/process-sweep/sweeper.ts
|
|
175820
|
-
import { join as
|
|
175841
|
+
import { join as join140 } from "path";
|
|
175821
175842
|
|
|
175822
175843
|
// packages/utils/src/process-sweep/family-sweeper.ts
|
|
175823
175844
|
import { existsSync as existsSync111, mkdirSync as mkdirSync26, statSync as statSync17, utimesSync, writeFileSync as writeFileSync29 } from "fs";
|
|
@@ -175934,7 +175955,7 @@ function delay6(ms) {
|
|
|
175934
175955
|
// packages/utils/src/process-sweep/sweeper.ts
|
|
175935
175956
|
var LSP_PROXY_SWEEP_STAMP_FILE = "lsp-proxy-sweep.stamp";
|
|
175936
175957
|
async function sweepOrphanedLspDaemonProxies(options = {}) {
|
|
175937
|
-
const stampFile =
|
|
175958
|
+
const stampFile = join140(resolveLspDaemonBaseDir(options), LSP_PROXY_SWEEP_STAMP_FILE);
|
|
175938
175959
|
const ownedRoots = options.ownedRoots ?? discoverOmoOwnedRoots(options);
|
|
175939
175960
|
const result = await runProcessFamilySweep({
|
|
175940
175961
|
familyLabel: "lsp-daemon proxy sweep",
|
|
@@ -175953,7 +175974,7 @@ async function sweepOrphanedLspDaemonProxies(options = {}) {
|
|
|
175953
175974
|
var LSP_DAEMON_SWEEP_STAMP_FILE = "lsp-daemon-sweep.stamp";
|
|
175954
175975
|
async function sweepStaleLspDaemonVersions(options = {}) {
|
|
175955
175976
|
const baseDir = resolveLspDaemonBaseDir(options);
|
|
175956
|
-
const stampFile =
|
|
175977
|
+
const stampFile = join140(baseDir, LSP_DAEMON_SWEEP_STAMP_FILE);
|
|
175957
175978
|
const currentVersion = resolveCurrentLspDaemonVersion(options);
|
|
175958
175979
|
const dryRun = options.dryRun === true;
|
|
175959
175980
|
if (currentVersion === undefined) {
|
|
@@ -176026,15 +176047,15 @@ function defaultPluginRoot() {
|
|
|
176026
176047
|
init_atomic_write();
|
|
176027
176048
|
init_xdg_data_dir();
|
|
176028
176049
|
import { existsSync as existsSync112, mkdirSync as mkdirSync28, readFileSync as readFileSync77 } from "fs";
|
|
176029
|
-
import { basename as basename24, join as
|
|
176050
|
+
import { basename as basename24, join as join142 } from "path";
|
|
176030
176051
|
|
|
176031
176052
|
// packages/telemetry-core/src/day-claim.ts
|
|
176032
176053
|
import { closeSync as closeSync6, mkdirSync as mkdirSync27, openSync as openSync6, readdirSync as readdirSync33, rmSync as rmSync6 } from "fs";
|
|
176033
|
-
import { join as
|
|
176054
|
+
import { join as join141 } from "path";
|
|
176034
176055
|
var CLAIM_PREFIX = "daily-active.";
|
|
176035
176056
|
var CLAIM_SUFFIX = ".claim";
|
|
176036
176057
|
function getTelemetryDayClaimFilePath(stateDir, dayUTC) {
|
|
176037
|
-
return
|
|
176058
|
+
return join141(stateDir, `${CLAIM_PREFIX}${dayUTC}${CLAIM_SUFFIX}`);
|
|
176038
176059
|
}
|
|
176039
176060
|
function claimUtcDay(stateDir, dayUTC) {
|
|
176040
176061
|
try {
|
|
@@ -176060,7 +176081,7 @@ function pruneSupersededClaims(stateDir, dayUTC) {
|
|
|
176060
176081
|
if (!entry.startsWith(CLAIM_PREFIX) || !entry.endsWith(CLAIM_SUFFIX))
|
|
176061
176082
|
continue;
|
|
176062
176083
|
try {
|
|
176063
|
-
rmSync6(
|
|
176084
|
+
rmSync6(join141(stateDir, entry), { force: true });
|
|
176064
176085
|
} catch {}
|
|
176065
176086
|
}
|
|
176066
176087
|
}
|
|
@@ -176073,14 +176094,14 @@ function resolveTelemetryStateDir(product, options = {}) {
|
|
|
176073
176094
|
env: options.env,
|
|
176074
176095
|
osProvider: options.osProvider
|
|
176075
176096
|
});
|
|
176076
|
-
const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined :
|
|
176097
|
+
const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined : join142(options.env.XDG_DATA_HOME, product.cacheDirName);
|
|
176077
176098
|
if (dataDir === xdgStateDir || xdgStateDir === undefined && basename24(dataDir) === product.cacheDirName) {
|
|
176078
176099
|
return dataDir;
|
|
176079
176100
|
}
|
|
176080
|
-
return
|
|
176101
|
+
return join142(dataDir, product.cacheDirName);
|
|
176081
176102
|
}
|
|
176082
176103
|
function getTelemetryActivityStateFilePath(stateDir) {
|
|
176083
|
-
return
|
|
176104
|
+
return join142(stateDir, POSTHOG_ACTIVITY_STATE_FILE);
|
|
176084
176105
|
}
|
|
176085
176106
|
function getDailyActiveCaptureState(input) {
|
|
176086
176107
|
const dayUTC = getUtcDayString(input.now ?? new Date);
|