staklink 0.4.22 → 0.4.23
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/proxy-server.cjs +18 -18
- package/dist/staklink-cli.cjs +1 -1
- package/package.json +1 -1
package/dist/proxy-server.cjs
CHANGED
|
@@ -60927,7 +60927,7 @@ var SSEManager = class {
|
|
|
60927
60927
|
var sseManager = new SSEManager();
|
|
60928
60928
|
|
|
60929
60929
|
// src/proxy/version.ts
|
|
60930
|
-
var VERSION = "0.4.
|
|
60930
|
+
var VERSION = "0.4.23";
|
|
60931
60931
|
|
|
60932
60932
|
// node_modules/uuid/dist/esm/stringify.js
|
|
60933
60933
|
var byteToHex = [];
|
|
@@ -137683,7 +137683,7 @@ async function runAgent({
|
|
|
137683
137683
|
}) {
|
|
137684
137684
|
createGooseConfig(searchApiKey, mcpServers);
|
|
137685
137685
|
const env2 = goose_env(apiKey, model);
|
|
137686
|
-
|
|
137686
|
+
log("RUN goose with env", env2);
|
|
137687
137687
|
const safePrompt = prompt.startsWith("-") ? `
|
|
137688
137688
|
${prompt}` : prompt;
|
|
137689
137689
|
const cleanPrompt = sanitizeShellArg(safePrompt);
|
|
@@ -137691,7 +137691,7 @@ ${prompt}` : prompt;
|
|
|
137691
137691
|
system += system_prompt ? sanitizeShellArg(system_prompt) + "\n\n" : "";
|
|
137692
137692
|
system += SYSTEM_SUFFIX;
|
|
137693
137693
|
system = sanitizeShellArg(system);
|
|
137694
|
-
|
|
137694
|
+
log("Using Goose CLI", cleanPrompt, system);
|
|
137695
137695
|
let cmd = `goose run --with-builtin developer -t "${cleanPrompt}" --system "${system}"`;
|
|
137696
137696
|
if (session) {
|
|
137697
137697
|
session = sanitizeShellArg(session);
|
|
@@ -137703,14 +137703,14 @@ ${prompt}` : prompt;
|
|
|
137703
137703
|
} catch {
|
|
137704
137704
|
}
|
|
137705
137705
|
}
|
|
137706
|
-
let res = await executeCommand(cmd, cwd, env2, (l) =>
|
|
137706
|
+
let res = await executeCommand(cmd, cwd, env2, (l) => log(l));
|
|
137707
137707
|
if (session && isStreamDecodeError(res.stdout)) {
|
|
137708
137708
|
const maxRetries = 2;
|
|
137709
137709
|
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
|
137710
|
-
|
|
137710
|
+
log(`Stream decode error detected, retrying (${attempt}/${maxRetries})...`);
|
|
137711
137711
|
await new Promise((r) => setTimeout(r, 2e3 * attempt));
|
|
137712
137712
|
const retryCmd = `goose run --with-builtin developer -t "continue" --system "${system}" --name ${session} --resume`;
|
|
137713
|
-
res = await executeCommand(retryCmd, cwd, env2, (l) =>
|
|
137713
|
+
res = await executeCommand(retryCmd, cwd, env2, (l) => log(l));
|
|
137714
137714
|
if (!isStreamDecodeError(res.stdout)) break;
|
|
137715
137715
|
}
|
|
137716
137716
|
}
|
|
@@ -137788,9 +137788,9 @@ function createGooseConfig(exaApiKey, mcpServers) {
|
|
|
137788
137788
|
fs8.mkdirSync(configDir, { recursive: true });
|
|
137789
137789
|
}
|
|
137790
137790
|
fs8.writeFileSync(configPath, configContent, "utf-8");
|
|
137791
|
-
|
|
137791
|
+
log(`Created goose config at ${configPath}`);
|
|
137792
137792
|
} catch (error88) {
|
|
137793
|
-
|
|
137793
|
+
warn("Error creating goose config:", error88);
|
|
137794
137794
|
}
|
|
137795
137795
|
}
|
|
137796
137796
|
async function runGooseWeb(apiKey, cwd, port) {
|
|
@@ -137813,7 +137813,7 @@ async function runGooseWeb(apiKey, cwd, port) {
|
|
|
137813
137813
|
env: env2
|
|
137814
137814
|
});
|
|
137815
137815
|
} catch (error88) {
|
|
137816
|
-
|
|
137816
|
+
error("Error occurred while starting Goose:", error88);
|
|
137817
137817
|
}
|
|
137818
137818
|
}
|
|
137819
137819
|
|
|
@@ -137833,7 +137833,7 @@ async function runAgent2({
|
|
|
137833
137833
|
if (!prompt) {
|
|
137834
137834
|
throw new Error("Missing prompt");
|
|
137835
137835
|
}
|
|
137836
|
-
|
|
137836
|
+
log("runAgent called with:", {
|
|
137837
137837
|
prompt,
|
|
137838
137838
|
apiKey: apiKey ? "***" : "undefined",
|
|
137839
137839
|
cwd
|
|
@@ -137865,7 +137865,7 @@ async function runAgent2({
|
|
|
137865
137865
|
}
|
|
137866
137866
|
};
|
|
137867
137867
|
} catch (error88) {
|
|
137868
|
-
|
|
137868
|
+
log("Model error:", error88);
|
|
137869
137869
|
throw error88;
|
|
137870
137870
|
}
|
|
137871
137871
|
}
|
|
@@ -137875,7 +137875,7 @@ function findClaudePath() {
|
|
|
137875
137875
|
if (!claudePath) {
|
|
137876
137876
|
throw new Error("Claude CLI not found in PATH");
|
|
137877
137877
|
}
|
|
137878
|
-
|
|
137878
|
+
log("Found Claude CLI at:", claudePath);
|
|
137879
137879
|
return claudePath;
|
|
137880
137880
|
} catch (error88) {
|
|
137881
137881
|
throw new Error(`Could not find Claude CLI: ${error88}`);
|
|
@@ -139357,7 +139357,7 @@ async function runAgent3({
|
|
|
139357
139357
|
let system = SYSTEM_CORE;
|
|
139358
139358
|
system += system_prompt ? system_prompt + "\n\n" : "";
|
|
139359
139359
|
system += SYSTEM_SUFFIX;
|
|
139360
|
-
|
|
139360
|
+
log("Codex agent using API key:", apiKey ? `${apiKey.substring(0, 8)}...` : "MISSING");
|
|
139361
139361
|
if (apiKey) {
|
|
139362
139362
|
writeCodexAuth(apiKey);
|
|
139363
139363
|
}
|
|
@@ -139566,13 +139566,13 @@ var parseValidationResponse = (rawResponse) => {
|
|
|
139566
139566
|
async function streamGooseToSSE(sessionId, prompt, apiKey, res, options) {
|
|
139567
139567
|
let resume = false;
|
|
139568
139568
|
try {
|
|
139569
|
-
|
|
139569
|
+
log("Exporting session", sessionId);
|
|
139570
139570
|
exportSession(sessionId, "assistant");
|
|
139571
139571
|
resume = true;
|
|
139572
|
-
|
|
139572
|
+
log("Session exists, resume");
|
|
139573
139573
|
} catch (error88) {
|
|
139574
|
-
|
|
139575
|
-
|
|
139574
|
+
log("Error exporting session", error88);
|
|
139575
|
+
log("Session doesn't exist, don't resume");
|
|
139576
139576
|
}
|
|
139577
139577
|
log("Streaming Goose to SSE", { sessionId, prompt, apiKey, resume, model: options?.model });
|
|
139578
139578
|
createGooseConfig(options?.searchApiKey);
|
|
@@ -139751,7 +139751,7 @@ async function streamCodexToSSE(sessionId, prompt, apiKey, res, options) {
|
|
|
139751
139751
|
ensureSessionsDir();
|
|
139752
139752
|
const sessionPath = getSessionPath(sessionId);
|
|
139753
139753
|
log("Streaming Codex to SSE", { sessionId, prompt, sessionPath });
|
|
139754
|
-
|
|
139754
|
+
log("Codex streaming using API key:", apiKey ? `${apiKey.substring(0, 8)}...` : "MISSING");
|
|
139755
139755
|
if (apiKey) {
|
|
139756
139756
|
writeCodexAuth(apiKey);
|
|
139757
139757
|
}
|
package/dist/staklink-cli.cjs
CHANGED
|
@@ -11004,7 +11004,7 @@ var glob = Object.assign(glob_, {
|
|
|
11004
11004
|
glob.glob = glob;
|
|
11005
11005
|
|
|
11006
11006
|
// src/proxy/version.ts
|
|
11007
|
-
var VERSION = "0.4.
|
|
11007
|
+
var VERSION = "0.4.23";
|
|
11008
11008
|
|
|
11009
11009
|
// src/deps.ts
|
|
11010
11010
|
var import_child_process = require("child_process");
|