@llmtune/cli 0.1.1 → 0.1.2
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/agent/loop.js +1 -1
- package/dist/context/git-context.js +26 -36
- package/dist/index.js +2 -1
- package/dist/repl/repl.js +2 -1
- package/dist/tools/tools/web-fetch.js +2 -1
- package/dist/version.d.ts +2 -0
- package/dist/version.js +9 -0
- package/package.json +1 -1
package/dist/agent/loop.js
CHANGED
|
@@ -136,7 +136,7 @@ async function runAgentLoop(client, conversation, registry, userInput, config, o
|
|
|
136
136
|
workspaceRoot: config.workspaceRoot,
|
|
137
137
|
cwd: config.cwd,
|
|
138
138
|
};
|
|
139
|
-
const result = await registry.
|
|
139
|
+
const result = await registry.dispatchAsync(tc.function.name, toolInput, toolCtx);
|
|
140
140
|
if (result.isError) {
|
|
141
141
|
console.log(chalk_1.default.red(` ✗ ${tc.function.name}: ${String(result.output).slice(0, 200)}`));
|
|
142
142
|
}
|
|
@@ -2,48 +2,38 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.collectGitContext = collectGitContext;
|
|
4
4
|
const child_process_1 = require("child_process");
|
|
5
|
-
function
|
|
5
|
+
function runGit(args, cwd) {
|
|
6
6
|
try {
|
|
7
|
-
const
|
|
8
|
-
cwd
|
|
9
|
-
encoding: "utf-8",
|
|
10
|
-
timeout: 5000,
|
|
11
|
-
}).trim();
|
|
12
|
-
if (!gitDir) {
|
|
13
|
-
return { available: false, repoRoot: null, branch: null, recentCommit: null, status: null };
|
|
14
|
-
}
|
|
15
|
-
const branch = (0, child_process_1.execSync)("git rev-parse --abbrev-ref HEAD 2>/dev/null", {
|
|
16
|
-
cwd: gitDir,
|
|
7
|
+
const out = (0, child_process_1.execSync)(`git ${args}`, {
|
|
8
|
+
cwd,
|
|
17
9
|
encoding: "utf-8",
|
|
18
10
|
timeout: 5000,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
timeout: 5000,
|
|
24
|
-
}).trim();
|
|
25
|
-
let status = null;
|
|
26
|
-
try {
|
|
27
|
-
const raw = (0, child_process_1.execSync)("git status --short 2>/dev/null", {
|
|
28
|
-
cwd: gitDir,
|
|
29
|
-
encoding: "utf-8",
|
|
30
|
-
timeout: 5000,
|
|
31
|
-
}).trim();
|
|
32
|
-
if (raw) {
|
|
33
|
-
const lines = raw.split("\n").slice(0, 30);
|
|
34
|
-
status = lines.join("\n");
|
|
35
|
-
if (raw.split("\n").length > 30) {
|
|
36
|
-
status += `\n... ${raw.split("\n").length - 30} more files`;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
catch {
|
|
41
|
-
// status unavailable, non-critical
|
|
42
|
-
}
|
|
43
|
-
return { available: true, repoRoot: gitDir, branch, recentCommit, status };
|
|
11
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
12
|
+
});
|
|
13
|
+
const trimmed = out.trim();
|
|
14
|
+
return trimmed || null;
|
|
44
15
|
}
|
|
45
16
|
catch {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function collectGitContext(workspaceRoot) {
|
|
21
|
+
const gitDir = runGit("rev-parse --show-toplevel", workspaceRoot);
|
|
22
|
+
if (!gitDir) {
|
|
46
23
|
return { available: false, repoRoot: null, branch: null, recentCommit: null, status: null };
|
|
47
24
|
}
|
|
25
|
+
const branch = runGit("rev-parse --abbrev-ref HEAD", gitDir);
|
|
26
|
+
const recentCommit = runGit("log -1 --oneline", gitDir);
|
|
27
|
+
let status = null;
|
|
28
|
+
const raw = runGit("status --short", gitDir);
|
|
29
|
+
if (raw) {
|
|
30
|
+
const lines = raw.split("\n").slice(0, 30);
|
|
31
|
+
status = lines.join("\n");
|
|
32
|
+
const total = raw.split("\n").length;
|
|
33
|
+
if (total > 30) {
|
|
34
|
+
status += `\n... ${total - 30} more files`;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return { available: true, repoRoot: gitDir, branch, recentCommit, status };
|
|
48
38
|
}
|
|
49
39
|
//# sourceMappingURL=git-context.js.map
|
package/dist/index.js
CHANGED
|
@@ -42,11 +42,12 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
42
42
|
const config_1 = require("./auth/config");
|
|
43
43
|
const client_1 = require("./auth/client");
|
|
44
44
|
const repl_1 = require("./repl/repl");
|
|
45
|
+
const version_1 = require("./version");
|
|
45
46
|
const program = new commander_1.Command();
|
|
46
47
|
program
|
|
47
48
|
.name("llmtune")
|
|
48
49
|
.description("AI CLI Agent powered by llmtune.io")
|
|
49
|
-
.version(
|
|
50
|
+
.version(version_1.CLI_VERSION);
|
|
50
51
|
program
|
|
51
52
|
.command("login")
|
|
52
53
|
.description("Configure API key and settings")
|
package/dist/repl/repl.js
CHANGED
|
@@ -57,6 +57,7 @@ const trust_1 = require("../skills/trust");
|
|
|
57
57
|
const service_2 = require("../memory/service");
|
|
58
58
|
const logger_1 = require("../telemetry/logger");
|
|
59
59
|
const config_1 = require("../auth/config");
|
|
60
|
+
const version_1 = require("../version");
|
|
60
61
|
const fs = __importStar(require("fs"));
|
|
61
62
|
const path = __importStar(require("path"));
|
|
62
63
|
const HELP_TEXT = `
|
|
@@ -106,7 +107,7 @@ async function startRepl(options) {
|
|
|
106
107
|
let currentModel = options.model;
|
|
107
108
|
let streamMode = options.stream;
|
|
108
109
|
let verbose = false;
|
|
109
|
-
console.log(chalk_1.default.cyan(`\nLLMTune CLI
|
|
110
|
+
console.log(chalk_1.default.cyan(`\nLLMTune CLI v${version_1.CLI_VERSION}`));
|
|
110
111
|
console.log(chalk_1.default.dim(`Model: ${currentModel}`));
|
|
111
112
|
console.log(chalk_1.default.dim(`Tools: ${registry.listSpecs().map((s) => s.name).join(", ")}`));
|
|
112
113
|
if (skillList.length > 0) {
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.webFetchTool = void 0;
|
|
7
7
|
const https_1 = __importDefault(require("https"));
|
|
8
8
|
const http_1 = __importDefault(require("http"));
|
|
9
|
+
const version_1 = require("../../version");
|
|
9
10
|
const MAX_RESPONSE_SIZE = 500_000;
|
|
10
11
|
const TIMEOUT_MS = 30_000;
|
|
11
12
|
exports.webFetchTool = {
|
|
@@ -68,7 +69,7 @@ exports.webFetchTool = {
|
|
|
68
69
|
const req = lib.request(url, {
|
|
69
70
|
method,
|
|
70
71
|
headers: {
|
|
71
|
-
"User-Agent":
|
|
72
|
+
"User-Agent": `LLMTune-CLI/${version_1.CLI_VERSION}`,
|
|
72
73
|
Accept: "text/html,application/json,text/plain,*/*",
|
|
73
74
|
...headers,
|
|
74
75
|
},
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CLI_VERSION = void 0;
|
|
7
|
+
const package_json_1 = __importDefault(require("../package.json"));
|
|
8
|
+
exports.CLI_VERSION = package_json_1.default.version;
|
|
9
|
+
//# sourceMappingURL=version.js.map
|