staklink 0.4.3 → 0.4.4
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 +24 -1
- package/dist/staklink-cli.cjs +27 -27
- package/package.json +1 -1
package/dist/proxy-server.cjs
CHANGED
|
@@ -60777,7 +60777,7 @@ var SSEManager = class {
|
|
|
60777
60777
|
var sseManager = new SSEManager();
|
|
60778
60778
|
|
|
60779
60779
|
// src/proxy/version.ts
|
|
60780
|
-
var VERSION = "0.4.
|
|
60780
|
+
var VERSION = "0.4.4";
|
|
60781
60781
|
|
|
60782
60782
|
// node_modules/uuid/dist/esm/stringify.js
|
|
60783
60783
|
var byteToHex = [];
|
|
@@ -139988,6 +139988,22 @@ var SCREENSHOT_DIR = import_path3.default.join(
|
|
|
139988
139988
|
"tmp",
|
|
139989
139989
|
"screenshots"
|
|
139990
139990
|
);
|
|
139991
|
+
async function cleanupAllScreenshots() {
|
|
139992
|
+
try {
|
|
139993
|
+
const entries = await import_promises2.default.readdir(SCREENSHOT_DIR);
|
|
139994
|
+
const pngs = entries.filter((e) => e.endsWith(".png"));
|
|
139995
|
+
await Promise.all(
|
|
139996
|
+
pngs.map(
|
|
139997
|
+
(file3) => import_promises2.default.unlink(import_path3.default.join(SCREENSHOT_DIR, file3)).catch(() => {
|
|
139998
|
+
})
|
|
139999
|
+
)
|
|
140000
|
+
);
|
|
140001
|
+
if (pngs.length > 0) {
|
|
140002
|
+
log(`Cleaned up ${pngs.length} leftover screenshot(s)`);
|
|
140003
|
+
}
|
|
140004
|
+
} catch {
|
|
140005
|
+
}
|
|
140006
|
+
}
|
|
139991
140007
|
async function collectScreenshots(since) {
|
|
139992
140008
|
try {
|
|
139993
140009
|
const entries = await import_promises2.default.readdir(SCREENSHOT_DIR);
|
|
@@ -140001,6 +140017,10 @@ async function collectScreenshots(since) {
|
|
|
140001
140017
|
}
|
|
140002
140018
|
const buf = await import_promises2.default.readFile(filePath);
|
|
140003
140019
|
results.push({ filename: file3, base64: `data:image/png;base64,${buf.toString("base64")}` });
|
|
140020
|
+
try {
|
|
140021
|
+
await import_promises2.default.unlink(filePath);
|
|
140022
|
+
} catch {
|
|
140023
|
+
}
|
|
140004
140024
|
}
|
|
140005
140025
|
return results;
|
|
140006
140026
|
} catch {
|
|
@@ -142495,6 +142515,9 @@ ${logs}
|
|
|
142495
142515
|
|
|
142496
142516
|
// src/proxy/main.ts
|
|
142497
142517
|
console.log("Starting staklink proxy server...");
|
|
142518
|
+
cleanupAllScreenshots().catch((err) => {
|
|
142519
|
+
warn("Screenshot cleanup failed:", err);
|
|
142520
|
+
});
|
|
142498
142521
|
startProxyServer().catch((err) => {
|
|
142499
142522
|
error("Failed to start proxy server:", err);
|
|
142500
142523
|
process.exit(1);
|
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.4.
|
|
10970
|
+
var VERSION = "0.4.4";
|
|
10971
10971
|
|
|
10972
10972
|
// src/deps.ts
|
|
10973
10973
|
var import_child_process = require("child_process");
|
|
@@ -10977,11 +10977,18 @@ var import_os = require("os");
|
|
|
10977
10977
|
var import_path2 = require("path");
|
|
10978
10978
|
var execAsync = (0, import_util2.promisify)(import_child_process.exec);
|
|
10979
10979
|
var GOOSE_VERSION = "1.22.0";
|
|
10980
|
+
var SKILLS = [
|
|
10981
|
+
{ name: "agent-browser", repo: "https://github.com/vercel-labs/agent-browser" },
|
|
10982
|
+
{ name: "code-simplifier", repo: "https://github.com/getsentry/skills" },
|
|
10983
|
+
{ name: "frontend-design", repo: "https://github.com/anthropics/claude-code" }
|
|
10984
|
+
];
|
|
10980
10985
|
async function ensureDepsInstalled() {
|
|
10981
10986
|
await ensureGooseInstalled();
|
|
10982
10987
|
await ensureAgentBrowserInstalled();
|
|
10983
|
-
|
|
10984
|
-
|
|
10988
|
+
for (const skill of SKILLS) {
|
|
10989
|
+
await ensureSkillInstalled(skill.name, skill.repo);
|
|
10990
|
+
await migrateSkill(skill.name);
|
|
10991
|
+
}
|
|
10985
10992
|
}
|
|
10986
10993
|
async function ensureGooseInstalled() {
|
|
10987
10994
|
try {
|
|
@@ -11032,42 +11039,35 @@ async function installAgentBrowser() {
|
|
|
11032
11039
|
console.error("\u26A0\uFE0F Failed to install agent-browser:", error2);
|
|
11033
11040
|
}
|
|
11034
11041
|
}
|
|
11035
|
-
|
|
11036
|
-
var AGENT_BROWSER_SKILL_REPO = "https://github.com/vercel-labs/agent-browser";
|
|
11037
|
-
async function ensureAgentBrowserSkillInstalled() {
|
|
11038
|
-
const skillPath = (0, import_path2.join)((0, import_os.homedir)(), ".config", "agents", "skills", AGENT_BROWSER_SKILL_NAME);
|
|
11039
|
-
if ((0, import_fs3.existsSync)(skillPath)) {
|
|
11040
|
-
console.log(`\u2705 Skill "${AGENT_BROWSER_SKILL_NAME}" is already installed`);
|
|
11041
|
-
return;
|
|
11042
|
-
}
|
|
11043
|
-
console.log(`\u{1F4E6} Installing ${AGENT_BROWSER_SKILL_NAME} skill...`);
|
|
11044
|
-
await installAgentBrowserSkill();
|
|
11045
|
-
}
|
|
11046
|
-
async function migrateAgentBrowserSkill() {
|
|
11042
|
+
async function migrateSkill(skillName) {
|
|
11047
11043
|
const home = (0, import_os.homedir)();
|
|
11048
|
-
const oldPath = (0, import_path2.join)(home, ".agents", "skills",
|
|
11044
|
+
const oldPath = (0, import_path2.join)(home, ".agents", "skills", skillName);
|
|
11049
11045
|
const newDir = (0, import_path2.join)(home, ".config", "agents", "skills");
|
|
11050
|
-
const newPath = (0, import_path2.join)(newDir,
|
|
11046
|
+
const newPath = (0, import_path2.join)(newDir, skillName);
|
|
11051
11047
|
if (!(0, import_fs3.existsSync)(oldPath) || (0, import_fs3.existsSync)(newPath)) {
|
|
11052
11048
|
return;
|
|
11053
11049
|
}
|
|
11054
11050
|
try {
|
|
11055
|
-
console.log(
|
|
11051
|
+
console.log(`\u{1F504} Copying ${skillName} skill to new location...`);
|
|
11056
11052
|
await execAsync(`mkdir -p "${newDir}"`);
|
|
11057
|
-
await execAsync(`
|
|
11058
|
-
console.log(
|
|
11053
|
+
await execAsync(`cp -r "${oldPath}" "${newPath}"`);
|
|
11054
|
+
console.log(`\u2705 ${skillName} skill copied to new location`);
|
|
11059
11055
|
} catch (error2) {
|
|
11060
|
-
console.error(
|
|
11056
|
+
console.error(`\u26A0\uFE0F Failed to copy ${skillName} skill:`, error2);
|
|
11061
11057
|
}
|
|
11062
11058
|
}
|
|
11063
|
-
async function
|
|
11059
|
+
async function ensureSkillInstalled(skillName, repo) {
|
|
11060
|
+
const skillPath = (0, import_path2.join)((0, import_os.homedir)(), ".config", "agents", "skills", skillName);
|
|
11061
|
+
if ((0, import_fs3.existsSync)(skillPath)) {
|
|
11062
|
+
console.log(`\u2705 Skill "${skillName}" is already installed`);
|
|
11063
|
+
return;
|
|
11064
|
+
}
|
|
11065
|
+
console.log(`\u{1F4E6} Installing ${skillName} skill...`);
|
|
11064
11066
|
try {
|
|
11065
|
-
await execAsync(
|
|
11066
|
-
|
|
11067
|
-
);
|
|
11068
|
-
console.log(`\u2705 Skill "${AGENT_BROWSER_SKILL_NAME}" installed successfully`);
|
|
11067
|
+
await execAsync(`npx skills add ${repo} --skill ${skillName} -g -y`);
|
|
11068
|
+
console.log(`\u2705 Skill "${skillName}" installed successfully`);
|
|
11069
11069
|
} catch (error2) {
|
|
11070
|
-
console.error(`\u26A0\uFE0F Failed to install ${
|
|
11070
|
+
console.error(`\u26A0\uFE0F Failed to install ${skillName} skill:`, error2);
|
|
11071
11071
|
}
|
|
11072
11072
|
}
|
|
11073
11073
|
|