staklink 0.3.68 → 0.3.70
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 +20 -4
- package/dist/staklink-cli.cjs +1 -1
- package/package.json +1 -1
package/dist/proxy-server.cjs
CHANGED
|
@@ -61229,7 +61229,7 @@ var SSEManager = class {
|
|
|
61229
61229
|
var sseManager = new SSEManager();
|
|
61230
61230
|
|
|
61231
61231
|
// src/proxy/version.ts
|
|
61232
|
-
var VERSION = "0.3.
|
|
61232
|
+
var VERSION = "0.3.70";
|
|
61233
61233
|
|
|
61234
61234
|
// node_modules/uuid/dist/esm/stringify.js
|
|
61235
61235
|
var byteToHex = [];
|
|
@@ -132817,9 +132817,13 @@ _a153 = symbol153;
|
|
|
132817
132817
|
async function streamGooseToSSE(sessionId, prompt, apiKey, res, options) {
|
|
132818
132818
|
let resume = false;
|
|
132819
132819
|
try {
|
|
132820
|
+
console.log("Exporting session", sessionId);
|
|
132820
132821
|
exportSession(sessionId, "assistant");
|
|
132821
132822
|
resume = true;
|
|
132822
|
-
|
|
132823
|
+
console.log("Session exists, resume");
|
|
132824
|
+
} catch (error87) {
|
|
132825
|
+
console.log("Error exporting session", error87);
|
|
132826
|
+
console.log("Session doesn't exist, don't resume");
|
|
132823
132827
|
}
|
|
132824
132828
|
log("Streaming Goose to SSE", { sessionId, prompt, apiKey, resume });
|
|
132825
132829
|
createGooseConfig();
|
|
@@ -132835,7 +132839,6 @@ async function streamGooseToSSE(sessionId, prompt, apiKey, res, options) {
|
|
|
132835
132839
|
system: options?.system
|
|
132836
132840
|
});
|
|
132837
132841
|
for await (const part of result.fullStream) {
|
|
132838
|
-
log("Stream part received:", JSON.stringify(part));
|
|
132839
132842
|
sendSSE(res, "message", part);
|
|
132840
132843
|
if (options?.webhookUrl) {
|
|
132841
132844
|
const p = part;
|
|
@@ -132878,7 +132881,7 @@ async function streamGooseToSSE(sessionId, prompt, apiKey, res, options) {
|
|
|
132878
132881
|
type: "tool-result",
|
|
132879
132882
|
toolCallId: p.toolCallId,
|
|
132880
132883
|
toolName: p.toolName,
|
|
132881
|
-
output: p.output,
|
|
132884
|
+
output: truncateOutput(p.output),
|
|
132882
132885
|
timestamp: Date.now()
|
|
132883
132886
|
}).catch((error87) => error("Error posting to webhook", error87));
|
|
132884
132887
|
break;
|
|
@@ -132901,6 +132904,19 @@ function sendSSE(res, event, data) {
|
|
|
132901
132904
|
`);
|
|
132902
132905
|
}
|
|
132903
132906
|
}
|
|
132907
|
+
function truncateOutput(output) {
|
|
132908
|
+
const str = typeof output === "string" ? output : JSON.stringify(output);
|
|
132909
|
+
const lines = str.split("\n");
|
|
132910
|
+
const maxLines = 10;
|
|
132911
|
+
const maxLineLength = 100;
|
|
132912
|
+
const truncatedLines = lines.slice(0, maxLines).map(
|
|
132913
|
+
(line) => line.length > maxLineLength ? line.slice(0, maxLineLength) + "..." : line
|
|
132914
|
+
);
|
|
132915
|
+
if (lines.length > maxLines) {
|
|
132916
|
+
truncatedLines.push("[truncated]");
|
|
132917
|
+
}
|
|
132918
|
+
return truncatedLines.join("\n");
|
|
132919
|
+
}
|
|
132904
132920
|
async function postToWebhook(url3, payload) {
|
|
132905
132921
|
try {
|
|
132906
132922
|
const response = await fetch(url3, {
|
package/dist/staklink-cli.cjs
CHANGED
|
@@ -10967,7 +10967,7 @@ var glob = Object.assign(glob_, {
|
|
|
10967
10967
|
glob.glob = glob;
|
|
10968
10968
|
|
|
10969
10969
|
// src/proxy/version.ts
|
|
10970
|
-
var VERSION = "0.3.
|
|
10970
|
+
var VERSION = "0.3.70";
|
|
10971
10971
|
|
|
10972
10972
|
// src/cli.ts
|
|
10973
10973
|
var STAKLINK_PROXY = "staklink-proxy";
|