staklink 0.3.92 → 0.4.1

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.
@@ -61258,7 +61258,7 @@ var SSEManager = class {
61258
61258
  var sseManager = new SSEManager();
61259
61259
 
61260
61260
  // src/proxy/version.ts
61261
- var VERSION = "0.3.92";
61261
+ var VERSION = "0.4.1";
61262
61262
 
61263
61263
  // node_modules/uuid/dist/esm/stringify.js
61264
61264
  var byteToHex = [];
@@ -139748,6 +139748,24 @@ async function startProxyServer() {
139748
139748
  res.json({ exists: false });
139749
139749
  }
139750
139750
  });
139751
+ app.get("/agent/session", async (req, res) => {
139752
+ log("===> GET /agent/session");
139753
+ const sessionId = req.query.sessionId || req.query.session_id;
139754
+ if (!sessionId) {
139755
+ res.status(400).json({ error: "Missing required query parameter: sessionId" });
139756
+ return;
139757
+ }
139758
+ try {
139759
+ const messages = exportSession(sessionId, "assistant");
139760
+ res.json({ success: true, messages });
139761
+ } catch (error87) {
139762
+ error("Error exporting session:", error87);
139763
+ res.status(404).json({
139764
+ success: false,
139765
+ error: error87 instanceof Error ? error87.message : "Session not found"
139766
+ });
139767
+ }
139768
+ });
139751
139769
  app.post(
139752
139770
  "/agent",
139753
139771
  createAsyncAgentHandler((req) => ({
@@ -10967,13 +10967,18 @@ var glob = Object.assign(glob_, {
10967
10967
  glob.glob = glob;
10968
10968
 
10969
10969
  // src/proxy/version.ts
10970
- var VERSION = "0.3.92";
10970
+ var VERSION = "0.4.1";
10971
10971
 
10972
- // src/goose.ts
10972
+ // src/deps.ts
10973
10973
  var import_child_process = require("child_process");
10974
10974
  var import_util2 = require("util");
10975
10975
  var execAsync = (0, import_util2.promisify)(import_child_process.exec);
10976
10976
  var GOOSE_VERSION = "1.22.0";
10977
+ async function ensureDepsInstalled() {
10978
+ await ensureGooseInstalled();
10979
+ await ensureAgentBrowserInstalled();
10980
+ await ensureAgentBrowserSkillInstalled();
10981
+ }
10977
10982
  async function ensureGooseInstalled() {
10978
10983
  try {
10979
10984
  const { stdout } = await execAsync("goose --version");
@@ -11003,6 +11008,52 @@ async function installGoose() {
11003
11008
  console.error("\u26A0\uFE0F Failed to install Goose:", error2);
11004
11009
  }
11005
11010
  }
11011
+ async function ensureAgentBrowserInstalled() {
11012
+ try {
11013
+ await execAsync("agent-browser --version");
11014
+ console.log("\u2705 agent-browser is already installed");
11015
+ } catch {
11016
+ console.log("\u{1F4E6} agent-browser not found, installing...");
11017
+ await installAgentBrowser();
11018
+ }
11019
+ }
11020
+ async function installAgentBrowser() {
11021
+ try {
11022
+ console.log("\u{1F4E6} Installing agent-browser...");
11023
+ await execAsync("npm install -g agent-browser");
11024
+ console.log("\u{1F4E6} Running agent-browser install...");
11025
+ await execAsync("agent-browser install");
11026
+ console.log("\u2705 agent-browser installed successfully");
11027
+ } catch (error2) {
11028
+ console.error("\u26A0\uFE0F Failed to install agent-browser:", error2);
11029
+ }
11030
+ }
11031
+ var AGENT_BROWSER_SKILL_NAME = "agent-browser";
11032
+ var AGENT_BROWSER_SKILL_REPO = "https://github.com/vercel-labs/agent-browser";
11033
+ async function ensureAgentBrowserSkillInstalled() {
11034
+ try {
11035
+ const { stdout } = await execAsync("npx skills ls -g");
11036
+ if (stdout.includes(AGENT_BROWSER_SKILL_NAME)) {
11037
+ console.log(`\u2705 Skill "${AGENT_BROWSER_SKILL_NAME}" is already installed`);
11038
+ return;
11039
+ }
11040
+ console.log(`\u{1F4E6} Installing ${AGENT_BROWSER_SKILL_NAME} skill...`);
11041
+ await installAgentBrowserSkill();
11042
+ } catch {
11043
+ console.log(`\u{1F4E6} Installing ${AGENT_BROWSER_SKILL_NAME} skill...`);
11044
+ await installAgentBrowserSkill();
11045
+ }
11046
+ }
11047
+ async function installAgentBrowserSkill() {
11048
+ try {
11049
+ await execAsync(
11050
+ `npx skills add ${AGENT_BROWSER_SKILL_REPO} --skill ${AGENT_BROWSER_SKILL_NAME} -g -y`
11051
+ );
11052
+ console.log(`\u2705 Skill "${AGENT_BROWSER_SKILL_NAME}" installed successfully`);
11053
+ } catch (error2) {
11054
+ console.error(`\u26A0\uFE0F Failed to install ${AGENT_BROWSER_SKILL_NAME} skill:`, error2);
11055
+ }
11056
+ }
11006
11057
 
11007
11058
  // src/cli.ts
11008
11059
  var STAKLINK_PROXY = "staklink-proxy";
@@ -11048,7 +11099,7 @@ program2.command("start").description("Start the staklink proxy server").action(
11048
11099
  const root = await workspaceRoot();
11049
11100
  const proxyServerPath = getProxyPath();
11050
11101
  console.log("Starting staklink proxy server...");
11051
- await ensureGooseInstalled();
11102
+ await ensureDepsInstalled();
11052
11103
  console.log(`Workspace root: ${root}`);
11053
11104
  console.log(`Proxy server path: ${proxyServerPath}`);
11054
11105
  const runner = new Runner(root, console.log);
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.92",
5
+ "version": "0.4.1",
6
6
  "type": "module",
7
7
  "publisher": "stakwork",
8
8
  "engines": {