staklink 0.3.66 → 0.3.68
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 +63 -17
- package/dist/staklink-cli.cjs +1 -1
- package/package.json +2 -2
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.68";
|
|
61233
61233
|
|
|
61234
61234
|
// node_modules/uuid/dist/esm/stringify.js
|
|
61235
61235
|
var byteToHex = [];
|
|
@@ -105427,14 +105427,32 @@ async function callModel(opts) {
|
|
|
105427
105427
|
// src/agent/summary.ts
|
|
105428
105428
|
var SYSTEM = `You are a software development expert. Your job is to summarize a software development session.`;
|
|
105429
105429
|
var makeSummaryPrompt = (sessionData) => {
|
|
105430
|
-
return `Please summarize the following software development
|
|
105430
|
+
return `Please summarize the following software development interaction:
|
|
105431
105431
|
|
|
105432
105432
|
${sessionData}
|
|
105433
105433
|
|
|
105434
|
-
Be sure to mention specific file names, or names of new functions, classes, components, data models, endpoints, or other code elements that were created or modified. For file names, use the full file path. In general, just make it easy for the user to understand what was done in
|
|
105434
|
+
Be sure to mention specific file names, or names of new functions, classes, components, data models, endpoints, or other code elements that were created or modified. For file names, use the full file path. In general, just make it easy for the user to understand what was done in this interaction.
|
|
105435
105435
|
`;
|
|
105436
105436
|
};
|
|
105437
|
+
function extractLastInteraction(messages) {
|
|
105438
|
+
if (!messages || messages.length === 0) {
|
|
105439
|
+
return [];
|
|
105440
|
+
}
|
|
105441
|
+
const result = [];
|
|
105442
|
+
let i = messages.length - 1;
|
|
105443
|
+
while (i >= 0 && (messages[i].role === "assistant" || messages[i].role === "tool")) {
|
|
105444
|
+
result.unshift(messages[i]);
|
|
105445
|
+
i--;
|
|
105446
|
+
}
|
|
105447
|
+
while (i >= 0 && messages[i].role === "user") {
|
|
105448
|
+
result.unshift(messages[i]);
|
|
105449
|
+
i--;
|
|
105450
|
+
}
|
|
105451
|
+
return result;
|
|
105452
|
+
}
|
|
105437
105453
|
async function summarizeSession(sessionData, apiKey) {
|
|
105454
|
+
const lastInteraction = extractLastInteraction(sessionData);
|
|
105455
|
+
const dataToSummarize = JSON.stringify(lastInteraction, null, 2);
|
|
105438
105456
|
const systemMessage = {
|
|
105439
105457
|
role: "system",
|
|
105440
105458
|
content: SYSTEM
|
|
@@ -105444,7 +105462,7 @@ async function summarizeSession(sessionData, apiKey) {
|
|
|
105444
105462
|
content: [
|
|
105445
105463
|
{
|
|
105446
105464
|
type: "text",
|
|
105447
|
-
text: makeSummaryPrompt(
|
|
105465
|
+
text: makeSummaryPrompt(dataToSummarize)
|
|
105448
105466
|
}
|
|
105449
105467
|
]
|
|
105450
105468
|
};
|
|
@@ -121054,6 +121072,8 @@ var GooseLanguageModel = class {
|
|
|
121054
121072
|
const env = {
|
|
121055
121073
|
// Skip goose configure prompt - allows using goose without setup
|
|
121056
121074
|
CONFIGURE: "false",
|
|
121075
|
+
GOOSE_MODE: "auto",
|
|
121076
|
+
GOOSE_CONTEXT_STRATEGY: "summarize",
|
|
121057
121077
|
...this.settings.env
|
|
121058
121078
|
};
|
|
121059
121079
|
if (this.parsedProvider && this.parsedModel) {
|
|
@@ -121257,7 +121277,10 @@ var GooseLanguageModel = class {
|
|
|
121257
121277
|
type: "tool-call",
|
|
121258
121278
|
toolCallId: content.id || generateId3(),
|
|
121259
121279
|
toolName: content.toolCall.value.name,
|
|
121260
|
-
input: JSON.stringify(content.toolCall.value.arguments)
|
|
121280
|
+
input: JSON.stringify(content.toolCall.value.arguments),
|
|
121281
|
+
// Mark as provider-executed so AI SDK doesn't try to execute it
|
|
121282
|
+
providerExecuted: true,
|
|
121283
|
+
dynamic: true
|
|
121261
121284
|
};
|
|
121262
121285
|
}
|
|
121263
121286
|
}
|
|
@@ -121270,7 +121293,9 @@ var GooseLanguageModel = class {
|
|
|
121270
121293
|
type: "tool-result",
|
|
121271
121294
|
toolCallId: content.id || generateId3(),
|
|
121272
121295
|
toolName: "unknown",
|
|
121273
|
-
result: resultText
|
|
121296
|
+
result: resultText,
|
|
121297
|
+
// Mark as dynamic (provider-executed) so AI SDK knows this is informational
|
|
121298
|
+
dynamic: true
|
|
121274
121299
|
};
|
|
121275
121300
|
}
|
|
121276
121301
|
}
|
|
@@ -121488,7 +121513,7 @@ function goose_env(apiKey) {
|
|
|
121488
121513
|
PATH: `${path8.join(os.homedir(), ".local", "bin")}:${process.env.PATH}`
|
|
121489
121514
|
};
|
|
121490
121515
|
}
|
|
121491
|
-
async function runAgent({ prompt, apiKey, cwd, system_prompt, session,
|
|
121516
|
+
async function runAgent({ prompt, apiKey, cwd, system_prompt, session, summarize }) {
|
|
121492
121517
|
createGooseConfig();
|
|
121493
121518
|
const env = goose_env(apiKey);
|
|
121494
121519
|
console.log("RUN goose with env", env);
|
|
@@ -121502,15 +121527,17 @@ async function runAgent({ prompt, apiKey, cwd, system_prompt, session, resume, s
|
|
|
121502
121527
|
session = sanitizeShellArg(session);
|
|
121503
121528
|
session = session.replaceAll(" ", "_");
|
|
121504
121529
|
cmd += ` --name ${session}`;
|
|
121505
|
-
|
|
121506
|
-
|
|
121507
|
-
|
|
121530
|
+
try {
|
|
121531
|
+
exportSession(session, "assistant");
|
|
121532
|
+
cmd += ` --resume`;
|
|
121533
|
+
} catch {
|
|
121534
|
+
}
|
|
121508
121535
|
}
|
|
121509
121536
|
const res = await executeCommand(cmd, cwd, env, (l) => console.log(l));
|
|
121510
121537
|
const output = res.stdout;
|
|
121511
121538
|
if (summarize && session) {
|
|
121512
121539
|
const sessionData = exportSession(session, "assistant");
|
|
121513
|
-
const summary = await summarizeSession(
|
|
121540
|
+
const summary = await summarizeSession(sessionData, apiKey);
|
|
121514
121541
|
return { output, summary };
|
|
121515
121542
|
}
|
|
121516
121543
|
return output;
|
|
@@ -132788,7 +132815,13 @@ _a153 = symbol153;
|
|
|
132788
132815
|
|
|
132789
132816
|
// src/agent/goose-streaming.ts
|
|
132790
132817
|
async function streamGooseToSSE(sessionId, prompt, apiKey, res, options) {
|
|
132791
|
-
|
|
132818
|
+
let resume = false;
|
|
132819
|
+
try {
|
|
132820
|
+
exportSession(sessionId, "assistant");
|
|
132821
|
+
resume = true;
|
|
132822
|
+
} catch {
|
|
132823
|
+
}
|
|
132824
|
+
log("Streaming Goose to SSE", { sessionId, prompt, apiKey, resume });
|
|
132792
132825
|
createGooseConfig();
|
|
132793
132826
|
const textAccumulators = /* @__PURE__ */ new Map();
|
|
132794
132827
|
try {
|
|
@@ -132796,7 +132829,7 @@ async function streamGooseToSSE(sessionId, prompt, apiKey, res, options) {
|
|
|
132796
132829
|
model: goose("anthropic/claude-sonnet-4-5", {
|
|
132797
132830
|
sessionName: sessionId,
|
|
132798
132831
|
apiKey,
|
|
132799
|
-
resume
|
|
132832
|
+
resume
|
|
132800
132833
|
}),
|
|
132801
132834
|
prompt,
|
|
132802
132835
|
system: options?.system
|
|
@@ -134816,7 +134849,7 @@ ${diff.trim()}`);
|
|
|
134816
134849
|
res.status(401).json({ error: "Invalid or expired token" });
|
|
134817
134850
|
return;
|
|
134818
134851
|
}
|
|
134819
|
-
const { prompt, system
|
|
134852
|
+
const { prompt, system } = req.body;
|
|
134820
134853
|
if (!prompt) {
|
|
134821
134854
|
res.status(400).json({
|
|
134822
134855
|
error: "Missing required field: prompt"
|
|
@@ -134833,7 +134866,7 @@ ${diff.trim()}`);
|
|
|
134833
134866
|
prompt,
|
|
134834
134867
|
session.apiKey || process.env.ANTHROPIC_API_KEY || "",
|
|
134835
134868
|
res,
|
|
134836
|
-
{ system,
|
|
134869
|
+
{ system, webhookUrl: session.webhookUrl }
|
|
134837
134870
|
);
|
|
134838
134871
|
});
|
|
134839
134872
|
app.use(requireAuth);
|
|
@@ -134857,7 +134890,7 @@ ${diff.trim()}`);
|
|
|
134857
134890
|
return async (req, res) => {
|
|
134858
134891
|
const request_id = startReq();
|
|
134859
134892
|
try {
|
|
134860
|
-
const { repoName, apiKey, agent_name, session,
|
|
134893
|
+
const { repoName, apiKey, agent_name, session, summarize } = req.body;
|
|
134861
134894
|
const params = getParams(req);
|
|
134862
134895
|
const workspaceRoot2 = await workspaceRoot();
|
|
134863
134896
|
let repoPath = workspaceRoot2;
|
|
@@ -134878,7 +134911,6 @@ ${diff.trim()}`);
|
|
|
134878
134911
|
cwd: repoPath,
|
|
134879
134912
|
system_prompt: params.system,
|
|
134880
134913
|
session,
|
|
134881
|
-
resume: resume ? true : false,
|
|
134882
134914
|
summarize: summarize ? true : false
|
|
134883
134915
|
}).then((result) => {
|
|
134884
134916
|
const finalResult = transformResult ? transformResult(result) : result;
|
|
@@ -134896,6 +134928,20 @@ ${diff.trim()}`);
|
|
|
134896
134928
|
}
|
|
134897
134929
|
};
|
|
134898
134930
|
};
|
|
134931
|
+
app.post("/validate_session", async (req, res) => {
|
|
134932
|
+
log("===> POST /validate_session");
|
|
134933
|
+
const { session } = req.body;
|
|
134934
|
+
if (!session) {
|
|
134935
|
+
res.status(400).json({ error: "Missing required field: session" });
|
|
134936
|
+
return;
|
|
134937
|
+
}
|
|
134938
|
+
try {
|
|
134939
|
+
exportSession(session, "assistant");
|
|
134940
|
+
res.json({ exists: true });
|
|
134941
|
+
} catch (error87) {
|
|
134942
|
+
res.json({ exists: false });
|
|
134943
|
+
}
|
|
134944
|
+
});
|
|
134899
134945
|
app.post(
|
|
134900
134946
|
"/agent",
|
|
134901
134947
|
createAsyncAgentHandler((req) => ({
|
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.68";
|
|
10971
10971
|
|
|
10972
10972
|
// src/cli.ts
|
|
10973
10973
|
var STAKLINK_PROXY = "staklink-proxy";
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "staklink",
|
|
3
3
|
"displayName": "staklink",
|
|
4
4
|
"description": "staklink process manager",
|
|
5
|
-
"version": "0.3.
|
|
5
|
+
"version": "0.3.68",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"publisher": "stakwork",
|
|
8
8
|
"engines": {
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
"@ai-sdk/google": "^3.0.6",
|
|
119
119
|
"@types/jsonwebtoken": "^9.0.10",
|
|
120
120
|
"ai": "^6.0.26",
|
|
121
|
-
"ai-sdk-provider-goose": "^0.1.
|
|
121
|
+
"ai-sdk-provider-goose": "^0.1.9",
|
|
122
122
|
"aieo": "^0.1.29",
|
|
123
123
|
"async-mutex": "^0.5.0",
|
|
124
124
|
"commander": "^14.0.1",
|