@wrongstack/cli 0.256.0 → 0.257.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/index.js +45 -26
- package/dist/index.js.map +1 -1
- package/package.json +12 -12
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import { makeProviderFromConfig, capabilitiesFor, buildProviderFactoriesFromRegi
|
|
|
14
14
|
import { getProcessRegistry, builtinToolsPack, TIER1_TOOLS, rememberTool, forgetTool, searchMemoryTool, relatedMemoryTool, runStartupIndex, isIndexableFile, enqueueReindex, cancelPendingReindexes, shutdownCodebaseIndexHost, resetIndexCircuitBreaker } from '@wrongstack/tools';
|
|
15
15
|
import { DefaultSessionStore } from '@wrongstack/core/storage';
|
|
16
16
|
import { WebSocketServer, WebSocket } from 'ws';
|
|
17
|
-
import { spawn,
|
|
17
|
+
import { spawn, execFile, execFileSync } from 'child_process';
|
|
18
18
|
import { MCPRegistry, MCPServer, serveHttp, serveStdio } from '@wrongstack/mcp';
|
|
19
19
|
import * as fs2 from 'fs';
|
|
20
20
|
import { writeFileSync, existsSync, readFileSync } from 'fs';
|
|
@@ -37,8 +37,13 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
37
37
|
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
38
38
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
39
39
|
});
|
|
40
|
-
var __esm = (fn, res) => function __init() {
|
|
41
|
-
|
|
40
|
+
var __esm = (fn, res, err) => function __init() {
|
|
41
|
+
if (err) throw err[0];
|
|
42
|
+
try {
|
|
43
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
44
|
+
} catch (e) {
|
|
45
|
+
throw err = [e], e;
|
|
46
|
+
}
|
|
42
47
|
};
|
|
43
48
|
var __export = (target, all) => {
|
|
44
49
|
for (var name in all)
|
|
@@ -4549,7 +4554,7 @@ async function runWebUI(opts) {
|
|
|
4549
4554
|
opts.agent.ctx.provider.id,
|
|
4550
4555
|
opts.agent.ctx.model
|
|
4551
4556
|
);
|
|
4552
|
-
const registryMax = m?.capabilities
|
|
4557
|
+
const registryMax = m?.capabilities.maxContext;
|
|
4553
4558
|
maxContext = registryMax ?? opts.agent.ctx.provider.capabilities?.maxContext ?? 0;
|
|
4554
4559
|
const rates = getCostRates(m);
|
|
4555
4560
|
inputCost = rates.input;
|
|
@@ -8648,24 +8653,24 @@ var DEFAULT_TIMEOUT_MS = 6e4;
|
|
|
8648
8653
|
var MAX_OUTPUT_LINES = 500;
|
|
8649
8654
|
function runCommand(cmd, cwd, timeout) {
|
|
8650
8655
|
return new Promise((resolve10) => {
|
|
8651
|
-
|
|
8652
|
-
|
|
8653
|
-
|
|
8654
|
-
|
|
8655
|
-
|
|
8656
|
-
|
|
8657
|
-
|
|
8658
|
-
|
|
8659
|
-
|
|
8660
|
-
|
|
8661
|
-
|
|
8662
|
-
|
|
8663
|
-
|
|
8664
|
-
|
|
8665
|
-
|
|
8666
|
-
|
|
8667
|
-
}
|
|
8668
|
-
);
|
|
8656
|
+
const opts = {
|
|
8657
|
+
cwd,
|
|
8658
|
+
timeout,
|
|
8659
|
+
maxBuffer: 2 * 1024 * 1024,
|
|
8660
|
+
// 2 MB
|
|
8661
|
+
windowsHide: true,
|
|
8662
|
+
// On POSIX: no shell → command string is a literal argument.
|
|
8663
|
+
// On Windows: shell:true → cmd.exe /c "..." handles quoting.
|
|
8664
|
+
shell: process.platform === "win32" ? true : false
|
|
8665
|
+
};
|
|
8666
|
+
execFile(cmd, [], opts, (error, stdout, stderr) => {
|
|
8667
|
+
resolve10({
|
|
8668
|
+
stdout,
|
|
8669
|
+
stderr,
|
|
8670
|
+
exitCode: typeof error?.code === "number" ? error.code : 0,
|
|
8671
|
+
killed: error?.killed ?? false
|
|
8672
|
+
});
|
|
8673
|
+
});
|
|
8669
8674
|
});
|
|
8670
8675
|
}
|
|
8671
8676
|
function formatOutput(cmd, result, elapsed) {
|
|
@@ -21999,7 +22004,8 @@ init_sdd();
|
|
|
21999
22004
|
init_utils();
|
|
22000
22005
|
var DEFAULT_MAX_CONSECUTIVE_AUTO_PROCEED = 50;
|
|
22001
22006
|
function parseSuggestionsFromOutput(finalText) {
|
|
22002
|
-
const { texts } = parseNextSteps(finalText, false);
|
|
22007
|
+
const { texts, autoTexts } = parseNextSteps(finalText, false);
|
|
22008
|
+
if (autoTexts.length > 0) ;
|
|
22003
22009
|
return texts.length > 0 ? texts : null;
|
|
22004
22010
|
}
|
|
22005
22011
|
async function runRepl(opts) {
|
|
@@ -22224,13 +22230,17 @@ ${lines.join("\n")}
|
|
|
22224
22230
|
);
|
|
22225
22231
|
}
|
|
22226
22232
|
} else {
|
|
22227
|
-
const
|
|
22233
|
+
const isYolo = opts.getYolo?.() ?? false;
|
|
22234
|
+
const autoSuggestions = opts.getAutoSuggestions?.() ?? [];
|
|
22235
|
+
const useAutoSuggestions = isYolo && autoSuggestions.length > 0;
|
|
22236
|
+
const top = useAutoSuggestions ? autoSuggestions[0] ?? "" : suggestions[0] ?? "";
|
|
22228
22237
|
const delay = opts.autoProceedDelayMs ?? 1e3;
|
|
22229
22238
|
const ctrl = new AbortController();
|
|
22230
22239
|
activeCtrl = ctrl;
|
|
22231
22240
|
try {
|
|
22232
22241
|
autoIterCount++;
|
|
22233
|
-
|
|
22242
|
+
const promptToFeed = useAutoSuggestions && opts.autonomyNextPrompt ? opts.autonomyNextPrompt.replace("{{suggestion}}", top) : top;
|
|
22243
|
+
await runAutoProceed(opts, promptToFeed, delay, ctrl);
|
|
22234
22244
|
} finally {
|
|
22235
22245
|
activeCtrl = void 0;
|
|
22236
22246
|
}
|
|
@@ -22909,6 +22919,8 @@ async function execute(deps) {
|
|
|
22909
22919
|
getNextPredict,
|
|
22910
22920
|
onSuggestionsParsed,
|
|
22911
22921
|
getSuggestions: getSuggestions2,
|
|
22922
|
+
getAutoSuggestions,
|
|
22923
|
+
autonomyNextPrompt,
|
|
22912
22924
|
autoProceedDelayMs,
|
|
22913
22925
|
autoProceedMaxIterations,
|
|
22914
22926
|
brain,
|
|
@@ -23269,7 +23281,8 @@ async function execute(deps) {
|
|
|
23269
23281
|
enhanceDelayMs: cfg.autonomy?.enhanceDelayMs ?? 6e4,
|
|
23270
23282
|
enhanceEnabled: cfg.autonomy?.enhance ?? true,
|
|
23271
23283
|
enhanceLanguage: cfg.autonomy?.enhanceLanguage === "english" ? "english" : "original",
|
|
23272
|
-
mouseMode: autonomy?.mouseMode ?? false
|
|
23284
|
+
mouseMode: autonomy?.mouseMode ?? false,
|
|
23285
|
+
autonomyNextPrompt: cfg.autonomy?.autonomyNextPrompt ?? "auto {{suggestion}}"
|
|
23273
23286
|
};
|
|
23274
23287
|
},
|
|
23275
23288
|
async saveSettings(s) {
|
|
@@ -23293,6 +23306,7 @@ async function execute(deps) {
|
|
|
23293
23306
|
if (s.mouseMode !== void 0) a["mouseMode"] = s.mouseMode;
|
|
23294
23307
|
if (s.enhanceEnabled !== void 0) a["enhance"] = s.enhanceEnabled;
|
|
23295
23308
|
if (s.enhanceLanguage !== void 0) a["enhanceLanguage"] = s.enhanceLanguage;
|
|
23309
|
+
if (s.autonomyNextPrompt !== void 0) a["autonomyNextPrompt"] = s.autonomyNextPrompt;
|
|
23296
23310
|
}
|
|
23297
23311
|
);
|
|
23298
23312
|
if (s.featureMcp !== void 0 || s.featurePlugins !== void 0 || s.featureMemory !== void 0 || s.featureSkills !== void 0 || s.featureModelsRegistry !== void 0 || s.contextAutoCompact !== void 0 || s.contextStrategy !== void 0 || s.logLevel !== void 0 || s.auditLevel !== void 0 || s.indexOnStart !== void 0 || s.maxIterations !== void 0 || s.nextPrediction !== void 0 || s.debugStream !== void 0 || s.configScope !== void 0 || s.enhanceDelayMs !== void 0) {
|
|
@@ -23437,6 +23451,8 @@ async function execute(deps) {
|
|
|
23437
23451
|
onClearHistory: (dispatch) => {
|
|
23438
23452
|
dispatch({ type: "clearHistory" });
|
|
23439
23453
|
dispatch({ type: "resetContextChip" });
|
|
23454
|
+
dispatch({ type: "streamReset" });
|
|
23455
|
+
dispatch({ type: "toolStreamClear" });
|
|
23440
23456
|
},
|
|
23441
23457
|
fleetStreamController,
|
|
23442
23458
|
interruptController,
|
|
@@ -23870,6 +23886,9 @@ ${parts.join("\n")}
|
|
|
23870
23886
|
getNextPredict,
|
|
23871
23887
|
onSuggestionsParsed,
|
|
23872
23888
|
getSuggestions: getSuggestions2,
|
|
23889
|
+
getAutoSuggestions,
|
|
23890
|
+
getYolo,
|
|
23891
|
+
autonomyNextPrompt,
|
|
23873
23892
|
autoProceedDelayMs,
|
|
23874
23893
|
onValidateAutoProceed,
|
|
23875
23894
|
autoProceedMaxIterations,
|