drizzy-agent 0.7.4 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +554 -28
- package/dist/features/background-agent/compaction-aware-message-resolver.d.ts +1 -0
- package/dist/hooks/anthropic-effort/hook.d.ts +3 -1
- package/dist/hooks/comment-checker/apply-patch-edits.d.ts +10 -0
- package/dist/hooks/comment-checker/cli-runner.d.ts +1 -1
- package/dist/hooks/keyword-detector/hook.d.ts +1 -0
- package/dist/index.js +1168 -664
- package/dist/plugin/chat-params.d.ts +3 -1
- package/dist/shared/agent-variant.d.ts +1 -3
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/model-suggestion-retry.d.ts +4 -2
- package/dist/shared/user-message-variant.d.ts +9 -0
- package/package.json +15 -15
package/dist/cli/index.js
CHANGED
|
@@ -4621,6 +4621,462 @@ var init_model_availability = __esm(() => {
|
|
|
4621
4621
|
init_connected_providers_cache();
|
|
4622
4622
|
});
|
|
4623
4623
|
|
|
4624
|
+
// node_modules/isexe/windows.js
|
|
4625
|
+
var require_windows = __commonJS((exports, module) => {
|
|
4626
|
+
module.exports = isexe;
|
|
4627
|
+
isexe.sync = sync;
|
|
4628
|
+
var fs4 = __require("fs");
|
|
4629
|
+
function checkPathExt(path4, options) {
|
|
4630
|
+
var pathext = options.pathExt !== undefined ? options.pathExt : process.env.PATHEXT;
|
|
4631
|
+
if (!pathext) {
|
|
4632
|
+
return true;
|
|
4633
|
+
}
|
|
4634
|
+
pathext = pathext.split(";");
|
|
4635
|
+
if (pathext.indexOf("") !== -1) {
|
|
4636
|
+
return true;
|
|
4637
|
+
}
|
|
4638
|
+
for (var i2 = 0;i2 < pathext.length; i2++) {
|
|
4639
|
+
var p2 = pathext[i2].toLowerCase();
|
|
4640
|
+
if (p2 && path4.substr(-p2.length).toLowerCase() === p2) {
|
|
4641
|
+
return true;
|
|
4642
|
+
}
|
|
4643
|
+
}
|
|
4644
|
+
return false;
|
|
4645
|
+
}
|
|
4646
|
+
function checkStat(stat, path4, options) {
|
|
4647
|
+
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
4648
|
+
return false;
|
|
4649
|
+
}
|
|
4650
|
+
return checkPathExt(path4, options);
|
|
4651
|
+
}
|
|
4652
|
+
function isexe(path4, options, cb) {
|
|
4653
|
+
fs4.stat(path4, function(er, stat) {
|
|
4654
|
+
cb(er, er ? false : checkStat(stat, path4, options));
|
|
4655
|
+
});
|
|
4656
|
+
}
|
|
4657
|
+
function sync(path4, options) {
|
|
4658
|
+
return checkStat(fs4.statSync(path4), path4, options);
|
|
4659
|
+
}
|
|
4660
|
+
});
|
|
4661
|
+
|
|
4662
|
+
// node_modules/isexe/mode.js
|
|
4663
|
+
var require_mode = __commonJS((exports, module) => {
|
|
4664
|
+
module.exports = isexe;
|
|
4665
|
+
isexe.sync = sync;
|
|
4666
|
+
var fs4 = __require("fs");
|
|
4667
|
+
function isexe(path4, options, cb) {
|
|
4668
|
+
fs4.stat(path4, function(er, stat) {
|
|
4669
|
+
cb(er, er ? false : checkStat(stat, options));
|
|
4670
|
+
});
|
|
4671
|
+
}
|
|
4672
|
+
function sync(path4, options) {
|
|
4673
|
+
return checkStat(fs4.statSync(path4), options);
|
|
4674
|
+
}
|
|
4675
|
+
function checkStat(stat, options) {
|
|
4676
|
+
return stat.isFile() && checkMode(stat, options);
|
|
4677
|
+
}
|
|
4678
|
+
function checkMode(stat, options) {
|
|
4679
|
+
var mod = stat.mode;
|
|
4680
|
+
var uid = stat.uid;
|
|
4681
|
+
var gid = stat.gid;
|
|
4682
|
+
var myUid = options.uid !== undefined ? options.uid : process.getuid && process.getuid();
|
|
4683
|
+
var myGid = options.gid !== undefined ? options.gid : process.getgid && process.getgid();
|
|
4684
|
+
var u2 = parseInt("100", 8);
|
|
4685
|
+
var g2 = parseInt("010", 8);
|
|
4686
|
+
var o2 = parseInt("001", 8);
|
|
4687
|
+
var ug = u2 | g2;
|
|
4688
|
+
var ret = mod & o2 || mod & g2 && gid === myGid || mod & u2 && uid === myUid || mod & ug && myUid === 0;
|
|
4689
|
+
return ret;
|
|
4690
|
+
}
|
|
4691
|
+
});
|
|
4692
|
+
|
|
4693
|
+
// node_modules/isexe/index.js
|
|
4694
|
+
var require_isexe = __commonJS((exports, module) => {
|
|
4695
|
+
var fs4 = __require("fs");
|
|
4696
|
+
var core3;
|
|
4697
|
+
if (process.platform === "win32" || global.TESTING_WINDOWS) {
|
|
4698
|
+
core3 = require_windows();
|
|
4699
|
+
} else {
|
|
4700
|
+
core3 = require_mode();
|
|
4701
|
+
}
|
|
4702
|
+
module.exports = isexe;
|
|
4703
|
+
isexe.sync = sync;
|
|
4704
|
+
function isexe(path4, options, cb) {
|
|
4705
|
+
if (typeof options === "function") {
|
|
4706
|
+
cb = options;
|
|
4707
|
+
options = {};
|
|
4708
|
+
}
|
|
4709
|
+
if (!cb) {
|
|
4710
|
+
if (typeof Promise !== "function") {
|
|
4711
|
+
throw new TypeError("callback not provided");
|
|
4712
|
+
}
|
|
4713
|
+
return new Promise(function(resolve2, reject) {
|
|
4714
|
+
isexe(path4, options || {}, function(er, is) {
|
|
4715
|
+
if (er) {
|
|
4716
|
+
reject(er);
|
|
4717
|
+
} else {
|
|
4718
|
+
resolve2(is);
|
|
4719
|
+
}
|
|
4720
|
+
});
|
|
4721
|
+
});
|
|
4722
|
+
}
|
|
4723
|
+
core3(path4, options || {}, function(er, is) {
|
|
4724
|
+
if (er) {
|
|
4725
|
+
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
4726
|
+
er = null;
|
|
4727
|
+
is = false;
|
|
4728
|
+
}
|
|
4729
|
+
}
|
|
4730
|
+
cb(er, is);
|
|
4731
|
+
});
|
|
4732
|
+
}
|
|
4733
|
+
function sync(path4, options) {
|
|
4734
|
+
try {
|
|
4735
|
+
return core3.sync(path4, options || {});
|
|
4736
|
+
} catch (er) {
|
|
4737
|
+
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
4738
|
+
return false;
|
|
4739
|
+
} else {
|
|
4740
|
+
throw er;
|
|
4741
|
+
}
|
|
4742
|
+
}
|
|
4743
|
+
}
|
|
4744
|
+
});
|
|
4745
|
+
|
|
4746
|
+
// node_modules/which/which.js
|
|
4747
|
+
var require_which = __commonJS((exports, module) => {
|
|
4748
|
+
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
4749
|
+
var path4 = __require("path");
|
|
4750
|
+
var COLON = isWindows ? ";" : ":";
|
|
4751
|
+
var isexe = require_isexe();
|
|
4752
|
+
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
4753
|
+
var getPathInfo = (cmd, opt) => {
|
|
4754
|
+
const colon = opt.colon || COLON;
|
|
4755
|
+
const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [
|
|
4756
|
+
...isWindows ? [process.cwd()] : [],
|
|
4757
|
+
...(opt.path || process.env.PATH || "").split(colon)
|
|
4758
|
+
];
|
|
4759
|
+
const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
4760
|
+
const pathExt = isWindows ? pathExtExe.split(colon) : [""];
|
|
4761
|
+
if (isWindows) {
|
|
4762
|
+
if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
|
|
4763
|
+
pathExt.unshift("");
|
|
4764
|
+
}
|
|
4765
|
+
return {
|
|
4766
|
+
pathEnv,
|
|
4767
|
+
pathExt,
|
|
4768
|
+
pathExtExe
|
|
4769
|
+
};
|
|
4770
|
+
};
|
|
4771
|
+
var which = (cmd, opt, cb) => {
|
|
4772
|
+
if (typeof opt === "function") {
|
|
4773
|
+
cb = opt;
|
|
4774
|
+
opt = {};
|
|
4775
|
+
}
|
|
4776
|
+
if (!opt)
|
|
4777
|
+
opt = {};
|
|
4778
|
+
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
4779
|
+
const found = [];
|
|
4780
|
+
const step = (i2) => new Promise((resolve2, reject) => {
|
|
4781
|
+
if (i2 === pathEnv.length)
|
|
4782
|
+
return opt.all && found.length ? resolve2(found) : reject(getNotFoundError(cmd));
|
|
4783
|
+
const ppRaw = pathEnv[i2];
|
|
4784
|
+
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
4785
|
+
const pCmd = path4.join(pathPart, cmd);
|
|
4786
|
+
const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
4787
|
+
resolve2(subStep(p2, i2, 0));
|
|
4788
|
+
});
|
|
4789
|
+
const subStep = (p2, i2, ii) => new Promise((resolve2, reject) => {
|
|
4790
|
+
if (ii === pathExt.length)
|
|
4791
|
+
return resolve2(step(i2 + 1));
|
|
4792
|
+
const ext = pathExt[ii];
|
|
4793
|
+
isexe(p2 + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
4794
|
+
if (!er && is) {
|
|
4795
|
+
if (opt.all)
|
|
4796
|
+
found.push(p2 + ext);
|
|
4797
|
+
else
|
|
4798
|
+
return resolve2(p2 + ext);
|
|
4799
|
+
}
|
|
4800
|
+
return resolve2(subStep(p2, i2, ii + 1));
|
|
4801
|
+
});
|
|
4802
|
+
});
|
|
4803
|
+
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
4804
|
+
};
|
|
4805
|
+
var whichSync = (cmd, opt) => {
|
|
4806
|
+
opt = opt || {};
|
|
4807
|
+
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
4808
|
+
const found = [];
|
|
4809
|
+
for (let i2 = 0;i2 < pathEnv.length; i2++) {
|
|
4810
|
+
const ppRaw = pathEnv[i2];
|
|
4811
|
+
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
4812
|
+
const pCmd = path4.join(pathPart, cmd);
|
|
4813
|
+
const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
4814
|
+
for (let j2 = 0;j2 < pathExt.length; j2++) {
|
|
4815
|
+
const cur = p2 + pathExt[j2];
|
|
4816
|
+
try {
|
|
4817
|
+
const is = isexe.sync(cur, { pathExt: pathExtExe });
|
|
4818
|
+
if (is) {
|
|
4819
|
+
if (opt.all)
|
|
4820
|
+
found.push(cur);
|
|
4821
|
+
else
|
|
4822
|
+
return cur;
|
|
4823
|
+
}
|
|
4824
|
+
} catch (ex) {}
|
|
4825
|
+
}
|
|
4826
|
+
}
|
|
4827
|
+
if (opt.all && found.length)
|
|
4828
|
+
return found;
|
|
4829
|
+
if (opt.nothrow)
|
|
4830
|
+
return null;
|
|
4831
|
+
throw getNotFoundError(cmd);
|
|
4832
|
+
};
|
|
4833
|
+
module.exports = which;
|
|
4834
|
+
which.sync = whichSync;
|
|
4835
|
+
});
|
|
4836
|
+
|
|
4837
|
+
// node_modules/path-key/index.js
|
|
4838
|
+
var require_path_key = __commonJS((exports, module) => {
|
|
4839
|
+
var pathKey = (options = {}) => {
|
|
4840
|
+
const environment = options.env || process.env;
|
|
4841
|
+
const platform = options.platform || process.platform;
|
|
4842
|
+
if (platform !== "win32") {
|
|
4843
|
+
return "PATH";
|
|
4844
|
+
}
|
|
4845
|
+
return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
4846
|
+
};
|
|
4847
|
+
module.exports = pathKey;
|
|
4848
|
+
module.exports.default = pathKey;
|
|
4849
|
+
});
|
|
4850
|
+
|
|
4851
|
+
// node_modules/cross-spawn/lib/util/resolveCommand.js
|
|
4852
|
+
var require_resolveCommand = __commonJS((exports, module) => {
|
|
4853
|
+
var path4 = __require("path");
|
|
4854
|
+
var which = require_which();
|
|
4855
|
+
var getPathKey = require_path_key();
|
|
4856
|
+
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
4857
|
+
const env = parsed.options.env || process.env;
|
|
4858
|
+
const cwd = process.cwd();
|
|
4859
|
+
const hasCustomCwd = parsed.options.cwd != null;
|
|
4860
|
+
const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled;
|
|
4861
|
+
if (shouldSwitchCwd) {
|
|
4862
|
+
try {
|
|
4863
|
+
process.chdir(parsed.options.cwd);
|
|
4864
|
+
} catch (err) {}
|
|
4865
|
+
}
|
|
4866
|
+
let resolved;
|
|
4867
|
+
try {
|
|
4868
|
+
resolved = which.sync(parsed.command, {
|
|
4869
|
+
path: env[getPathKey({ env })],
|
|
4870
|
+
pathExt: withoutPathExt ? path4.delimiter : undefined
|
|
4871
|
+
});
|
|
4872
|
+
} catch (e2) {} finally {
|
|
4873
|
+
if (shouldSwitchCwd) {
|
|
4874
|
+
process.chdir(cwd);
|
|
4875
|
+
}
|
|
4876
|
+
}
|
|
4877
|
+
if (resolved) {
|
|
4878
|
+
resolved = path4.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
4879
|
+
}
|
|
4880
|
+
return resolved;
|
|
4881
|
+
}
|
|
4882
|
+
function resolveCommand(parsed) {
|
|
4883
|
+
return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
|
|
4884
|
+
}
|
|
4885
|
+
module.exports = resolveCommand;
|
|
4886
|
+
});
|
|
4887
|
+
|
|
4888
|
+
// node_modules/cross-spawn/lib/util/escape.js
|
|
4889
|
+
var require_escape = __commonJS((exports, module) => {
|
|
4890
|
+
var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
|
|
4891
|
+
function escapeCommand(arg) {
|
|
4892
|
+
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
4893
|
+
return arg;
|
|
4894
|
+
}
|
|
4895
|
+
function escapeArgument(arg, doubleEscapeMetaChars) {
|
|
4896
|
+
arg = `${arg}`;
|
|
4897
|
+
arg = arg.replace(/(?=(\\+?)?)\1"/g, "$1$1\\\"");
|
|
4898
|
+
arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
|
|
4899
|
+
arg = `"${arg}"`;
|
|
4900
|
+
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
4901
|
+
if (doubleEscapeMetaChars) {
|
|
4902
|
+
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
4903
|
+
}
|
|
4904
|
+
return arg;
|
|
4905
|
+
}
|
|
4906
|
+
exports.command = escapeCommand;
|
|
4907
|
+
exports.argument = escapeArgument;
|
|
4908
|
+
});
|
|
4909
|
+
|
|
4910
|
+
// node_modules/shebang-regex/index.js
|
|
4911
|
+
var require_shebang_regex = __commonJS((exports, module) => {
|
|
4912
|
+
module.exports = /^#!(.*)/;
|
|
4913
|
+
});
|
|
4914
|
+
|
|
4915
|
+
// node_modules/shebang-command/index.js
|
|
4916
|
+
var require_shebang_command = __commonJS((exports, module) => {
|
|
4917
|
+
var shebangRegex = require_shebang_regex();
|
|
4918
|
+
module.exports = (string4 = "") => {
|
|
4919
|
+
const match = string4.match(shebangRegex);
|
|
4920
|
+
if (!match) {
|
|
4921
|
+
return null;
|
|
4922
|
+
}
|
|
4923
|
+
const [path4, argument] = match[0].replace(/#! ?/, "").split(" ");
|
|
4924
|
+
const binary2 = path4.split("/").pop();
|
|
4925
|
+
if (binary2 === "env") {
|
|
4926
|
+
return argument;
|
|
4927
|
+
}
|
|
4928
|
+
return argument ? `${binary2} ${argument}` : binary2;
|
|
4929
|
+
};
|
|
4930
|
+
});
|
|
4931
|
+
|
|
4932
|
+
// node_modules/cross-spawn/lib/util/readShebang.js
|
|
4933
|
+
var require_readShebang = __commonJS((exports, module) => {
|
|
4934
|
+
var fs4 = __require("fs");
|
|
4935
|
+
var shebangCommand = require_shebang_command();
|
|
4936
|
+
function readShebang(command) {
|
|
4937
|
+
const size = 150;
|
|
4938
|
+
const buffer = Buffer.alloc(size);
|
|
4939
|
+
let fd;
|
|
4940
|
+
try {
|
|
4941
|
+
fd = fs4.openSync(command, "r");
|
|
4942
|
+
fs4.readSync(fd, buffer, 0, size, 0);
|
|
4943
|
+
fs4.closeSync(fd);
|
|
4944
|
+
} catch (e2) {}
|
|
4945
|
+
return shebangCommand(buffer.toString());
|
|
4946
|
+
}
|
|
4947
|
+
module.exports = readShebang;
|
|
4948
|
+
});
|
|
4949
|
+
|
|
4950
|
+
// node_modules/cross-spawn/lib/parse.js
|
|
4951
|
+
var require_parse = __commonJS((exports, module) => {
|
|
4952
|
+
var path4 = __require("path");
|
|
4953
|
+
var resolveCommand = require_resolveCommand();
|
|
4954
|
+
var escape = require_escape();
|
|
4955
|
+
var readShebang = require_readShebang();
|
|
4956
|
+
var isWin = process.platform === "win32";
|
|
4957
|
+
var isExecutableRegExp = /\.(?:com|exe)$/i;
|
|
4958
|
+
var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
|
|
4959
|
+
function detectShebang(parsed) {
|
|
4960
|
+
parsed.file = resolveCommand(parsed);
|
|
4961
|
+
const shebang = parsed.file && readShebang(parsed.file);
|
|
4962
|
+
if (shebang) {
|
|
4963
|
+
parsed.args.unshift(parsed.file);
|
|
4964
|
+
parsed.command = shebang;
|
|
4965
|
+
return resolveCommand(parsed);
|
|
4966
|
+
}
|
|
4967
|
+
return parsed.file;
|
|
4968
|
+
}
|
|
4969
|
+
function parseNonShell(parsed) {
|
|
4970
|
+
if (!isWin) {
|
|
4971
|
+
return parsed;
|
|
4972
|
+
}
|
|
4973
|
+
const commandFile = detectShebang(parsed);
|
|
4974
|
+
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
4975
|
+
if (parsed.options.forceShell || needsShell) {
|
|
4976
|
+
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
4977
|
+
parsed.command = path4.normalize(parsed.command);
|
|
4978
|
+
parsed.command = escape.command(parsed.command);
|
|
4979
|
+
parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
|
|
4980
|
+
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
4981
|
+
parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`];
|
|
4982
|
+
parsed.command = process.env.comspec || "cmd.exe";
|
|
4983
|
+
parsed.options.windowsVerbatimArguments = true;
|
|
4984
|
+
}
|
|
4985
|
+
return parsed;
|
|
4986
|
+
}
|
|
4987
|
+
function parse7(command, args, options) {
|
|
4988
|
+
if (args && !Array.isArray(args)) {
|
|
4989
|
+
options = args;
|
|
4990
|
+
args = null;
|
|
4991
|
+
}
|
|
4992
|
+
args = args ? args.slice(0) : [];
|
|
4993
|
+
options = Object.assign({}, options);
|
|
4994
|
+
const parsed = {
|
|
4995
|
+
command,
|
|
4996
|
+
args,
|
|
4997
|
+
options,
|
|
4998
|
+
file: undefined,
|
|
4999
|
+
original: {
|
|
5000
|
+
command,
|
|
5001
|
+
args
|
|
5002
|
+
}
|
|
5003
|
+
};
|
|
5004
|
+
return options.shell ? parsed : parseNonShell(parsed);
|
|
5005
|
+
}
|
|
5006
|
+
module.exports = parse7;
|
|
5007
|
+
});
|
|
5008
|
+
|
|
5009
|
+
// node_modules/cross-spawn/lib/enoent.js
|
|
5010
|
+
var require_enoent = __commonJS((exports, module) => {
|
|
5011
|
+
var isWin = process.platform === "win32";
|
|
5012
|
+
function notFoundError(original, syscall) {
|
|
5013
|
+
return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
|
|
5014
|
+
code: "ENOENT",
|
|
5015
|
+
errno: "ENOENT",
|
|
5016
|
+
syscall: `${syscall} ${original.command}`,
|
|
5017
|
+
path: original.command,
|
|
5018
|
+
spawnargs: original.args
|
|
5019
|
+
});
|
|
5020
|
+
}
|
|
5021
|
+
function hookChildProcess(cp, parsed) {
|
|
5022
|
+
if (!isWin) {
|
|
5023
|
+
return;
|
|
5024
|
+
}
|
|
5025
|
+
const originalEmit = cp.emit;
|
|
5026
|
+
cp.emit = function(name, arg1) {
|
|
5027
|
+
if (name === "exit") {
|
|
5028
|
+
const err = verifyENOENT(arg1, parsed);
|
|
5029
|
+
if (err) {
|
|
5030
|
+
return originalEmit.call(cp, "error", err);
|
|
5031
|
+
}
|
|
5032
|
+
}
|
|
5033
|
+
return originalEmit.apply(cp, arguments);
|
|
5034
|
+
};
|
|
5035
|
+
}
|
|
5036
|
+
function verifyENOENT(status, parsed) {
|
|
5037
|
+
if (isWin && status === 1 && !parsed.file) {
|
|
5038
|
+
return notFoundError(parsed.original, "spawn");
|
|
5039
|
+
}
|
|
5040
|
+
return null;
|
|
5041
|
+
}
|
|
5042
|
+
function verifyENOENTSync(status, parsed) {
|
|
5043
|
+
if (isWin && status === 1 && !parsed.file) {
|
|
5044
|
+
return notFoundError(parsed.original, "spawnSync");
|
|
5045
|
+
}
|
|
5046
|
+
return null;
|
|
5047
|
+
}
|
|
5048
|
+
module.exports = {
|
|
5049
|
+
hookChildProcess,
|
|
5050
|
+
verifyENOENT,
|
|
5051
|
+
verifyENOENTSync,
|
|
5052
|
+
notFoundError
|
|
5053
|
+
};
|
|
5054
|
+
});
|
|
5055
|
+
|
|
5056
|
+
// node_modules/cross-spawn/index.js
|
|
5057
|
+
var require_cross_spawn = __commonJS((exports, module) => {
|
|
5058
|
+
var cp = __require("child_process");
|
|
5059
|
+
var parse7 = require_parse();
|
|
5060
|
+
var enoent = require_enoent();
|
|
5061
|
+
function spawn(command, args, options) {
|
|
5062
|
+
const parsed = parse7(command, args, options);
|
|
5063
|
+
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
|
5064
|
+
enoent.hookChildProcess(spawned, parsed);
|
|
5065
|
+
return spawned;
|
|
5066
|
+
}
|
|
5067
|
+
function spawnSync(command, args, options) {
|
|
5068
|
+
const parsed = parse7(command, args, options);
|
|
5069
|
+
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
5070
|
+
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
5071
|
+
return result;
|
|
5072
|
+
}
|
|
5073
|
+
module.exports = spawn;
|
|
5074
|
+
module.exports.spawn = spawn;
|
|
5075
|
+
module.exports.sync = spawnSync;
|
|
5076
|
+
module.exports._parse = parse7;
|
|
5077
|
+
module.exports._enoent = enoent;
|
|
5078
|
+
});
|
|
5079
|
+
|
|
4624
5080
|
// src/hooks/auto-update-checker/constants.ts
|
|
4625
5081
|
import * as path4 from "path";
|
|
4626
5082
|
import * as os3 from "os";
|
|
@@ -26085,6 +26541,31 @@ class OpencodeClient extends _HeyApiClient {
|
|
|
26085
26541
|
}
|
|
26086
26542
|
|
|
26087
26543
|
// node_modules/@opencode-ai/sdk/dist/client.js
|
|
26544
|
+
function pick2(value, fallback) {
|
|
26545
|
+
if (!value)
|
|
26546
|
+
return;
|
|
26547
|
+
if (!fallback)
|
|
26548
|
+
return value;
|
|
26549
|
+
if (value === fallback)
|
|
26550
|
+
return fallback;
|
|
26551
|
+
if (value === encodeURIComponent(fallback))
|
|
26552
|
+
return fallback;
|
|
26553
|
+
return value;
|
|
26554
|
+
}
|
|
26555
|
+
function rewrite(request, directory) {
|
|
26556
|
+
if (request.method !== "GET" && request.method !== "HEAD")
|
|
26557
|
+
return request;
|
|
26558
|
+
const value = pick2(request.headers.get("x-opencode-directory"), directory);
|
|
26559
|
+
if (!value)
|
|
26560
|
+
return request;
|
|
26561
|
+
const url2 = new URL(request.url);
|
|
26562
|
+
if (!url2.searchParams.has("directory")) {
|
|
26563
|
+
url2.searchParams.set("directory", value);
|
|
26564
|
+
}
|
|
26565
|
+
const next = new Request(url2, request);
|
|
26566
|
+
next.headers.delete("x-opencode-directory");
|
|
26567
|
+
return next;
|
|
26568
|
+
}
|
|
26088
26569
|
function createOpencodeClient(config2) {
|
|
26089
26570
|
if (!config2?.fetch) {
|
|
26090
26571
|
const customFetch = (req) => {
|
|
@@ -26103,10 +26584,46 @@ function createOpencodeClient(config2) {
|
|
|
26103
26584
|
};
|
|
26104
26585
|
}
|
|
26105
26586
|
const client2 = createClient(config2);
|
|
26587
|
+
client2.interceptors.request.use((request) => rewrite(request, config2?.directory));
|
|
26106
26588
|
return new OpencodeClient({ client: client2 });
|
|
26107
26589
|
}
|
|
26108
26590
|
// node_modules/@opencode-ai/sdk/dist/server.js
|
|
26109
|
-
|
|
26591
|
+
var import_cross_spawn = __toESM(require_cross_spawn(), 1);
|
|
26592
|
+
|
|
26593
|
+
// node_modules/@opencode-ai/sdk/dist/process.js
|
|
26594
|
+
import { spawnSync } from "child_process";
|
|
26595
|
+
function stop(proc) {
|
|
26596
|
+
if (proc.exitCode !== null || proc.signalCode !== null)
|
|
26597
|
+
return;
|
|
26598
|
+
if (process.platform === "win32" && proc.pid) {
|
|
26599
|
+
const out = spawnSync("taskkill", ["/pid", String(proc.pid), "/T", "/F"], { windowsHide: true });
|
|
26600
|
+
if (!out.error && out.status === 0)
|
|
26601
|
+
return;
|
|
26602
|
+
}
|
|
26603
|
+
proc.kill();
|
|
26604
|
+
}
|
|
26605
|
+
function bindAbort(proc, signal, onAbort) {
|
|
26606
|
+
if (!signal)
|
|
26607
|
+
return () => {};
|
|
26608
|
+
const abort = () => {
|
|
26609
|
+
clear();
|
|
26610
|
+
stop(proc);
|
|
26611
|
+
onAbort?.();
|
|
26612
|
+
};
|
|
26613
|
+
const clear = () => {
|
|
26614
|
+
signal.removeEventListener("abort", abort);
|
|
26615
|
+
proc.off("exit", clear);
|
|
26616
|
+
proc.off("error", clear);
|
|
26617
|
+
};
|
|
26618
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
26619
|
+
proc.on("exit", clear);
|
|
26620
|
+
proc.on("error", clear);
|
|
26621
|
+
if (signal.aborted)
|
|
26622
|
+
abort();
|
|
26623
|
+
return clear;
|
|
26624
|
+
}
|
|
26625
|
+
|
|
26626
|
+
// node_modules/@opencode-ai/sdk/dist/server.js
|
|
26110
26627
|
async function createOpencodeServer(options) {
|
|
26111
26628
|
options = Object.assign({
|
|
26112
26629
|
hostname: "127.0.0.1",
|
|
@@ -26116,19 +26633,24 @@ async function createOpencodeServer(options) {
|
|
|
26116
26633
|
const args = [`serve`, `--hostname=${options.hostname}`, `--port=${options.port}`];
|
|
26117
26634
|
if (options.config?.logLevel)
|
|
26118
26635
|
args.push(`--log-level=${options.config.logLevel}`);
|
|
26119
|
-
const proc =
|
|
26120
|
-
signal: options.signal,
|
|
26636
|
+
const proc = import_cross_spawn.default(`opencode`, args, {
|
|
26121
26637
|
env: {
|
|
26122
26638
|
...process.env,
|
|
26123
26639
|
OPENCODE_CONFIG_CONTENT: JSON.stringify(options.config ?? {})
|
|
26124
26640
|
}
|
|
26125
26641
|
});
|
|
26642
|
+
let clear = () => {};
|
|
26126
26643
|
const url2 = await new Promise((resolve2, reject) => {
|
|
26127
26644
|
const id = setTimeout(() => {
|
|
26645
|
+
clear();
|
|
26646
|
+
stop(proc);
|
|
26128
26647
|
reject(new Error(`Timeout waiting for server to start after ${options.timeout}ms`));
|
|
26129
26648
|
}, options.timeout);
|
|
26130
26649
|
let output = "";
|
|
26650
|
+
let resolved = false;
|
|
26131
26651
|
proc.stdout?.on("data", (chunk) => {
|
|
26652
|
+
if (resolved)
|
|
26653
|
+
return;
|
|
26132
26654
|
output += chunk.toString();
|
|
26133
26655
|
const lines = output.split(`
|
|
26134
26656
|
`);
|
|
@@ -26136,9 +26658,14 @@ async function createOpencodeServer(options) {
|
|
|
26136
26658
|
if (line.startsWith("opencode server listening")) {
|
|
26137
26659
|
const match = line.match(/on\s+(https?:\/\/[^\s]+)/);
|
|
26138
26660
|
if (!match) {
|
|
26139
|
-
|
|
26661
|
+
clear();
|
|
26662
|
+
stop(proc);
|
|
26663
|
+
clearTimeout(id);
|
|
26664
|
+
reject(new Error(`Failed to parse server url from output: ${line}`));
|
|
26665
|
+
return;
|
|
26140
26666
|
}
|
|
26141
26667
|
clearTimeout(id);
|
|
26668
|
+
resolved = true;
|
|
26142
26669
|
resolve2(match[1]);
|
|
26143
26670
|
return;
|
|
26144
26671
|
}
|
|
@@ -26160,17 +26687,16 @@ Server output: ${output}`;
|
|
|
26160
26687
|
clearTimeout(id);
|
|
26161
26688
|
reject(error48);
|
|
26162
26689
|
});
|
|
26163
|
-
|
|
26164
|
-
|
|
26165
|
-
|
|
26166
|
-
|
|
26167
|
-
});
|
|
26168
|
-
}
|
|
26690
|
+
clear = bindAbort(proc, options.signal, () => {
|
|
26691
|
+
clearTimeout(id);
|
|
26692
|
+
reject(options.signal?.reason);
|
|
26693
|
+
});
|
|
26169
26694
|
});
|
|
26170
26695
|
return {
|
|
26171
26696
|
url: url2,
|
|
26172
26697
|
close() {
|
|
26173
|
-
|
|
26698
|
+
clear();
|
|
26699
|
+
stop(proc);
|
|
26174
26700
|
}
|
|
26175
26701
|
};
|
|
26176
26702
|
}
|
|
@@ -29019,7 +29545,7 @@ async function findAvailablePort2(startPort = DEFAULT_PORT) {
|
|
|
29019
29545
|
}
|
|
29020
29546
|
|
|
29021
29547
|
// src/features/mcp-oauth/oauth-authorization-flow.ts
|
|
29022
|
-
import { spawn
|
|
29548
|
+
import { spawn } from "child_process";
|
|
29023
29549
|
import { createHash, randomBytes as randomBytes2 } from "crypto";
|
|
29024
29550
|
import { createServer } from "http";
|
|
29025
29551
|
function generateCodeVerifier() {
|
|
@@ -29100,7 +29626,7 @@ function openBrowser(url2) {
|
|
|
29100
29626
|
args = [url2];
|
|
29101
29627
|
}
|
|
29102
29628
|
try {
|
|
29103
|
-
const child =
|
|
29629
|
+
const child = spawn(command, args, { stdio: "ignore", detached: true });
|
|
29104
29630
|
child.on("error", () => {});
|
|
29105
29631
|
child.unref();
|
|
29106
29632
|
} catch {}
|
|
@@ -29371,7 +29897,7 @@ function createMcpOAuthCommand() {
|
|
|
29371
29897
|
// package.json
|
|
29372
29898
|
var package_default = {
|
|
29373
29899
|
name: "drizzy-agent",
|
|
29374
|
-
version: "0.
|
|
29900
|
+
version: "0.8.0",
|
|
29375
29901
|
description: "DrizzyAgent - AI agent plugin for OpenCode",
|
|
29376
29902
|
main: "dist/index.js",
|
|
29377
29903
|
types: "dist/index.d.ts",
|
|
@@ -29428,8 +29954,8 @@ var package_default = {
|
|
|
29428
29954
|
"@clack/prompts": "^0.11.0",
|
|
29429
29955
|
"@code-yeongyu/comment-checker": "^0.7.0",
|
|
29430
29956
|
"@modelcontextprotocol/sdk": "^1.25.2",
|
|
29431
|
-
"@opencode-ai/plugin": "^1.
|
|
29432
|
-
"@opencode-ai/sdk": "^1.
|
|
29957
|
+
"@opencode-ai/plugin": "^1.4.0",
|
|
29958
|
+
"@opencode-ai/sdk": "^1.4.0",
|
|
29433
29959
|
commander: "^14.0.2",
|
|
29434
29960
|
"detect-libc": "^2.0.0",
|
|
29435
29961
|
diff: "^8.0.3",
|
|
@@ -29447,20 +29973,20 @@ var package_default = {
|
|
|
29447
29973
|
typescript: "^5.7.3"
|
|
29448
29974
|
},
|
|
29449
29975
|
optionalDependencies: {
|
|
29450
|
-
"drizzy-agent-darwin-arm64": "0.
|
|
29451
|
-
"drizzy-agent-darwin-x64": "0.
|
|
29452
|
-
"drizzy-agent-darwin-x64-baseline": "0.
|
|
29453
|
-
"drizzy-agent-linux-arm64": "0.
|
|
29454
|
-
"drizzy-agent-linux-arm64-musl": "0.
|
|
29455
|
-
"drizzy-agent-linux-x64": "0.
|
|
29456
|
-
"drizzy-agent-linux-x64-baseline": "0.
|
|
29457
|
-
"drizzy-agent-linux-x64-musl": "0.
|
|
29458
|
-
"drizzy-agent-linux-x64-musl-baseline": "0.
|
|
29459
|
-
"drizzy-agent-windows-x64": "0.
|
|
29460
|
-
"drizzy-agent-windows-x64-baseline": "0.
|
|
29976
|
+
"drizzy-agent-darwin-arm64": "0.8.0",
|
|
29977
|
+
"drizzy-agent-darwin-x64": "0.8.0",
|
|
29978
|
+
"drizzy-agent-darwin-x64-baseline": "0.8.0",
|
|
29979
|
+
"drizzy-agent-linux-arm64": "0.8.0",
|
|
29980
|
+
"drizzy-agent-linux-arm64-musl": "0.8.0",
|
|
29981
|
+
"drizzy-agent-linux-x64": "0.8.0",
|
|
29982
|
+
"drizzy-agent-linux-x64-baseline": "0.8.0",
|
|
29983
|
+
"drizzy-agent-linux-x64-musl": "0.8.0",
|
|
29984
|
+
"drizzy-agent-linux-x64-musl-baseline": "0.8.0",
|
|
29985
|
+
"drizzy-agent-windows-x64": "0.8.0",
|
|
29986
|
+
"drizzy-agent-windows-x64-baseline": "0.8.0"
|
|
29461
29987
|
},
|
|
29462
29988
|
overrides: {
|
|
29463
|
-
"@opencode-ai/sdk": "^1.
|
|
29989
|
+
"@opencode-ai/sdk": "^1.4.0"
|
|
29464
29990
|
},
|
|
29465
29991
|
trustedDependencies: [
|
|
29466
29992
|
"@ast-grep/cli",
|