@kryvenaiofficial/kryven 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +936 -557
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -1162,8 +1162,8 @@ var require_command = __commonJS({
|
|
|
1162
1162
|
"node_modules/commander/lib/command.js"(exports) {
|
|
1163
1163
|
var EventEmitter6 = __require("node:events").EventEmitter;
|
|
1164
1164
|
var childProcess = __require("node:child_process");
|
|
1165
|
-
var
|
|
1166
|
-
var
|
|
1165
|
+
var path10 = __require("node:path");
|
|
1166
|
+
var fs6 = __require("node:fs");
|
|
1167
1167
|
var process21 = __require("node:process");
|
|
1168
1168
|
var { Argument: Argument2, humanReadableArgName } = require_argument();
|
|
1169
1169
|
var { CommanderError: CommanderError2 } = require_error();
|
|
@@ -2144,7 +2144,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2144
2144
|
* @param {string} subcommandName
|
|
2145
2145
|
*/
|
|
2146
2146
|
_checkForMissingExecutable(executableFile, executableDir, subcommandName) {
|
|
2147
|
-
if (
|
|
2147
|
+
if (fs6.existsSync(executableFile)) return;
|
|
2148
2148
|
const executableDirMessage = executableDir ? `searched for local subcommand relative to directory '${executableDir}'` : "no directory for search for local subcommand, use .executableDir() to supply a custom directory";
|
|
2149
2149
|
const executableMissing = `'${executableFile}' does not exist
|
|
2150
2150
|
- if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
@@ -2162,11 +2162,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2162
2162
|
let launchWithNode = false;
|
|
2163
2163
|
const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
2164
2164
|
function findFile(baseDir, baseName) {
|
|
2165
|
-
const localBin =
|
|
2166
|
-
if (
|
|
2167
|
-
if (sourceExt.includes(
|
|
2165
|
+
const localBin = path10.resolve(baseDir, baseName);
|
|
2166
|
+
if (fs6.existsSync(localBin)) return localBin;
|
|
2167
|
+
if (sourceExt.includes(path10.extname(baseName))) return void 0;
|
|
2168
2168
|
const foundExt = sourceExt.find(
|
|
2169
|
-
(ext) =>
|
|
2169
|
+
(ext) => fs6.existsSync(`${localBin}${ext}`)
|
|
2170
2170
|
);
|
|
2171
2171
|
if (foundExt) return `${localBin}${foundExt}`;
|
|
2172
2172
|
return void 0;
|
|
@@ -2178,21 +2178,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2178
2178
|
if (this._scriptPath) {
|
|
2179
2179
|
let resolvedScriptPath;
|
|
2180
2180
|
try {
|
|
2181
|
-
resolvedScriptPath =
|
|
2181
|
+
resolvedScriptPath = fs6.realpathSync(this._scriptPath);
|
|
2182
2182
|
} catch {
|
|
2183
2183
|
resolvedScriptPath = this._scriptPath;
|
|
2184
2184
|
}
|
|
2185
|
-
executableDir =
|
|
2186
|
-
|
|
2185
|
+
executableDir = path10.resolve(
|
|
2186
|
+
path10.dirname(resolvedScriptPath),
|
|
2187
2187
|
executableDir
|
|
2188
2188
|
);
|
|
2189
2189
|
}
|
|
2190
2190
|
if (executableDir) {
|
|
2191
2191
|
let localFile = findFile(executableDir, executableFile);
|
|
2192
2192
|
if (!localFile && !subcommand._executableFile && this._scriptPath) {
|
|
2193
|
-
const legacyName =
|
|
2193
|
+
const legacyName = path10.basename(
|
|
2194
2194
|
this._scriptPath,
|
|
2195
|
-
|
|
2195
|
+
path10.extname(this._scriptPath)
|
|
2196
2196
|
);
|
|
2197
2197
|
if (legacyName !== this._name) {
|
|
2198
2198
|
localFile = findFile(
|
|
@@ -2203,7 +2203,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2203
2203
|
}
|
|
2204
2204
|
executableFile = localFile || executableFile;
|
|
2205
2205
|
}
|
|
2206
|
-
launchWithNode = sourceExt.includes(
|
|
2206
|
+
launchWithNode = sourceExt.includes(path10.extname(executableFile));
|
|
2207
2207
|
let proc;
|
|
2208
2208
|
if (process21.platform !== "win32") {
|
|
2209
2209
|
if (launchWithNode) {
|
|
@@ -3050,7 +3050,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3050
3050
|
* @return {Command}
|
|
3051
3051
|
*/
|
|
3052
3052
|
nameFromFilename(filename) {
|
|
3053
|
-
this._name =
|
|
3053
|
+
this._name = path10.basename(filename, path10.extname(filename));
|
|
3054
3054
|
return this;
|
|
3055
3055
|
}
|
|
3056
3056
|
/**
|
|
@@ -3064,9 +3064,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3064
3064
|
* @param {string} [path]
|
|
3065
3065
|
* @return {(string|null|Command)}
|
|
3066
3066
|
*/
|
|
3067
|
-
executableDir(
|
|
3068
|
-
if (
|
|
3069
|
-
this._executableDir =
|
|
3067
|
+
executableDir(path11) {
|
|
3068
|
+
if (path11 === void 0) return this._executableDir;
|
|
3069
|
+
this._executableDir = path11;
|
|
3070
3070
|
return this;
|
|
3071
3071
|
}
|
|
3072
3072
|
/**
|
|
@@ -3679,10 +3679,10 @@ function logPath() {
|
|
|
3679
3679
|
}
|
|
3680
3680
|
function writeLine(level, parts) {
|
|
3681
3681
|
if (!DEBUG) return;
|
|
3682
|
-
const
|
|
3683
|
-
if (!existsSync(dirname(
|
|
3682
|
+
const path10 = logPath();
|
|
3683
|
+
if (!existsSync(dirname(path10))) {
|
|
3684
3684
|
try {
|
|
3685
|
-
mkdirSync(dirname(
|
|
3685
|
+
mkdirSync(dirname(path10), { recursive: true });
|
|
3686
3686
|
} catch {
|
|
3687
3687
|
return;
|
|
3688
3688
|
}
|
|
@@ -3690,7 +3690,7 @@ function writeLine(level, parts) {
|
|
|
3690
3690
|
const line = `${(/* @__PURE__ */ new Date()).toISOString()} ${level} ${parts.map((p) => typeof p === "string" ? p : JSON.stringify(p)).join(" ")}
|
|
3691
3691
|
`;
|
|
3692
3692
|
try {
|
|
3693
|
-
appendFileSync(
|
|
3693
|
+
appendFileSync(path10, line);
|
|
3694
3694
|
} catch {
|
|
3695
3695
|
}
|
|
3696
3696
|
}
|
|
@@ -3790,8 +3790,8 @@ var init_client = __esm({
|
|
|
3790
3790
|
...extra
|
|
3791
3791
|
};
|
|
3792
3792
|
}
|
|
3793
|
-
async request(
|
|
3794
|
-
const url = `${this.baseUrl}${
|
|
3793
|
+
async request(path10, init, signal) {
|
|
3794
|
+
const url = `${this.baseUrl}${path10}`;
|
|
3795
3795
|
logger.debug(
|
|
3796
3796
|
"request",
|
|
3797
3797
|
init.method ?? "GET",
|
|
@@ -4838,8 +4838,8 @@ var require_windows = __commonJS({
|
|
|
4838
4838
|
"node_modules/isexe/windows.js"(exports, module) {
|
|
4839
4839
|
module.exports = isexe;
|
|
4840
4840
|
isexe.sync = sync;
|
|
4841
|
-
var
|
|
4842
|
-
function checkPathExt(
|
|
4841
|
+
var fs6 = __require("fs");
|
|
4842
|
+
function checkPathExt(path10, options) {
|
|
4843
4843
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
4844
4844
|
if (!pathext) {
|
|
4845
4845
|
return true;
|
|
@@ -4850,25 +4850,25 @@ var require_windows = __commonJS({
|
|
|
4850
4850
|
}
|
|
4851
4851
|
for (var i2 = 0; i2 < pathext.length; i2++) {
|
|
4852
4852
|
var p = pathext[i2].toLowerCase();
|
|
4853
|
-
if (p &&
|
|
4853
|
+
if (p && path10.substr(-p.length).toLowerCase() === p) {
|
|
4854
4854
|
return true;
|
|
4855
4855
|
}
|
|
4856
4856
|
}
|
|
4857
4857
|
return false;
|
|
4858
4858
|
}
|
|
4859
|
-
function checkStat(stat9,
|
|
4859
|
+
function checkStat(stat9, path10, options) {
|
|
4860
4860
|
if (!stat9.isSymbolicLink() && !stat9.isFile()) {
|
|
4861
4861
|
return false;
|
|
4862
4862
|
}
|
|
4863
|
-
return checkPathExt(
|
|
4863
|
+
return checkPathExt(path10, options);
|
|
4864
4864
|
}
|
|
4865
|
-
function isexe(
|
|
4866
|
-
|
|
4867
|
-
cb(er, er ? false : checkStat(stat9,
|
|
4865
|
+
function isexe(path10, options, cb) {
|
|
4866
|
+
fs6.stat(path10, function(er, stat9) {
|
|
4867
|
+
cb(er, er ? false : checkStat(stat9, path10, options));
|
|
4868
4868
|
});
|
|
4869
4869
|
}
|
|
4870
|
-
function sync(
|
|
4871
|
-
return checkStat(
|
|
4870
|
+
function sync(path10, options) {
|
|
4871
|
+
return checkStat(fs6.statSync(path10), path10, options);
|
|
4872
4872
|
}
|
|
4873
4873
|
}
|
|
4874
4874
|
});
|
|
@@ -4878,14 +4878,14 @@ var require_mode = __commonJS({
|
|
|
4878
4878
|
"node_modules/isexe/mode.js"(exports, module) {
|
|
4879
4879
|
module.exports = isexe;
|
|
4880
4880
|
isexe.sync = sync;
|
|
4881
|
-
var
|
|
4882
|
-
function isexe(
|
|
4883
|
-
|
|
4881
|
+
var fs6 = __require("fs");
|
|
4882
|
+
function isexe(path10, options, cb) {
|
|
4883
|
+
fs6.stat(path10, function(er, stat9) {
|
|
4884
4884
|
cb(er, er ? false : checkStat(stat9, options));
|
|
4885
4885
|
});
|
|
4886
4886
|
}
|
|
4887
|
-
function sync(
|
|
4888
|
-
return checkStat(
|
|
4887
|
+
function sync(path10, options) {
|
|
4888
|
+
return checkStat(fs6.statSync(path10), options);
|
|
4889
4889
|
}
|
|
4890
4890
|
function checkStat(stat9, options) {
|
|
4891
4891
|
return stat9.isFile() && checkMode(stat9, options);
|
|
@@ -4909,7 +4909,7 @@ var require_mode = __commonJS({
|
|
|
4909
4909
|
// node_modules/isexe/index.js
|
|
4910
4910
|
var require_isexe = __commonJS({
|
|
4911
4911
|
"node_modules/isexe/index.js"(exports, module) {
|
|
4912
|
-
var
|
|
4912
|
+
var fs6 = __require("fs");
|
|
4913
4913
|
var core;
|
|
4914
4914
|
if (process.platform === "win32" || global.TESTING_WINDOWS) {
|
|
4915
4915
|
core = require_windows();
|
|
@@ -4918,7 +4918,7 @@ var require_isexe = __commonJS({
|
|
|
4918
4918
|
}
|
|
4919
4919
|
module.exports = isexe;
|
|
4920
4920
|
isexe.sync = sync;
|
|
4921
|
-
function isexe(
|
|
4921
|
+
function isexe(path10, options, cb) {
|
|
4922
4922
|
if (typeof options === "function") {
|
|
4923
4923
|
cb = options;
|
|
4924
4924
|
options = {};
|
|
@@ -4928,7 +4928,7 @@ var require_isexe = __commonJS({
|
|
|
4928
4928
|
throw new TypeError("callback not provided");
|
|
4929
4929
|
}
|
|
4930
4930
|
return new Promise(function(resolve7, reject) {
|
|
4931
|
-
isexe(
|
|
4931
|
+
isexe(path10, options || {}, function(er, is) {
|
|
4932
4932
|
if (er) {
|
|
4933
4933
|
reject(er);
|
|
4934
4934
|
} else {
|
|
@@ -4937,7 +4937,7 @@ var require_isexe = __commonJS({
|
|
|
4937
4937
|
});
|
|
4938
4938
|
});
|
|
4939
4939
|
}
|
|
4940
|
-
core(
|
|
4940
|
+
core(path10, options || {}, function(er, is) {
|
|
4941
4941
|
if (er) {
|
|
4942
4942
|
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
4943
4943
|
er = null;
|
|
@@ -4947,9 +4947,9 @@ var require_isexe = __commonJS({
|
|
|
4947
4947
|
cb(er, is);
|
|
4948
4948
|
});
|
|
4949
4949
|
}
|
|
4950
|
-
function sync(
|
|
4950
|
+
function sync(path10, options) {
|
|
4951
4951
|
try {
|
|
4952
|
-
return core.sync(
|
|
4952
|
+
return core.sync(path10, options || {});
|
|
4953
4953
|
} catch (er) {
|
|
4954
4954
|
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
4955
4955
|
return false;
|
|
@@ -4965,7 +4965,7 @@ var require_isexe = __commonJS({
|
|
|
4965
4965
|
var require_which = __commonJS({
|
|
4966
4966
|
"node_modules/which/which.js"(exports, module) {
|
|
4967
4967
|
var isWindows3 = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
4968
|
-
var
|
|
4968
|
+
var path10 = __require("path");
|
|
4969
4969
|
var COLON = isWindows3 ? ";" : ":";
|
|
4970
4970
|
var isexe = require_isexe();
|
|
4971
4971
|
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
@@ -5003,7 +5003,7 @@ var require_which = __commonJS({
|
|
|
5003
5003
|
return opt.all && found.length ? resolve7(found) : reject(getNotFoundError(cmd));
|
|
5004
5004
|
const ppRaw = pathEnv[i2];
|
|
5005
5005
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
5006
|
-
const pCmd =
|
|
5006
|
+
const pCmd = path10.join(pathPart, cmd);
|
|
5007
5007
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
5008
5008
|
resolve7(subStep(p, i2, 0));
|
|
5009
5009
|
});
|
|
@@ -5030,7 +5030,7 @@ var require_which = __commonJS({
|
|
|
5030
5030
|
for (let i2 = 0; i2 < pathEnv.length; i2++) {
|
|
5031
5031
|
const ppRaw = pathEnv[i2];
|
|
5032
5032
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
5033
|
-
const pCmd =
|
|
5033
|
+
const pCmd = path10.join(pathPart, cmd);
|
|
5034
5034
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
5035
5035
|
for (let j = 0; j < pathExt.length; j++) {
|
|
5036
5036
|
const cur = p + pathExt[j];
|
|
@@ -5078,7 +5078,7 @@ var require_path_key = __commonJS({
|
|
|
5078
5078
|
var require_resolveCommand = __commonJS({
|
|
5079
5079
|
"node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
|
|
5080
5080
|
"use strict";
|
|
5081
|
-
var
|
|
5081
|
+
var path10 = __require("path");
|
|
5082
5082
|
var which = require_which();
|
|
5083
5083
|
var getPathKey = require_path_key();
|
|
5084
5084
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
@@ -5096,7 +5096,7 @@ var require_resolveCommand = __commonJS({
|
|
|
5096
5096
|
try {
|
|
5097
5097
|
resolved = which.sync(parsed.command, {
|
|
5098
5098
|
path: env4[getPathKey({ env: env4 })],
|
|
5099
|
-
pathExt: withoutPathExt ?
|
|
5099
|
+
pathExt: withoutPathExt ? path10.delimiter : void 0
|
|
5100
5100
|
});
|
|
5101
5101
|
} catch (e) {
|
|
5102
5102
|
} finally {
|
|
@@ -5105,7 +5105,7 @@ var require_resolveCommand = __commonJS({
|
|
|
5105
5105
|
}
|
|
5106
5106
|
}
|
|
5107
5107
|
if (resolved) {
|
|
5108
|
-
resolved =
|
|
5108
|
+
resolved = path10.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
5109
5109
|
}
|
|
5110
5110
|
return resolved;
|
|
5111
5111
|
}
|
|
@@ -5159,8 +5159,8 @@ var require_shebang_command = __commonJS({
|
|
|
5159
5159
|
if (!match) {
|
|
5160
5160
|
return null;
|
|
5161
5161
|
}
|
|
5162
|
-
const [
|
|
5163
|
-
const binary =
|
|
5162
|
+
const [path10, argument] = match[0].replace(/#! ?/, "").split(" ");
|
|
5163
|
+
const binary = path10.split("/").pop();
|
|
5164
5164
|
if (binary === "env") {
|
|
5165
5165
|
return argument;
|
|
5166
5166
|
}
|
|
@@ -5173,16 +5173,16 @@ var require_shebang_command = __commonJS({
|
|
|
5173
5173
|
var require_readShebang = __commonJS({
|
|
5174
5174
|
"node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
|
|
5175
5175
|
"use strict";
|
|
5176
|
-
var
|
|
5176
|
+
var fs6 = __require("fs");
|
|
5177
5177
|
var shebangCommand = require_shebang_command();
|
|
5178
5178
|
function readShebang(command) {
|
|
5179
5179
|
const size = 150;
|
|
5180
5180
|
const buffer = Buffer.alloc(size);
|
|
5181
5181
|
let fd;
|
|
5182
5182
|
try {
|
|
5183
|
-
fd =
|
|
5184
|
-
|
|
5185
|
-
|
|
5183
|
+
fd = fs6.openSync(command, "r");
|
|
5184
|
+
fs6.readSync(fd, buffer, 0, size, 0);
|
|
5185
|
+
fs6.closeSync(fd);
|
|
5186
5186
|
} catch (e) {
|
|
5187
5187
|
}
|
|
5188
5188
|
return shebangCommand(buffer.toString());
|
|
@@ -5195,7 +5195,7 @@ var require_readShebang = __commonJS({
|
|
|
5195
5195
|
var require_parse = __commonJS({
|
|
5196
5196
|
"node_modules/cross-spawn/lib/parse.js"(exports, module) {
|
|
5197
5197
|
"use strict";
|
|
5198
|
-
var
|
|
5198
|
+
var path10 = __require("path");
|
|
5199
5199
|
var resolveCommand = require_resolveCommand();
|
|
5200
5200
|
var escape2 = require_escape();
|
|
5201
5201
|
var readShebang = require_readShebang();
|
|
@@ -5220,7 +5220,7 @@ var require_parse = __commonJS({
|
|
|
5220
5220
|
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
5221
5221
|
if (parsed.options.forceShell || needsShell) {
|
|
5222
5222
|
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
5223
|
-
parsed.command =
|
|
5223
|
+
parsed.command = path10.normalize(parsed.command);
|
|
5224
5224
|
parsed.command = escape2.command(parsed.command);
|
|
5225
5225
|
parsed.args = parsed.args.map((arg) => escape2.argument(arg, needsDoubleEscapeMetaChars));
|
|
5226
5226
|
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
@@ -5310,7 +5310,7 @@ var require_cross_spawn = __commonJS({
|
|
|
5310
5310
|
var cp2 = __require("child_process");
|
|
5311
5311
|
var parse = require_parse();
|
|
5312
5312
|
var enoent = require_enoent();
|
|
5313
|
-
function
|
|
5313
|
+
function spawn12(command, args, options) {
|
|
5314
5314
|
const parsed = parse(command, args, options);
|
|
5315
5315
|
const spawned = cp2.spawn(parsed.command, parsed.args, parsed.options);
|
|
5316
5316
|
enoent.hookChildProcess(spawned, parsed);
|
|
@@ -5322,8 +5322,8 @@ var require_cross_spawn = __commonJS({
|
|
|
5322
5322
|
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
5323
5323
|
return result;
|
|
5324
5324
|
}
|
|
5325
|
-
module.exports =
|
|
5326
|
-
module.exports.spawn =
|
|
5325
|
+
module.exports = spawn12;
|
|
5326
|
+
module.exports.spawn = spawn12;
|
|
5327
5327
|
module.exports.sync = spawnSync3;
|
|
5328
5328
|
module.exports._parse = parse;
|
|
5329
5329
|
module.exports._enoent = enoent;
|
|
@@ -9350,13 +9350,13 @@ var init_output_sync = __esm({
|
|
|
9350
9350
|
}
|
|
9351
9351
|
};
|
|
9352
9352
|
writeToFiles = (serializedResult, stdioItems, outputFiles) => {
|
|
9353
|
-
for (const { path:
|
|
9354
|
-
const pathString = typeof
|
|
9353
|
+
for (const { path: path10, append } of stdioItems.filter(({ type }) => FILE_TYPES.has(type))) {
|
|
9354
|
+
const pathString = typeof path10 === "string" ? path10 : path10.toString();
|
|
9355
9355
|
if (append || outputFiles.has(pathString)) {
|
|
9356
|
-
appendFileSync2(
|
|
9356
|
+
appendFileSync2(path10, serializedResult);
|
|
9357
9357
|
} else {
|
|
9358
9358
|
outputFiles.add(pathString);
|
|
9359
|
-
writeFileSync(
|
|
9359
|
+
writeFileSync(path10, serializedResult);
|
|
9360
9360
|
}
|
|
9361
9361
|
}
|
|
9362
9362
|
};
|
|
@@ -12518,8 +12518,8 @@ var init_parseUtil = __esm({
|
|
|
12518
12518
|
init_errors2();
|
|
12519
12519
|
init_en();
|
|
12520
12520
|
makeIssue = (params) => {
|
|
12521
|
-
const { data, path:
|
|
12522
|
-
const fullPath = [...
|
|
12521
|
+
const { data, path: path10, errorMaps, issueData } = params;
|
|
12522
|
+
const fullPath = [...path10, ...issueData.path || []];
|
|
12523
12523
|
const fullIssue = {
|
|
12524
12524
|
...issueData,
|
|
12525
12525
|
path: fullPath
|
|
@@ -12827,11 +12827,11 @@ var init_types = __esm({
|
|
|
12827
12827
|
init_parseUtil();
|
|
12828
12828
|
init_util();
|
|
12829
12829
|
ParseInputLazyPath = class {
|
|
12830
|
-
constructor(parent, value,
|
|
12830
|
+
constructor(parent, value, path10, key) {
|
|
12831
12831
|
this._cachedPath = [];
|
|
12832
12832
|
this.parent = parent;
|
|
12833
12833
|
this.data = value;
|
|
12834
|
-
this._path =
|
|
12834
|
+
this._path = path10;
|
|
12835
12835
|
this._key = key;
|
|
12836
12836
|
}
|
|
12837
12837
|
get path() {
|
|
@@ -16262,35 +16262,35 @@ import {
|
|
|
16262
16262
|
} from "node:fs";
|
|
16263
16263
|
import { dirname as dirname2 } from "node:path";
|
|
16264
16264
|
function loadUserConfig() {
|
|
16265
|
-
const
|
|
16266
|
-
if (!existsSync2(
|
|
16265
|
+
const path10 = getConfigPath();
|
|
16266
|
+
if (!existsSync2(path10)) return {};
|
|
16267
16267
|
try {
|
|
16268
|
-
const raw = JSON.parse(readFileSync3(
|
|
16268
|
+
const raw = JSON.parse(readFileSync3(path10, "utf8"));
|
|
16269
16269
|
return UserConfigSchema.parse(raw);
|
|
16270
16270
|
} catch (err) {
|
|
16271
|
-
logger.warn("config: failed to parse",
|
|
16271
|
+
logger.warn("config: failed to parse", path10, String(err));
|
|
16272
16272
|
return {};
|
|
16273
16273
|
}
|
|
16274
16274
|
}
|
|
16275
16275
|
function saveUserConfig(cfg) {
|
|
16276
|
-
const
|
|
16277
|
-
const dir = dirname2(
|
|
16276
|
+
const path10 = getConfigPath();
|
|
16277
|
+
const dir = dirname2(path10);
|
|
16278
16278
|
if (!existsSync2(dir)) mkdirSync2(dir, { recursive: true, mode: 448 });
|
|
16279
|
-
writeFileSync2(
|
|
16279
|
+
writeFileSync2(path10, JSON.stringify(cfg, null, 2));
|
|
16280
16280
|
try {
|
|
16281
|
-
chmodSync(
|
|
16281
|
+
chmodSync(path10, 384);
|
|
16282
16282
|
} catch (err) {
|
|
16283
16283
|
logger.warn("config: chmod 0600 failed", String(err));
|
|
16284
16284
|
}
|
|
16285
16285
|
}
|
|
16286
16286
|
function loadProjectConfig(cwd2) {
|
|
16287
|
-
const
|
|
16288
|
-
if (!existsSync2(
|
|
16287
|
+
const path10 = getProjectConfigPath(cwd2);
|
|
16288
|
+
if (!existsSync2(path10)) return {};
|
|
16289
16289
|
try {
|
|
16290
|
-
const raw = JSON.parse(readFileSync3(
|
|
16290
|
+
const raw = JSON.parse(readFileSync3(path10, "utf8"));
|
|
16291
16291
|
return ProjectConfigSchema.parse(raw);
|
|
16292
16292
|
} catch (err) {
|
|
16293
|
-
logger.warn("project config: failed to parse",
|
|
16293
|
+
logger.warn("project config: failed to parse", path10, String(err));
|
|
16294
16294
|
return {};
|
|
16295
16295
|
}
|
|
16296
16296
|
}
|
|
@@ -16346,12 +16346,12 @@ var init_load = __esm({
|
|
|
16346
16346
|
import { readFileSync as readFileSync4, existsSync as existsSync3 } from "node:fs";
|
|
16347
16347
|
import { join as join2 } from "node:path";
|
|
16348
16348
|
import { homedir as homedir2 } from "node:os";
|
|
16349
|
-
function readCapped(
|
|
16350
|
-
if (!existsSync3(
|
|
16349
|
+
function readCapped(path10) {
|
|
16350
|
+
if (!existsSync3(path10)) return null;
|
|
16351
16351
|
try {
|
|
16352
|
-
const raw = readFileSync4(
|
|
16352
|
+
const raw = readFileSync4(path10, "utf8");
|
|
16353
16353
|
const truncated = raw.length > MAX_CHARS;
|
|
16354
|
-
return { path:
|
|
16354
|
+
return { path: path10, content: truncated ? raw.slice(0, MAX_CHARS) : raw, truncated };
|
|
16355
16355
|
} catch {
|
|
16356
16356
|
return null;
|
|
16357
16357
|
}
|
|
@@ -28223,8 +28223,8 @@ function classifyBashRisk(cmd) {
|
|
|
28223
28223
|
}
|
|
28224
28224
|
return { blocked: false };
|
|
28225
28225
|
}
|
|
28226
|
-
function isProtectedPath(
|
|
28227
|
-
const p =
|
|
28226
|
+
function isProtectedPath(path10) {
|
|
28227
|
+
const p = path10.replace(/\\/g, "/");
|
|
28228
28228
|
return PROTECTED_PATHS.some((re) => re.test(p));
|
|
28229
28229
|
}
|
|
28230
28230
|
function commandHash(toolName, args) {
|
|
@@ -28316,8 +28316,8 @@ var init_Read = __esm({
|
|
|
28316
28316
|
async call(rawInput, ctx) {
|
|
28317
28317
|
const v = validateInput(Input, rawInput);
|
|
28318
28318
|
if (!v.ok) return { ok: false, output: `Invalid input: ${v.error}` };
|
|
28319
|
-
const { path:
|
|
28320
|
-
const abs = isAbsolute6(
|
|
28319
|
+
const { path: path10, offset, limit } = v.value;
|
|
28320
|
+
const abs = isAbsolute6(path10) ? path10 : resolve3(ctx.cwd, path10);
|
|
28321
28321
|
const absKey = abs.replace(/\\/g, "/");
|
|
28322
28322
|
if (isProtectedPath(absKey)) {
|
|
28323
28323
|
return {
|
|
@@ -28387,8 +28387,8 @@ var init_Write = __esm({
|
|
|
28387
28387
|
async call(rawInput, ctx) {
|
|
28388
28388
|
const v = validateInput(Input2, rawInput);
|
|
28389
28389
|
if (!v.ok) return { ok: false, output: `Invalid input: ${v.error}` };
|
|
28390
|
-
const { path:
|
|
28391
|
-
const abs = isAbsolute7(
|
|
28390
|
+
const { path: path10, content } = v.value;
|
|
28391
|
+
const abs = isAbsolute7(path10) ? path10 : resolve4(ctx.cwd, path10);
|
|
28392
28392
|
const absKey = abs.replace(/\\/g, "/");
|
|
28393
28393
|
if (isProtectedPath(absKey)) {
|
|
28394
28394
|
return { ok: false, output: `Refused: ${abs} matches a protected-secrets pattern. Cannot write.` };
|
|
@@ -28468,8 +28468,8 @@ var init_Edit = __esm({
|
|
|
28468
28468
|
async call(rawInput, ctx) {
|
|
28469
28469
|
const v = validateInput(Input3, rawInput);
|
|
28470
28470
|
if (!v.ok) return { ok: false, output: `Invalid input: ${v.error}` };
|
|
28471
|
-
const { path:
|
|
28472
|
-
const abs = isAbsolute8(
|
|
28471
|
+
const { path: path10, old_string, new_string, replace_all } = v.value;
|
|
28472
|
+
const abs = isAbsolute8(path10) ? path10 : resolve5(ctx.cwd, path10);
|
|
28473
28473
|
const absKey = abs.replace(/\\/g, "/");
|
|
28474
28474
|
if (isProtectedPath(absKey)) {
|
|
28475
28475
|
return { ok: false, output: `Refused: ${abs} matches a protected-secrets pattern. Cannot edit.` };
|
|
@@ -28954,9 +28954,9 @@ var init_Grep = __esm({
|
|
|
28954
28954
|
import { spawn as spawn5 } from "node:child_process";
|
|
28955
28955
|
import { stat as stat7 } from "node:fs/promises";
|
|
28956
28956
|
import { join as join20, isAbsolute as isAbsolute11 } from "node:path";
|
|
28957
|
-
async function fileExists(
|
|
28957
|
+
async function fileExists(path10) {
|
|
28958
28958
|
try {
|
|
28959
|
-
await stat7(
|
|
28959
|
+
await stat7(path10);
|
|
28960
28960
|
return true;
|
|
28961
28961
|
} catch {
|
|
28962
28962
|
return false;
|
|
@@ -29546,39 +29546,39 @@ var init_store = __esm({
|
|
|
29546
29546
|
// ── I/O ────────────────────────────────────────────────────────────────────
|
|
29547
29547
|
/** Load rules from disk. Safe to call multiple times (re-reads each time). */
|
|
29548
29548
|
load() {
|
|
29549
|
-
const
|
|
29550
|
-
if (!existsSync13(
|
|
29549
|
+
const path10 = permissionsPath();
|
|
29550
|
+
if (!existsSync13(path10)) {
|
|
29551
29551
|
this.rules = [];
|
|
29552
29552
|
return;
|
|
29553
29553
|
}
|
|
29554
29554
|
try {
|
|
29555
|
-
const raw = JSON.parse(readFileSync9(
|
|
29555
|
+
const raw = JSON.parse(readFileSync9(path10, "utf8"));
|
|
29556
29556
|
if (raw.version !== 1 || !Array.isArray(raw.rules)) {
|
|
29557
|
-
logger.warn("permissions/store: unrecognised format, ignoring",
|
|
29557
|
+
logger.warn("permissions/store: unrecognised format, ignoring", path10);
|
|
29558
29558
|
this.rules = [];
|
|
29559
29559
|
return;
|
|
29560
29560
|
}
|
|
29561
29561
|
this.rules = raw.rules;
|
|
29562
29562
|
this.dirty = false;
|
|
29563
29563
|
} catch (err) {
|
|
29564
|
-
logger.warn("permissions/store: failed to parse",
|
|
29564
|
+
logger.warn("permissions/store: failed to parse", path10, String(err));
|
|
29565
29565
|
this.rules = [];
|
|
29566
29566
|
}
|
|
29567
29567
|
}
|
|
29568
29568
|
/** Flush dirty rules to disk. No-op when nothing has changed. */
|
|
29569
29569
|
save() {
|
|
29570
29570
|
if (!this.dirty) return;
|
|
29571
|
-
const
|
|
29572
|
-
const dir = dirname11(
|
|
29571
|
+
const path10 = permissionsPath();
|
|
29572
|
+
const dir = dirname11(path10);
|
|
29573
29573
|
if (!existsSync13(dir)) {
|
|
29574
29574
|
mkdirSync5(dir, { recursive: true, mode: 448 });
|
|
29575
29575
|
}
|
|
29576
29576
|
const file = { version: 1, rules: this.rules };
|
|
29577
29577
|
try {
|
|
29578
|
-
writeFileSync6(
|
|
29578
|
+
writeFileSync6(path10, JSON.stringify(file, null, 2), { mode: 384 });
|
|
29579
29579
|
this.dirty = false;
|
|
29580
29580
|
} catch (err) {
|
|
29581
|
-
logger.warn("permissions/store: failed to save",
|
|
29581
|
+
logger.warn("permissions/store: failed to save", path10, String(err));
|
|
29582
29582
|
}
|
|
29583
29583
|
}
|
|
29584
29584
|
// ── Mutations ───────────────────────────────────────────────────────────────
|
|
@@ -29714,11 +29714,11 @@ function patternMatches(pattern, toolName, args) {
|
|
|
29714
29714
|
}
|
|
29715
29715
|
}
|
|
29716
29716
|
function consultProjectPermissions(toolName, args, cwd2) {
|
|
29717
|
-
const
|
|
29718
|
-
if (!existsSync14(
|
|
29717
|
+
const path10 = join22(cwd2, ".kryven", "settings.json");
|
|
29718
|
+
if (!existsSync14(path10)) return null;
|
|
29719
29719
|
let perms;
|
|
29720
29720
|
try {
|
|
29721
|
-
const parsed = JSON.parse(readFileSync10(
|
|
29721
|
+
const parsed = JSON.parse(readFileSync10(path10, "utf8"));
|
|
29722
29722
|
perms = parsed.permissions ?? {};
|
|
29723
29723
|
} catch {
|
|
29724
29724
|
return null;
|
|
@@ -29741,10 +29741,10 @@ var init_project_rules = __esm({
|
|
|
29741
29741
|
// src/agent/hooks-runner.ts
|
|
29742
29742
|
import { existsSync as existsSync15, readFileSync as readFileSync11 } from "node:fs";
|
|
29743
29743
|
import { join as join23 } from "node:path";
|
|
29744
|
-
function readEventHooks(
|
|
29745
|
-
if (!existsSync15(
|
|
29744
|
+
function readEventHooks(path10, event) {
|
|
29745
|
+
if (!existsSync15(path10)) return [];
|
|
29746
29746
|
try {
|
|
29747
|
-
const parsed = JSON.parse(readFileSync11(
|
|
29747
|
+
const parsed = JSON.parse(readFileSync11(path10, "utf8"));
|
|
29748
29748
|
const list = parsed.hooks?.[event];
|
|
29749
29749
|
if (!Array.isArray(list)) return [];
|
|
29750
29750
|
const out = [];
|
|
@@ -29915,12 +29915,33 @@ async function* runAgentLoopWithTools(client, conversation, opts) {
|
|
|
29915
29915
|
}
|
|
29916
29916
|
if (!message.tool_calls || message.tool_calls.length === 0) {
|
|
29917
29917
|
const emptyTurn = !message.content || message.content.trim().length === 0;
|
|
29918
|
-
|
|
29918
|
+
const ESCALATION_NEXT = {
|
|
29919
|
+
"kryven-flash": "kryven-extended",
|
|
29920
|
+
"kryven-extended": "kryven-coder"
|
|
29921
|
+
};
|
|
29922
|
+
const lowerC = (message.content || "").toLowerCase();
|
|
29923
|
+
const STALL_PHRASES = [
|
|
29924
|
+
"i don't have access",
|
|
29925
|
+
"i do not have access",
|
|
29926
|
+
"i cannot access",
|
|
29927
|
+
"i can't access",
|
|
29928
|
+
"i'm unable to",
|
|
29929
|
+
"i am unable to",
|
|
29930
|
+
"you'll need to",
|
|
29931
|
+
"you will need to",
|
|
29932
|
+
"please run",
|
|
29933
|
+
"please paste",
|
|
29934
|
+
"could you provide",
|
|
29935
|
+
"i don't have the ability"
|
|
29936
|
+
];
|
|
29937
|
+
const stalledChat = iter === 1 && opts.tools.length > 0 && lowerC.length > 0 && lowerC.length < 600 && STALL_PHRASES.some((p) => lowerC.includes(p));
|
|
29938
|
+
const nextModel = ESCALATION_NEXT[activeModel];
|
|
29939
|
+
if ((emptyTurn || stalledChat) && !escalated && nextModel) {
|
|
29919
29940
|
escalated = true;
|
|
29920
29941
|
const from = activeModel;
|
|
29921
|
-
activeModel =
|
|
29942
|
+
activeModel = nextModel;
|
|
29922
29943
|
conversation.truncateTo(conversation.size() - 1);
|
|
29923
|
-
yield { type: "reflection", phase: `escalate:${from}
|
|
29944
|
+
yield { type: "reflection", phase: `escalate:${from}->${nextModel}`, ok: false, detail: "Retrying on a more capable model." };
|
|
29924
29945
|
continue;
|
|
29925
29946
|
}
|
|
29926
29947
|
if (opts.reflect && editsMade && reflectionsLeft > 0 && !opts.signal?.aborted) {
|
|
@@ -29943,6 +29964,12 @@ async function* runAgentLoopWithTools(client, conversation, opts) {
|
|
|
29943
29964
|
}
|
|
29944
29965
|
yield { type: "reflection", phase: "check", ok, detail };
|
|
29945
29966
|
if (!ok && iter < MAX_ITER) {
|
|
29967
|
+
if (!escalated && ESCALATION_NEXT[activeModel]) {
|
|
29968
|
+
escalated = true;
|
|
29969
|
+
const from = activeModel;
|
|
29970
|
+
activeModel = ESCALATION_NEXT[activeModel];
|
|
29971
|
+
yield { type: "reflection", phase: `escalate:${from}->${activeModel}`, ok: false, detail: "Build check failed \u2014 fixing on a more capable model." };
|
|
29972
|
+
}
|
|
29946
29973
|
conversation.append({
|
|
29947
29974
|
role: "user",
|
|
29948
29975
|
content: `Your edits did not pass the project check \`${opts.reflect.command}\`. Fix the issues, then stop. Check output:
|
|
@@ -30205,54 +30232,54 @@ var require_polyfills = __commonJS({
|
|
|
30205
30232
|
}
|
|
30206
30233
|
var chdir;
|
|
30207
30234
|
module.exports = patch;
|
|
30208
|
-
function patch(
|
|
30235
|
+
function patch(fs6) {
|
|
30209
30236
|
if (constants5.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
|
30210
|
-
patchLchmod(
|
|
30211
|
-
}
|
|
30212
|
-
if (!
|
|
30213
|
-
patchLutimes(
|
|
30214
|
-
}
|
|
30215
|
-
|
|
30216
|
-
|
|
30217
|
-
|
|
30218
|
-
|
|
30219
|
-
|
|
30220
|
-
|
|
30221
|
-
|
|
30222
|
-
|
|
30223
|
-
|
|
30224
|
-
|
|
30225
|
-
|
|
30226
|
-
|
|
30227
|
-
|
|
30228
|
-
|
|
30229
|
-
|
|
30230
|
-
|
|
30231
|
-
|
|
30232
|
-
|
|
30233
|
-
if (
|
|
30234
|
-
|
|
30237
|
+
patchLchmod(fs6);
|
|
30238
|
+
}
|
|
30239
|
+
if (!fs6.lutimes) {
|
|
30240
|
+
patchLutimes(fs6);
|
|
30241
|
+
}
|
|
30242
|
+
fs6.chown = chownFix(fs6.chown);
|
|
30243
|
+
fs6.fchown = chownFix(fs6.fchown);
|
|
30244
|
+
fs6.lchown = chownFix(fs6.lchown);
|
|
30245
|
+
fs6.chmod = chmodFix(fs6.chmod);
|
|
30246
|
+
fs6.fchmod = chmodFix(fs6.fchmod);
|
|
30247
|
+
fs6.lchmod = chmodFix(fs6.lchmod);
|
|
30248
|
+
fs6.chownSync = chownFixSync(fs6.chownSync);
|
|
30249
|
+
fs6.fchownSync = chownFixSync(fs6.fchownSync);
|
|
30250
|
+
fs6.lchownSync = chownFixSync(fs6.lchownSync);
|
|
30251
|
+
fs6.chmodSync = chmodFixSync(fs6.chmodSync);
|
|
30252
|
+
fs6.fchmodSync = chmodFixSync(fs6.fchmodSync);
|
|
30253
|
+
fs6.lchmodSync = chmodFixSync(fs6.lchmodSync);
|
|
30254
|
+
fs6.stat = statFix(fs6.stat);
|
|
30255
|
+
fs6.fstat = statFix(fs6.fstat);
|
|
30256
|
+
fs6.lstat = statFix(fs6.lstat);
|
|
30257
|
+
fs6.statSync = statFixSync(fs6.statSync);
|
|
30258
|
+
fs6.fstatSync = statFixSync(fs6.fstatSync);
|
|
30259
|
+
fs6.lstatSync = statFixSync(fs6.lstatSync);
|
|
30260
|
+
if (fs6.chmod && !fs6.lchmod) {
|
|
30261
|
+
fs6.lchmod = function(path10, mode, cb) {
|
|
30235
30262
|
if (cb) process.nextTick(cb);
|
|
30236
30263
|
};
|
|
30237
|
-
|
|
30264
|
+
fs6.lchmodSync = function() {
|
|
30238
30265
|
};
|
|
30239
30266
|
}
|
|
30240
|
-
if (
|
|
30241
|
-
|
|
30267
|
+
if (fs6.chown && !fs6.lchown) {
|
|
30268
|
+
fs6.lchown = function(path10, uid, gid, cb) {
|
|
30242
30269
|
if (cb) process.nextTick(cb);
|
|
30243
30270
|
};
|
|
30244
|
-
|
|
30271
|
+
fs6.lchownSync = function() {
|
|
30245
30272
|
};
|
|
30246
30273
|
}
|
|
30247
30274
|
if (platform3 === "win32") {
|
|
30248
|
-
|
|
30275
|
+
fs6.rename = typeof fs6.rename !== "function" ? fs6.rename : (function(fs$rename) {
|
|
30249
30276
|
function rename(from, to, cb) {
|
|
30250
30277
|
var start = Date.now();
|
|
30251
30278
|
var backoff = 0;
|
|
30252
30279
|
fs$rename(from, to, function CB(er) {
|
|
30253
30280
|
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
|
30254
30281
|
setTimeout(function() {
|
|
30255
|
-
|
|
30282
|
+
fs6.stat(to, function(stater, st) {
|
|
30256
30283
|
if (stater && stater.code === "ENOENT")
|
|
30257
30284
|
fs$rename(from, to, CB);
|
|
30258
30285
|
else
|
|
@@ -30268,9 +30295,9 @@ var require_polyfills = __commonJS({
|
|
|
30268
30295
|
}
|
|
30269
30296
|
if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
|
|
30270
30297
|
return rename;
|
|
30271
|
-
})(
|
|
30298
|
+
})(fs6.rename);
|
|
30272
30299
|
}
|
|
30273
|
-
|
|
30300
|
+
fs6.read = typeof fs6.read !== "function" ? fs6.read : (function(fs$read) {
|
|
30274
30301
|
function read(fd, buffer, offset, length, position, callback_) {
|
|
30275
30302
|
var callback;
|
|
30276
30303
|
if (callback_ && typeof callback_ === "function") {
|
|
@@ -30278,22 +30305,22 @@ var require_polyfills = __commonJS({
|
|
|
30278
30305
|
callback = function(er, _, __) {
|
|
30279
30306
|
if (er && er.code === "EAGAIN" && eagCounter < 10) {
|
|
30280
30307
|
eagCounter++;
|
|
30281
|
-
return fs$read.call(
|
|
30308
|
+
return fs$read.call(fs6, fd, buffer, offset, length, position, callback);
|
|
30282
30309
|
}
|
|
30283
30310
|
callback_.apply(this, arguments);
|
|
30284
30311
|
};
|
|
30285
30312
|
}
|
|
30286
|
-
return fs$read.call(
|
|
30313
|
+
return fs$read.call(fs6, fd, buffer, offset, length, position, callback);
|
|
30287
30314
|
}
|
|
30288
30315
|
if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
|
|
30289
30316
|
return read;
|
|
30290
|
-
})(
|
|
30291
|
-
|
|
30317
|
+
})(fs6.read);
|
|
30318
|
+
fs6.readSync = typeof fs6.readSync !== "function" ? fs6.readSync : /* @__PURE__ */ (function(fs$readSync) {
|
|
30292
30319
|
return function(fd, buffer, offset, length, position) {
|
|
30293
30320
|
var eagCounter = 0;
|
|
30294
30321
|
while (true) {
|
|
30295
30322
|
try {
|
|
30296
|
-
return fs$readSync.call(
|
|
30323
|
+
return fs$readSync.call(fs6, fd, buffer, offset, length, position);
|
|
30297
30324
|
} catch (er) {
|
|
30298
30325
|
if (er.code === "EAGAIN" && eagCounter < 10) {
|
|
30299
30326
|
eagCounter++;
|
|
@@ -30303,11 +30330,11 @@ var require_polyfills = __commonJS({
|
|
|
30303
30330
|
}
|
|
30304
30331
|
}
|
|
30305
30332
|
};
|
|
30306
|
-
})(
|
|
30307
|
-
function patchLchmod(
|
|
30308
|
-
|
|
30309
|
-
|
|
30310
|
-
|
|
30333
|
+
})(fs6.readSync);
|
|
30334
|
+
function patchLchmod(fs7) {
|
|
30335
|
+
fs7.lchmod = function(path10, mode, callback) {
|
|
30336
|
+
fs7.open(
|
|
30337
|
+
path10,
|
|
30311
30338
|
constants5.O_WRONLY | constants5.O_SYMLINK,
|
|
30312
30339
|
mode,
|
|
30313
30340
|
function(err, fd) {
|
|
@@ -30315,80 +30342,80 @@ var require_polyfills = __commonJS({
|
|
|
30315
30342
|
if (callback) callback(err);
|
|
30316
30343
|
return;
|
|
30317
30344
|
}
|
|
30318
|
-
|
|
30319
|
-
|
|
30345
|
+
fs7.fchmod(fd, mode, function(err2) {
|
|
30346
|
+
fs7.close(fd, function(err22) {
|
|
30320
30347
|
if (callback) callback(err2 || err22);
|
|
30321
30348
|
});
|
|
30322
30349
|
});
|
|
30323
30350
|
}
|
|
30324
30351
|
);
|
|
30325
30352
|
};
|
|
30326
|
-
|
|
30327
|
-
var fd =
|
|
30353
|
+
fs7.lchmodSync = function(path10, mode) {
|
|
30354
|
+
var fd = fs7.openSync(path10, constants5.O_WRONLY | constants5.O_SYMLINK, mode);
|
|
30328
30355
|
var threw = true;
|
|
30329
30356
|
var ret;
|
|
30330
30357
|
try {
|
|
30331
|
-
ret =
|
|
30358
|
+
ret = fs7.fchmodSync(fd, mode);
|
|
30332
30359
|
threw = false;
|
|
30333
30360
|
} finally {
|
|
30334
30361
|
if (threw) {
|
|
30335
30362
|
try {
|
|
30336
|
-
|
|
30363
|
+
fs7.closeSync(fd);
|
|
30337
30364
|
} catch (er) {
|
|
30338
30365
|
}
|
|
30339
30366
|
} else {
|
|
30340
|
-
|
|
30367
|
+
fs7.closeSync(fd);
|
|
30341
30368
|
}
|
|
30342
30369
|
}
|
|
30343
30370
|
return ret;
|
|
30344
30371
|
};
|
|
30345
30372
|
}
|
|
30346
|
-
function patchLutimes(
|
|
30347
|
-
if (constants5.hasOwnProperty("O_SYMLINK") &&
|
|
30348
|
-
|
|
30349
|
-
|
|
30373
|
+
function patchLutimes(fs7) {
|
|
30374
|
+
if (constants5.hasOwnProperty("O_SYMLINK") && fs7.futimes) {
|
|
30375
|
+
fs7.lutimes = function(path10, at, mt, cb) {
|
|
30376
|
+
fs7.open(path10, constants5.O_SYMLINK, function(er, fd) {
|
|
30350
30377
|
if (er) {
|
|
30351
30378
|
if (cb) cb(er);
|
|
30352
30379
|
return;
|
|
30353
30380
|
}
|
|
30354
|
-
|
|
30355
|
-
|
|
30381
|
+
fs7.futimes(fd, at, mt, function(er2) {
|
|
30382
|
+
fs7.close(fd, function(er22) {
|
|
30356
30383
|
if (cb) cb(er2 || er22);
|
|
30357
30384
|
});
|
|
30358
30385
|
});
|
|
30359
30386
|
});
|
|
30360
30387
|
};
|
|
30361
|
-
|
|
30362
|
-
var fd =
|
|
30388
|
+
fs7.lutimesSync = function(path10, at, mt) {
|
|
30389
|
+
var fd = fs7.openSync(path10, constants5.O_SYMLINK);
|
|
30363
30390
|
var ret;
|
|
30364
30391
|
var threw = true;
|
|
30365
30392
|
try {
|
|
30366
|
-
ret =
|
|
30393
|
+
ret = fs7.futimesSync(fd, at, mt);
|
|
30367
30394
|
threw = false;
|
|
30368
30395
|
} finally {
|
|
30369
30396
|
if (threw) {
|
|
30370
30397
|
try {
|
|
30371
|
-
|
|
30398
|
+
fs7.closeSync(fd);
|
|
30372
30399
|
} catch (er) {
|
|
30373
30400
|
}
|
|
30374
30401
|
} else {
|
|
30375
|
-
|
|
30402
|
+
fs7.closeSync(fd);
|
|
30376
30403
|
}
|
|
30377
30404
|
}
|
|
30378
30405
|
return ret;
|
|
30379
30406
|
};
|
|
30380
|
-
} else if (
|
|
30381
|
-
|
|
30407
|
+
} else if (fs7.futimes) {
|
|
30408
|
+
fs7.lutimes = function(_a, _b, _c, cb) {
|
|
30382
30409
|
if (cb) process.nextTick(cb);
|
|
30383
30410
|
};
|
|
30384
|
-
|
|
30411
|
+
fs7.lutimesSync = function() {
|
|
30385
30412
|
};
|
|
30386
30413
|
}
|
|
30387
30414
|
}
|
|
30388
30415
|
function chmodFix(orig) {
|
|
30389
30416
|
if (!orig) return orig;
|
|
30390
30417
|
return function(target, mode, cb) {
|
|
30391
|
-
return orig.call(
|
|
30418
|
+
return orig.call(fs6, target, mode, function(er) {
|
|
30392
30419
|
if (chownErOk(er)) er = null;
|
|
30393
30420
|
if (cb) cb.apply(this, arguments);
|
|
30394
30421
|
});
|
|
@@ -30398,7 +30425,7 @@ var require_polyfills = __commonJS({
|
|
|
30398
30425
|
if (!orig) return orig;
|
|
30399
30426
|
return function(target, mode) {
|
|
30400
30427
|
try {
|
|
30401
|
-
return orig.call(
|
|
30428
|
+
return orig.call(fs6, target, mode);
|
|
30402
30429
|
} catch (er) {
|
|
30403
30430
|
if (!chownErOk(er)) throw er;
|
|
30404
30431
|
}
|
|
@@ -30407,7 +30434,7 @@ var require_polyfills = __commonJS({
|
|
|
30407
30434
|
function chownFix(orig) {
|
|
30408
30435
|
if (!orig) return orig;
|
|
30409
30436
|
return function(target, uid, gid, cb) {
|
|
30410
|
-
return orig.call(
|
|
30437
|
+
return orig.call(fs6, target, uid, gid, function(er) {
|
|
30411
30438
|
if (chownErOk(er)) er = null;
|
|
30412
30439
|
if (cb) cb.apply(this, arguments);
|
|
30413
30440
|
});
|
|
@@ -30417,7 +30444,7 @@ var require_polyfills = __commonJS({
|
|
|
30417
30444
|
if (!orig) return orig;
|
|
30418
30445
|
return function(target, uid, gid) {
|
|
30419
30446
|
try {
|
|
30420
|
-
return orig.call(
|
|
30447
|
+
return orig.call(fs6, target, uid, gid);
|
|
30421
30448
|
} catch (er) {
|
|
30422
30449
|
if (!chownErOk(er)) throw er;
|
|
30423
30450
|
}
|
|
@@ -30437,13 +30464,13 @@ var require_polyfills = __commonJS({
|
|
|
30437
30464
|
}
|
|
30438
30465
|
if (cb) cb.apply(this, arguments);
|
|
30439
30466
|
}
|
|
30440
|
-
return options ? orig.call(
|
|
30467
|
+
return options ? orig.call(fs6, target, options, callback) : orig.call(fs6, target, callback);
|
|
30441
30468
|
};
|
|
30442
30469
|
}
|
|
30443
30470
|
function statFixSync(orig) {
|
|
30444
30471
|
if (!orig) return orig;
|
|
30445
30472
|
return function(target, options) {
|
|
30446
|
-
var stats = options ? orig.call(
|
|
30473
|
+
var stats = options ? orig.call(fs6, target, options) : orig.call(fs6, target);
|
|
30447
30474
|
if (stats) {
|
|
30448
30475
|
if (stats.uid < 0) stats.uid += 4294967296;
|
|
30449
30476
|
if (stats.gid < 0) stats.gid += 4294967296;
|
|
@@ -30472,16 +30499,16 @@ var require_legacy_streams = __commonJS({
|
|
|
30472
30499
|
"node_modules/graceful-fs/legacy-streams.js"(exports, module) {
|
|
30473
30500
|
var Stream2 = __require("stream").Stream;
|
|
30474
30501
|
module.exports = legacy;
|
|
30475
|
-
function legacy(
|
|
30502
|
+
function legacy(fs6) {
|
|
30476
30503
|
return {
|
|
30477
30504
|
ReadStream,
|
|
30478
30505
|
WriteStream
|
|
30479
30506
|
};
|
|
30480
|
-
function ReadStream(
|
|
30481
|
-
if (!(this instanceof ReadStream)) return new ReadStream(
|
|
30507
|
+
function ReadStream(path10, options) {
|
|
30508
|
+
if (!(this instanceof ReadStream)) return new ReadStream(path10, options);
|
|
30482
30509
|
Stream2.call(this);
|
|
30483
30510
|
var self = this;
|
|
30484
|
-
this.path =
|
|
30511
|
+
this.path = path10;
|
|
30485
30512
|
this.fd = null;
|
|
30486
30513
|
this.readable = true;
|
|
30487
30514
|
this.paused = false;
|
|
@@ -30515,7 +30542,7 @@ var require_legacy_streams = __commonJS({
|
|
|
30515
30542
|
});
|
|
30516
30543
|
return;
|
|
30517
30544
|
}
|
|
30518
|
-
|
|
30545
|
+
fs6.open(this.path, this.flags, this.mode, function(err, fd) {
|
|
30519
30546
|
if (err) {
|
|
30520
30547
|
self.emit("error", err);
|
|
30521
30548
|
self.readable = false;
|
|
@@ -30526,10 +30553,10 @@ var require_legacy_streams = __commonJS({
|
|
|
30526
30553
|
self._read();
|
|
30527
30554
|
});
|
|
30528
30555
|
}
|
|
30529
|
-
function WriteStream(
|
|
30530
|
-
if (!(this instanceof WriteStream)) return new WriteStream(
|
|
30556
|
+
function WriteStream(path10, options) {
|
|
30557
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path10, options);
|
|
30531
30558
|
Stream2.call(this);
|
|
30532
|
-
this.path =
|
|
30559
|
+
this.path = path10;
|
|
30533
30560
|
this.fd = null;
|
|
30534
30561
|
this.writable = true;
|
|
30535
30562
|
this.flags = "w";
|
|
@@ -30554,7 +30581,7 @@ var require_legacy_streams = __commonJS({
|
|
|
30554
30581
|
this.busy = false;
|
|
30555
30582
|
this._queue = [];
|
|
30556
30583
|
if (this.fd === null) {
|
|
30557
|
-
this._open =
|
|
30584
|
+
this._open = fs6.open;
|
|
30558
30585
|
this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
|
|
30559
30586
|
this.flush();
|
|
30560
30587
|
}
|
|
@@ -30589,7 +30616,7 @@ var require_clone = __commonJS({
|
|
|
30589
30616
|
// node_modules/graceful-fs/graceful-fs.js
|
|
30590
30617
|
var require_graceful_fs = __commonJS({
|
|
30591
30618
|
"node_modules/graceful-fs/graceful-fs.js"(exports, module) {
|
|
30592
|
-
var
|
|
30619
|
+
var fs6 = __require("fs");
|
|
30593
30620
|
var polyfills = require_polyfills();
|
|
30594
30621
|
var legacy = require_legacy_streams();
|
|
30595
30622
|
var clone = require_clone();
|
|
@@ -30621,12 +30648,12 @@ var require_graceful_fs = __commonJS({
|
|
|
30621
30648
|
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
30622
30649
|
console.error(m);
|
|
30623
30650
|
};
|
|
30624
|
-
if (!
|
|
30651
|
+
if (!fs6[gracefulQueue]) {
|
|
30625
30652
|
queue = global[gracefulQueue] || [];
|
|
30626
|
-
publishQueue(
|
|
30627
|
-
|
|
30653
|
+
publishQueue(fs6, queue);
|
|
30654
|
+
fs6.close = (function(fs$close) {
|
|
30628
30655
|
function close(fd, cb) {
|
|
30629
|
-
return fs$close.call(
|
|
30656
|
+
return fs$close.call(fs6, fd, function(err) {
|
|
30630
30657
|
if (!err) {
|
|
30631
30658
|
resetQueue();
|
|
30632
30659
|
}
|
|
@@ -30638,48 +30665,48 @@ var require_graceful_fs = __commonJS({
|
|
|
30638
30665
|
value: fs$close
|
|
30639
30666
|
});
|
|
30640
30667
|
return close;
|
|
30641
|
-
})(
|
|
30642
|
-
|
|
30668
|
+
})(fs6.close);
|
|
30669
|
+
fs6.closeSync = (function(fs$closeSync) {
|
|
30643
30670
|
function closeSync3(fd) {
|
|
30644
|
-
fs$closeSync.apply(
|
|
30671
|
+
fs$closeSync.apply(fs6, arguments);
|
|
30645
30672
|
resetQueue();
|
|
30646
30673
|
}
|
|
30647
30674
|
Object.defineProperty(closeSync3, previousSymbol, {
|
|
30648
30675
|
value: fs$closeSync
|
|
30649
30676
|
});
|
|
30650
30677
|
return closeSync3;
|
|
30651
|
-
})(
|
|
30678
|
+
})(fs6.closeSync);
|
|
30652
30679
|
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
|
30653
30680
|
process.on("exit", function() {
|
|
30654
|
-
debug(
|
|
30655
|
-
__require("assert").equal(
|
|
30681
|
+
debug(fs6[gracefulQueue]);
|
|
30682
|
+
__require("assert").equal(fs6[gracefulQueue].length, 0);
|
|
30656
30683
|
});
|
|
30657
30684
|
}
|
|
30658
30685
|
}
|
|
30659
30686
|
var queue;
|
|
30660
30687
|
if (!global[gracefulQueue]) {
|
|
30661
|
-
publishQueue(global,
|
|
30662
|
-
}
|
|
30663
|
-
module.exports = patch(clone(
|
|
30664
|
-
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !
|
|
30665
|
-
module.exports = patch(
|
|
30666
|
-
|
|
30667
|
-
}
|
|
30668
|
-
function patch(
|
|
30669
|
-
polyfills(
|
|
30670
|
-
|
|
30671
|
-
|
|
30672
|
-
|
|
30673
|
-
var fs$readFile =
|
|
30674
|
-
|
|
30675
|
-
function readFile18(
|
|
30688
|
+
publishQueue(global, fs6[gracefulQueue]);
|
|
30689
|
+
}
|
|
30690
|
+
module.exports = patch(clone(fs6));
|
|
30691
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs6.__patched) {
|
|
30692
|
+
module.exports = patch(fs6);
|
|
30693
|
+
fs6.__patched = true;
|
|
30694
|
+
}
|
|
30695
|
+
function patch(fs7) {
|
|
30696
|
+
polyfills(fs7);
|
|
30697
|
+
fs7.gracefulify = patch;
|
|
30698
|
+
fs7.createReadStream = createReadStream2;
|
|
30699
|
+
fs7.createWriteStream = createWriteStream2;
|
|
30700
|
+
var fs$readFile = fs7.readFile;
|
|
30701
|
+
fs7.readFile = readFile18;
|
|
30702
|
+
function readFile18(path10, options, cb) {
|
|
30676
30703
|
if (typeof options === "function")
|
|
30677
30704
|
cb = options, options = null;
|
|
30678
|
-
return go$readFile(
|
|
30679
|
-
function go$readFile(
|
|
30680
|
-
return fs$readFile(
|
|
30705
|
+
return go$readFile(path10, options, cb);
|
|
30706
|
+
function go$readFile(path11, options2, cb2, startTime) {
|
|
30707
|
+
return fs$readFile(path11, options2, function(err) {
|
|
30681
30708
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
30682
|
-
enqueue([go$readFile, [
|
|
30709
|
+
enqueue([go$readFile, [path11, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
30683
30710
|
else {
|
|
30684
30711
|
if (typeof cb2 === "function")
|
|
30685
30712
|
cb2.apply(this, arguments);
|
|
@@ -30687,16 +30714,16 @@ var require_graceful_fs = __commonJS({
|
|
|
30687
30714
|
});
|
|
30688
30715
|
}
|
|
30689
30716
|
}
|
|
30690
|
-
var fs$writeFile =
|
|
30691
|
-
|
|
30692
|
-
function writeFile12(
|
|
30717
|
+
var fs$writeFile = fs7.writeFile;
|
|
30718
|
+
fs7.writeFile = writeFile12;
|
|
30719
|
+
function writeFile12(path10, data, options, cb) {
|
|
30693
30720
|
if (typeof options === "function")
|
|
30694
30721
|
cb = options, options = null;
|
|
30695
|
-
return go$writeFile(
|
|
30696
|
-
function go$writeFile(
|
|
30697
|
-
return fs$writeFile(
|
|
30722
|
+
return go$writeFile(path10, data, options, cb);
|
|
30723
|
+
function go$writeFile(path11, data2, options2, cb2, startTime) {
|
|
30724
|
+
return fs$writeFile(path11, data2, options2, function(err) {
|
|
30698
30725
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
30699
|
-
enqueue([go$writeFile, [
|
|
30726
|
+
enqueue([go$writeFile, [path11, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
30700
30727
|
else {
|
|
30701
30728
|
if (typeof cb2 === "function")
|
|
30702
30729
|
cb2.apply(this, arguments);
|
|
@@ -30704,17 +30731,17 @@ var require_graceful_fs = __commonJS({
|
|
|
30704
30731
|
});
|
|
30705
30732
|
}
|
|
30706
30733
|
}
|
|
30707
|
-
var fs$appendFile =
|
|
30734
|
+
var fs$appendFile = fs7.appendFile;
|
|
30708
30735
|
if (fs$appendFile)
|
|
30709
|
-
|
|
30710
|
-
function appendFile4(
|
|
30736
|
+
fs7.appendFile = appendFile4;
|
|
30737
|
+
function appendFile4(path10, data, options, cb) {
|
|
30711
30738
|
if (typeof options === "function")
|
|
30712
30739
|
cb = options, options = null;
|
|
30713
|
-
return go$appendFile(
|
|
30714
|
-
function go$appendFile(
|
|
30715
|
-
return fs$appendFile(
|
|
30740
|
+
return go$appendFile(path10, data, options, cb);
|
|
30741
|
+
function go$appendFile(path11, data2, options2, cb2, startTime) {
|
|
30742
|
+
return fs$appendFile(path11, data2, options2, function(err) {
|
|
30716
30743
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
30717
|
-
enqueue([go$appendFile, [
|
|
30744
|
+
enqueue([go$appendFile, [path11, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
30718
30745
|
else {
|
|
30719
30746
|
if (typeof cb2 === "function")
|
|
30720
30747
|
cb2.apply(this, arguments);
|
|
@@ -30722,9 +30749,9 @@ var require_graceful_fs = __commonJS({
|
|
|
30722
30749
|
});
|
|
30723
30750
|
}
|
|
30724
30751
|
}
|
|
30725
|
-
var fs$copyFile =
|
|
30752
|
+
var fs$copyFile = fs7.copyFile;
|
|
30726
30753
|
if (fs$copyFile)
|
|
30727
|
-
|
|
30754
|
+
fs7.copyFile = copyFile;
|
|
30728
30755
|
function copyFile(src, dest, flags, cb) {
|
|
30729
30756
|
if (typeof flags === "function") {
|
|
30730
30757
|
cb = flags;
|
|
@@ -30742,34 +30769,34 @@ var require_graceful_fs = __commonJS({
|
|
|
30742
30769
|
});
|
|
30743
30770
|
}
|
|
30744
30771
|
}
|
|
30745
|
-
var fs$readdir =
|
|
30746
|
-
|
|
30772
|
+
var fs$readdir = fs7.readdir;
|
|
30773
|
+
fs7.readdir = readdir11;
|
|
30747
30774
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
30748
|
-
function readdir11(
|
|
30775
|
+
function readdir11(path10, options, cb) {
|
|
30749
30776
|
if (typeof options === "function")
|
|
30750
30777
|
cb = options, options = null;
|
|
30751
|
-
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(
|
|
30752
|
-
return fs$readdir(
|
|
30753
|
-
|
|
30778
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path11, options2, cb2, startTime) {
|
|
30779
|
+
return fs$readdir(path11, fs$readdirCallback(
|
|
30780
|
+
path11,
|
|
30754
30781
|
options2,
|
|
30755
30782
|
cb2,
|
|
30756
30783
|
startTime
|
|
30757
30784
|
));
|
|
30758
|
-
} : function go$readdir2(
|
|
30759
|
-
return fs$readdir(
|
|
30760
|
-
|
|
30785
|
+
} : function go$readdir2(path11, options2, cb2, startTime) {
|
|
30786
|
+
return fs$readdir(path11, options2, fs$readdirCallback(
|
|
30787
|
+
path11,
|
|
30761
30788
|
options2,
|
|
30762
30789
|
cb2,
|
|
30763
30790
|
startTime
|
|
30764
30791
|
));
|
|
30765
30792
|
};
|
|
30766
|
-
return go$readdir(
|
|
30767
|
-
function fs$readdirCallback(
|
|
30793
|
+
return go$readdir(path10, options, cb);
|
|
30794
|
+
function fs$readdirCallback(path11, options2, cb2, startTime) {
|
|
30768
30795
|
return function(err, files) {
|
|
30769
30796
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
30770
30797
|
enqueue([
|
|
30771
30798
|
go$readdir,
|
|
30772
|
-
[
|
|
30799
|
+
[path11, options2, cb2],
|
|
30773
30800
|
err,
|
|
30774
30801
|
startTime || Date.now(),
|
|
30775
30802
|
Date.now()
|
|
@@ -30784,21 +30811,21 @@ var require_graceful_fs = __commonJS({
|
|
|
30784
30811
|
}
|
|
30785
30812
|
}
|
|
30786
30813
|
if (process.version.substr(0, 4) === "v0.8") {
|
|
30787
|
-
var legStreams = legacy(
|
|
30814
|
+
var legStreams = legacy(fs7);
|
|
30788
30815
|
ReadStream = legStreams.ReadStream;
|
|
30789
30816
|
WriteStream = legStreams.WriteStream;
|
|
30790
30817
|
}
|
|
30791
|
-
var fs$ReadStream =
|
|
30818
|
+
var fs$ReadStream = fs7.ReadStream;
|
|
30792
30819
|
if (fs$ReadStream) {
|
|
30793
30820
|
ReadStream.prototype = Object.create(fs$ReadStream.prototype);
|
|
30794
30821
|
ReadStream.prototype.open = ReadStream$open;
|
|
30795
30822
|
}
|
|
30796
|
-
var fs$WriteStream =
|
|
30823
|
+
var fs$WriteStream = fs7.WriteStream;
|
|
30797
30824
|
if (fs$WriteStream) {
|
|
30798
30825
|
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
|
30799
30826
|
WriteStream.prototype.open = WriteStream$open;
|
|
30800
30827
|
}
|
|
30801
|
-
Object.defineProperty(
|
|
30828
|
+
Object.defineProperty(fs7, "ReadStream", {
|
|
30802
30829
|
get: function() {
|
|
30803
30830
|
return ReadStream;
|
|
30804
30831
|
},
|
|
@@ -30808,7 +30835,7 @@ var require_graceful_fs = __commonJS({
|
|
|
30808
30835
|
enumerable: true,
|
|
30809
30836
|
configurable: true
|
|
30810
30837
|
});
|
|
30811
|
-
Object.defineProperty(
|
|
30838
|
+
Object.defineProperty(fs7, "WriteStream", {
|
|
30812
30839
|
get: function() {
|
|
30813
30840
|
return WriteStream;
|
|
30814
30841
|
},
|
|
@@ -30819,7 +30846,7 @@ var require_graceful_fs = __commonJS({
|
|
|
30819
30846
|
configurable: true
|
|
30820
30847
|
});
|
|
30821
30848
|
var FileReadStream = ReadStream;
|
|
30822
|
-
Object.defineProperty(
|
|
30849
|
+
Object.defineProperty(fs7, "FileReadStream", {
|
|
30823
30850
|
get: function() {
|
|
30824
30851
|
return FileReadStream;
|
|
30825
30852
|
},
|
|
@@ -30830,7 +30857,7 @@ var require_graceful_fs = __commonJS({
|
|
|
30830
30857
|
configurable: true
|
|
30831
30858
|
});
|
|
30832
30859
|
var FileWriteStream = WriteStream;
|
|
30833
|
-
Object.defineProperty(
|
|
30860
|
+
Object.defineProperty(fs7, "FileWriteStream", {
|
|
30834
30861
|
get: function() {
|
|
30835
30862
|
return FileWriteStream;
|
|
30836
30863
|
},
|
|
@@ -30840,7 +30867,7 @@ var require_graceful_fs = __commonJS({
|
|
|
30840
30867
|
enumerable: true,
|
|
30841
30868
|
configurable: true
|
|
30842
30869
|
});
|
|
30843
|
-
function ReadStream(
|
|
30870
|
+
function ReadStream(path10, options) {
|
|
30844
30871
|
if (this instanceof ReadStream)
|
|
30845
30872
|
return fs$ReadStream.apply(this, arguments), this;
|
|
30846
30873
|
else
|
|
@@ -30860,7 +30887,7 @@ var require_graceful_fs = __commonJS({
|
|
|
30860
30887
|
}
|
|
30861
30888
|
});
|
|
30862
30889
|
}
|
|
30863
|
-
function WriteStream(
|
|
30890
|
+
function WriteStream(path10, options) {
|
|
30864
30891
|
if (this instanceof WriteStream)
|
|
30865
30892
|
return fs$WriteStream.apply(this, arguments), this;
|
|
30866
30893
|
else
|
|
@@ -30878,22 +30905,22 @@ var require_graceful_fs = __commonJS({
|
|
|
30878
30905
|
}
|
|
30879
30906
|
});
|
|
30880
30907
|
}
|
|
30881
|
-
function createReadStream2(
|
|
30882
|
-
return new
|
|
30908
|
+
function createReadStream2(path10, options) {
|
|
30909
|
+
return new fs7.ReadStream(path10, options);
|
|
30883
30910
|
}
|
|
30884
|
-
function createWriteStream2(
|
|
30885
|
-
return new
|
|
30911
|
+
function createWriteStream2(path10, options) {
|
|
30912
|
+
return new fs7.WriteStream(path10, options);
|
|
30886
30913
|
}
|
|
30887
|
-
var fs$open =
|
|
30888
|
-
|
|
30889
|
-
function open(
|
|
30914
|
+
var fs$open = fs7.open;
|
|
30915
|
+
fs7.open = open;
|
|
30916
|
+
function open(path10, flags, mode, cb) {
|
|
30890
30917
|
if (typeof mode === "function")
|
|
30891
30918
|
cb = mode, mode = null;
|
|
30892
|
-
return go$open(
|
|
30893
|
-
function go$open(
|
|
30894
|
-
return fs$open(
|
|
30919
|
+
return go$open(path10, flags, mode, cb);
|
|
30920
|
+
function go$open(path11, flags2, mode2, cb2, startTime) {
|
|
30921
|
+
return fs$open(path11, flags2, mode2, function(err, fd) {
|
|
30895
30922
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
30896
|
-
enqueue([go$open, [
|
|
30923
|
+
enqueue([go$open, [path11, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
30897
30924
|
else {
|
|
30898
30925
|
if (typeof cb2 === "function")
|
|
30899
30926
|
cb2.apply(this, arguments);
|
|
@@ -30901,20 +30928,20 @@ var require_graceful_fs = __commonJS({
|
|
|
30901
30928
|
});
|
|
30902
30929
|
}
|
|
30903
30930
|
}
|
|
30904
|
-
return
|
|
30931
|
+
return fs7;
|
|
30905
30932
|
}
|
|
30906
30933
|
function enqueue(elem) {
|
|
30907
30934
|
debug("ENQUEUE", elem[0].name, elem[1]);
|
|
30908
|
-
|
|
30935
|
+
fs6[gracefulQueue].push(elem);
|
|
30909
30936
|
retry2();
|
|
30910
30937
|
}
|
|
30911
30938
|
var retryTimer;
|
|
30912
30939
|
function resetQueue() {
|
|
30913
30940
|
var now = Date.now();
|
|
30914
|
-
for (var i2 = 0; i2 <
|
|
30915
|
-
if (
|
|
30916
|
-
|
|
30917
|
-
|
|
30941
|
+
for (var i2 = 0; i2 < fs6[gracefulQueue].length; ++i2) {
|
|
30942
|
+
if (fs6[gracefulQueue][i2].length > 2) {
|
|
30943
|
+
fs6[gracefulQueue][i2][3] = now;
|
|
30944
|
+
fs6[gracefulQueue][i2][4] = now;
|
|
30918
30945
|
}
|
|
30919
30946
|
}
|
|
30920
30947
|
retry2();
|
|
@@ -30922,9 +30949,9 @@ var require_graceful_fs = __commonJS({
|
|
|
30922
30949
|
function retry2() {
|
|
30923
30950
|
clearTimeout(retryTimer);
|
|
30924
30951
|
retryTimer = void 0;
|
|
30925
|
-
if (
|
|
30952
|
+
if (fs6[gracefulQueue].length === 0)
|
|
30926
30953
|
return;
|
|
30927
|
-
var elem =
|
|
30954
|
+
var elem = fs6[gracefulQueue].shift();
|
|
30928
30955
|
var fn = elem[0];
|
|
30929
30956
|
var args = elem[1];
|
|
30930
30957
|
var err = elem[2];
|
|
@@ -30946,7 +30973,7 @@ var require_graceful_fs = __commonJS({
|
|
|
30946
30973
|
debug("RETRY", fn.name, args);
|
|
30947
30974
|
fn.apply(null, args.concat([startTime]));
|
|
30948
30975
|
} else {
|
|
30949
|
-
|
|
30976
|
+
fs6[gracefulQueue].push(elem);
|
|
30950
30977
|
}
|
|
30951
30978
|
}
|
|
30952
30979
|
if (retryTimer === void 0) {
|
|
@@ -31381,10 +31408,10 @@ var require_mtime_precision = __commonJS({
|
|
|
31381
31408
|
"node_modules/proper-lockfile/lib/mtime-precision.js"(exports, module) {
|
|
31382
31409
|
"use strict";
|
|
31383
31410
|
var cacheSymbol = Symbol();
|
|
31384
|
-
function probe(file,
|
|
31385
|
-
const cachedPrecision =
|
|
31411
|
+
function probe(file, fs6, callback) {
|
|
31412
|
+
const cachedPrecision = fs6[cacheSymbol];
|
|
31386
31413
|
if (cachedPrecision) {
|
|
31387
|
-
return
|
|
31414
|
+
return fs6.stat(file, (err, stat9) => {
|
|
31388
31415
|
if (err) {
|
|
31389
31416
|
return callback(err);
|
|
31390
31417
|
}
|
|
@@ -31392,16 +31419,16 @@ var require_mtime_precision = __commonJS({
|
|
|
31392
31419
|
});
|
|
31393
31420
|
}
|
|
31394
31421
|
const mtime = new Date(Math.ceil(Date.now() / 1e3) * 1e3 + 5);
|
|
31395
|
-
|
|
31422
|
+
fs6.utimes(file, mtime, mtime, (err) => {
|
|
31396
31423
|
if (err) {
|
|
31397
31424
|
return callback(err);
|
|
31398
31425
|
}
|
|
31399
|
-
|
|
31426
|
+
fs6.stat(file, (err2, stat9) => {
|
|
31400
31427
|
if (err2) {
|
|
31401
31428
|
return callback(err2);
|
|
31402
31429
|
}
|
|
31403
31430
|
const precision = stat9.mtime.getTime() % 1e3 === 0 ? "s" : "ms";
|
|
31404
|
-
Object.defineProperty(
|
|
31431
|
+
Object.defineProperty(fs6, cacheSymbol, { value: precision });
|
|
31405
31432
|
callback(null, stat9.mtime, precision);
|
|
31406
31433
|
});
|
|
31407
31434
|
});
|
|
@@ -31422,8 +31449,8 @@ var require_mtime_precision = __commonJS({
|
|
|
31422
31449
|
var require_lockfile = __commonJS({
|
|
31423
31450
|
"node_modules/proper-lockfile/lib/lockfile.js"(exports, module) {
|
|
31424
31451
|
"use strict";
|
|
31425
|
-
var
|
|
31426
|
-
var
|
|
31452
|
+
var path10 = __require("path");
|
|
31453
|
+
var fs6 = require_graceful_fs();
|
|
31427
31454
|
var retry2 = require_retry2();
|
|
31428
31455
|
var onExit2 = require_signal_exit3();
|
|
31429
31456
|
var mtimePrecision = require_mtime_precision();
|
|
@@ -31433,7 +31460,7 @@ var require_lockfile = __commonJS({
|
|
|
31433
31460
|
}
|
|
31434
31461
|
function resolveCanonicalPath(file, options, callback) {
|
|
31435
31462
|
if (!options.realpath) {
|
|
31436
|
-
return callback(null,
|
|
31463
|
+
return callback(null, path10.resolve(file));
|
|
31437
31464
|
}
|
|
31438
31465
|
options.fs.realpath(file, callback);
|
|
31439
31466
|
}
|
|
@@ -31554,7 +31581,7 @@ var require_lockfile = __commonJS({
|
|
|
31554
31581
|
update: null,
|
|
31555
31582
|
realpath: true,
|
|
31556
31583
|
retries: 0,
|
|
31557
|
-
fs:
|
|
31584
|
+
fs: fs6,
|
|
31558
31585
|
onCompromised: (err) => {
|
|
31559
31586
|
throw err;
|
|
31560
31587
|
},
|
|
@@ -31598,7 +31625,7 @@ var require_lockfile = __commonJS({
|
|
|
31598
31625
|
}
|
|
31599
31626
|
function unlock(file, options, callback) {
|
|
31600
31627
|
options = {
|
|
31601
|
-
fs:
|
|
31628
|
+
fs: fs6,
|
|
31602
31629
|
realpath: true,
|
|
31603
31630
|
...options
|
|
31604
31631
|
};
|
|
@@ -31620,7 +31647,7 @@ var require_lockfile = __commonJS({
|
|
|
31620
31647
|
options = {
|
|
31621
31648
|
stale: 1e4,
|
|
31622
31649
|
realpath: true,
|
|
31623
|
-
fs:
|
|
31650
|
+
fs: fs6,
|
|
31624
31651
|
...options
|
|
31625
31652
|
};
|
|
31626
31653
|
options.stale = Math.max(options.stale || 0, 2e3);
|
|
@@ -31659,16 +31686,16 @@ var require_lockfile = __commonJS({
|
|
|
31659
31686
|
var require_adapter = __commonJS({
|
|
31660
31687
|
"node_modules/proper-lockfile/lib/adapter.js"(exports, module) {
|
|
31661
31688
|
"use strict";
|
|
31662
|
-
var
|
|
31663
|
-
function createSyncFs(
|
|
31689
|
+
var fs6 = require_graceful_fs();
|
|
31690
|
+
function createSyncFs(fs7) {
|
|
31664
31691
|
const methods = ["mkdir", "realpath", "stat", "rmdir", "utimes"];
|
|
31665
|
-
const newFs = { ...
|
|
31692
|
+
const newFs = { ...fs7 };
|
|
31666
31693
|
methods.forEach((method) => {
|
|
31667
31694
|
newFs[method] = (...args) => {
|
|
31668
31695
|
const callback = args.pop();
|
|
31669
31696
|
let ret;
|
|
31670
31697
|
try {
|
|
31671
|
-
ret =
|
|
31698
|
+
ret = fs7[`${method}Sync`](...args);
|
|
31672
31699
|
} catch (err) {
|
|
31673
31700
|
return callback(err);
|
|
31674
31701
|
}
|
|
@@ -31706,7 +31733,7 @@ var require_adapter = __commonJS({
|
|
|
31706
31733
|
}
|
|
31707
31734
|
function toSyncOptions(options) {
|
|
31708
31735
|
options = { ...options };
|
|
31709
|
-
options.fs = createSyncFs(options.fs ||
|
|
31736
|
+
options.fs = createSyncFs(options.fs || fs6);
|
|
31710
31737
|
if (typeof options.retries === "number" && options.retries > 0 || options.retries && typeof options.retries.retries === "number" && options.retries.retries > 0) {
|
|
31711
31738
|
throw Object.assign(new Error("Cannot use retries with the sync api"), { code: "ESYNC" });
|
|
31712
31739
|
}
|
|
@@ -32502,7 +32529,7 @@ async function modelsCommand() {
|
|
|
32502
32529
|
}
|
|
32503
32530
|
|
|
32504
32531
|
// src/commands/chat.ts
|
|
32505
|
-
var
|
|
32532
|
+
var import_react31 = __toESM(require_react(), 1);
|
|
32506
32533
|
|
|
32507
32534
|
// node_modules/ink/build/render.js
|
|
32508
32535
|
import { Stream } from "node:stream";
|
|
@@ -35042,7 +35069,7 @@ var checkAnsi = (ansiCodes, isEscapes, endAnsiCode) => {
|
|
|
35042
35069
|
output = output.filter((element, index) => output.indexOf(element) === index);
|
|
35043
35070
|
if (endAnsiCode !== void 0) {
|
|
35044
35071
|
const fistEscapeCode = wrapAnsi2(ansi_styles_default2.codes.get(Number.parseInt(endAnsiCode, 10)));
|
|
35045
|
-
output = output.reduce((
|
|
35072
|
+
output = output.reduce((current2, next) => next === fistEscapeCode ? [next, ...current2] : [...current2, next], []);
|
|
35046
35073
|
}
|
|
35047
35074
|
}
|
|
35048
35075
|
return output.join("");
|
|
@@ -36713,8 +36740,8 @@ function Text({ color, backgroundColor, dimColor = false, bold: bold2 = false, i
|
|
|
36713
36740
|
}
|
|
36714
36741
|
|
|
36715
36742
|
// node_modules/ink/build/components/ErrorOverview.js
|
|
36716
|
-
var cleanupPath = (
|
|
36717
|
-
return
|
|
36743
|
+
var cleanupPath = (path10) => {
|
|
36744
|
+
return path10?.replace(`file://${cwd()}/`, "");
|
|
36718
36745
|
};
|
|
36719
36746
|
var stackUtils = new import_stack_utils.default({
|
|
36720
36747
|
cwd: cwd(),
|
|
@@ -37657,7 +37684,7 @@ var import_react20 = __toESM(require_react(), 1);
|
|
|
37657
37684
|
var import_react21 = __toESM(require_react(), 1);
|
|
37658
37685
|
|
|
37659
37686
|
// src/tui/REPL.tsx
|
|
37660
|
-
var
|
|
37687
|
+
var import_react29 = __toESM(require_react(), 1);
|
|
37661
37688
|
|
|
37662
37689
|
// src/tui/Markdown.tsx
|
|
37663
37690
|
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
|
|
@@ -37705,11 +37732,25 @@ function renderInline(s) {
|
|
|
37705
37732
|
|
|
37706
37733
|
// src/tui/MessageList.tsx
|
|
37707
37734
|
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
|
|
37708
|
-
var MessageList = ({ message: m }) => {
|
|
37709
|
-
|
|
37710
|
-
|
|
37711
|
-
|
|
37712
|
-
|
|
37735
|
+
var MessageList = ({ message: m, theme }) => {
|
|
37736
|
+
const isUser = m.role === "user";
|
|
37737
|
+
const accent = theme ? isUser ? theme.info : theme.accent : isUser ? "blue" : "green";
|
|
37738
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Box_default, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
37739
|
+
Box_default,
|
|
37740
|
+
{
|
|
37741
|
+
borderStyle: "single",
|
|
37742
|
+
borderTop: false,
|
|
37743
|
+
borderRight: false,
|
|
37744
|
+
borderBottom: false,
|
|
37745
|
+
borderColor: accent,
|
|
37746
|
+
paddingLeft: 1,
|
|
37747
|
+
flexDirection: "column",
|
|
37748
|
+
children: [
|
|
37749
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { bold: true, color: accent, children: isUser ? "you" : "kryven" }),
|
|
37750
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Box_default, { flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Markdown, { text: m.content ?? "" }) })
|
|
37751
|
+
]
|
|
37752
|
+
}
|
|
37753
|
+
) });
|
|
37713
37754
|
};
|
|
37714
37755
|
|
|
37715
37756
|
// src/tui/MarkdownStream.tsx
|
|
@@ -38252,7 +38293,7 @@ var CompletionMenu = ({ items, selected }) => /* @__PURE__ */ (0, import_jsx_run
|
|
|
38252
38293
|
// src/tui/ModelPicker.tsx
|
|
38253
38294
|
var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
|
|
38254
38295
|
var VISIBLE = 10;
|
|
38255
|
-
var ModelPicker = ({ models, selected, current }) => {
|
|
38296
|
+
var ModelPicker = ({ models, selected, current: current2 }) => {
|
|
38256
38297
|
const total = models.length;
|
|
38257
38298
|
const start = Math.max(
|
|
38258
38299
|
0,
|
|
@@ -38275,7 +38316,7 @@ var ModelPicker = ({ models, selected, current }) => {
|
|
|
38275
38316
|
windowed.map((m, i2) => {
|
|
38276
38317
|
const idx = start + i2;
|
|
38277
38318
|
const isSel = idx === selected;
|
|
38278
|
-
const isCur = m.id ===
|
|
38319
|
+
const isCur = m.id === current2;
|
|
38279
38320
|
const cost = m.costIn != null && m.costOut != null ? ` $${m.costIn.toFixed(2)}/$${m.costOut.toFixed(2)}` : "";
|
|
38280
38321
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Box_default, { children: [
|
|
38281
38322
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Box_default, { width: 2, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { color: "cyanBright", children: isSel ? "\u25B6" : " " }) }),
|
|
@@ -38759,7 +38800,7 @@ function normalizeArrayFields(fm) {
|
|
|
38759
38800
|
}
|
|
38760
38801
|
return fm;
|
|
38761
38802
|
}
|
|
38762
|
-
function parseSkillFile(
|
|
38803
|
+
function parseSkillFile(path10, src) {
|
|
38763
38804
|
const m = src.match(FRONTMATTER_RE);
|
|
38764
38805
|
if (!m) {
|
|
38765
38806
|
return { frontmatter: {}, body: src };
|
|
@@ -38768,7 +38809,7 @@ function parseSkillFile(path9, src) {
|
|
|
38768
38809
|
try {
|
|
38769
38810
|
frontmatter = normalizeArrayFields(parseSimpleYaml(m[1]));
|
|
38770
38811
|
} catch (err) {
|
|
38771
|
-
logger.warn("skill: yaml parse failed",
|
|
38812
|
+
logger.warn("skill: yaml parse failed", path10, String(err));
|
|
38772
38813
|
}
|
|
38773
38814
|
const body = src.slice(m[0].length);
|
|
38774
38815
|
return { frontmatter, body };
|
|
@@ -40620,12 +40661,12 @@ var ThemeManager = class extends EventEmitter4 {
|
|
|
40620
40661
|
async loadAll() {
|
|
40621
40662
|
await mkdir4(THEMES_DIR, { recursive: true, mode: 448 });
|
|
40622
40663
|
for (const t of BUILTIN_THEMES) {
|
|
40623
|
-
const
|
|
40664
|
+
const path10 = join10(THEMES_DIR, `${t.name}.json`);
|
|
40624
40665
|
try {
|
|
40625
|
-
await writeFile3(
|
|
40666
|
+
await writeFile3(path10, JSON.stringify(t, null, 2), { flag: "wx" });
|
|
40626
40667
|
} catch (err) {
|
|
40627
40668
|
if (err?.code !== "EEXIST") {
|
|
40628
|
-
logger.warn("theme: cannot materialize built-in",
|
|
40669
|
+
logger.warn("theme: cannot materialize built-in", path10, String(err));
|
|
40629
40670
|
}
|
|
40630
40671
|
}
|
|
40631
40672
|
}
|
|
@@ -40633,15 +40674,15 @@ var ThemeManager = class extends EventEmitter4 {
|
|
|
40633
40674
|
const files = await readdir4(THEMES_DIR);
|
|
40634
40675
|
for (const f of files) {
|
|
40635
40676
|
if (!f.endsWith(".json")) continue;
|
|
40636
|
-
const
|
|
40677
|
+
const path10 = join10(THEMES_DIR, f);
|
|
40637
40678
|
try {
|
|
40638
|
-
const raw = await readFile5(
|
|
40679
|
+
const raw = await readFile5(path10, "utf8");
|
|
40639
40680
|
const parsed = JSON.parse(raw);
|
|
40640
40681
|
if (parsed?.name && parsed?.colors) {
|
|
40641
|
-
this.themes.set(parsed.name, { ...parsed, sourcePath:
|
|
40682
|
+
this.themes.set(parsed.name, { ...parsed, sourcePath: path10 });
|
|
40642
40683
|
}
|
|
40643
40684
|
} catch (err) {
|
|
40644
|
-
logger.warn("theme: parse failed",
|
|
40685
|
+
logger.warn("theme: parse failed", path10, String(err));
|
|
40645
40686
|
}
|
|
40646
40687
|
}
|
|
40647
40688
|
} catch (err) {
|
|
@@ -40660,20 +40701,20 @@ var ThemeManager = class extends EventEmitter4 {
|
|
|
40660
40701
|
try {
|
|
40661
40702
|
this.watcher = fsWatch(THEMES_DIR, { persistent: false }, async (_event, filename) => {
|
|
40662
40703
|
if (!filename || !filename.endsWith(".json")) return;
|
|
40663
|
-
const
|
|
40664
|
-
if (!existsSync10(
|
|
40704
|
+
const path10 = join10(THEMES_DIR, filename);
|
|
40705
|
+
if (!existsSync10(path10)) return;
|
|
40665
40706
|
try {
|
|
40666
|
-
const raw = await readFile5(
|
|
40707
|
+
const raw = await readFile5(path10, "utf8");
|
|
40667
40708
|
const parsed = JSON.parse(raw);
|
|
40668
40709
|
if (parsed?.name && parsed?.colors) {
|
|
40669
|
-
this.themes.set(parsed.name, { ...parsed, sourcePath:
|
|
40710
|
+
this.themes.set(parsed.name, { ...parsed, sourcePath: path10 });
|
|
40670
40711
|
if (this.active.name === parsed.name) {
|
|
40671
40712
|
this.active = this.themes.get(parsed.name);
|
|
40672
40713
|
this.emit("change", this.active);
|
|
40673
40714
|
}
|
|
40674
40715
|
}
|
|
40675
40716
|
} catch (err) {
|
|
40676
|
-
logger.warn("theme: hot-reload parse failed",
|
|
40717
|
+
logger.warn("theme: hot-reload parse failed", path10, String(err));
|
|
40677
40718
|
}
|
|
40678
40719
|
});
|
|
40679
40720
|
} catch (err) {
|
|
@@ -40701,7 +40742,7 @@ init_load();
|
|
|
40701
40742
|
var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
|
|
40702
40743
|
var ThemePanel = ({
|
|
40703
40744
|
entries,
|
|
40704
|
-
current
|
|
40745
|
+
current: current2
|
|
40705
40746
|
}) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 1, children: [
|
|
40706
40747
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text, { bold: true, color: "magenta", children: "Themes" }),
|
|
40707
40748
|
entries.map((e) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Box_default, { children: [
|
|
@@ -40713,7 +40754,7 @@ var ThemePanel = ({
|
|
|
40713
40754
|
] }, e.name)),
|
|
40714
40755
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Text, { color: "gray", children: [
|
|
40715
40756
|
"Active: ",
|
|
40716
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text, { color: "magentaBright", children:
|
|
40757
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text, { color: "magentaBright", children: current2 }),
|
|
40717
40758
|
" \xB7 ",
|
|
40718
40759
|
"/theme ",
|
|
40719
40760
|
"<name>",
|
|
@@ -40729,15 +40770,15 @@ var themeCommand = {
|
|
|
40729
40770
|
const trimmed = args.trim().toLowerCase();
|
|
40730
40771
|
if (!trimmed) {
|
|
40731
40772
|
const all2 = tm.list();
|
|
40732
|
-
const
|
|
40773
|
+
const current2 = tm.current();
|
|
40733
40774
|
const entries = all2.map((t) => ({
|
|
40734
40775
|
name: t.name,
|
|
40735
|
-
active: t.name ===
|
|
40776
|
+
active: t.name === current2.name,
|
|
40736
40777
|
accent: t.colors.accent
|
|
40737
40778
|
}));
|
|
40738
40779
|
return {
|
|
40739
40780
|
type: "render",
|
|
40740
|
-
element: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ThemePanel, { entries, current:
|
|
40781
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ThemePanel, { entries, current: current2.name })
|
|
40741
40782
|
};
|
|
40742
40783
|
}
|
|
40743
40784
|
if (trimmed === "cycle") {
|
|
@@ -41583,9 +41624,9 @@ Valid actions: ${[...VALID_ACTIONS].join(", ")}`
|
|
|
41583
41624
|
};
|
|
41584
41625
|
}
|
|
41585
41626
|
const mgr = getKeybindings();
|
|
41586
|
-
const
|
|
41627
|
+
const current2 = mgr.list();
|
|
41587
41628
|
const merged = /* @__PURE__ */ new Map();
|
|
41588
|
-
for (const b of
|
|
41629
|
+
for (const b of current2) merged.set(b.key, b);
|
|
41589
41630
|
merged.set(key, { key, action });
|
|
41590
41631
|
const next = [...merged.values()];
|
|
41591
41632
|
try {
|
|
@@ -41611,15 +41652,15 @@ Valid actions: ${[...VALID_ACTIONS].join(", ")}`
|
|
|
41611
41652
|
};
|
|
41612
41653
|
}
|
|
41613
41654
|
const mgr = getKeybindings();
|
|
41614
|
-
const
|
|
41615
|
-
const found =
|
|
41655
|
+
const current2 = mgr.list();
|
|
41656
|
+
const found = current2.some((b) => b.key === key);
|
|
41616
41657
|
if (!found) {
|
|
41617
41658
|
return {
|
|
41618
41659
|
type: "error",
|
|
41619
41660
|
message: `No binding for key "${key}". Run /keybindings to see active bindings.`
|
|
41620
41661
|
};
|
|
41621
41662
|
}
|
|
41622
|
-
const next =
|
|
41663
|
+
const next = current2.filter((b) => b.key !== key);
|
|
41623
41664
|
try {
|
|
41624
41665
|
await saveToDisk(next);
|
|
41625
41666
|
await mgr.loadFromDisk();
|
|
@@ -41769,9 +41810,9 @@ function getMemoryPath() {
|
|
|
41769
41810
|
return join16(getConfigDir(), "memory.json");
|
|
41770
41811
|
}
|
|
41771
41812
|
async function loadNotes() {
|
|
41772
|
-
const
|
|
41813
|
+
const path10 = getMemoryPath();
|
|
41773
41814
|
try {
|
|
41774
|
-
const raw = await readFile8(
|
|
41815
|
+
const raw = await readFile8(path10, "utf8");
|
|
41775
41816
|
const parsed = JSON.parse(raw);
|
|
41776
41817
|
if (Array.isArray(parsed)) {
|
|
41777
41818
|
return parsed.filter(
|
|
@@ -41783,16 +41824,16 @@ async function loadNotes() {
|
|
|
41783
41824
|
return [];
|
|
41784
41825
|
}
|
|
41785
41826
|
async function saveNotes(notes) {
|
|
41786
|
-
const
|
|
41787
|
-
await mkdir7(dirname8(
|
|
41788
|
-
await writeFile6(
|
|
41827
|
+
const path10 = getMemoryPath();
|
|
41828
|
+
await mkdir7(dirname8(path10), { recursive: true });
|
|
41829
|
+
await writeFile6(path10, JSON.stringify(notes, null, 2) + "\n", "utf8");
|
|
41789
41830
|
}
|
|
41790
41831
|
function fmtDate2(ts) {
|
|
41791
41832
|
const d = new Date(ts);
|
|
41792
41833
|
const pad = (n2) => String(n2).padStart(2, "0");
|
|
41793
41834
|
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ${pad(d.getHours())}:${pad(d.getMinutes())}`;
|
|
41794
41835
|
}
|
|
41795
|
-
var NoteListPanel = ({ notes, path:
|
|
41836
|
+
var NoteListPanel = ({ notes, path: path10 }) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
41796
41837
|
Box_default,
|
|
41797
41838
|
{
|
|
41798
41839
|
flexDirection: "column",
|
|
@@ -41808,7 +41849,7 @@ var NoteListPanel = ({ notes, path: path9 }) => /* @__PURE__ */ (0, import_jsx_r
|
|
|
41808
41849
|
" ",
|
|
41809
41850
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text, { color: "gray", dimColor: true, children: [
|
|
41810
41851
|
"(",
|
|
41811
|
-
|
|
41852
|
+
path10,
|
|
41812
41853
|
")"
|
|
41813
41854
|
] })
|
|
41814
41855
|
] }),
|
|
@@ -41961,21 +42002,21 @@ function projectSettingsPath(cwd2) {
|
|
|
41961
42002
|
function settingsPathForScope(scope, cwd2) {
|
|
41962
42003
|
return scope === "global" ? globalSettingsPath() : projectSettingsPath(cwd2);
|
|
41963
42004
|
}
|
|
41964
|
-
function readSettings(
|
|
41965
|
-
if (!existsSync12(
|
|
42005
|
+
function readSettings(path10) {
|
|
42006
|
+
if (!existsSync12(path10)) return {};
|
|
41966
42007
|
try {
|
|
41967
|
-
return JSON.parse(readFileSync8(
|
|
42008
|
+
return JSON.parse(readFileSync8(path10, "utf8"));
|
|
41968
42009
|
} catch {
|
|
41969
42010
|
return {};
|
|
41970
42011
|
}
|
|
41971
42012
|
}
|
|
41972
|
-
function writeSettings(
|
|
41973
|
-
const dir = dirname9(
|
|
42013
|
+
function writeSettings(path10, settings) {
|
|
42014
|
+
const dir = dirname9(path10);
|
|
41974
42015
|
if (!existsSync12(dir)) mkdirSync4(dir, { recursive: true });
|
|
41975
|
-
writeFileSync5(
|
|
42016
|
+
writeFileSync5(path10, JSON.stringify(settings, null, 2) + "\n", "utf8");
|
|
41976
42017
|
}
|
|
41977
|
-
function readHooks(
|
|
41978
|
-
const settings = readSettings(
|
|
42018
|
+
function readHooks(path10) {
|
|
42019
|
+
const settings = readSettings(path10);
|
|
41979
42020
|
const raw = settings.hooks;
|
|
41980
42021
|
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return {};
|
|
41981
42022
|
const out = {};
|
|
@@ -41996,32 +42037,32 @@ function readHooks(path9) {
|
|
|
41996
42037
|
}
|
|
41997
42038
|
return out;
|
|
41998
42039
|
}
|
|
41999
|
-
function writeHooks(
|
|
42000
|
-
const settings = readSettings(
|
|
42040
|
+
function writeHooks(path10, hooks) {
|
|
42041
|
+
const settings = readSettings(path10);
|
|
42001
42042
|
settings.hooks = hooks;
|
|
42002
|
-
writeSettings(
|
|
42043
|
+
writeSettings(path10, settings);
|
|
42003
42044
|
}
|
|
42004
|
-
function addHook(
|
|
42005
|
-
const hooks = readHooks(
|
|
42045
|
+
function addHook(path10, event, command) {
|
|
42046
|
+
const hooks = readHooks(path10);
|
|
42006
42047
|
const list = hooks[event] ?? [];
|
|
42007
42048
|
const newEntry = { command, enabled: true };
|
|
42008
42049
|
list.push(newEntry);
|
|
42009
42050
|
hooks[event] = list;
|
|
42010
|
-
writeHooks(
|
|
42051
|
+
writeHooks(path10, hooks);
|
|
42011
42052
|
return { added: true, index: list.length - 1 };
|
|
42012
42053
|
}
|
|
42013
|
-
function setEnabled(
|
|
42014
|
-
const hooks = readHooks(
|
|
42054
|
+
function setEnabled(path10, event, index, enabled) {
|
|
42055
|
+
const hooks = readHooks(path10);
|
|
42015
42056
|
const list = hooks[event];
|
|
42016
42057
|
if (!list || list.length === 0) return { ok: false, reason: "no-event" };
|
|
42017
42058
|
if (index < 0 || index >= list.length) return { ok: false, reason: "out-of-range" };
|
|
42018
42059
|
list[index] = { ...list[index], enabled };
|
|
42019
42060
|
hooks[event] = list;
|
|
42020
|
-
writeHooks(
|
|
42061
|
+
writeHooks(path10, hooks);
|
|
42021
42062
|
return { ok: true };
|
|
42022
42063
|
}
|
|
42023
|
-
function removeHook(
|
|
42024
|
-
const hooks = readHooks(
|
|
42064
|
+
function removeHook(path10, event, index) {
|
|
42065
|
+
const hooks = readHooks(path10);
|
|
42025
42066
|
const list = hooks[event];
|
|
42026
42067
|
if (!list || list.length === 0) return { ok: false, reason: "no-event" };
|
|
42027
42068
|
if (index < 0 || index >= list.length) return { ok: false, reason: "out-of-range" };
|
|
@@ -42031,17 +42072,17 @@ function removeHook(path9, event, index) {
|
|
|
42031
42072
|
} else {
|
|
42032
42073
|
hooks[event] = list;
|
|
42033
42074
|
}
|
|
42034
|
-
writeHooks(
|
|
42075
|
+
writeHooks(path10, hooks);
|
|
42035
42076
|
return { ok: true };
|
|
42036
42077
|
}
|
|
42037
|
-
function editHook(
|
|
42038
|
-
const hooks = readHooks(
|
|
42078
|
+
function editHook(path10, event, index, newCommand2) {
|
|
42079
|
+
const hooks = readHooks(path10);
|
|
42039
42080
|
const list = hooks[event];
|
|
42040
42081
|
if (!list || list.length === 0) return { ok: false, reason: "no-event" };
|
|
42041
42082
|
if (index < 0 || index >= list.length) return { ok: false, reason: "out-of-range" };
|
|
42042
42083
|
list[index] = { ...list[index], command: newCommand2 };
|
|
42043
42084
|
hooks[event] = list;
|
|
42044
|
-
writeHooks(
|
|
42085
|
+
writeHooks(path10, hooks);
|
|
42045
42086
|
return { ok: true };
|
|
42046
42087
|
}
|
|
42047
42088
|
var HookRow = ({ index, entry }) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Box_default, { flexDirection: "row", marginLeft: 2, children: [
|
|
@@ -42198,14 +42239,14 @@ var hooksCommand = {
|
|
|
42198
42239
|
message: `Usage: /hooks add ${rawScope} ${event} <command>`
|
|
42199
42240
|
};
|
|
42200
42241
|
}
|
|
42201
|
-
const
|
|
42242
|
+
const path10 = settingsPathForScope(scope, ctx.cwd);
|
|
42202
42243
|
try {
|
|
42203
|
-
const { index } = addHook(
|
|
42244
|
+
const { index } = addHook(path10, event, command);
|
|
42204
42245
|
return {
|
|
42205
42246
|
type: "ack",
|
|
42206
42247
|
message: `Added hook [${index}] to ${scope}/${event}:
|
|
42207
42248
|
${command}
|
|
42208
|
-
Saved to ${
|
|
42249
|
+
Saved to ${path10}`
|
|
42209
42250
|
};
|
|
42210
42251
|
} catch (err) {
|
|
42211
42252
|
return { type: "error", message: `Failed to write hook: ${err.message}` };
|
|
@@ -42230,9 +42271,9 @@ Saved to ${path9}`
|
|
|
42230
42271
|
message: `Usage: /hooks ${sub} ${rawScope} <event> <index>`
|
|
42231
42272
|
};
|
|
42232
42273
|
}
|
|
42233
|
-
const
|
|
42274
|
+
const path10 = settingsPathForScope(scope, ctx.cwd);
|
|
42234
42275
|
try {
|
|
42235
|
-
const result = setEnabled(
|
|
42276
|
+
const result = setEnabled(path10, event, index, enabled);
|
|
42236
42277
|
if (!result.ok) {
|
|
42237
42278
|
if (result.reason === "no-event") {
|
|
42238
42279
|
return {
|
|
@@ -42272,9 +42313,9 @@ Saved to ${path9}`
|
|
|
42272
42313
|
message: `Usage: /hooks edit ${rawScope} <event> <index> <new-command>`
|
|
42273
42314
|
};
|
|
42274
42315
|
}
|
|
42275
|
-
const
|
|
42316
|
+
const path10 = settingsPathForScope(scope, ctx.cwd);
|
|
42276
42317
|
try {
|
|
42277
|
-
const result = editHook(
|
|
42318
|
+
const result = editHook(path10, event, index, newCommand2);
|
|
42278
42319
|
if (!result.ok) {
|
|
42279
42320
|
if (result.reason === "no-event") {
|
|
42280
42321
|
return {
|
|
@@ -42314,9 +42355,9 @@ Saved to ${path9}`
|
|
|
42314
42355
|
message: `Usage: /hooks rm ${rawScope} <event> <index>`
|
|
42315
42356
|
};
|
|
42316
42357
|
}
|
|
42317
|
-
const
|
|
42358
|
+
const path10 = settingsPathForScope(scope, ctx.cwd);
|
|
42318
42359
|
try {
|
|
42319
|
-
const result = removeHook(
|
|
42360
|
+
const result = removeHook(path10, event, index);
|
|
42320
42361
|
if (!result.ok) {
|
|
42321
42362
|
if (result.reason === "no-event") {
|
|
42322
42363
|
return {
|
|
@@ -43552,8 +43593,8 @@ async function listBgAgents() {
|
|
|
43552
43593
|
const tailBytes = Math.min(st.size, 4096);
|
|
43553
43594
|
if (tailBytes > 0) {
|
|
43554
43595
|
const buf = Buffer.alloc(tailBytes);
|
|
43555
|
-
const
|
|
43556
|
-
const fd = await
|
|
43596
|
+
const fs6 = await import("node:fs/promises");
|
|
43597
|
+
const fd = await fs6.open(log, "r");
|
|
43557
43598
|
try {
|
|
43558
43599
|
await fd.read(buf, 0, tailBytes, st.size - tailBytes);
|
|
43559
43600
|
} finally {
|
|
@@ -43629,8 +43670,8 @@ async function attachBgAgent(id, onLine, signal) {
|
|
|
43629
43670
|
const s = await stat8(p);
|
|
43630
43671
|
if (s.size > pos) {
|
|
43631
43672
|
const buf = Buffer.alloc(s.size - pos);
|
|
43632
|
-
const
|
|
43633
|
-
const fd = await
|
|
43673
|
+
const fs6 = await import("node:fs/promises");
|
|
43674
|
+
const fd = await fs6.open(p, "r");
|
|
43634
43675
|
try {
|
|
43635
43676
|
await fd.read(buf, 0, buf.length, pos);
|
|
43636
43677
|
flush(decoder.write(buf), false);
|
|
@@ -43719,7 +43760,7 @@ async function runBgAgent(id) {
|
|
|
43719
43760
|
apiKey: cfg.apiKey,
|
|
43720
43761
|
baseUrl: cfg.apiBaseUrl,
|
|
43721
43762
|
clientType: "ide",
|
|
43722
|
-
userAgent: `kryven-cli-bg/${"0.2.
|
|
43763
|
+
userAgent: `kryven-cli-bg/${"0.2.6"}`
|
|
43723
43764
|
});
|
|
43724
43765
|
const transcriptPath = join25(dir, "transcript.jsonl");
|
|
43725
43766
|
const appendTranscript = async (m) => {
|
|
@@ -43937,10 +43978,10 @@ var bgCommand = {
|
|
|
43937
43978
|
init_modes();
|
|
43938
43979
|
var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1);
|
|
43939
43980
|
var ORDER = ["plan", "default", "acceptEdits", "bypass", "deny"];
|
|
43940
|
-
var ModePanel = ({ current }) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [
|
|
43981
|
+
var ModePanel = ({ current: current2 }) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [
|
|
43941
43982
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { bold: true, color: "cyan", children: "Permission mode" }),
|
|
43942
43983
|
ORDER.map((m) => {
|
|
43943
|
-
const active = m ===
|
|
43984
|
+
const active = m === current2;
|
|
43944
43985
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Box_default, { children: [
|
|
43945
43986
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Box_default, { width: 14, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Text, { color: active ? "greenBright" : "cyan", bold: active, children: [
|
|
43946
43987
|
active ? "\u25B8 " : " ",
|
|
@@ -44187,17 +44228,17 @@ var SessionStore = class {
|
|
|
44187
44228
|
true
|
|
44188
44229
|
);
|
|
44189
44230
|
}
|
|
44190
|
-
async queueWrite(
|
|
44231
|
+
async queueWrite(path10, data, append) {
|
|
44191
44232
|
this.writing = this.writing.then(async () => {
|
|
44192
44233
|
try {
|
|
44193
44234
|
if (append) {
|
|
44194
|
-
await appendFile(
|
|
44235
|
+
await appendFile(path10, data);
|
|
44195
44236
|
} else {
|
|
44196
44237
|
const { writeFile: writeFile12 } = await import("node:fs/promises");
|
|
44197
|
-
await writeFile12(
|
|
44238
|
+
await writeFile12(path10, data);
|
|
44198
44239
|
}
|
|
44199
44240
|
} catch (err) {
|
|
44200
|
-
logger.warn("session: write failed",
|
|
44241
|
+
logger.warn("session: write failed", path10, String(err));
|
|
44201
44242
|
}
|
|
44202
44243
|
});
|
|
44203
44244
|
return this.writing;
|
|
@@ -44422,9 +44463,9 @@ var SessionsClient = class {
|
|
|
44422
44463
|
headers() {
|
|
44423
44464
|
return this.client.headers();
|
|
44424
44465
|
}
|
|
44425
|
-
async req(method,
|
|
44426
|
-
const url = `${this.baseUrl}${
|
|
44427
|
-
logger.debug("sessions", method,
|
|
44466
|
+
async req(method, path10, body, signal) {
|
|
44467
|
+
const url = `${this.baseUrl}${path10}`;
|
|
44468
|
+
logger.debug("sessions", method, path10);
|
|
44428
44469
|
const res = await this.fetch(url, {
|
|
44429
44470
|
method,
|
|
44430
44471
|
headers: this.headers(),
|
|
@@ -44508,24 +44549,24 @@ import { appendFile as appendFile3, mkdir as mkdir12, readFile as readFile15 } f
|
|
|
44508
44549
|
import { existsSync as existsSync19 } from "node:fs";
|
|
44509
44550
|
import { dirname as dirname14 } from "node:path";
|
|
44510
44551
|
async function ensureFile() {
|
|
44511
|
-
const
|
|
44512
|
-
if (!existsSync19(dirname14(
|
|
44513
|
-
await mkdir12(dirname14(
|
|
44552
|
+
const path10 = getHistoryPath();
|
|
44553
|
+
if (!existsSync19(dirname14(path10))) {
|
|
44554
|
+
await mkdir12(dirname14(path10), { recursive: true, mode: 448 });
|
|
44514
44555
|
}
|
|
44515
|
-
if (!existsSync19(
|
|
44516
|
-
await appendFile3(
|
|
44556
|
+
if (!existsSync19(path10)) {
|
|
44557
|
+
await appendFile3(path10, "");
|
|
44517
44558
|
}
|
|
44518
|
-
return
|
|
44559
|
+
return path10;
|
|
44519
44560
|
}
|
|
44520
44561
|
async function appendHistory(entry) {
|
|
44521
44562
|
try {
|
|
44522
|
-
const
|
|
44523
|
-
const release = await import_proper_lockfile.default.lock(
|
|
44563
|
+
const path10 = await ensureFile();
|
|
44564
|
+
const release = await import_proper_lockfile.default.lock(path10, {
|
|
44524
44565
|
retries: { retries: 3, factor: 1.5, minTimeout: 30 },
|
|
44525
44566
|
stale: 5e3
|
|
44526
44567
|
});
|
|
44527
44568
|
try {
|
|
44528
|
-
await appendFile3(
|
|
44569
|
+
await appendFile3(path10, JSON.stringify(entry) + "\n");
|
|
44529
44570
|
} finally {
|
|
44530
44571
|
await release();
|
|
44531
44572
|
}
|
|
@@ -44672,8 +44713,8 @@ function compareSemver(a2, b) {
|
|
|
44672
44713
|
}
|
|
44673
44714
|
return 0;
|
|
44674
44715
|
}
|
|
44675
|
-
async function checkForUpdate(
|
|
44676
|
-
if (!
|
|
44716
|
+
async function checkForUpdate(current2, timeoutMs = 2500) {
|
|
44717
|
+
if (!current2 || !SEMVER.test(current2)) return null;
|
|
44677
44718
|
try {
|
|
44678
44719
|
const ac = new AbortController();
|
|
44679
44720
|
const timer = setTimeout(() => ac.abort(), timeoutMs);
|
|
@@ -44690,24 +44731,278 @@ async function checkForUpdate(current, timeoutMs = 2500) {
|
|
|
44690
44731
|
const j = await res.json();
|
|
44691
44732
|
const latest = String(j?.version ?? "");
|
|
44692
44733
|
if (!SEMVER.test(latest)) return null;
|
|
44693
|
-
return { updateAvailable: compareSemver(latest,
|
|
44734
|
+
return { updateAvailable: compareSemver(latest, current2) > 0, latest };
|
|
44694
44735
|
} catch {
|
|
44695
44736
|
return null;
|
|
44696
44737
|
}
|
|
44697
44738
|
}
|
|
44698
44739
|
|
|
44699
|
-
// src/
|
|
44740
|
+
// src/utils/clipboard.ts
|
|
44741
|
+
import { spawn as spawn8 } from "node:child_process";
|
|
44742
|
+
function osc52(payload) {
|
|
44743
|
+
const b64 = Buffer.from(payload, "utf8").toString("base64");
|
|
44744
|
+
return `\x1B]52;c;${b64}\x07`;
|
|
44745
|
+
}
|
|
44746
|
+
function osClipboardFallback(text) {
|
|
44747
|
+
const candidates = process.platform === "win32" ? [{ cmd: "clip", args: [] }] : process.platform === "darwin" ? [{ cmd: "pbcopy", args: [] }] : [
|
|
44748
|
+
{ cmd: "wl-copy", args: [] },
|
|
44749
|
+
{ cmd: "xclip", args: ["-selection", "clipboard"] },
|
|
44750
|
+
{ cmd: "xsel", args: ["--clipboard", "--input"] }
|
|
44751
|
+
];
|
|
44752
|
+
return new Promise((resolve7) => {
|
|
44753
|
+
const tryNext = (i2) => {
|
|
44754
|
+
if (i2 >= candidates.length) return resolve7(false);
|
|
44755
|
+
const { cmd, args } = candidates[i2];
|
|
44756
|
+
let settled = false;
|
|
44757
|
+
try {
|
|
44758
|
+
const child = spawn8(cmd, args, { stdio: ["pipe", "ignore", "ignore"] });
|
|
44759
|
+
child.on("error", () => {
|
|
44760
|
+
if (!settled) {
|
|
44761
|
+
settled = true;
|
|
44762
|
+
tryNext(i2 + 1);
|
|
44763
|
+
}
|
|
44764
|
+
});
|
|
44765
|
+
child.on("close", (code) => {
|
|
44766
|
+
if (!settled) {
|
|
44767
|
+
settled = true;
|
|
44768
|
+
code === 0 ? resolve7(true) : tryNext(i2 + 1);
|
|
44769
|
+
}
|
|
44770
|
+
});
|
|
44771
|
+
child.stdin.end(text);
|
|
44772
|
+
} catch {
|
|
44773
|
+
tryNext(i2 + 1);
|
|
44774
|
+
}
|
|
44775
|
+
};
|
|
44776
|
+
tryNext(0);
|
|
44777
|
+
});
|
|
44778
|
+
}
|
|
44779
|
+
async function copyToClipboard(text) {
|
|
44780
|
+
let wroteOsc = false;
|
|
44781
|
+
try {
|
|
44782
|
+
if (process.stdout.isTTY) {
|
|
44783
|
+
process.stdout.write(osc52(text));
|
|
44784
|
+
wroteOsc = true;
|
|
44785
|
+
}
|
|
44786
|
+
} catch {
|
|
44787
|
+
}
|
|
44788
|
+
const osOk = await osClipboardFallback(text).catch(() => false);
|
|
44789
|
+
return wroteOsc || osOk;
|
|
44790
|
+
}
|
|
44791
|
+
|
|
44792
|
+
// src/utils/tts.ts
|
|
44793
|
+
import { spawn as spawn9 } from "node:child_process";
|
|
44794
|
+
var current = null;
|
|
44795
|
+
function ttsLikelyAvailable() {
|
|
44796
|
+
return process.platform === "win32" || process.platform === "darwin" || process.platform === "linux";
|
|
44797
|
+
}
|
|
44798
|
+
function stopSpeaking() {
|
|
44799
|
+
if (current && !current.killed) {
|
|
44800
|
+
try {
|
|
44801
|
+
current.kill();
|
|
44802
|
+
} catch {
|
|
44803
|
+
}
|
|
44804
|
+
}
|
|
44805
|
+
current = null;
|
|
44806
|
+
}
|
|
44807
|
+
function speak(text) {
|
|
44808
|
+
stopSpeaking();
|
|
44809
|
+
const clean = sanitizeForSpeech(text);
|
|
44810
|
+
if (!clean) return Promise.resolve();
|
|
44811
|
+
return new Promise((resolve7) => {
|
|
44812
|
+
let child;
|
|
44813
|
+
try {
|
|
44814
|
+
if (process.platform === "win32") {
|
|
44815
|
+
const ps = "Add-Type -AssemblyName System.Speech;$s=New-Object System.Speech.Synthesis.SpeechSynthesizer;$t=[Console]::In.ReadToEnd();$s.Speak($t);";
|
|
44816
|
+
child = spawn9("powershell", ["-NoProfile", "-NonInteractive", "-Command", ps], {
|
|
44817
|
+
stdio: ["pipe", "ignore", "ignore"]
|
|
44818
|
+
});
|
|
44819
|
+
child.stdin?.end(clean);
|
|
44820
|
+
} else if (process.platform === "darwin") {
|
|
44821
|
+
child = spawn9("say", [], { stdio: ["pipe", "ignore", "ignore"] });
|
|
44822
|
+
child.stdin?.end(clean);
|
|
44823
|
+
} else {
|
|
44824
|
+
child = spawn9("sh", ["-c", "command -v spd-say >/dev/null 2>&1 && spd-say -e || espeak"], {
|
|
44825
|
+
stdio: ["pipe", "ignore", "ignore"]
|
|
44826
|
+
});
|
|
44827
|
+
child.stdin?.end(clean);
|
|
44828
|
+
}
|
|
44829
|
+
} catch {
|
|
44830
|
+
return resolve7();
|
|
44831
|
+
}
|
|
44832
|
+
current = child;
|
|
44833
|
+
child.on("error", () => {
|
|
44834
|
+
current = null;
|
|
44835
|
+
resolve7();
|
|
44836
|
+
});
|
|
44837
|
+
child.on("close", () => {
|
|
44838
|
+
current = null;
|
|
44839
|
+
resolve7();
|
|
44840
|
+
});
|
|
44841
|
+
});
|
|
44842
|
+
}
|
|
44843
|
+
function sanitizeForSpeech(text) {
|
|
44844
|
+
if (!text) return "";
|
|
44845
|
+
let s = text;
|
|
44846
|
+
s = s.replace(/```[\s\S]*?```/g, " (code block) ");
|
|
44847
|
+
s = s.replace(/`([^`]+)`/g, "$1").replace(/\*\*([^*]+)\*\*/g, "$1").replace(/[*_#>]/g, "");
|
|
44848
|
+
s = s.replace(/\[([^\]]+)\]\([^)]+\)/g, "$1");
|
|
44849
|
+
s = s.replace(/\s+/g, " ").trim();
|
|
44850
|
+
return s.length > 1200 ? s.slice(0, 1200) + " \u2026" : s;
|
|
44851
|
+
}
|
|
44852
|
+
|
|
44853
|
+
// src/tui/FilePicker.tsx
|
|
44854
|
+
var import_react28 = __toESM(require_react(), 1);
|
|
44700
44855
|
var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1);
|
|
44701
|
-
import fs4 from "node:fs";
|
|
44702
|
-
import path8 from "node:path";
|
|
44856
|
+
import * as fs4 from "node:fs";
|
|
44857
|
+
import * as path8 from "node:path";
|
|
44858
|
+
var IGNORED = /* @__PURE__ */ new Set([
|
|
44859
|
+
"node_modules",
|
|
44860
|
+
".git",
|
|
44861
|
+
".next",
|
|
44862
|
+
"dist",
|
|
44863
|
+
"build",
|
|
44864
|
+
".cache",
|
|
44865
|
+
"coverage",
|
|
44866
|
+
".turbo",
|
|
44867
|
+
".parcel-cache",
|
|
44868
|
+
"__pycache__",
|
|
44869
|
+
".venv",
|
|
44870
|
+
"venv"
|
|
44871
|
+
]);
|
|
44872
|
+
function listDir2(dir) {
|
|
44873
|
+
let dirents;
|
|
44874
|
+
try {
|
|
44875
|
+
dirents = fs4.readdirSync(dir, { withFileTypes: true });
|
|
44876
|
+
} catch {
|
|
44877
|
+
return [];
|
|
44878
|
+
}
|
|
44879
|
+
const out = dirents.filter((d) => !(d.isDirectory() && IGNORED.has(d.name))).filter((d) => !d.name.startsWith(".") || d.name === ".env").map((d) => ({ name: d.name, abs: path8.join(dir, d.name), isDir: d.isDirectory() }));
|
|
44880
|
+
out.sort((a2, b) => a2.isDir === b.isDir ? a2.name.localeCompare(b.name) : a2.isDir ? -1 : 1);
|
|
44881
|
+
return out;
|
|
44882
|
+
}
|
|
44883
|
+
var FilePicker = ({ cwd: cwd2, theme, onSubmit, onCancel }) => {
|
|
44884
|
+
const [dir, setDir] = (0, import_react28.useState)(cwd2);
|
|
44885
|
+
const [cursor, setCursor] = (0, import_react28.useState)(0);
|
|
44886
|
+
const [selected, setSelected] = (0, import_react28.useState)(/* @__PURE__ */ new Set());
|
|
44887
|
+
const entries = (0, import_react28.useMemo)(() => listDir2(dir), [dir]);
|
|
44888
|
+
const WINDOW = 12;
|
|
44889
|
+
const start = Math.max(0, Math.min(cursor - Math.floor(WINDOW / 2), Math.max(0, entries.length - WINDOW)));
|
|
44890
|
+
const visible = entries.slice(start, start + WINDOW);
|
|
44891
|
+
const finish = (extraAbs) => {
|
|
44892
|
+
const all = new Set(selected);
|
|
44893
|
+
if (extraAbs) all.add(extraAbs);
|
|
44894
|
+
const rels = [...all].map((abs) => {
|
|
44895
|
+
const rel2 = path8.relative(cwd2, abs);
|
|
44896
|
+
return rel2 === "" ? "." : rel2.split(path8.sep).join("/");
|
|
44897
|
+
});
|
|
44898
|
+
onSubmit(rels);
|
|
44899
|
+
};
|
|
44900
|
+
use_input_default((inputCh, key) => {
|
|
44901
|
+
if (key.escape) {
|
|
44902
|
+
onCancel();
|
|
44903
|
+
return;
|
|
44904
|
+
}
|
|
44905
|
+
if (key.upArrow) {
|
|
44906
|
+
setCursor((c3) => Math.max(0, c3 - 1));
|
|
44907
|
+
return;
|
|
44908
|
+
}
|
|
44909
|
+
if (key.downArrow) {
|
|
44910
|
+
setCursor((c3) => Math.min(entries.length - 1, c3 + 1));
|
|
44911
|
+
return;
|
|
44912
|
+
}
|
|
44913
|
+
if (key.leftArrow) {
|
|
44914
|
+
const parent = path8.dirname(dir);
|
|
44915
|
+
if (parent !== dir) {
|
|
44916
|
+
setDir(parent);
|
|
44917
|
+
setCursor(0);
|
|
44918
|
+
}
|
|
44919
|
+
return;
|
|
44920
|
+
}
|
|
44921
|
+
const cur = entries[cursor];
|
|
44922
|
+
if (key.rightArrow) {
|
|
44923
|
+
if (cur?.isDir) {
|
|
44924
|
+
setDir(cur.abs);
|
|
44925
|
+
setCursor(0);
|
|
44926
|
+
}
|
|
44927
|
+
return;
|
|
44928
|
+
}
|
|
44929
|
+
if (inputCh === " ") {
|
|
44930
|
+
if (cur) {
|
|
44931
|
+
setSelected((prev) => {
|
|
44932
|
+
const next = new Set(prev);
|
|
44933
|
+
next.has(cur.abs) ? next.delete(cur.abs) : next.add(cur.abs);
|
|
44934
|
+
return next;
|
|
44935
|
+
});
|
|
44936
|
+
}
|
|
44937
|
+
return;
|
|
44938
|
+
}
|
|
44939
|
+
if (inputCh === "a" && cur) {
|
|
44940
|
+
finish(cur.abs);
|
|
44941
|
+
return;
|
|
44942
|
+
}
|
|
44943
|
+
if (key.return) {
|
|
44944
|
+
if (cur?.isDir && selected.size === 0) {
|
|
44945
|
+
setDir(cur.abs);
|
|
44946
|
+
setCursor(0);
|
|
44947
|
+
return;
|
|
44948
|
+
}
|
|
44949
|
+
finish(selected.size === 0 && cur ? cur.abs : void 0);
|
|
44950
|
+
return;
|
|
44951
|
+
}
|
|
44952
|
+
});
|
|
44953
|
+
const rel = path8.relative(cwd2, dir) || ".";
|
|
44954
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
|
|
44955
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: theme.accent, bold: true, children: "\uFF0B Add files / folders to the prompt" }),
|
|
44956
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Text, { color: theme.muted, children: [
|
|
44957
|
+
"./",
|
|
44958
|
+
rel === "." ? "" : rel,
|
|
44959
|
+
"/"
|
|
44960
|
+
] }),
|
|
44961
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
|
|
44962
|
+
start > 0 && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: theme.muted, children: " \u2191 more\u2026" }),
|
|
44963
|
+
visible.map((e) => {
|
|
44964
|
+
const i2 = entries.indexOf(e);
|
|
44965
|
+
const isCursor = i2 === cursor;
|
|
44966
|
+
const isSel = selected.has(e.abs);
|
|
44967
|
+
const mark = isSel ? "\u25C9" : "\u25EF";
|
|
44968
|
+
const icon = e.isDir ? "\u25B8 " : " ";
|
|
44969
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: isCursor ? theme.accent : theme.fg, inverse: isCursor, children: `${mark} ${icon}${e.name}${e.isDir ? "/" : ""}` }, e.abs);
|
|
44970
|
+
}),
|
|
44971
|
+
entries.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: theme.muted, children: " (empty)" }),
|
|
44972
|
+
start + WINDOW < entries.length && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { color: theme.muted, children: " \u2193 more\u2026" })
|
|
44973
|
+
] }),
|
|
44974
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Text, { color: theme.muted, children: [
|
|
44975
|
+
"\u2191\u2193 move \xB7 \u2192 open \xB7 \u2190 up \xB7 space select",
|
|
44976
|
+
selected.size > 0 ? ` (${selected.size})` : "",
|
|
44977
|
+
" \xB7 enter add \xB7 esc cancel"
|
|
44978
|
+
] }) })
|
|
44979
|
+
] });
|
|
44980
|
+
};
|
|
44981
|
+
|
|
44982
|
+
// src/tui/REPL.tsx
|
|
44983
|
+
var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1);
|
|
44984
|
+
import fs5 from "node:fs";
|
|
44985
|
+
import path9 from "node:path";
|
|
44986
|
+
function extractCodeBlocks(text) {
|
|
44987
|
+
if (!text) return [];
|
|
44988
|
+
const out = [];
|
|
44989
|
+
const re = /```[^\n]*\n([\s\S]*?)```/g;
|
|
44990
|
+
let m;
|
|
44991
|
+
while ((m = re.exec(text)) !== null) {
|
|
44992
|
+
const body = (m[1] ?? "").replace(/\n+$/, "");
|
|
44993
|
+
if (body.trim()) out.push(body);
|
|
44994
|
+
}
|
|
44995
|
+
return out;
|
|
44996
|
+
}
|
|
44997
|
+
var VOICE_CONVERSATION_ADDENDUM = `CONVERSATION MODE (voice): Talk to the user like a friendly pair-programmer having a real conversation. Narrate what you're about to do in a natural, spoken style before you do it ("Alrighty, I'll get started on your file\u2026", "Okay, I just created it \u2014 want me to wire it up next?"). When something is genuinely ambiguous or you need a decision, STOP and ask the user a short question, then wait for their reply instead of guessing. Keep each spoken turn brief and natural (1\u20134 sentences) since it will be read aloud; avoid dumping long code or file contents into the spoken reply \u2014 make the edits via tools and describe them in a sentence. Stay warm and concise.`;
|
|
44703
44998
|
function detectReflectCommand(cwd2) {
|
|
44704
44999
|
const override = process.env.KRYVEN_REFLECT_CMD;
|
|
44705
45000
|
if (override !== void 0) return override.trim() || null;
|
|
44706
45001
|
try {
|
|
44707
|
-
if (
|
|
44708
|
-
const pkgPath =
|
|
44709
|
-
if (
|
|
44710
|
-
const pkg = JSON.parse(
|
|
45002
|
+
if (fs5.existsSync(path9.join(cwd2, "tsconfig.json"))) return "npx tsc --noEmit";
|
|
45003
|
+
const pkgPath = path9.join(cwd2, "package.json");
|
|
45004
|
+
if (fs5.existsSync(pkgPath)) {
|
|
45005
|
+
const pkg = JSON.parse(fs5.readFileSync(pkgPath, "utf8"));
|
|
44711
45006
|
if (pkg?.scripts?.typecheck) return "npm run typecheck";
|
|
44712
45007
|
if (pkg?.scripts?.test) return "npm test";
|
|
44713
45008
|
}
|
|
@@ -44735,16 +45030,16 @@ var REPL = ({
|
|
|
44735
45030
|
seedPrompt
|
|
44736
45031
|
}) => {
|
|
44737
45032
|
const app = use_app_default();
|
|
44738
|
-
const clientRef = (0,
|
|
44739
|
-
const [isGuest, setIsGuest] = (0,
|
|
44740
|
-
const conversationRef = (0,
|
|
44741
|
-
const sessionRef = (0,
|
|
44742
|
-
const remoteSessionRef = (0,
|
|
44743
|
-
const abortRef = (0,
|
|
44744
|
-
const permissionResolveRef = (0,
|
|
44745
|
-
const readPathsRef = (0,
|
|
44746
|
-
const toolMetaRef = (0,
|
|
44747
|
-
(0,
|
|
45033
|
+
const clientRef = (0, import_react29.useRef)(client);
|
|
45034
|
+
const [isGuest, setIsGuest] = (0, import_react29.useState)(initialIsGuest);
|
|
45035
|
+
const conversationRef = (0, import_react29.useRef)(new Conversation());
|
|
45036
|
+
const sessionRef = (0, import_react29.useRef)(new SessionStore(resumeSessionId));
|
|
45037
|
+
const remoteSessionRef = (0, import_react29.useRef)(null);
|
|
45038
|
+
const abortRef = (0, import_react29.useRef)(null);
|
|
45039
|
+
const permissionResolveRef = (0, import_react29.useRef)(null);
|
|
45040
|
+
const readPathsRef = (0, import_react29.useRef)(/* @__PURE__ */ new Set());
|
|
45041
|
+
const toolMetaRef = (0, import_react29.useRef)(/* @__PURE__ */ new Map());
|
|
45042
|
+
(0, import_react29.useEffect)(() => {
|
|
44748
45043
|
if (isGuest) return;
|
|
44749
45044
|
const cfg = resolveConfig();
|
|
44750
45045
|
if (cfg.apiKey && cfg.telemetry !== false) {
|
|
@@ -44762,27 +45057,37 @@ var REPL = ({
|
|
|
44762
45057
|
);
|
|
44763
45058
|
};
|
|
44764
45059
|
}, []);
|
|
44765
|
-
const [input, setInput] = (0,
|
|
44766
|
-
const [streaming, setStreaming] = (0,
|
|
44767
|
-
const [busy, setBusy] = (0,
|
|
44768
|
-
const [model, setModel] = (0,
|
|
44769
|
-
const [mood, setMood] = (0,
|
|
44770
|
-
const [git, setGit] = (0,
|
|
44771
|
-
const [, forceRender] = (0,
|
|
44772
|
-
const [overlay, setOverlay] = (0,
|
|
44773
|
-
const [notes, setNotes] = (0,
|
|
44774
|
-
const [sessionTokens, setSessionTokens] = (0,
|
|
44775
|
-
const [toolEntries, setToolEntries] = (0,
|
|
44776
|
-
const [permissionReq, setPermissionReq] = (0,
|
|
44777
|
-
const [modelPicker, setModelPicker] = (0,
|
|
44778
|
-
const [
|
|
44779
|
-
const
|
|
44780
|
-
const
|
|
44781
|
-
const
|
|
44782
|
-
const
|
|
44783
|
-
const
|
|
44784
|
-
|
|
44785
|
-
|
|
45060
|
+
const [input, setInput] = (0, import_react29.useState)("");
|
|
45061
|
+
const [streaming, setStreaming] = (0, import_react29.useState)(null);
|
|
45062
|
+
const [busy, setBusy] = (0, import_react29.useState)(false);
|
|
45063
|
+
const [model, setModel] = (0, import_react29.useState)(initialModel);
|
|
45064
|
+
const [mood, setMood] = (0, import_react29.useState)(initialMood);
|
|
45065
|
+
const [git, setGit] = (0, import_react29.useState)({ isRepo: false });
|
|
45066
|
+
const [, forceRender] = (0, import_react29.useState)(0);
|
|
45067
|
+
const [overlay, setOverlay] = (0, import_react29.useState)(null);
|
|
45068
|
+
const [notes, setNotes] = (0, import_react29.useState)([]);
|
|
45069
|
+
const [sessionTokens, setSessionTokens] = (0, import_react29.useState)(0);
|
|
45070
|
+
const [toolEntries, setToolEntries] = (0, import_react29.useState)([]);
|
|
45071
|
+
const [permissionReq, setPermissionReq] = (0, import_react29.useState)(null);
|
|
45072
|
+
const [modelPicker, setModelPicker] = (0, import_react29.useState)(null);
|
|
45073
|
+
const [filePicker, setFilePicker] = (0, import_react29.useState)(false);
|
|
45074
|
+
const [voiceMode, setVoiceMode] = (0, import_react29.useState)(false);
|
|
45075
|
+
const voiceModeRef = (0, import_react29.useRef)(false);
|
|
45076
|
+
const [toast, setToast] = (0, import_react29.useState)(null);
|
|
45077
|
+
const toastTimerRef = (0, import_react29.useRef)(null);
|
|
45078
|
+
const pushToast = (msg) => {
|
|
45079
|
+
setToast(msg);
|
|
45080
|
+
if (toastTimerRef.current) clearTimeout(toastTimerRef.current);
|
|
45081
|
+
toastTimerRef.current = setTimeout(() => setToast(null), 3500);
|
|
45082
|
+
};
|
|
45083
|
+
const [staticGen, setStaticGen] = (0, import_react29.useState)(0);
|
|
45084
|
+
const prevCommittedCountRef = (0, import_react29.useRef)(0);
|
|
45085
|
+
const cfgRef = (0, import_react29.useRef)(resolveConfig());
|
|
45086
|
+
const vimEnabledRef = (0, import_react29.useRef)(cfgRef.current.vim === true);
|
|
45087
|
+
const vimRef = (0, import_react29.useRef)(initialVim());
|
|
45088
|
+
const [vimTick, setVimTick] = (0, import_react29.useState)(0);
|
|
45089
|
+
const themeMgrRef = (0, import_react29.useRef)(null);
|
|
45090
|
+
const keyMgrRef = (0, import_react29.useRef)(null);
|
|
44786
45091
|
const initialTheme = (() => {
|
|
44787
45092
|
const name = _themeOverride || cfgRef.current.theme || "default";
|
|
44788
45093
|
const c3 = (BUILTIN_THEMES.find((b) => b.name === name) ?? BUILTIN_THEMES.find((b) => b.name === "default"))?.colors;
|
|
@@ -44795,9 +45100,9 @@ var REPL = ({
|
|
|
44795
45100
|
border: c3?.border ?? "#3F3F46"
|
|
44796
45101
|
};
|
|
44797
45102
|
})();
|
|
44798
|
-
const [accentColor, setAccentColor] = (0,
|
|
44799
|
-
const [theme, setTheme] = (0,
|
|
44800
|
-
(0,
|
|
45103
|
+
const [accentColor, setAccentColor] = (0, import_react29.useState)(initialTheme.accent);
|
|
45104
|
+
const [theme, setTheme] = (0, import_react29.useState)(initialTheme);
|
|
45105
|
+
(0, import_react29.useEffect)(() => {
|
|
44801
45106
|
let cancelled = false;
|
|
44802
45107
|
(async () => {
|
|
44803
45108
|
try {
|
|
@@ -44842,15 +45147,15 @@ var REPL = ({
|
|
|
44842
45147
|
keyMgrRef.current?.stopWatching?.();
|
|
44843
45148
|
};
|
|
44844
45149
|
}, []);
|
|
44845
|
-
const toolsEnabled = (0,
|
|
44846
|
-
(0,
|
|
44847
|
-
void checkForUpdate("0.2.
|
|
45150
|
+
const toolsEnabled = (0, import_react29.useMemo)(() => listTools().length > 0, []);
|
|
45151
|
+
(0, import_react29.useEffect)(() => {
|
|
45152
|
+
void checkForUpdate("0.2.6").then((info) => {
|
|
44848
45153
|
if (info?.updateAvailable) {
|
|
44849
45154
|
setNotes((p) => [
|
|
44850
45155
|
...p,
|
|
44851
45156
|
{
|
|
44852
45157
|
kind: "system",
|
|
44853
|
-
text: `Update available: ${"0.2.
|
|
45158
|
+
text: `Update available: ${"0.2.6"} \u2192 ${info.latest}. Run \`kryven update\` to update.`
|
|
44854
45159
|
}
|
|
44855
45160
|
]);
|
|
44856
45161
|
}
|
|
@@ -44876,7 +45181,7 @@ var REPL = ({
|
|
|
44876
45181
|
}
|
|
44877
45182
|
})();
|
|
44878
45183
|
}, []);
|
|
44879
|
-
const completion = (0,
|
|
45184
|
+
const completion = (0, import_react29.useMemo)(() => {
|
|
44880
45185
|
if (busy || permissionReq || overlay || !input) return null;
|
|
44881
45186
|
try {
|
|
44882
45187
|
return getCompletions(input, input.length, cwd2);
|
|
@@ -44909,6 +45214,7 @@ var REPL = ({
|
|
|
44909
45214
|
}
|
|
44910
45215
|
return;
|
|
44911
45216
|
}
|
|
45217
|
+
if (filePicker) return;
|
|
44912
45218
|
if (permissionReq && permissionResolveRef.current) {
|
|
44913
45219
|
const ch = inputCh.toLowerCase();
|
|
44914
45220
|
let decision = null;
|
|
@@ -44925,6 +45231,7 @@ var REPL = ({
|
|
|
44925
45231
|
}
|
|
44926
45232
|
if (key.ctrl && inputCh === "c") {
|
|
44927
45233
|
if (abortRef.current) abortRef.current.abort();
|
|
45234
|
+
stopSpeaking();
|
|
44928
45235
|
if (permissionResolveRef.current) {
|
|
44929
45236
|
permissionResolveRef.current("deny");
|
|
44930
45237
|
permissionResolveRef.current = null;
|
|
@@ -44932,6 +45239,23 @@ var REPL = ({
|
|
|
44932
45239
|
}
|
|
44933
45240
|
return;
|
|
44934
45241
|
}
|
|
45242
|
+
if (key.ctrl && (inputCh === "y" || inputCh === "Y")) {
|
|
45243
|
+
const lastAsst = [...conversationRef.current.all()].reverse().find((m) => m.role === "assistant");
|
|
45244
|
+
const content = lastAsst?.content || "";
|
|
45245
|
+
const blocks = extractCodeBlocks(content);
|
|
45246
|
+
const target = blocks.length > 0 ? blocks[blocks.length - 1] : content.trim();
|
|
45247
|
+
if (target) {
|
|
45248
|
+
void copyToClipboard(target);
|
|
45249
|
+
pushToast(blocks.length > 0 ? "\u2713 Copied command to clipboard" : "\u2713 Copied reply to clipboard");
|
|
45250
|
+
} else {
|
|
45251
|
+
pushToast("Nothing to copy yet");
|
|
45252
|
+
}
|
|
45253
|
+
return;
|
|
45254
|
+
}
|
|
45255
|
+
if (key.ctrl && (inputCh === "g" || inputCh === "G") && !busy && !permissionReq && !overlay && !modelPicker) {
|
|
45256
|
+
setFilePicker(true);
|
|
45257
|
+
return;
|
|
45258
|
+
}
|
|
44935
45259
|
if (key.tab && key.shift && !permissionReq && !overlay) {
|
|
44936
45260
|
const next = cyclePermissionMode();
|
|
44937
45261
|
setNotes((p) => [...p, { kind: "system", text: `Permission mode: ${next}` }]);
|
|
@@ -44968,7 +45292,7 @@ var REPL = ({
|
|
|
44968
45292
|
if (out.consumed) setVimTick((n2) => n2 + 1);
|
|
44969
45293
|
}
|
|
44970
45294
|
});
|
|
44971
|
-
const slashCtx = (0,
|
|
45295
|
+
const slashCtx = (0, import_react29.useMemo)(
|
|
44972
45296
|
() => ({
|
|
44973
45297
|
conversation: conversationRef.current,
|
|
44974
45298
|
model,
|
|
@@ -44990,7 +45314,7 @@ var REPL = ({
|
|
|
44990
45314
|
apiKey: key,
|
|
44991
45315
|
baseUrl: cfg.apiBaseUrl,
|
|
44992
45316
|
clientType: "ide",
|
|
44993
|
-
userAgent: `kryven-cli/${"0.2.
|
|
45317
|
+
userAgent: `kryven-cli/${"0.2.6"}`
|
|
44994
45318
|
});
|
|
44995
45319
|
try {
|
|
44996
45320
|
await candidate.ping();
|
|
@@ -45093,6 +45417,18 @@ var REPL = ({
|
|
|
45093
45417
|
const text = rawText.trim();
|
|
45094
45418
|
if (!text || busy || permissionReq) return;
|
|
45095
45419
|
setInput("");
|
|
45420
|
+
if (/^\/voice(\s|$)/i.test(text)) {
|
|
45421
|
+
const arg = text.replace(/^\/voice\s*/i, "").trim().toLowerCase();
|
|
45422
|
+
const next = arg === "on" ? true : arg === "off" ? false : !voiceModeRef.current;
|
|
45423
|
+
voiceModeRef.current = next;
|
|
45424
|
+
setVoiceMode(next);
|
|
45425
|
+
if (!next) stopSpeaking();
|
|
45426
|
+
setNotes((p) => [...p, {
|
|
45427
|
+
kind: "system",
|
|
45428
|
+
text: next ? `Voice + conversation mode ON \u2014 I'll talk through my work and read replies aloud.${ttsLikelyAvailable() ? "" : " (no OS voice detected; conversational text still applies)"}` : "Voice mode OFF."
|
|
45429
|
+
}]);
|
|
45430
|
+
return;
|
|
45431
|
+
}
|
|
45096
45432
|
const slash = parseSlash(text);
|
|
45097
45433
|
if (slash) {
|
|
45098
45434
|
let cmd = findCommand(slash.name);
|
|
@@ -45125,11 +45461,14 @@ var REPL = ({
|
|
|
45125
45461
|
}
|
|
45126
45462
|
void appendHistory({ ts: userMsg.ts, cwd: cwd2, prompt: text });
|
|
45127
45463
|
forceRender((n2) => n2 + 1);
|
|
45128
|
-
const
|
|
45464
|
+
const baseSys = composeSystemPrompt({
|
|
45129
45465
|
cwd: cwd2,
|
|
45130
45466
|
git,
|
|
45131
45467
|
toolsList: toolsEnabled ? listTools().map((t) => t.name) : void 0
|
|
45132
45468
|
});
|
|
45469
|
+
const sys = voiceModeRef.current ? `${baseSys}
|
|
45470
|
+
|
|
45471
|
+
${VOICE_CONVERSATION_ADDENDUM}` : baseSys;
|
|
45133
45472
|
const ac = new AbortController();
|
|
45134
45473
|
abortRef.current = ac;
|
|
45135
45474
|
setBusy(true);
|
|
@@ -45154,6 +45493,10 @@ var REPL = ({
|
|
|
45154
45493
|
setStreaming(null);
|
|
45155
45494
|
setBusy(false);
|
|
45156
45495
|
forceRender((n2) => n2 + 1);
|
|
45496
|
+
if (voiceModeRef.current && !ac.signal.aborted) {
|
|
45497
|
+
const lastAsst = [...conversationRef.current.all()].reverse().find((m) => m.role === "assistant");
|
|
45498
|
+
if (lastAsst?.content) void speak(lastAsst.content);
|
|
45499
|
+
}
|
|
45157
45500
|
}
|
|
45158
45501
|
};
|
|
45159
45502
|
const runGuestTurn = async (ac) => {
|
|
@@ -45367,16 +45710,16 @@ var REPL = ({
|
|
|
45367
45710
|
costUsd: sessionCostUsd(conversationRef.current.all(), model),
|
|
45368
45711
|
mode: getPermissionMode()
|
|
45369
45712
|
};
|
|
45370
|
-
const staticItems = (0,
|
|
45713
|
+
const staticItems = (0, import_react29.useMemo)(() => {
|
|
45371
45714
|
const gen = `g${staticGen}`;
|
|
45372
45715
|
const items = [
|
|
45373
45716
|
{
|
|
45374
45717
|
id: `${gen}-header`,
|
|
45375
|
-
node: /* @__PURE__ */ (0,
|
|
45376
|
-
/* @__PURE__ */ (0,
|
|
45377
|
-
/* @__PURE__ */ (0,
|
|
45718
|
+
node: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
|
|
45719
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Wordmark, { muted: theme.muted, fg: theme.fg }),
|
|
45720
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Text, { color: theme.muted, children: [
|
|
45378
45721
|
"Kryven CLI ",
|
|
45379
|
-
"0.2.
|
|
45722
|
+
"0.2.6",
|
|
45380
45723
|
toolsEnabled ? " \xB7 tools" : "",
|
|
45381
45724
|
" \xB7 Powered by KRY-5.2 Extended"
|
|
45382
45725
|
] }) })
|
|
@@ -45398,10 +45741,10 @@ var REPL = ({
|
|
|
45398
45741
|
for (let i2 = 0; i2 < all.length; i2++) {
|
|
45399
45742
|
const m = all[i2];
|
|
45400
45743
|
if (m.role === "user") {
|
|
45401
|
-
items.push({ id: `${gen}-m${i2}`, node: /* @__PURE__ */ (0,
|
|
45744
|
+
items.push({ id: `${gen}-m${i2}`, node: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MessageList, { message: m, theme }) });
|
|
45402
45745
|
} else if (m.role === "assistant") {
|
|
45403
45746
|
if (typeof m.content === "string" && m.content.trim().length > 0) {
|
|
45404
|
-
items.push({ id: `${gen}-m${i2}`, node: /* @__PURE__ */ (0,
|
|
45747
|
+
items.push({ id: `${gen}-m${i2}`, node: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MessageList, { message: m, theme }) });
|
|
45405
45748
|
}
|
|
45406
45749
|
} else if (m.role === "tool") {
|
|
45407
45750
|
const meta = m.tool_call_id ? toolMetaRef.current.get(m.tool_call_id) : void 0;
|
|
@@ -45413,69 +45756,91 @@ var REPL = ({
|
|
|
45413
45756
|
status: "ok",
|
|
45414
45757
|
output: typeof m.content === "string" ? m.content : ""
|
|
45415
45758
|
};
|
|
45416
|
-
items.push({ id: `${gen}-t${i2}`, node: /* @__PURE__ */ (0,
|
|
45759
|
+
items.push({ id: `${gen}-t${i2}`, node: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ToolCall, { ...entry }) });
|
|
45417
45760
|
}
|
|
45418
45761
|
}
|
|
45419
45762
|
return items;
|
|
45420
45763
|
}, [convSize, staticGen, toolsEnabled]);
|
|
45421
45764
|
const committedCount = staticItems.length;
|
|
45422
|
-
(0,
|
|
45765
|
+
(0, import_react29.useEffect)(() => {
|
|
45423
45766
|
if (committedCount < prevCommittedCountRef.current) {
|
|
45424
45767
|
setStaticGen((g) => g + 1);
|
|
45425
45768
|
}
|
|
45426
45769
|
prevCommittedCountRef.current = committedCount;
|
|
45427
45770
|
}, [committedCount]);
|
|
45428
|
-
return /* @__PURE__ */ (0,
|
|
45429
|
-
/* @__PURE__ */ (0,
|
|
45430
|
-
streaming != null && /* @__PURE__ */ (0,
|
|
45431
|
-
/* @__PURE__ */ (0,
|
|
45432
|
-
/* @__PURE__ */ (0,
|
|
45771
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
45772
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Static, { items: staticItems, children: (item) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Box_default, { flexDirection: "column", children: item.node }, item.id) }, staticGen),
|
|
45773
|
+
streaming != null && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
|
|
45774
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { bold: true, color: "green", children: "kryven" }),
|
|
45775
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Box_default, { paddingLeft: 2, flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MarkdownStream, { streamingText: streaming, done: !busy }) })
|
|
45433
45776
|
] }),
|
|
45434
|
-
/* @__PURE__ */ (0,
|
|
45435
|
-
modelPicker && /* @__PURE__ */ (0,
|
|
45436
|
-
|
|
45437
|
-
|
|
45438
|
-
|
|
45777
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ToolCallList, { entries: toolEntries, paused: Boolean(permissionReq) }),
|
|
45778
|
+
modelPicker && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ModelPicker, { models: MODELS, selected: modelPicker.sel, current: model }),
|
|
45779
|
+
filePicker && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Box_default, { marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
45780
|
+
FilePicker,
|
|
45781
|
+
{
|
|
45782
|
+
cwd: cwd2,
|
|
45783
|
+
theme,
|
|
45784
|
+
onSubmit: (rels) => {
|
|
45785
|
+
setFilePicker(false);
|
|
45786
|
+
if (rels.length > 0) {
|
|
45787
|
+
const tokens = rels.map((r) => `@${r}`).join(" ");
|
|
45788
|
+
setInput((prev) => prev ? `${prev} ${tokens} ` : `${tokens} `);
|
|
45789
|
+
pushToast(`Added ${rels.length} path${rels.length === 1 ? "" : "s"} to the prompt`);
|
|
45790
|
+
}
|
|
45791
|
+
setVimTick((n2) => n2 + 1);
|
|
45792
|
+
},
|
|
45793
|
+
onCancel: () => setFilePicker(false)
|
|
45794
|
+
}
|
|
45795
|
+
) }),
|
|
45796
|
+
permissionReq && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, borderStyle: "round", borderColor: "yellow", paddingX: 1, children: [
|
|
45797
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { bold: true, children: "Permission required" }),
|
|
45798
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Text, { children: [
|
|
45439
45799
|
"Tool: ",
|
|
45440
|
-
/* @__PURE__ */ (0,
|
|
45800
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: "cyan", children: permissionReq.toolName }),
|
|
45441
45801
|
" ",
|
|
45442
|
-
/* @__PURE__ */ (0,
|
|
45802
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Text, { color: riskColor(permissionReq.risk), children: [
|
|
45443
45803
|
"[",
|
|
45444
45804
|
permissionReq.risk,
|
|
45445
45805
|
"]"
|
|
45446
45806
|
] })
|
|
45447
45807
|
] }),
|
|
45448
|
-
/* @__PURE__ */ (0,
|
|
45449
|
-
/* @__PURE__ */ (0,
|
|
45450
|
-
/* @__PURE__ */ (0,
|
|
45808
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: "gray", children: permissionReq.argsPreview }),
|
|
45809
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Text, { children: [
|
|
45810
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: "green", children: "[Y]" }),
|
|
45451
45811
|
" allow once \xB7",
|
|
45452
45812
|
" ",
|
|
45453
|
-
/* @__PURE__ */ (0,
|
|
45813
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: "green", children: "[A]" }),
|
|
45454
45814
|
" always (this command) \xB7",
|
|
45455
45815
|
" ",
|
|
45456
|
-
/* @__PURE__ */ (0,
|
|
45816
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: "green", children: "[Shift+A]" }),
|
|
45457
45817
|
" always (this tool) \xB7",
|
|
45458
45818
|
" ",
|
|
45459
|
-
/* @__PURE__ */ (0,
|
|
45819
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: "red", children: "[N]" }),
|
|
45460
45820
|
" deny"
|
|
45461
45821
|
] })
|
|
45462
45822
|
] }),
|
|
45463
|
-
notes.length > 0 && /* @__PURE__ */ (0,
|
|
45823
|
+
notes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Box_default, { flexDirection: "column", marginBottom: 1, children: notes.slice(-3).map((n2, i2) => /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Text, { color: n2.kind === "error" ? "red" : "gray", children: [
|
|
45464
45824
|
n2.kind === "error" ? "\u2717 " : "\xB7 ",
|
|
45465
45825
|
n2.text
|
|
45466
45826
|
] }, i2)) }),
|
|
45467
|
-
overlay && /* @__PURE__ */ (0,
|
|
45827
|
+
overlay && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Box_default, { marginBottom: 1, flexDirection: "column", children: [
|
|
45468
45828
|
overlay,
|
|
45469
|
-
/* @__PURE__ */ (0,
|
|
45829
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: "gray", children: "(press Enter or Esc to dismiss)" })
|
|
45830
|
+
] }),
|
|
45831
|
+
completion && completion.items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CompletionMenu, { items: completion.items, selected: 0 }),
|
|
45832
|
+
voiceMode && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Box_default, { children: [
|
|
45833
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: theme.accent, children: "\u{1F399} voice + conversation mode \u2014 replies read aloud \xB7 " }),
|
|
45834
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: theme.muted, children: "/voice to turn off" })
|
|
45470
45835
|
] }),
|
|
45471
|
-
|
|
45472
|
-
/* @__PURE__ */ (0,
|
|
45836
|
+
toast && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Box_default, { marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: theme.accent, children: toast }) }),
|
|
45837
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
45473
45838
|
PromptInput,
|
|
45474
45839
|
{
|
|
45475
45840
|
value: input,
|
|
45476
45841
|
onChange: setInput,
|
|
45477
45842
|
onSubmit: submit,
|
|
45478
|
-
disabled: busy || Boolean(permissionReq) || Boolean(modelPicker),
|
|
45843
|
+
disabled: busy || Boolean(permissionReq) || Boolean(modelPicker) || filePicker,
|
|
45479
45844
|
placeholder: busy ? "" : void 0,
|
|
45480
45845
|
vimMode: vimEnabledRef.current ? vimRef.current.mode : null,
|
|
45481
45846
|
vimCmdline: vimEnabledRef.current ? vimRef.current.cmdline : null,
|
|
@@ -45486,30 +45851,44 @@ var REPL = ({
|
|
|
45486
45851
|
},
|
|
45487
45852
|
`pi-${vimTick}`
|
|
45488
45853
|
),
|
|
45489
|
-
isHome ? /* @__PURE__ */ (0,
|
|
45490
|
-
/* @__PURE__ */ (0,
|
|
45491
|
-
/* @__PURE__ */ (0,
|
|
45492
|
-
/* @__PURE__ */ (0,
|
|
45493
|
-
/* @__PURE__ */ (0,
|
|
45854
|
+
isHome ? /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
|
|
45855
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Box_default, { flexDirection: "row", gap: 2, justifyContent: "flex-end", children: [
|
|
45856
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Text, { children: [
|
|
45857
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: theme.fg, children: "/model" }),
|
|
45858
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: theme.muted, children: " models" })
|
|
45859
|
+
] }),
|
|
45860
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Text, { children: [
|
|
45861
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: theme.fg, children: "/help" }),
|
|
45862
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: theme.muted, children: " commands" })
|
|
45863
|
+
] }),
|
|
45864
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Text, { children: [
|
|
45865
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: theme.fg, children: "shift+tab" }),
|
|
45866
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: theme.muted, children: " mode" })
|
|
45867
|
+
] })
|
|
45868
|
+
] }),
|
|
45869
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Box_default, { flexDirection: "row", gap: 2, justifyContent: "flex-end", children: [
|
|
45870
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Text, { children: [
|
|
45871
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: theme.fg, children: "ctrl+g" }),
|
|
45872
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: theme.muted, children: " add files" })
|
|
45494
45873
|
] }),
|
|
45495
|
-
/* @__PURE__ */ (0,
|
|
45496
|
-
/* @__PURE__ */ (0,
|
|
45497
|
-
/* @__PURE__ */ (0,
|
|
45874
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Text, { children: [
|
|
45875
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: theme.fg, children: "ctrl+y" }),
|
|
45876
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: theme.muted, children: " copy cmd" })
|
|
45498
45877
|
] }),
|
|
45499
|
-
/* @__PURE__ */ (0,
|
|
45500
|
-
/* @__PURE__ */ (0,
|
|
45501
|
-
/* @__PURE__ */ (0,
|
|
45878
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Text, { children: [
|
|
45879
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: theme.fg, children: "/voice" }),
|
|
45880
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: theme.muted, children: " talk" })
|
|
45502
45881
|
] })
|
|
45503
45882
|
] }),
|
|
45504
|
-
/* @__PURE__ */ (0,
|
|
45505
|
-
/* @__PURE__ */ (0,
|
|
45506
|
-
/* @__PURE__ */ (0,
|
|
45507
|
-
/* @__PURE__ */ (0,
|
|
45508
|
-
/* @__PURE__ */ (0,
|
|
45883
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Box_default, { marginTop: 1, flexDirection: "row", children: [
|
|
45884
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: theme.warn, children: "\u25CF Tip " }),
|
|
45885
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: theme.muted, children: "Run " }),
|
|
45886
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: theme.fg, children: isGuest ? "/login" : "/model" }),
|
|
45887
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { color: theme.muted, children: isGuest ? " to unlock unlimited chat and tools." : " to switch models, or /help for all commands." })
|
|
45509
45888
|
] })
|
|
45510
|
-
] }) : /* @__PURE__ */ (0,
|
|
45511
|
-
/* @__PURE__ */ (0,
|
|
45512
|
-
/* @__PURE__ */ (0,
|
|
45889
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
|
|
45890
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Box_default, { marginTop: 1, children: busy && !permissionReq && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Spinner2, { label: "thinking\u2026 (Ctrl+C to cancel)" }) }),
|
|
45891
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(StatusBar, { status }) })
|
|
45513
45892
|
] })
|
|
45514
45893
|
] });
|
|
45515
45894
|
};
|
|
@@ -45523,11 +45902,11 @@ init_logger();
|
|
|
45523
45902
|
|
|
45524
45903
|
// src/utils/fingerprint.ts
|
|
45525
45904
|
import { readFileSync as readFileSync13, writeFileSync as writeFileSync7, existsSync as existsSync20, mkdirSync as mkdirSync6, chmodSync as chmodSync2 } from "node:fs";
|
|
45526
|
-
import { dirname as
|
|
45905
|
+
import { dirname as dirname16, join as join30 } from "node:path";
|
|
45527
45906
|
import { homedir as homedir10 } from "node:os";
|
|
45528
45907
|
import { createHash as createHash3, randomBytes } from "node:crypto";
|
|
45529
45908
|
import os6 from "node:os";
|
|
45530
|
-
var FP_PATH =
|
|
45909
|
+
var FP_PATH = join30(homedir10(), ".kryven", ".fingerprint");
|
|
45531
45910
|
function readMachineId() {
|
|
45532
45911
|
try {
|
|
45533
45912
|
if (existsSync20("/etc/machine-id")) return readFileSync13("/etc/machine-id", "utf8").trim();
|
|
@@ -45574,7 +45953,7 @@ function getFingerprint(opts = {}) {
|
|
|
45574
45953
|
}
|
|
45575
45954
|
const fresh = computeFingerprint();
|
|
45576
45955
|
try {
|
|
45577
|
-
mkdirSync6(
|
|
45956
|
+
mkdirSync6(dirname16(FP_PATH), { recursive: true, mode: 448 });
|
|
45578
45957
|
writeFileSync7(FP_PATH, fresh, { mode: 384 });
|
|
45579
45958
|
chmodSync2(FP_PATH, 384);
|
|
45580
45959
|
} catch {
|
|
@@ -45655,7 +46034,7 @@ init_tools();
|
|
|
45655
46034
|
init_logger();
|
|
45656
46035
|
import { readdir as readdir10, readFile as readFile16 } from "node:fs/promises";
|
|
45657
46036
|
import { existsSync as existsSync21 } from "node:fs";
|
|
45658
|
-
import { join as
|
|
46037
|
+
import { join as join31, isAbsolute as isAbsolute12, resolve as resolve6 } from "node:path";
|
|
45659
46038
|
import { homedir as homedir11 } from "node:os";
|
|
45660
46039
|
async function readDirCommands(dir, scope) {
|
|
45661
46040
|
if (!existsSync21(dir)) return [];
|
|
@@ -45668,7 +46047,7 @@ async function readDirCommands(dir, scope) {
|
|
|
45668
46047
|
}
|
|
45669
46048
|
for (const e of entries) {
|
|
45670
46049
|
if (!e.isFile() || !e.name.endsWith(".md")) continue;
|
|
45671
|
-
const file =
|
|
46050
|
+
const file = join31(dir, e.name);
|
|
45672
46051
|
try {
|
|
45673
46052
|
const src = await readFile16(file, "utf8");
|
|
45674
46053
|
const { frontmatter, body } = parseSkillFile(file, src);
|
|
@@ -45689,10 +46068,10 @@ async function readDirCommands(dir, scope) {
|
|
|
45689
46068
|
async function loadFileCommands(cwd2) {
|
|
45690
46069
|
const root = isAbsolute12(cwd2 || "") ? cwd2 : cwd2 ? resolve6(cwd2) : process.cwd();
|
|
45691
46070
|
const sources = [
|
|
45692
|
-
[
|
|
45693
|
-
[
|
|
45694
|
-
[
|
|
45695
|
-
[
|
|
46071
|
+
[join31(root, ".kryven", "commands"), "project-kryven"],
|
|
46072
|
+
[join31(root, ".claude", "commands"), "project-claude"],
|
|
46073
|
+
[join31(homedir11(), ".kryven", "commands"), "user-kryven"],
|
|
46074
|
+
[join31(homedir11(), ".claude", "commands"), "user-claude"]
|
|
45696
46075
|
];
|
|
45697
46076
|
const seen = /* @__PURE__ */ new Map();
|
|
45698
46077
|
for (const [dir, scope] of sources) {
|
|
@@ -45725,8 +46104,8 @@ init_logger();
|
|
|
45725
46104
|
init_defaults();
|
|
45726
46105
|
import { readFile as readFile17 } from "node:fs/promises";
|
|
45727
46106
|
import { existsSync as existsSync22 } from "node:fs";
|
|
45728
|
-
import { join as
|
|
45729
|
-
var MCP_CONFIG_PATH =
|
|
46107
|
+
import { join as join32 } from "node:path";
|
|
46108
|
+
var MCP_CONFIG_PATH = join32(getConfigDir(), "mcp.json");
|
|
45730
46109
|
async function loadMCPRegistry() {
|
|
45731
46110
|
if (!existsSync22(MCP_CONFIG_PATH)) return { servers: [] };
|
|
45732
46111
|
try {
|
|
@@ -45775,14 +46154,14 @@ async function bootstrapMCP(opts = {}) {
|
|
|
45775
46154
|
init_store();
|
|
45776
46155
|
|
|
45777
46156
|
// src/tui/SetupWizard.tsx
|
|
45778
|
-
var
|
|
46157
|
+
var import_react30 = __toESM(require_react(), 1);
|
|
45779
46158
|
init_client();
|
|
45780
46159
|
init_crypto();
|
|
45781
46160
|
init_errors();
|
|
45782
46161
|
init_load();
|
|
45783
|
-
var
|
|
45784
|
-
import { dirname as
|
|
45785
|
-
import { spawn as
|
|
46162
|
+
var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1);
|
|
46163
|
+
import { dirname as dirname17 } from "node:path";
|
|
46164
|
+
import { spawn as spawn10 } from "node:child_process";
|
|
45786
46165
|
var OPTIONS = [
|
|
45787
46166
|
{
|
|
45788
46167
|
id: "guest",
|
|
@@ -45799,10 +46178,10 @@ var SetupWizard = ({
|
|
|
45799
46178
|
baseUrl,
|
|
45800
46179
|
onDone
|
|
45801
46180
|
}) => {
|
|
45802
|
-
const [step, setStep] = (0,
|
|
45803
|
-
const [sel, setSel] = (0,
|
|
45804
|
-
const [keyVal, setKeyVal] = (0,
|
|
45805
|
-
const [error, setError] = (0,
|
|
46181
|
+
const [step, setStep] = (0, import_react30.useState)("choose");
|
|
46182
|
+
const [sel, setSel] = (0, import_react30.useState)(0);
|
|
46183
|
+
const [keyVal, setKeyVal] = (0, import_react30.useState)("");
|
|
46184
|
+
const [error, setError] = (0, import_react30.useState)(null);
|
|
45806
46185
|
use_input_default((input, key) => {
|
|
45807
46186
|
if (key.ctrl && input === "c") {
|
|
45808
46187
|
onDone({ mode: "cancel" });
|
|
@@ -45842,7 +46221,7 @@ var SetupWizard = ({
|
|
|
45842
46221
|
apiKey: k,
|
|
45843
46222
|
baseUrl,
|
|
45844
46223
|
clientType: "ide",
|
|
45845
|
-
userAgent: `kryven-cli/${"0.2.
|
|
46224
|
+
userAgent: `kryven-cli/${"0.2.6"}`
|
|
45846
46225
|
}).ping();
|
|
45847
46226
|
onDone({ mode: "key", key: k });
|
|
45848
46227
|
} catch (err) {
|
|
@@ -45851,8 +46230,8 @@ var SetupWizard = ({
|
|
|
45851
46230
|
}
|
|
45852
46231
|
})();
|
|
45853
46232
|
};
|
|
45854
|
-
return /* @__PURE__ */ (0,
|
|
45855
|
-
/* @__PURE__ */ (0,
|
|
46233
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
46234
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
45856
46235
|
Box_default,
|
|
45857
46236
|
{
|
|
45858
46237
|
flexDirection: "column",
|
|
@@ -45861,18 +46240,18 @@ var SetupWizard = ({
|
|
|
45861
46240
|
paddingX: 2,
|
|
45862
46241
|
marginBottom: 1,
|
|
45863
46242
|
children: [
|
|
45864
|
-
/* @__PURE__ */ (0,
|
|
45865
|
-
/* @__PURE__ */ (0,
|
|
46243
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { bold: true, color: "magentaBright", children: "\u2726 Kryven CLI Setup Wizard" }),
|
|
46244
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { color: "gray", children: "Let's configure your Kryven CLI. Press Ctrl+C any time to exit." })
|
|
45866
46245
|
]
|
|
45867
46246
|
}
|
|
45868
46247
|
),
|
|
45869
|
-
step === "choose" && /* @__PURE__ */ (0,
|
|
45870
|
-
/* @__PURE__ */ (0,
|
|
45871
|
-
/* @__PURE__ */ (0,
|
|
45872
|
-
/* @__PURE__ */ (0,
|
|
46248
|
+
step === "choose" && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Box_default, { flexDirection: "column", paddingX: 1, children: [
|
|
46249
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { color: "white", children: "How would you like to start?" }),
|
|
46250
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { color: "gray", children: "Use \u2191/\u2193 (or 1-2), Enter to confirm." }),
|
|
46251
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: OPTIONS.map((o2, i2) => {
|
|
45873
46252
|
const on6 = i2 === sel;
|
|
45874
|
-
return /* @__PURE__ */ (0,
|
|
45875
|
-
/* @__PURE__ */ (0,
|
|
46253
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
|
|
46254
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Text, { color: on6 ? "greenBright" : "white", bold: on6, children: [
|
|
45876
46255
|
on6 ? "(\u25CF)" : "(\u25CB)",
|
|
45877
46256
|
" ",
|
|
45878
46257
|
i2 + 1,
|
|
@@ -45880,20 +46259,20 @@ var SetupWizard = ({
|
|
|
45880
46259
|
o2.title,
|
|
45881
46260
|
o2.id === "guest" ? " (recommended)" : ""
|
|
45882
46261
|
] }),
|
|
45883
|
-
/* @__PURE__ */ (0,
|
|
46262
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Text, { color: "gray", children: [
|
|
45884
46263
|
" ",
|
|
45885
46264
|
o2.desc
|
|
45886
46265
|
] })
|
|
45887
46266
|
] }, o2.id);
|
|
45888
46267
|
}) }),
|
|
45889
|
-
error && /* @__PURE__ */ (0,
|
|
46268
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { color: "red", children: error })
|
|
45890
46269
|
] }),
|
|
45891
|
-
step === "enter-key" && /* @__PURE__ */ (0,
|
|
45892
|
-
/* @__PURE__ */ (0,
|
|
45893
|
-
/* @__PURE__ */ (0,
|
|
45894
|
-
/* @__PURE__ */ (0,
|
|
45895
|
-
/* @__PURE__ */ (0,
|
|
45896
|
-
/* @__PURE__ */ (0,
|
|
46270
|
+
step === "enter-key" && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Box_default, { flexDirection: "column", paddingX: 1, children: [
|
|
46271
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { children: "Paste your Kryven API key:" }),
|
|
46272
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { color: "gray", children: "Get one at https://kryven.cc/api-dashboard" }),
|
|
46273
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Box_default, { marginTop: 1, borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [
|
|
46274
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { color: "cyan", children: "kry> " }),
|
|
46275
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
45897
46276
|
build_default,
|
|
45898
46277
|
{
|
|
45899
46278
|
value: keyVal,
|
|
@@ -45904,20 +46283,20 @@ var SetupWizard = ({
|
|
|
45904
46283
|
}
|
|
45905
46284
|
)
|
|
45906
46285
|
] }),
|
|
45907
|
-
/* @__PURE__ */ (0,
|
|
45908
|
-
error && /* @__PURE__ */ (0,
|
|
46286
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { color: "gray", children: "Enter to validate \xB7 Esc to go back" }),
|
|
46287
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { color: "red", children: error })
|
|
45909
46288
|
] }),
|
|
45910
|
-
step === "validating" && /* @__PURE__ */ (0,
|
|
46289
|
+
step === "validating" && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Box_default, { paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { color: "yellow", children: "Validating key against /v1/models\u2026" }) })
|
|
45911
46290
|
] });
|
|
45912
46291
|
};
|
|
45913
46292
|
function openBrowser(url) {
|
|
45914
46293
|
try {
|
|
45915
46294
|
if (process.platform === "win32") {
|
|
45916
|
-
|
|
46295
|
+
spawn10("cmd", ["/c", "start", "", url], { detached: true, stdio: "ignore" }).unref();
|
|
45917
46296
|
} else if (process.platform === "darwin") {
|
|
45918
|
-
|
|
46297
|
+
spawn10("open", [url], { detached: true, stdio: "ignore" }).unref();
|
|
45919
46298
|
} else {
|
|
45920
|
-
|
|
46299
|
+
spawn10("xdg-open", [url], { detached: true, stdio: "ignore" }).unref();
|
|
45921
46300
|
}
|
|
45922
46301
|
} catch {
|
|
45923
46302
|
}
|
|
@@ -45925,7 +46304,7 @@ function openBrowser(url) {
|
|
|
45925
46304
|
function runSetupWizard(baseUrl) {
|
|
45926
46305
|
return new Promise((resolve7) => {
|
|
45927
46306
|
const instance = render_default(
|
|
45928
|
-
/* @__PURE__ */ (0,
|
|
46307
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
45929
46308
|
SetupWizard,
|
|
45930
46309
|
{
|
|
45931
46310
|
baseUrl,
|
|
@@ -45943,7 +46322,7 @@ async function maybeRunFirstRunSetup(opts) {
|
|
|
45943
46322
|
const cfg = resolveConfig(opts.apiKey);
|
|
45944
46323
|
const user = loadUserConfig();
|
|
45945
46324
|
if (user.setupComplete || cfg.apiKeySource !== "none" || !process.stdin.isTTY) return;
|
|
45946
|
-
console.log(source_default.green(`[OK] Config directory ready at ${
|
|
46325
|
+
console.log(source_default.green(`[OK] Config directory ready at ${dirname17(cfg.configPath)}`));
|
|
45947
46326
|
console.log(source_default.green("[OK] 6 built-in tools available (Read/Write/Edit/Bash/Glob/Grep)"));
|
|
45948
46327
|
console.log(source_default.cyan("\n-> Starting setup wizard...\n"));
|
|
45949
46328
|
const res = await runSetupWizard(cfg.apiBaseUrl);
|
|
@@ -45976,7 +46355,7 @@ async function chatCommand(opts = {}) {
|
|
|
45976
46355
|
client = new GuestKryvenClient({
|
|
45977
46356
|
baseUrl: cfg.apiBaseUrl,
|
|
45978
46357
|
shareFingerprint: cfg.shareFingerprint !== false,
|
|
45979
|
-
userAgent: `kryven-cli/${"0.2.
|
|
46358
|
+
userAgent: `kryven-cli/${"0.2.6"}`
|
|
45980
46359
|
});
|
|
45981
46360
|
console.log(source_default.cyan("Guest mode \u2014 3 free prompts. Run `kryven login` for unlimited chat."));
|
|
45982
46361
|
} else {
|
|
@@ -45984,7 +46363,7 @@ async function chatCommand(opts = {}) {
|
|
|
45984
46363
|
apiKey: cfg.apiKey,
|
|
45985
46364
|
baseUrl: cfg.apiBaseUrl,
|
|
45986
46365
|
clientType: "ide",
|
|
45987
|
-
userAgent: `kryven-cli/${"0.2.
|
|
46366
|
+
userAgent: `kryven-cli/${"0.2.6"}`
|
|
45988
46367
|
});
|
|
45989
46368
|
}
|
|
45990
46369
|
let resumeMessages;
|
|
@@ -46051,7 +46430,7 @@ async function chatCommand(opts = {}) {
|
|
|
46051
46430
|
logger.warn("config save (touch) failed", String(err));
|
|
46052
46431
|
}
|
|
46053
46432
|
const { waitUntilExit } = render_default(
|
|
46054
|
-
|
|
46433
|
+
import_react31.default.createElement(REPL, {
|
|
46055
46434
|
client,
|
|
46056
46435
|
initialModel: model,
|
|
46057
46436
|
initialMood: mood,
|
|
@@ -46072,7 +46451,7 @@ async function chatCommand(opts = {}) {
|
|
|
46072
46451
|
init_execa();
|
|
46073
46452
|
|
|
46074
46453
|
// src/shims/version.ts
|
|
46075
|
-
var KRYVEN_VERSION = "0.2.
|
|
46454
|
+
var KRYVEN_VERSION = "0.2.6";
|
|
46076
46455
|
|
|
46077
46456
|
// src/commands/update.ts
|
|
46078
46457
|
var PACKAGE2 = "@kryvenaiofficial/kryven";
|
|
@@ -46103,9 +46482,9 @@ On macOS/Linux a global install may need sudo:
|
|
|
46103
46482
|
// src/commands/skills.ts
|
|
46104
46483
|
import { writeFile as writeFile11, mkdir as mkdir13 } from "node:fs/promises";
|
|
46105
46484
|
import { existsSync as existsSync23 } from "node:fs";
|
|
46106
|
-
import { join as
|
|
46485
|
+
import { join as join33 } from "node:path";
|
|
46107
46486
|
import { homedir as homedir12 } from "node:os";
|
|
46108
|
-
import { spawn as
|
|
46487
|
+
import { spawn as spawn11 } from "node:child_process";
|
|
46109
46488
|
var SCOPE_LABEL3 = {
|
|
46110
46489
|
"project-kryven": "project (.kryven)",
|
|
46111
46490
|
"project-claude": "project (.claude)",
|
|
@@ -46203,19 +46582,19 @@ async function skillsCreate(name) {
|
|
|
46203
46582
|
process.exit(2);
|
|
46204
46583
|
}
|
|
46205
46584
|
const safe = name.replace(/[^a-zA-Z0-9._-]/g, "-").toLowerCase();
|
|
46206
|
-
const dir =
|
|
46585
|
+
const dir = join33(homedir12(), ".kryven", "skills", safe);
|
|
46207
46586
|
if (existsSync23(dir)) {
|
|
46208
46587
|
console.error(source_default.red(`Already exists at ${dir}.`));
|
|
46209
46588
|
process.exit(1);
|
|
46210
46589
|
}
|
|
46211
46590
|
await mkdir13(dir, { recursive: true, mode: 448 });
|
|
46212
|
-
const file =
|
|
46591
|
+
const file = join33(dir, "SKILL.md");
|
|
46213
46592
|
await writeFile11(file, SKELETON_SKILL_MD.replace(/NAME_PLACEHOLDER/g, safe), { mode: 384 });
|
|
46214
46593
|
console.log(source_default.green(`Created ${file}`));
|
|
46215
46594
|
const editor = process.env.EDITOR || process.env.VISUAL || "vi";
|
|
46216
46595
|
console.log(source_default.dim(`Opening in ${editor}\u2026`));
|
|
46217
46596
|
await new Promise((resolveP) => {
|
|
46218
|
-
const child =
|
|
46597
|
+
const child = spawn11(editor, [file], { stdio: "inherit" });
|
|
46219
46598
|
child.on("close", () => resolveP());
|
|
46220
46599
|
child.on("error", () => resolveP());
|
|
46221
46600
|
});
|
|
@@ -46248,12 +46627,12 @@ async function skillsUpdate(name) {
|
|
|
46248
46627
|
}
|
|
46249
46628
|
for (const s of targets) {
|
|
46250
46629
|
const dir = s.sourcePath.replace(/\/SKILL\.md$/, "");
|
|
46251
|
-
if (!existsSync23(
|
|
46630
|
+
if (!existsSync23(join33(dir, ".git"))) {
|
|
46252
46631
|
console.log(source_default.dim(`Skipping ${s.name} (not a git checkout).`));
|
|
46253
46632
|
continue;
|
|
46254
46633
|
}
|
|
46255
46634
|
const r = await new Promise((resolveP) => {
|
|
46256
|
-
const child =
|
|
46635
|
+
const child = spawn11("git", ["-C", dir, "pull", "--ff-only"], { stdio: ["ignore", "pipe", "pipe"] });
|
|
46257
46636
|
const chunks = [];
|
|
46258
46637
|
child.stdout.on("data", (d) => chunks.push(d));
|
|
46259
46638
|
child.stderr.on("data", (d) => chunks.push(d));
|
|
@@ -46453,7 +46832,7 @@ async function main(argv2) {
|
|
|
46453
46832
|
var argv = process.argv.slice(2);
|
|
46454
46833
|
var first = argv[0];
|
|
46455
46834
|
if (first === "--version" || first === "-v" || first === "-V") {
|
|
46456
|
-
const v = "0.2.
|
|
46835
|
+
const v = "0.2.6";
|
|
46457
46836
|
process.stdout.write(v + "\n");
|
|
46458
46837
|
process.exit(0);
|
|
46459
46838
|
}
|