@tiens.nguyen/gonext-local-worker 1.0.230 → 1.0.231
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/gonext-repl.mjs +26 -3
- package/package.json +1 -1
package/gonext-repl.mjs
CHANGED
|
@@ -516,6 +516,19 @@ async function loadSessionTestAuto(cwd) {
|
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
518
|
|
|
519
|
+
// The /server deploy-target pick is also remembered per folder, so a fresh terminal in
|
|
520
|
+
// the same project still knows where to deploy (task #69 — it was session-only and got
|
|
521
|
+
// lost on restart). Returns {name,host,user} or null.
|
|
522
|
+
async function loadSessionServer(cwd) {
|
|
523
|
+
try {
|
|
524
|
+
const raw = JSON.parse(await readFile(sessionFilePath(cwd), "utf8"));
|
|
525
|
+
const s = raw?.deployServer;
|
|
526
|
+
return s && typeof s.host === "string" && typeof s.user === "string" ? s : null;
|
|
527
|
+
} catch {
|
|
528
|
+
return null;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
|
|
519
532
|
async function saveSession(cwd, history) {
|
|
520
533
|
try {
|
|
521
534
|
await mkdir(SESSIONS_DIR, { recursive: true });
|
|
@@ -523,7 +536,13 @@ async function saveSession(cwd, history) {
|
|
|
523
536
|
await writeFile(
|
|
524
537
|
sessionFilePath(cwd),
|
|
525
538
|
JSON.stringify(
|
|
526
|
-
{
|
|
539
|
+
{
|
|
540
|
+
cwd,
|
|
541
|
+
updatedAt: new Date().toISOString(),
|
|
542
|
+
testAuto: sessionTestAuto,
|
|
543
|
+
deployServer: selectedServer, // remember the /server pick per folder (task #69)
|
|
544
|
+
history: trimmed,
|
|
545
|
+
},
|
|
527
546
|
null,
|
|
528
547
|
2
|
|
529
548
|
) + "\n"
|
|
@@ -1321,8 +1340,10 @@ async function runAgentTurn(history) {
|
|
|
1321
1340
|
async function main() {
|
|
1322
1341
|
console.log(cyan("GoNext agent REPL") + dim(` · API ${apiBase} · key ${workerKey.slice(0, 8)}…`));
|
|
1323
1342
|
await ensureWorkspace();
|
|
1324
|
-
// Restore this folder's remembered auto-test
|
|
1343
|
+
// Restore this folder's remembered auto-test + deploy-target so the banner + agent-ask
|
|
1344
|
+
// reflect them (both survive a fresh terminal in the same project).
|
|
1325
1345
|
sessionTestAuto = await loadSessionTestAuto(resolve(process.cwd()));
|
|
1346
|
+
selectedServer = await loadSessionServer(resolve(process.cwd()));
|
|
1326
1347
|
// Show which models will answer, straight from user settings (also validates auth).
|
|
1327
1348
|
try {
|
|
1328
1349
|
const probe = await fetchAgentPayload([{ role: "user", content: "ping" }]);
|
|
@@ -1332,7 +1353,8 @@ async function main() {
|
|
|
1332
1353
|
`agent model: ${p.agentModelId || probe?.modelKey || "?"}` +
|
|
1333
1354
|
(p.codingModelId ? ` · coder: ${p.codingModelId}` : "") +
|
|
1334
1355
|
(p.ragEnabled ? " · RAG on" : "") +
|
|
1335
|
-
` · auto-test: ${sessionTestAuto ? "on" : "off"}`
|
|
1356
|
+
` · auto-test: ${sessionTestAuto ? "on" : "off"}` +
|
|
1357
|
+
(selectedServer ? ` · deploy: ${selectedServer.name} (${selectedServer.user}@${selectedServer.host})` : "")
|
|
1336
1358
|
) + (sessionTestAuto ? "" : dim(" (/test-auto to enable)"))
|
|
1337
1359
|
);
|
|
1338
1360
|
} catch (err) {
|
|
@@ -1415,6 +1437,7 @@ async function main() {
|
|
|
1415
1437
|
}
|
|
1416
1438
|
if (line === "/server") {
|
|
1417
1439
|
await chooseServer();
|
|
1440
|
+
await saveSession(cwd, history); // remember the pick for this folder
|
|
1418
1441
|
continue;
|
|
1419
1442
|
}
|
|
1420
1443
|
if (line === "/test-auto") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiens.nguyen/gonext-local-worker",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.231",
|
|
4
4
|
"description": "Polls GoNext cloud API for async local LLM jobs and runs them against Ollama/OpenAI-compatible servers on this Mac",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|