staklink 0.3.78 → 0.3.79

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.
@@ -61213,7 +61213,7 @@ var SSEManager = class {
61213
61213
  var sseManager = new SSEManager();
61214
61214
 
61215
61215
  // src/proxy/version.ts
61216
- var VERSION = "0.3.78";
61216
+ var VERSION = "0.3.79";
61217
61217
 
61218
61218
  // node_modules/uuid/dist/esm/stringify.js
61219
61219
  var byteToHex = [];
@@ -121586,9 +121586,10 @@ async function runAgent({
121586
121586
  system_prompt,
121587
121587
  session,
121588
121588
  summarize,
121589
- model
121589
+ model,
121590
+ searchApiKey
121590
121591
  }) {
121591
- createGooseConfig();
121592
+ createGooseConfig(searchApiKey);
121592
121593
  const env = goose_env(apiKey, model);
121593
121594
  console.log("RUN goose with env", env);
121594
121595
  const cleanPrompt = sanitizeShellArg(prompt);
@@ -121607,6 +121608,9 @@ async function runAgent({
121607
121608
  } catch {
121608
121609
  }
121609
121610
  }
121611
+ if (searchApiKey) {
121612
+ cmd += ` --with-streamable-http-extension "https://mcp.exa.ai/mcp?exaApiKey=${searchApiKey}"`;
121613
+ }
121610
121614
  const res = await executeCommand(cmd, cwd, env, (l) => console.log(l));
121611
121615
  const output = res.stdout;
121612
121616
  if (summarize && session) {
@@ -121616,10 +121620,10 @@ async function runAgent({
121616
121620
  }
121617
121621
  return output;
121618
121622
  }
121619
- function createGooseConfig() {
121623
+ function createGooseConfig(exaApiKey) {
121620
121624
  const configDir = path7.join(os.homedir(), ".config", "goose");
121621
121625
  const configPath = path7.join(configDir, "config.yaml");
121622
- const configContent = `extensions:
121626
+ let configContent = `extensions:
121623
121627
  extension_name:
121624
121628
  bundled: true
121625
121629
  display_name: "Dev"
@@ -121628,6 +121632,17 @@ function createGooseConfig() {
121628
121632
  timeout: 300
121629
121633
  type: "builtin"
121630
121634
  `;
121635
+ if (exaApiKey) {
121636
+ configContent += `
121637
+ exa:
121638
+ enabled: true
121639
+ type: streamable_http
121640
+ name: exa
121641
+ description: "Search the web and github"
121642
+ uri: https://mcp.exa.ai/mcp?exaApiKey=2f23c2d5-9304-43e7-986f-e73596406e98
121643
+ timeout: 300
121644
+ `;
121645
+ }
121631
121646
  try {
121632
121647
  if (!fs8.existsSync(configDir)) {
121633
121648
  fs8.mkdirSync(configDir, { recursive: true });
@@ -132901,7 +132916,7 @@ async function streamGooseToSSE(sessionId, prompt, apiKey, res, options) {
132901
132916
  console.log("Session doesn't exist, don't resume");
132902
132917
  }
132903
132918
  log("Streaming Goose to SSE", { sessionId, prompt, apiKey, resume });
132904
- createGooseConfig();
132919
+ createGooseConfig(options?.searchApiKey);
132905
132920
  const textAccumulators = /* @__PURE__ */ new Map();
132906
132921
  let finishData = null;
132907
132922
  try {
@@ -133043,7 +133058,7 @@ var SESSIONS = /* @__PURE__ */ new Map();
133043
133058
  function issueToken(sessionId) {
133044
133059
  return jwt3.sign({ sessionId }, JWT_SECRET, { expiresIn: TOKEN_EXPIRY });
133045
133060
  }
133046
- function createSession(sessionId, webhookUrl, apiKey) {
133061
+ function createSession(sessionId, webhookUrl, apiKey, searchApiKey) {
133047
133062
  const now3 = Date.now();
133048
133063
  const existing = SESSIONS.get(sessionId);
133049
133064
  if (existing) {
@@ -133054,6 +133069,9 @@ function createSession(sessionId, webhookUrl, apiKey) {
133054
133069
  if (apiKey !== void 0) {
133055
133070
  existing.apiKey = apiKey;
133056
133071
  }
133072
+ if (searchApiKey !== void 0) {
133073
+ existing.searchApiKey = searchApiKey;
133074
+ }
133057
133075
  return { token: issueToken(sessionId), created: false };
133058
133076
  }
133059
133077
  SESSIONS.set(sessionId, {
@@ -133061,7 +133079,8 @@ function createSession(sessionId, webhookUrl, apiKey) {
133061
133079
  createdAt: now3,
133062
133080
  lastActivity: now3,
133063
133081
  webhookUrl,
133064
- apiKey
133082
+ apiKey,
133083
+ searchApiKey
133065
133084
  });
133066
133085
  return { token: issueToken(sessionId), created: true };
133067
133086
  }
@@ -133097,7 +133116,7 @@ var createAsyncAgentHandler = (getParams, transformResult) => {
133097
133116
  return async (req, res) => {
133098
133117
  const request_id = startReq();
133099
133118
  try {
133100
- const { repoName, apiKey, agent_name, session, summarize, model } = req.body;
133119
+ const { repoName, apiKey, agent_name, session, summarize, model, searchApiKey } = req.body;
133101
133120
  const params = getParams(req);
133102
133121
  const workspaceRoot2 = await workspaceRoot();
133103
133122
  let repoPath = workspaceRoot2;
@@ -133119,7 +133138,8 @@ var createAsyncAgentHandler = (getParams, transformResult) => {
133119
133138
  system_prompt: params.system,
133120
133139
  session,
133121
133140
  summarize: summarize ? true : false,
133122
- model
133141
+ model,
133142
+ searchApiKey
133123
133143
  }).then((result) => {
133124
133144
  const finalResult = transformResult ? transformResult(result) : result;
133125
133145
  finishReq(request_id, {
@@ -135234,20 +135254,20 @@ async function startProxyServer() {
135234
135254
  prompt,
135235
135255
  session.apiKey || process.env.ANTHROPIC_API_KEY || "",
135236
135256
  res,
135237
- { system, webhookUrl: session.webhookUrl }
135257
+ { system, webhookUrl: session.webhookUrl, searchApiKey: session.searchApiKey }
135238
135258
  );
135239
135259
  clearInterval(keepAliveInterval);
135240
135260
  });
135241
135261
  app.use(requireAuth);
135242
135262
  app.post("/session", async (req, res) => {
135243
- const { sessionId, webhookUrl, apiKey } = req.body;
135263
+ const { sessionId, webhookUrl, apiKey, searchApiKey } = req.body;
135244
135264
  if (!sessionId) {
135245
135265
  res.status(400).json({
135246
135266
  error: "Missing required fields: sessionId, webhookUrl"
135247
135267
  });
135248
135268
  return;
135249
135269
  }
135250
- const { token, created } = createSession(sessionId, webhookUrl, apiKey);
135270
+ const { token, created } = createSession(sessionId, webhookUrl, apiKey, searchApiKey);
135251
135271
  res.json({
135252
135272
  sessionId,
135253
135273
  token,
@@ -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.78";
10970
+ var VERSION = "0.3.79";
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.78",
5
+ "version": "0.3.79",
6
6
  "type": "module",
7
7
  "publisher": "stakwork",
8
8
  "engines": {