@appchy/jarvis 0.1.5 → 0.1.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/bin.js +23 -13
- package/dist/bin.js.map +1 -1
- package/package.json +2 -2
package/dist/bin.js
CHANGED
|
@@ -388,7 +388,7 @@ function claudeCodeProvider(config = {}) {
|
|
|
388
388
|
options: {
|
|
389
389
|
model: req.model,
|
|
390
390
|
systemPrompt: systemPromptOption,
|
|
391
|
-
maxTurns: config.maxTurns
|
|
391
|
+
...config.maxTurns ? { maxTurns: config.maxTurns } : {},
|
|
392
392
|
...permissionOptions,
|
|
393
393
|
...config.mcpServers ? { mcpServers: config.mcpServers } : {},
|
|
394
394
|
...config.workingDirectory ? { cwd: config.workingDirectory } : {},
|
|
@@ -557,7 +557,7 @@ function claudeCodeProvider(config = {}) {
|
|
|
557
557
|
options: {
|
|
558
558
|
model: req.model,
|
|
559
559
|
systemPrompt: streamSystemPromptOption,
|
|
560
|
-
maxTurns: config.maxTurns
|
|
560
|
+
...config.maxTurns ? { maxTurns: config.maxTurns } : {},
|
|
561
561
|
...permissionOptions,
|
|
562
562
|
...config.mcpServers ? { mcpServers: config.mcpServers } : {},
|
|
563
563
|
...config.workingDirectory ? { cwd: config.workingDirectory } : {},
|
|
@@ -2056,7 +2056,7 @@ function createWsProgressHandlers(deps) {
|
|
|
2056
2056
|
id: `status-plan-${crypto2.randomUUID()}`,
|
|
2057
2057
|
role: "assistant",
|
|
2058
2058
|
type: "status",
|
|
2059
|
-
content: "Planning
|
|
2059
|
+
content: "Planning",
|
|
2060
2060
|
isPartial: true,
|
|
2061
2061
|
createdAt: now
|
|
2062
2062
|
});
|
|
@@ -2238,7 +2238,7 @@ function createAgent(deps) {
|
|
|
2238
2238
|
systemPrompt: systemMsg?.content ?? "",
|
|
2239
2239
|
workingDirectory: wsPath,
|
|
2240
2240
|
tools: claudeCodeTools,
|
|
2241
|
-
maxTurns: msg.maxTurns
|
|
2241
|
+
...msg.maxTurns ? { maxTurns: msg.maxTurns } : {},
|
|
2242
2242
|
userId: deps.userId,
|
|
2243
2243
|
abortController,
|
|
2244
2244
|
heartbeat: () => {
|
|
@@ -2266,7 +2266,7 @@ function createAgent(deps) {
|
|
|
2266
2266
|
...deps.useSubscription ? { useSubscription: true } : { apiKey: deps.anthropicApiKey },
|
|
2267
2267
|
workingDirectory: wsPath,
|
|
2268
2268
|
tools: claudeCodeTools,
|
|
2269
|
-
maxTurns: msg.maxTurns
|
|
2269
|
+
...msg.maxTurns ? { maxTurns: msg.maxTurns } : {},
|
|
2270
2270
|
userId: deps.userId,
|
|
2271
2271
|
abortController,
|
|
2272
2272
|
heartbeat: () => {
|
|
@@ -4664,6 +4664,9 @@ async function waitForAgent(port, maxAttempts = 30) {
|
|
|
4664
4664
|
}
|
|
4665
4665
|
|
|
4666
4666
|
// src/cli.ts
|
|
4667
|
+
import { createRequire } from "module";
|
|
4668
|
+
var _require = createRequire(import.meta.url);
|
|
4669
|
+
var PKG_VERSION = _require("../package.json").version ?? "dev";
|
|
4667
4670
|
var LOG_DIR = path7.join(os4.homedir(), ".jarvis");
|
|
4668
4671
|
var LOG_FILE = path7.join(LOG_DIR, "agent.log");
|
|
4669
4672
|
var PID_FILE = path7.join(LOG_DIR, "agent.pid");
|
|
@@ -4693,7 +4696,7 @@ function clearPid() {
|
|
|
4693
4696
|
}
|
|
4694
4697
|
}
|
|
4695
4698
|
function createCli() {
|
|
4696
|
-
const program = new Command().name("jarvis").description("Jarvis local agent \u2014 runs Claude Code on your machine").version(
|
|
4699
|
+
const program = new Command().name("jarvis").description("Jarvis local agent \u2014 runs Claude Code on your machine").version(PKG_VERSION);
|
|
4697
4700
|
program.command("connect <token>").description("Connect to Jarvis cloud using a token from the web UI").option("-w, --workspace <path>", "Workspace root path for repo operations").action((token, opts) => {
|
|
4698
4701
|
try {
|
|
4699
4702
|
const parsed = parseConnectToken(token);
|
|
@@ -4762,12 +4765,19 @@ function createCli() {
|
|
|
4762
4765
|
args.push("--api-key", anthropicApiKey);
|
|
4763
4766
|
}
|
|
4764
4767
|
const binPath = process.argv[1];
|
|
4765
|
-
const
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
|
|
4768
|
+
const cliRoot = path7.resolve(path7.dirname(binPath), "..");
|
|
4769
|
+
const distEntry = path7.join(cliRoot, "dist", "bin.js");
|
|
4770
|
+
const useDistEntry = fs7.existsSync(distEntry);
|
|
4771
|
+
const child = spawn2(
|
|
4772
|
+
process.execPath,
|
|
4773
|
+
useDistEntry ? [distEntry, ...args] : [binPath, ...args],
|
|
4774
|
+
{
|
|
4775
|
+
detached: true,
|
|
4776
|
+
stdio: ["ignore", logFd, logFd],
|
|
4777
|
+
cwd: workspacePath,
|
|
4778
|
+
env: { ...process.env, NODE_NO_WARNINGS: "1" }
|
|
4779
|
+
}
|
|
4780
|
+
);
|
|
4771
4781
|
child.unref();
|
|
4772
4782
|
fs7.closeSync(logFd);
|
|
4773
4783
|
savePid(child.pid);
|
|
@@ -4858,7 +4868,7 @@ function createCli() {
|
|
|
4858
4868
|
const pid = readPid();
|
|
4859
4869
|
const port = config?.port ?? 7862;
|
|
4860
4870
|
const running = await isPortInUse(port);
|
|
4861
|
-
console.log(
|
|
4871
|
+
console.log(`Jarvis Agent v${PKG_VERSION}:`);
|
|
4862
4872
|
console.log(` Status: ${running ? `\x1B[32mrunning\x1B[0m` : `\x1B[31mstopped\x1B[0m`}${pid ? ` (PID: ${pid})` : ""}`);
|
|
4863
4873
|
console.log(` Port: ${port}`);
|
|
4864
4874
|
console.log(` Config: ${getConfigPath()}`);
|