@kody-ade/kody-engine-lite 0.1.16 → 0.1.18
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/bin/cli.js +15 -23
- package/package.json +1 -1
package/dist/bin/cli.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
4
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
5
|
-
}) : x)(function(x) {
|
|
6
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
7
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
8
|
-
});
|
|
9
3
|
var __esm = (fn, res) => function __init() {
|
|
10
4
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
11
5
|
};
|
|
@@ -120,12 +114,10 @@ function createOpenCodeRunner() {
|
|
|
120
114
|
if (model) {
|
|
121
115
|
args2.push("--model", model);
|
|
122
116
|
}
|
|
123
|
-
args2.push(prompt);
|
|
124
117
|
return runSubprocess(
|
|
125
118
|
"opencode",
|
|
126
119
|
args2,
|
|
127
|
-
|
|
128
|
-
// opencode takes message as positional, not stdin
|
|
120
|
+
prompt,
|
|
129
121
|
timeout,
|
|
130
122
|
options
|
|
131
123
|
);
|
|
@@ -1677,6 +1669,7 @@ var init_preflight = __esm({
|
|
|
1677
1669
|
var entry_exports = {};
|
|
1678
1670
|
import * as fs6 from "fs";
|
|
1679
1671
|
import * as path5 from "path";
|
|
1672
|
+
import { execFileSync as execFileSync7 } from "child_process";
|
|
1680
1673
|
function getArg(args2, flag) {
|
|
1681
1674
|
const idx = args2.indexOf(flag);
|
|
1682
1675
|
if (idx !== -1 && args2[idx + 1] && !args2[idx + 1].startsWith("--")) {
|
|
@@ -1726,8 +1719,7 @@ function findLatestTaskForIssue(issueNumber, projectDir) {
|
|
|
1726
1719
|
const direct = allDirs.find((d) => d.startsWith(prefix));
|
|
1727
1720
|
if (direct) return direct;
|
|
1728
1721
|
try {
|
|
1729
|
-
const
|
|
1730
|
-
const branch = execFileSync8("git", ["branch", "--show-current"], {
|
|
1722
|
+
const branch = execFileSync7("git", ["branch", "--show-current"], {
|
|
1731
1723
|
encoding: "utf-8",
|
|
1732
1724
|
cwd: projectDir,
|
|
1733
1725
|
timeout: 5e3,
|
|
@@ -1955,7 +1947,7 @@ var init_entry = __esm({
|
|
|
1955
1947
|
// src/bin/cli.ts
|
|
1956
1948
|
import * as fs7 from "fs";
|
|
1957
1949
|
import * as path6 from "path";
|
|
1958
|
-
import { execFileSync as
|
|
1950
|
+
import { execFileSync as execFileSync8 } from "child_process";
|
|
1959
1951
|
import { fileURLToPath } from "url";
|
|
1960
1952
|
var __dirname = path6.dirname(fileURLToPath(import.meta.url));
|
|
1961
1953
|
var PKG_ROOT = path6.resolve(__dirname, "..", "..");
|
|
@@ -1966,7 +1958,7 @@ function getVersion() {
|
|
|
1966
1958
|
}
|
|
1967
1959
|
function checkCommand2(name, args2, fix) {
|
|
1968
1960
|
try {
|
|
1969
|
-
const output =
|
|
1961
|
+
const output = execFileSync8(name, args2, {
|
|
1970
1962
|
encoding: "utf-8",
|
|
1971
1963
|
timeout: 1e4,
|
|
1972
1964
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -1984,7 +1976,7 @@ function checkFile(filePath, description, fix) {
|
|
|
1984
1976
|
}
|
|
1985
1977
|
function checkGhAuth(cwd) {
|
|
1986
1978
|
try {
|
|
1987
|
-
const output =
|
|
1979
|
+
const output = execFileSync8("gh", ["auth", "status"], {
|
|
1988
1980
|
encoding: "utf-8",
|
|
1989
1981
|
timeout: 1e4,
|
|
1990
1982
|
cwd,
|
|
@@ -2002,7 +1994,7 @@ function checkGhAuth(cwd) {
|
|
|
2002
1994
|
}
|
|
2003
1995
|
function checkGhRepoAccess(cwd) {
|
|
2004
1996
|
try {
|
|
2005
|
-
const remote =
|
|
1997
|
+
const remote = execFileSync8("git", ["remote", "get-url", "origin"], {
|
|
2006
1998
|
encoding: "utf-8",
|
|
2007
1999
|
timeout: 5e3,
|
|
2008
2000
|
cwd,
|
|
@@ -2013,7 +2005,7 @@ function checkGhRepoAccess(cwd) {
|
|
|
2013
2005
|
return { name: "GitHub repo", ok: false, fix: "Set git remote origin to a GitHub URL" };
|
|
2014
2006
|
}
|
|
2015
2007
|
const repoSlug = `${match[1]}/${match[2]}`;
|
|
2016
|
-
|
|
2008
|
+
execFileSync8("gh", ["repo", "view", repoSlug, "--json", "name"], {
|
|
2017
2009
|
encoding: "utf-8",
|
|
2018
2010
|
timeout: 1e4,
|
|
2019
2011
|
cwd,
|
|
@@ -2026,7 +2018,7 @@ function checkGhRepoAccess(cwd) {
|
|
|
2026
2018
|
}
|
|
2027
2019
|
function checkGhSecret(repoSlug, secretName) {
|
|
2028
2020
|
try {
|
|
2029
|
-
const output =
|
|
2021
|
+
const output = execFileSync8("gh", ["secret", "list", "--repo", repoSlug], {
|
|
2030
2022
|
encoding: "utf-8",
|
|
2031
2023
|
timeout: 1e4,
|
|
2032
2024
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -2112,7 +2104,7 @@ function detectBasicConfig(cwd) {
|
|
|
2112
2104
|
else if (!fs7.existsSync(path6.join(cwd, "pnpm-lock.yaml")) && fs7.existsSync(path6.join(cwd, "package-lock.json"))) pm = "npm";
|
|
2113
2105
|
let defaultBranch = "main";
|
|
2114
2106
|
try {
|
|
2115
|
-
const ref =
|
|
2107
|
+
const ref = execFileSync8("git", ["symbolic-ref", "refs/remotes/origin/HEAD"], {
|
|
2116
2108
|
encoding: "utf-8",
|
|
2117
2109
|
timeout: 5e3,
|
|
2118
2110
|
cwd,
|
|
@@ -2121,7 +2113,7 @@ function detectBasicConfig(cwd) {
|
|
|
2121
2113
|
defaultBranch = ref.replace("refs/remotes/origin/", "");
|
|
2122
2114
|
} catch {
|
|
2123
2115
|
try {
|
|
2124
|
-
|
|
2116
|
+
execFileSync8("git", ["rev-parse", "--verify", "origin/dev"], {
|
|
2125
2117
|
encoding: "utf-8",
|
|
2126
2118
|
timeout: 5e3,
|
|
2127
2119
|
cwd,
|
|
@@ -2134,7 +2126,7 @@ function detectBasicConfig(cwd) {
|
|
|
2134
2126
|
let owner = "";
|
|
2135
2127
|
let repo = "";
|
|
2136
2128
|
try {
|
|
2137
|
-
const remote =
|
|
2129
|
+
const remote = execFileSync8("git", ["remote", "get-url", "origin"], {
|
|
2138
2130
|
encoding: "utf-8",
|
|
2139
2131
|
timeout: 5e3,
|
|
2140
2132
|
cwd,
|
|
@@ -2258,7 +2250,7 @@ Output ONLY valid JSON. No markdown fences. No explanation before or after.
|
|
|
2258
2250
|
${context}`;
|
|
2259
2251
|
console.log(" \u23F3 Analyzing project with Claude Code...");
|
|
2260
2252
|
try {
|
|
2261
|
-
const output =
|
|
2253
|
+
const output = execFileSync8("claude", [
|
|
2262
2254
|
"--print",
|
|
2263
2255
|
"--model",
|
|
2264
2256
|
"haiku",
|
|
@@ -2462,7 +2454,7 @@ function initCommand(opts) {
|
|
|
2462
2454
|
console.log("\n\u2500\u2500 Labels \u2500\u2500");
|
|
2463
2455
|
for (const label of labels) {
|
|
2464
2456
|
try {
|
|
2465
|
-
|
|
2457
|
+
execFileSync8("gh", [
|
|
2466
2458
|
"label",
|
|
2467
2459
|
"create",
|
|
2468
2460
|
label.name,
|
|
@@ -2481,7 +2473,7 @@ function initCommand(opts) {
|
|
|
2481
2473
|
console.log(` \u2713 ${label.name}`);
|
|
2482
2474
|
} catch {
|
|
2483
2475
|
try {
|
|
2484
|
-
|
|
2476
|
+
execFileSync8("gh", ["label", "list", "--repo", repoSlug, "--search", label.name], {
|
|
2485
2477
|
encoding: "utf-8",
|
|
2486
2478
|
timeout: 1e4,
|
|
2487
2479
|
stdio: ["pipe", "pipe", "pipe"]
|