@skj1724/oh-my-opencode 3.18.25 → 3.18.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/atlas/agent.d.ts +3 -2
- package/dist/agents/dynamic-agent-category-skills-guide.d.ts +1 -1
- package/dist/agents/dynamic-agent-core-sections.d.ts +9 -15
- package/dist/agents/dynamic-agent-policy-sections.d.ts +5 -5
- package/dist/agents/dynamic-agent-tool-categorization.d.ts +1 -1
- package/dist/agents/prometheus/system-prompt.d.ts +1 -1
- package/dist/agents/prompts-zh/index.d.ts +3 -3
- package/dist/agents/sisyphus/default.d.ts +1 -1
- package/dist/agents/sisyphus.d.ts +1 -1
- package/dist/agents/types/language.d.ts +3 -0
- package/dist/cli/index.js +80 -64
- package/dist/features/background-agent/concurrency.d.ts +1 -1
- package/dist/hooks/tool-output-truncator.d.ts +6 -0
- package/dist/index.js +697 -371
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/interactive-bash/index.d.ts +2 -2
- package/dist/tools/interactive-bash/tools.d.ts +1 -0
- package/package.json +2 -1
- package/src/agents/prompts-zh/explore.md +85 -0
- package/src/agents/prompts-zh/index.ts +3 -3
- package/src/agents/prompts-zh/librarian.md +282 -0
- package/src/agents/prompts-zh/multimodal-looker.md +40 -0
- package/src/agents/prompts-zh/sisyphus-junior.md +29 -0
package/dist/cli/index.js
CHANGED
|
@@ -4964,12 +4964,26 @@ var init_plugin_identity = __esm(() => {
|
|
|
4964
4964
|
import * as fs from "fs";
|
|
4965
4965
|
import * as os from "os";
|
|
4966
4966
|
import * as path from "path";
|
|
4967
|
+
function ensureMaxLogSize() {
|
|
4968
|
+
try {
|
|
4969
|
+
const stat = fs.statSync(logFile);
|
|
4970
|
+
if (stat.size > MAX_LOG_BYTES) {
|
|
4971
|
+
const content = fs.readFileSync(logFile, "utf-8");
|
|
4972
|
+
const keepBytes = Math.floor(MAX_LOG_BYTES * LOG_TRUNCATE_RATIO);
|
|
4973
|
+
const truncated = content.slice(-keepBytes);
|
|
4974
|
+
const head = `[${new Date().toISOString()}] [logger] Log truncated (was ${stat.size} bytes, kept ${keepBytes} bytes)
|
|
4975
|
+
`;
|
|
4976
|
+
fs.writeFileSync(logFile, head + truncated);
|
|
4977
|
+
}
|
|
4978
|
+
} catch {}
|
|
4979
|
+
}
|
|
4967
4980
|
function flush() {
|
|
4968
4981
|
if (buffer.length === 0)
|
|
4969
4982
|
return;
|
|
4970
4983
|
const data = buffer.join("");
|
|
4971
4984
|
buffer = [];
|
|
4972
4985
|
try {
|
|
4986
|
+
ensureMaxLogSize();
|
|
4973
4987
|
fs.appendFileSync(logFile, data);
|
|
4974
4988
|
} catch {}
|
|
4975
4989
|
}
|
|
@@ -4994,10 +5008,11 @@ function log(message, data) {
|
|
|
4994
5008
|
}
|
|
4995
5009
|
} catch {}
|
|
4996
5010
|
}
|
|
4997
|
-
var logFile, OMO_DEBUG, perfLogFile, buffer, flushTimer = null, FLUSH_INTERVAL_MS = 500, BUFFER_SIZE_LIMIT = 50;
|
|
5011
|
+
var logFile, MAX_LOG_BYTES, LOG_TRUNCATE_RATIO = 0.5, OMO_DEBUG, perfLogFile, buffer, flushTimer = null, FLUSH_INTERVAL_MS = 500, BUFFER_SIZE_LIMIT = 50;
|
|
4998
5012
|
var init_logger = __esm(() => {
|
|
4999
5013
|
init_plugin_identity();
|
|
5000
5014
|
logFile = path.join(os.tmpdir(), LOG_FILENAME);
|
|
5015
|
+
MAX_LOG_BYTES = parseInt(process.env.OMO_MAX_LOG_BYTES ?? "", 10) || 1024 * 1024;
|
|
5001
5016
|
OMO_DEBUG = process.env.OMO_DEBUG === "1";
|
|
5002
5017
|
perfLogFile = path.join(os.tmpdir(), "oh-my-opencode-perf.log");
|
|
5003
5018
|
buffer = [];
|
|
@@ -6020,7 +6035,7 @@ var init_main = __esm(() => {
|
|
|
6020
6035
|
});
|
|
6021
6036
|
|
|
6022
6037
|
// src/shared/jsonc-parser.ts
|
|
6023
|
-
import { existsSync as existsSync2, readFileSync } from "fs";
|
|
6038
|
+
import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
|
|
6024
6039
|
import { join as join4 } from "path";
|
|
6025
6040
|
function stripBom(content) {
|
|
6026
6041
|
return content.charCodeAt(0) === 65279 ? content.slice(1) : content;
|
|
@@ -6214,10 +6229,10 @@ var init_model_versions = __esm(() => {
|
|
|
6214
6229
|
var init_agent_category = () => {};
|
|
6215
6230
|
|
|
6216
6231
|
// src/shared/write-file-atomically.ts
|
|
6217
|
-
import { closeSync, fsyncSync, openSync, renameSync, unlinkSync, writeFileSync } from "fs";
|
|
6232
|
+
import { closeSync, fsyncSync, openSync, renameSync, unlinkSync, writeFileSync as writeFileSync2 } from "fs";
|
|
6218
6233
|
function writeFileAtomically(filePath, content) {
|
|
6219
6234
|
const tempPath = `${filePath}.tmp`;
|
|
6220
|
-
|
|
6235
|
+
writeFileSync2(tempPath, content, "utf-8");
|
|
6221
6236
|
const tempFileDescriptor = openSync(tempPath, "r");
|
|
6222
6237
|
try {
|
|
6223
6238
|
fsyncSync(tempFileDescriptor);
|
|
@@ -7141,7 +7156,7 @@ function normalizeModelID(modelID) {
|
|
|
7141
7156
|
}
|
|
7142
7157
|
|
|
7143
7158
|
// src/shared/json-file-cache-store.ts
|
|
7144
|
-
import { existsSync as existsSync7, mkdirSync as mkdirSync4, readFileSync as
|
|
7159
|
+
import { existsSync as existsSync7, mkdirSync as mkdirSync4, readFileSync as readFileSync5, writeFileSync as writeFileSync3 } from "fs";
|
|
7145
7160
|
import { join as join8 } from "path";
|
|
7146
7161
|
function toLogLabel(cacheLabel) {
|
|
7147
7162
|
return cacheLabel.toLowerCase();
|
|
@@ -7168,7 +7183,7 @@ function createJsonFileCacheStore(options) {
|
|
|
7168
7183
|
return null;
|
|
7169
7184
|
}
|
|
7170
7185
|
try {
|
|
7171
|
-
const content =
|
|
7186
|
+
const content = readFileSync5(cacheFile, "utf-8");
|
|
7172
7187
|
const value = JSON.parse(content);
|
|
7173
7188
|
memoryValue = value;
|
|
7174
7189
|
log(`[${options.logPrefix}] Read ${toLogLabel(options.cacheLabel)}`, options.describe(value));
|
|
@@ -7188,7 +7203,7 @@ function createJsonFileCacheStore(options) {
|
|
|
7188
7203
|
ensureCacheDir();
|
|
7189
7204
|
const cacheFile = getCacheFilePath();
|
|
7190
7205
|
try {
|
|
7191
|
-
|
|
7206
|
+
writeFileSync3(cacheFile, options.serialize?.(value) ?? JSON.stringify(value, null, 2));
|
|
7192
7207
|
memoryValue = value;
|
|
7193
7208
|
log(`[${options.logPrefix}] ${options.cacheLabel} written`, options.describe(value));
|
|
7194
7209
|
} catch (error) {
|
|
@@ -7351,7 +7366,7 @@ var init_connected_providers_cache = __esm(() => {
|
|
|
7351
7366
|
});
|
|
7352
7367
|
|
|
7353
7368
|
// src/shared/model-availability.ts
|
|
7354
|
-
import { existsSync as existsSync8, readFileSync as
|
|
7369
|
+
import { existsSync as existsSync8, readFileSync as readFileSync6 } from "fs";
|
|
7355
7370
|
import { join as join9 } from "path";
|
|
7356
7371
|
function isModelCacheAvailable() {
|
|
7357
7372
|
if (hasProviderModelsCache()) {
|
|
@@ -51550,7 +51565,7 @@ var init_opencode_storage_paths = __esm(() => {
|
|
|
51550
51565
|
});
|
|
51551
51566
|
|
|
51552
51567
|
// src/shared/compaction-marker.ts
|
|
51553
|
-
import { existsSync as existsSync9, readdirSync, readFileSync as
|
|
51568
|
+
import { existsSync as existsSync9, readdirSync, readFileSync as readFileSync7 } from "fs";
|
|
51554
51569
|
import { join as join11 } from "path";
|
|
51555
51570
|
function isCompactionPart(part) {
|
|
51556
51571
|
return typeof part === "object" && part !== null && part.type === "compaction";
|
|
@@ -51578,7 +51593,7 @@ function hasCompactionPartInStorage(messageID) {
|
|
|
51578
51593
|
try {
|
|
51579
51594
|
return readdirSync(partDir).filter((fileName) => fileName.endsWith(".json")).some((fileName) => {
|
|
51580
51595
|
try {
|
|
51581
|
-
const content =
|
|
51596
|
+
const content = readFileSync7(join11(partDir, fileName), "utf-8");
|
|
51582
51597
|
return isCompactionPart(JSON.parse(content));
|
|
51583
51598
|
} catch {
|
|
51584
51599
|
return false;
|
|
@@ -52359,17 +52374,17 @@ var init_opencode_config_format = __esm(() => {
|
|
|
52359
52374
|
});
|
|
52360
52375
|
|
|
52361
52376
|
// src/cli/config-manager/parse-opencode-config-file.ts
|
|
52362
|
-
import { readFileSync as
|
|
52377
|
+
import { readFileSync as readFileSync8, statSync as statSync2 } from "fs";
|
|
52363
52378
|
function isEmptyOrWhitespace(content) {
|
|
52364
52379
|
return content.trim().length === 0;
|
|
52365
52380
|
}
|
|
52366
52381
|
function parseOpenCodeConfigFileWithError(path5) {
|
|
52367
52382
|
try {
|
|
52368
|
-
const stat =
|
|
52383
|
+
const stat = statSync2(path5);
|
|
52369
52384
|
if (stat.size === 0) {
|
|
52370
52385
|
return { config: null, error: `Config file is empty: ${path5}. Delete it or add valid JSON content.` };
|
|
52371
52386
|
}
|
|
52372
|
-
const content =
|
|
52387
|
+
const content = readFileSync8(path5, "utf-8");
|
|
52373
52388
|
if (isEmptyOrWhitespace(content)) {
|
|
52374
52389
|
return { config: null, error: `Config file contains only whitespace: ${path5}. Delete it or add valid JSON content.` };
|
|
52375
52390
|
}
|
|
@@ -52475,7 +52490,7 @@ function extractVersionFromPluginEntry(entry) {
|
|
|
52475
52490
|
}
|
|
52476
52491
|
|
|
52477
52492
|
// src/cli/config-manager/add-plugin-to-opencode-config.ts
|
|
52478
|
-
import { readFileSync as
|
|
52493
|
+
import { readFileSync as readFileSync9, writeFileSync as writeFileSync4 } from "fs";
|
|
52479
52494
|
async function addPluginToOpenCodeConfig(currentVersion) {
|
|
52480
52495
|
try {
|
|
52481
52496
|
ensureConfigDirectoryExists();
|
|
@@ -52491,7 +52506,7 @@ async function addPluginToOpenCodeConfig(currentVersion) {
|
|
|
52491
52506
|
try {
|
|
52492
52507
|
if (format2 === "none") {
|
|
52493
52508
|
const config2 = { plugin: [pluginEntry] };
|
|
52494
|
-
|
|
52509
|
+
writeFileSync4(path5, JSON.stringify(config2, null, 2) + `
|
|
52495
52510
|
`);
|
|
52496
52511
|
return { success: true, configPath: path5 };
|
|
52497
52512
|
}
|
|
@@ -52532,7 +52547,7 @@ async function addPluginToOpenCodeConfig(currentVersion) {
|
|
|
52532
52547
|
normalizedPlugins.push(pluginEntry);
|
|
52533
52548
|
config.plugin = normalizedPlugins;
|
|
52534
52549
|
if (format2 === "jsonc") {
|
|
52535
|
-
const content =
|
|
52550
|
+
const content = readFileSync9(path5, "utf-8");
|
|
52536
52551
|
const pluginArrayRegex = /((?:"plugin"|plugin)\s*:\s*)\[([\s\S]*?)\]/;
|
|
52537
52552
|
const match = content.match(pluginArrayRegex);
|
|
52538
52553
|
if (match) {
|
|
@@ -52541,14 +52556,14 @@ async function addPluginToOpenCodeConfig(currentVersion) {
|
|
|
52541
52556
|
const newContent = content.replace(pluginArrayRegex, `$1[
|
|
52542
52557
|
${formattedPlugins}
|
|
52543
52558
|
]`);
|
|
52544
|
-
|
|
52559
|
+
writeFileSync4(path5, newContent);
|
|
52545
52560
|
} else {
|
|
52546
52561
|
const newContent = content.replace(/(\{)/, `$1
|
|
52547
52562
|
"plugin": ["${pluginEntry}"],`);
|
|
52548
|
-
|
|
52563
|
+
writeFileSync4(path5, newContent);
|
|
52549
52564
|
}
|
|
52550
52565
|
} else {
|
|
52551
|
-
|
|
52566
|
+
writeFileSync4(path5, JSON.stringify(config, null, 2) + `
|
|
52552
52567
|
`);
|
|
52553
52568
|
}
|
|
52554
52569
|
return { success: true, configPath: path5 };
|
|
@@ -52888,7 +52903,7 @@ var init_generate_omo_config = __esm(() => {
|
|
|
52888
52903
|
});
|
|
52889
52904
|
|
|
52890
52905
|
// src/shared/migrate-legacy-config-file.ts
|
|
52891
|
-
import { existsSync as existsSync14, readFileSync as
|
|
52906
|
+
import { existsSync as existsSync14, readFileSync as readFileSync10, renameSync as renameSync2, rmSync } from "fs";
|
|
52892
52907
|
import { join as join13, dirname as dirname4, basename as basename2 } from "path";
|
|
52893
52908
|
function buildCanonicalPath(legacyPath) {
|
|
52894
52909
|
const dir = dirname4(legacyPath);
|
|
@@ -52933,7 +52948,7 @@ function migrateLegacyConfigFile(legacyPath) {
|
|
|
52933
52948
|
if (existsSync14(canonicalPath))
|
|
52934
52949
|
return false;
|
|
52935
52950
|
try {
|
|
52936
|
-
const content =
|
|
52951
|
+
const content = readFileSync10(legacyPath, "utf-8");
|
|
52937
52952
|
writeFileAtomically(canonicalPath, content);
|
|
52938
52953
|
const archivedLegacyConfig = archiveLegacyConfigFile(legacyPath);
|
|
52939
52954
|
log("[migrateLegacyConfigFile] Migrated legacy config to canonical path", {
|
|
@@ -52971,7 +52986,7 @@ function deepMergeRecord(target, source) {
|
|
|
52971
52986
|
}
|
|
52972
52987
|
|
|
52973
52988
|
// src/cli/config-manager/write-omo-config.ts
|
|
52974
|
-
import { existsSync as existsSync15, readFileSync as
|
|
52989
|
+
import { existsSync as existsSync15, readFileSync as readFileSync11, statSync as statSync3, writeFileSync as writeFileSync5 } from "fs";
|
|
52975
52990
|
import { basename as basename3, dirname as dirname5, extname, join as join14 } from "path";
|
|
52976
52991
|
function isEmptyOrWhitespace2(content) {
|
|
52977
52992
|
return content.trim().length === 0;
|
|
@@ -53002,32 +53017,32 @@ function writeOmoConfig(installConfig) {
|
|
|
53002
53017
|
};
|
|
53003
53018
|
}
|
|
53004
53019
|
try {
|
|
53005
|
-
const stat =
|
|
53006
|
-
const content =
|
|
53020
|
+
const stat = statSync3(omoConfigPath);
|
|
53021
|
+
const content = readFileSync11(omoConfigPath, "utf-8");
|
|
53007
53022
|
if (stat.size === 0 || isEmptyOrWhitespace2(content)) {
|
|
53008
|
-
|
|
53023
|
+
writeFileSync5(omoConfigPath, JSON.stringify(newConfig, null, 2) + `
|
|
53009
53024
|
`);
|
|
53010
53025
|
return { success: true, configPath: omoConfigPath };
|
|
53011
53026
|
}
|
|
53012
53027
|
const existing = parseJsonc(content);
|
|
53013
53028
|
if (!existing || typeof existing !== "object" || Array.isArray(existing)) {
|
|
53014
|
-
|
|
53029
|
+
writeFileSync5(omoConfigPath, JSON.stringify(newConfig, null, 2) + `
|
|
53015
53030
|
`);
|
|
53016
53031
|
return { success: true, configPath: omoConfigPath };
|
|
53017
53032
|
}
|
|
53018
53033
|
const merged = deepMergeRecord(newConfig, existing);
|
|
53019
|
-
|
|
53034
|
+
writeFileSync5(omoConfigPath, JSON.stringify(merged, null, 2) + `
|
|
53020
53035
|
`);
|
|
53021
53036
|
} catch (parseErr) {
|
|
53022
53037
|
if (parseErr instanceof SyntaxError) {
|
|
53023
|
-
|
|
53038
|
+
writeFileSync5(omoConfigPath, JSON.stringify(newConfig, null, 2) + `
|
|
53024
53039
|
`);
|
|
53025
53040
|
return { success: true, configPath: omoConfigPath };
|
|
53026
53041
|
}
|
|
53027
53042
|
throw parseErr;
|
|
53028
53043
|
}
|
|
53029
53044
|
} else {
|
|
53030
|
-
|
|
53045
|
+
writeFileSync5(omoConfigPath, JSON.stringify(newConfig, null, 2) + `
|
|
53031
53046
|
`);
|
|
53032
53047
|
}
|
|
53033
53048
|
return { success: true, configPath: omoConfigPath };
|
|
@@ -53146,7 +53161,7 @@ var init_opencode_binary = __esm(() => {
|
|
|
53146
53161
|
});
|
|
53147
53162
|
|
|
53148
53163
|
// src/cli/config-manager/detect-current-config.ts
|
|
53149
|
-
import { existsSync as existsSync16, readFileSync as
|
|
53164
|
+
import { existsSync as existsSync16, readFileSync as readFileSync12 } from "fs";
|
|
53150
53165
|
function detectProvidersFromOmoConfig() {
|
|
53151
53166
|
const omoConfigPath = getOmoConfigPath();
|
|
53152
53167
|
if (!existsSync16(omoConfigPath)) {
|
|
@@ -53160,7 +53175,7 @@ function detectProvidersFromOmoConfig() {
|
|
|
53160
53175
|
};
|
|
53161
53176
|
}
|
|
53162
53177
|
try {
|
|
53163
|
-
const content =
|
|
53178
|
+
const content = readFileSync12(omoConfigPath, "utf-8");
|
|
53164
53179
|
const omoConfig = parseJsonc(content);
|
|
53165
53180
|
if (!omoConfig || typeof omoConfig !== "object") {
|
|
53166
53181
|
return {
|
|
@@ -54876,7 +54891,7 @@ var {
|
|
|
54876
54891
|
// package.json
|
|
54877
54892
|
var package_default = {
|
|
54878
54893
|
name: "@skj1724/oh-my-opencode",
|
|
54879
|
-
version: "3.18.
|
|
54894
|
+
version: "3.18.27",
|
|
54880
54895
|
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
54881
54896
|
main: "./dist/index.js",
|
|
54882
54897
|
types: "dist/index.d.ts",
|
|
@@ -54937,6 +54952,7 @@ var package_default = {
|
|
|
54937
54952
|
diff: "^8.0.3",
|
|
54938
54953
|
"js-yaml": "^4.1.1",
|
|
54939
54954
|
"jsonc-parser": "^3.3.1",
|
|
54955
|
+
"memory-boat": "^0.0.1",
|
|
54940
54956
|
picocolors: "^1.1.1",
|
|
54941
54957
|
picomatch: "^4.0.4",
|
|
54942
54958
|
"posthog-node": "5.28.11",
|
|
@@ -59628,7 +59644,7 @@ init_data_path();
|
|
|
59628
59644
|
init_logger();
|
|
59629
59645
|
init_plugin_identity();
|
|
59630
59646
|
init_write_file_atomically();
|
|
59631
|
-
import { existsSync as existsSync18, mkdirSync as mkdirSync7, readFileSync as
|
|
59647
|
+
import { existsSync as existsSync18, mkdirSync as mkdirSync7, readFileSync as readFileSync13 } from "fs";
|
|
59632
59648
|
import { join as join16 } from "path";
|
|
59633
59649
|
var POSTHOG_ACTIVITY_STATE_FILE = "posthog-activity.json";
|
|
59634
59650
|
function getPostHogActivityStateFilePath() {
|
|
@@ -59649,7 +59665,7 @@ function readPostHogActivityState() {
|
|
|
59649
59665
|
return {};
|
|
59650
59666
|
}
|
|
59651
59667
|
try {
|
|
59652
|
-
const content =
|
|
59668
|
+
const content = readFileSync13(stateFilePath, "utf-8");
|
|
59653
59669
|
const parsed = JSON.parse(content);
|
|
59654
59670
|
if (!isPostHogActivityState(parsed)) {
|
|
59655
59671
|
return {};
|
|
@@ -77684,7 +77700,7 @@ var BOULDER_STATE_PATH = `${BOULDER_DIR}/${BOULDER_FILE}`;
|
|
|
77684
77700
|
var NOTEPAD_DIR = "notepads";
|
|
77685
77701
|
var NOTEPAD_BASE_PATH = `${BOULDER_DIR}/${NOTEPAD_DIR}`;
|
|
77686
77702
|
// src/features/boulder-state/storage.ts
|
|
77687
|
-
import { existsSync as existsSync20, readFileSync as
|
|
77703
|
+
import { existsSync as existsSync20, readFileSync as readFileSync15, writeFileSync as writeFileSync6, mkdirSync as mkdirSync8, readdirSync as readdirSync3 } from "fs";
|
|
77688
77704
|
import { dirname as dirname9, join as join19, basename as basename5 } from "path";
|
|
77689
77705
|
var RESERVED_KEYS = new Set(["__proto__", "prototype", "constructor"]);
|
|
77690
77706
|
function getBoulderFilePath(directory) {
|
|
@@ -77696,7 +77712,7 @@ function readBoulderState(directory) {
|
|
|
77696
77712
|
return null;
|
|
77697
77713
|
}
|
|
77698
77714
|
try {
|
|
77699
|
-
const content =
|
|
77715
|
+
const content = readFileSync15(filePath, "utf-8");
|
|
77700
77716
|
const parsed = JSON.parse(content);
|
|
77701
77717
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
77702
77718
|
return null;
|
|
@@ -77733,7 +77749,7 @@ function getPlanProgress(planPath) {
|
|
|
77733
77749
|
return { total: 0, completed: 0, isComplete: true };
|
|
77734
77750
|
}
|
|
77735
77751
|
try {
|
|
77736
|
-
const content =
|
|
77752
|
+
const content = readFileSync15(planPath, "utf-8");
|
|
77737
77753
|
const lines = content.split(/\r?\n/);
|
|
77738
77754
|
const hasStructuredSections = lines.some((line) => TODO_HEADING_PATTERN.test(line) || FINAL_VERIFICATION_HEADING_PATTERN.test(line));
|
|
77739
77755
|
if (hasStructuredSections) {
|
|
@@ -77805,7 +77821,7 @@ function getSessionAgent(sessionID) {
|
|
|
77805
77821
|
// src/features/run-continuation-state/constants.ts
|
|
77806
77822
|
var CONTINUATION_MARKER_DIR = ".sisyphus/run-continuation";
|
|
77807
77823
|
// src/features/run-continuation-state/storage.ts
|
|
77808
|
-
import { existsSync as existsSync21, mkdirSync as mkdirSync9, readFileSync as
|
|
77824
|
+
import { existsSync as existsSync21, mkdirSync as mkdirSync9, readFileSync as readFileSync16, rmSync as rmSync2, writeFileSync as writeFileSync7 } from "fs";
|
|
77809
77825
|
import { join as join20 } from "path";
|
|
77810
77826
|
function getMarkerPath(directory, sessionID) {
|
|
77811
77827
|
return join20(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
|
|
@@ -77815,7 +77831,7 @@ function readContinuationMarker(directory, sessionID) {
|
|
|
77815
77831
|
if (!existsSync21(markerPath))
|
|
77816
77832
|
return null;
|
|
77817
77833
|
try {
|
|
77818
|
-
const raw =
|
|
77834
|
+
const raw = readFileSync16(markerPath, "utf-8");
|
|
77819
77835
|
const parsed = JSON.parse(raw);
|
|
77820
77836
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
77821
77837
|
return null;
|
|
@@ -77876,7 +77892,7 @@ async function isSessionInBoulderLineage(input) {
|
|
|
77876
77892
|
// src/hooks/atlas/session-last-agent.ts
|
|
77877
77893
|
init_shared();
|
|
77878
77894
|
init_compaction_marker();
|
|
77879
|
-
import { readFileSync as
|
|
77895
|
+
import { readFileSync as readFileSync17, readdirSync as readdirSync4 } from "fs";
|
|
77880
77896
|
import { join as join21 } from "path";
|
|
77881
77897
|
var defaultSessionLastAgentDeps = {
|
|
77882
77898
|
getMessageDir,
|
|
@@ -77925,7 +77941,7 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
|
|
|
77925
77941
|
try {
|
|
77926
77942
|
const messages = readdirSync4(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
|
|
77927
77943
|
try {
|
|
77928
|
-
const content =
|
|
77944
|
+
const content = readFileSync17(join21(messageDir, fileName), "utf-8");
|
|
77929
77945
|
const parsed = JSON.parse(content);
|
|
77930
77946
|
return {
|
|
77931
77947
|
fileName,
|
|
@@ -77958,7 +77974,7 @@ init_agent_display_names();
|
|
|
77958
77974
|
|
|
77959
77975
|
// src/hooks/ralph-loop/storage.ts
|
|
77960
77976
|
init_frontmatter();
|
|
77961
|
-
import { existsSync as existsSync22, readFileSync as
|
|
77977
|
+
import { existsSync as existsSync22, readFileSync as readFileSync18, writeFileSync as writeFileSync8, unlinkSync as unlinkSync3, mkdirSync as mkdirSync10 } from "fs";
|
|
77962
77978
|
import { dirname as dirname10, join as join22 } from "path";
|
|
77963
77979
|
|
|
77964
77980
|
// src/hooks/ralph-loop/constants.ts
|
|
@@ -77976,7 +77992,7 @@ function readState(directory, customPath) {
|
|
|
77976
77992
|
return null;
|
|
77977
77993
|
}
|
|
77978
77994
|
try {
|
|
77979
|
-
const content =
|
|
77995
|
+
const content = readFileSync18(filePath, "utf-8");
|
|
77980
77996
|
const { data, body } = parseFrontmatter(content);
|
|
77981
77997
|
const active = data.active;
|
|
77982
77998
|
const iteration = data.iteration;
|
|
@@ -78744,7 +78760,7 @@ async function getLocalVersion(options = {}) {
|
|
|
78744
78760
|
}
|
|
78745
78761
|
}
|
|
78746
78762
|
// src/cli/doctor/checks/system.ts
|
|
78747
|
-
import { existsSync as existsSync33, readFileSync as
|
|
78763
|
+
import { existsSync as existsSync33, readFileSync as readFileSync28 } from "fs";
|
|
78748
78764
|
|
|
78749
78765
|
// src/cli/doctor/checks/system-binary.ts
|
|
78750
78766
|
import { existsSync as existsSync30 } from "fs";
|
|
@@ -78865,7 +78881,7 @@ function compareVersions3(current, minimum) {
|
|
|
78865
78881
|
|
|
78866
78882
|
// src/cli/doctor/checks/system-plugin.ts
|
|
78867
78883
|
init_shared();
|
|
78868
|
-
import { existsSync as existsSync31, readFileSync as
|
|
78884
|
+
import { existsSync as existsSync31, readFileSync as readFileSync26 } from "fs";
|
|
78869
78885
|
function detectConfigPath() {
|
|
78870
78886
|
const paths = getOpenCodeConfigPaths({ binary: "opencode", version: null });
|
|
78871
78887
|
if (existsSync31(paths.configJsonc))
|
|
@@ -78916,7 +78932,7 @@ function getPluginInfo() {
|
|
|
78916
78932
|
};
|
|
78917
78933
|
}
|
|
78918
78934
|
try {
|
|
78919
|
-
const content =
|
|
78935
|
+
const content = readFileSync26(configPath, "utf-8");
|
|
78920
78936
|
const parsedConfig = parseJsonc(content);
|
|
78921
78937
|
const pluginEntry = findPluginEntry2(parsedConfig.plugin ?? []);
|
|
78922
78938
|
if (!pluginEntry) {
|
|
@@ -78954,7 +78970,7 @@ function getPluginInfo() {
|
|
|
78954
78970
|
init_file_utils();
|
|
78955
78971
|
init_checker();
|
|
78956
78972
|
init_auto_update_checker();
|
|
78957
|
-
import { existsSync as existsSync32, readFileSync as
|
|
78973
|
+
import { existsSync as existsSync32, readFileSync as readFileSync27 } from "fs";
|
|
78958
78974
|
import { homedir as homedir7 } from "os";
|
|
78959
78975
|
import { join as join30 } from "path";
|
|
78960
78976
|
init_shared();
|
|
@@ -78984,7 +79000,7 @@ function readPackageJson(filePath) {
|
|
|
78984
79000
|
if (!existsSync32(filePath))
|
|
78985
79001
|
return null;
|
|
78986
79002
|
try {
|
|
78987
|
-
const content =
|
|
79003
|
+
const content = readFileSync27(filePath, "utf-8");
|
|
78988
79004
|
return parseJsonc(content);
|
|
78989
79005
|
} catch {
|
|
78990
79006
|
return null;
|
|
@@ -79066,7 +79082,7 @@ function isConfigValid(configPath) {
|
|
|
79066
79082
|
if (!existsSync33(configPath))
|
|
79067
79083
|
return false;
|
|
79068
79084
|
try {
|
|
79069
|
-
parseJsonc(
|
|
79085
|
+
parseJsonc(readFileSync28(configPath, "utf-8"));
|
|
79070
79086
|
return true;
|
|
79071
79087
|
} catch {
|
|
79072
79088
|
return false;
|
|
@@ -79188,13 +79204,13 @@ async function checkSystem(deps = defaultDeps3) {
|
|
|
79188
79204
|
}
|
|
79189
79205
|
|
|
79190
79206
|
// src/cli/doctor/checks/config.ts
|
|
79191
|
-
import { readFileSync as
|
|
79207
|
+
import { readFileSync as readFileSync31 } from "fs";
|
|
79192
79208
|
import { join as join34 } from "path";
|
|
79193
79209
|
init_shared();
|
|
79194
79210
|
|
|
79195
79211
|
// src/cli/doctor/checks/model-resolution-cache.ts
|
|
79196
79212
|
init_shared();
|
|
79197
|
-
import { existsSync as existsSync34, readFileSync as
|
|
79213
|
+
import { existsSync as existsSync34, readFileSync as readFileSync29 } from "fs";
|
|
79198
79214
|
import { homedir as homedir8 } from "os";
|
|
79199
79215
|
import { join as join31 } from "path";
|
|
79200
79216
|
function getUserConfigDir2() {
|
|
@@ -79213,7 +79229,7 @@ function loadCustomProviderNames() {
|
|
|
79213
79229
|
if (!existsSync34(configPath))
|
|
79214
79230
|
continue;
|
|
79215
79231
|
try {
|
|
79216
|
-
const content =
|
|
79232
|
+
const content = readFileSync29(configPath, "utf-8");
|
|
79217
79233
|
const data = parseJsonc(content);
|
|
79218
79234
|
if (data?.provider && typeof data.provider === "object") {
|
|
79219
79235
|
return Object.keys(data.provider);
|
|
@@ -79232,7 +79248,7 @@ function loadAvailableModelsFromCache() {
|
|
|
79232
79248
|
return { providers: [], modelCount: 0, cacheExists: false };
|
|
79233
79249
|
}
|
|
79234
79250
|
try {
|
|
79235
|
-
const content =
|
|
79251
|
+
const content = readFileSync29(cacheFile, "utf-8");
|
|
79236
79252
|
const data = parseJsonc(content);
|
|
79237
79253
|
const cacheProviders = Object.keys(data);
|
|
79238
79254
|
let modelCount = 0;
|
|
@@ -79255,14 +79271,14 @@ init_model_capabilities();
|
|
|
79255
79271
|
|
|
79256
79272
|
// src/cli/doctor/checks/model-resolution-config.ts
|
|
79257
79273
|
init_shared();
|
|
79258
|
-
import { readFileSync as
|
|
79274
|
+
import { readFileSync as readFileSync30 } from "fs";
|
|
79259
79275
|
import { join as join32 } from "path";
|
|
79260
79276
|
var PROJECT_CONFIG_DIR = join32(process.cwd(), ".opencode");
|
|
79261
79277
|
function loadOmoConfig() {
|
|
79262
79278
|
const projectDetected = detectPluginConfigFile(PROJECT_CONFIG_DIR);
|
|
79263
79279
|
if (projectDetected.format !== "none") {
|
|
79264
79280
|
try {
|
|
79265
|
-
const content =
|
|
79281
|
+
const content = readFileSync30(projectDetected.path, "utf-8");
|
|
79266
79282
|
return parseJsonc(content);
|
|
79267
79283
|
} catch {
|
|
79268
79284
|
return null;
|
|
@@ -79272,7 +79288,7 @@ function loadOmoConfig() {
|
|
|
79272
79288
|
const userDetected = detectPluginConfigFile(userConfigDir);
|
|
79273
79289
|
if (userDetected.format !== "none") {
|
|
79274
79290
|
try {
|
|
79275
|
-
const content =
|
|
79291
|
+
const content = readFileSync30(userDetected.path, "utf-8");
|
|
79276
79292
|
return parseJsonc(content);
|
|
79277
79293
|
} catch {
|
|
79278
79294
|
return null;
|
|
@@ -79497,7 +79513,7 @@ function validateConfig() {
|
|
|
79497
79513
|
return { exists: false, path: null, valid: true, config: null, errors: [] };
|
|
79498
79514
|
}
|
|
79499
79515
|
try {
|
|
79500
|
-
const content =
|
|
79516
|
+
const content = readFileSync31(configPath, "utf-8");
|
|
79501
79517
|
const rawConfig = parseJsonc(content);
|
|
79502
79518
|
const schemaResult = OhMyOpenCodeConfigSchema.safeParse(rawConfig);
|
|
79503
79519
|
if (!schemaResult.success) {
|
|
@@ -79879,7 +79895,7 @@ var BUILTIN_SERVERS = {
|
|
|
79879
79895
|
"kotlin-ls": { command: ["kotlin-lsp"], extensions: [".kt", ".kts"] }
|
|
79880
79896
|
};
|
|
79881
79897
|
// src/tools/lsp/server-config-loader.ts
|
|
79882
|
-
import { existsSync as existsSync36, readFileSync as
|
|
79898
|
+
import { existsSync as existsSync36, readFileSync as readFileSync32 } from "fs";
|
|
79883
79899
|
import { join as join37 } from "path";
|
|
79884
79900
|
init_shared();
|
|
79885
79901
|
init_jsonc_parser();
|
|
@@ -79887,7 +79903,7 @@ function loadJsonFile(path12) {
|
|
|
79887
79903
|
if (!existsSync36(path12))
|
|
79888
79904
|
return null;
|
|
79889
79905
|
try {
|
|
79890
|
-
return parseJsonc(
|
|
79906
|
+
return parseJsonc(readFileSync32(path12, "utf-8"));
|
|
79891
79907
|
} catch {
|
|
79892
79908
|
return null;
|
|
79893
79909
|
}
|
|
@@ -80081,7 +80097,7 @@ function getInstalledLspServers() {
|
|
|
80081
80097
|
|
|
80082
80098
|
// src/cli/doctor/checks/tools-mcp.ts
|
|
80083
80099
|
init_shared();
|
|
80084
|
-
import { existsSync as existsSync38, readFileSync as
|
|
80100
|
+
import { existsSync as existsSync38, readFileSync as readFileSync33 } from "fs";
|
|
80085
80101
|
import { homedir as homedir10 } from "os";
|
|
80086
80102
|
import { join as join40 } from "path";
|
|
80087
80103
|
var BUILTIN_MCP_SERVERS = ["context7", "grep_app"];
|
|
@@ -80098,7 +80114,7 @@ function loadUserMcpConfig() {
|
|
|
80098
80114
|
if (!existsSync38(configPath))
|
|
80099
80115
|
continue;
|
|
80100
80116
|
try {
|
|
80101
|
-
const content =
|
|
80117
|
+
const content = readFileSync33(configPath, "utf-8");
|
|
80102
80118
|
const config2 = parseJsonc(content);
|
|
80103
80119
|
if (config2.mcpServers) {
|
|
80104
80120
|
Object.assign(servers, config2.mcpServers);
|
|
@@ -80596,7 +80612,7 @@ async function refreshModelCapabilities(options, deps = {}) {
|
|
|
80596
80612
|
|
|
80597
80613
|
// src/features/mcp-oauth/storage.ts
|
|
80598
80614
|
init_shared();
|
|
80599
|
-
import { chmodSync as chmodSync2, existsSync as existsSync39, mkdirSync as mkdirSync12, readFileSync as
|
|
80615
|
+
import { chmodSync as chmodSync2, existsSync as existsSync39, mkdirSync as mkdirSync12, readFileSync as readFileSync34, renameSync as renameSync4, unlinkSync as unlinkSync6, writeFileSync as writeFileSync11 } from "fs";
|
|
80600
80616
|
import { dirname as dirname15, join as join41 } from "path";
|
|
80601
80617
|
var STORAGE_FILE_NAME = "mcp-oauth.json";
|
|
80602
80618
|
function getMcpOauthStoragePath() {
|
|
@@ -80641,7 +80657,7 @@ function readStore() {
|
|
|
80641
80657
|
return null;
|
|
80642
80658
|
}
|
|
80643
80659
|
try {
|
|
80644
|
-
const content =
|
|
80660
|
+
const content = readFileSync34(filePath, "utf-8");
|
|
80645
80661
|
return JSON.parse(content);
|
|
80646
80662
|
} catch {
|
|
80647
80663
|
return null;
|
|
@@ -80655,7 +80671,7 @@ function writeStore(store2) {
|
|
|
80655
80671
|
mkdirSync12(dir, { recursive: true });
|
|
80656
80672
|
}
|
|
80657
80673
|
const tempPath = `${filePath}.tmp.${Date.now()}`;
|
|
80658
|
-
|
|
80674
|
+
writeFileSync11(tempPath, JSON.stringify(store2, null, 2), { encoding: "utf-8", mode: 384 });
|
|
80659
80675
|
chmodSync2(tempPath, 384);
|
|
80660
80676
|
renameSync4(tempPath, filePath);
|
|
80661
80677
|
return true;
|
|
@@ -5,7 +5,7 @@ export declare class ConcurrencyManager {
|
|
|
5
5
|
private queues;
|
|
6
6
|
constructor(config?: BackgroundTaskConfig);
|
|
7
7
|
getConcurrencyLimit(model: string): number;
|
|
8
|
-
acquire(model: string): Promise<void>;
|
|
8
|
+
acquire(model: string, timeoutMs?: number): Promise<void>;
|
|
9
9
|
release(model: string): void;
|
|
10
10
|
/**
|
|
11
11
|
* Cancel all waiting acquires for a model. Used during cleanup.
|
|
@@ -17,5 +17,11 @@ export declare function createToolOutputTruncatorHook(ctx: PluginInput, options?
|
|
|
17
17
|
output: string;
|
|
18
18
|
metadata: unknown;
|
|
19
19
|
}) => Promise<void>;
|
|
20
|
+
event: ({ event }: {
|
|
21
|
+
event: {
|
|
22
|
+
type: string;
|
|
23
|
+
properties?: unknown;
|
|
24
|
+
};
|
|
25
|
+
}) => Promise<void>;
|
|
20
26
|
};
|
|
21
27
|
export {};
|