@clawpump/claw-agent 0.1.12 → 0.1.14
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.
|
@@ -1451,6 +1451,33 @@ async function getOriginUrl(updateRoot) {
|
|
|
1451
1451
|
return origin.code === 0 ? origin.stdout.trim() : ''
|
|
1452
1452
|
}
|
|
1453
1453
|
|
|
1454
|
+
// The ClawPump fork the desktop must always track. Anyone who installed
|
|
1455
|
+
// upstream Hermes has origin=NousResearch in ~/.hermes/hermes-agent; the
|
|
1456
|
+
// self-update fetches/rebuilds whatever origin points at, then dittos the
|
|
1457
|
+
// rebuilt app over the running one. With an upstream origin that rebuilds
|
|
1458
|
+
// UPSTREAM Hermes (its icon, installer, branding) on top of Claw Agent.
|
|
1459
|
+
const CLAWPUMP_FORK_HTTPS = 'https://github.com/Clawpump/claw-agent.git'
|
|
1460
|
+
|
|
1461
|
+
// Force a pre-existing checkout's origin to the ClawPump fork before any
|
|
1462
|
+
// update check/apply. Idempotent — no-ops once origin already points at the
|
|
1463
|
+
// fork (the common case after the install.sh bootstrap re-point). Best-effort:
|
|
1464
|
+
// never throws, so a git hiccup can't block the update path.
|
|
1465
|
+
async function ensureClawpumpOrigin(updateRoot) {
|
|
1466
|
+
try {
|
|
1467
|
+
const url = await getOriginUrl(updateRoot)
|
|
1468
|
+
if (/clawpump\/claw-agent/i.test(url)) return false
|
|
1469
|
+
const res = await runGit(['remote', 'set-url', 'origin', CLAWPUMP_FORK_HTTPS], { cwd: updateRoot })
|
|
1470
|
+
if (res.code !== 0) {
|
|
1471
|
+
await runGit(['remote', 'add', 'origin', CLAWPUMP_FORK_HTTPS], { cwd: updateRoot })
|
|
1472
|
+
}
|
|
1473
|
+
rememberLog(`[updates] re-pointed origin to the ClawPump fork (was: ${url || 'none'})`)
|
|
1474
|
+
return true
|
|
1475
|
+
} catch (error) {
|
|
1476
|
+
rememberLog(`[updates] ensureClawpumpOrigin failed: ${error.message}`)
|
|
1477
|
+
return false
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1454
1481
|
function emitUpdateProgress(payload) {
|
|
1455
1482
|
const merged = { stage: 'idle', message: '', percent: null, error: null, ...payload, at: Date.now() }
|
|
1456
1483
|
rememberLog(`[updates] ${merged.stage}: ${merged.message || merged.error || ''}`)
|
|
@@ -1487,6 +1514,7 @@ async function resolveHealedBranch(updateRoot, branch) {
|
|
|
1487
1514
|
|
|
1488
1515
|
async function checkUpdates() {
|
|
1489
1516
|
const updateRoot = resolveUpdateRoot()
|
|
1517
|
+
await ensureClawpumpOrigin(updateRoot)
|
|
1490
1518
|
let { branch } = readDesktopUpdateConfig()
|
|
1491
1519
|
const gitDir = path.join(updateRoot, '.git')
|
|
1492
1520
|
if (!directoryExists(gitDir)) {
|
|
@@ -1764,6 +1792,9 @@ async function applyUpdates(opts = {}) {
|
|
|
1764
1792
|
updateInFlight = true
|
|
1765
1793
|
|
|
1766
1794
|
try {
|
|
1795
|
+
// Guard against rebuilding/installing UPSTREAM Hermes over Claw Agent: make
|
|
1796
|
+
// sure the checkout the apply pulls + rebuilds from tracks the fork.
|
|
1797
|
+
await ensureClawpumpOrigin(resolveUpdateRoot())
|
|
1767
1798
|
const updater = resolveUpdaterBinary()
|
|
1768
1799
|
if (!updater && !IS_WINDOWS) {
|
|
1769
1800
|
// macOS/Linux drag-install: no staged Tauri hermes-setup. Unlike Windows
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "hermes",
|
|
3
3
|
"productName": "Claw Agent",
|
|
4
4
|
"private": true,
|
|
5
|
-
"version": "0.15.
|
|
5
|
+
"version": "0.15.4",
|
|
6
6
|
"description": "Claw Agent by ClawPump — native desktop app for Solana agents, built on Hermes Agent by Nous Research.",
|
|
7
7
|
"author": "ClawPump (built on Hermes by Nous Research)",
|
|
8
8
|
"type": "module",
|
package/agent/scripts/install.sh
CHANGED
|
@@ -1135,6 +1135,24 @@ clone_repo() {
|
|
|
1135
1135
|
log_info "Existing installation found, updating..."
|
|
1136
1136
|
cd "$INSTALL_DIR"
|
|
1137
1137
|
|
|
1138
|
+
# Re-point a pre-existing checkout at the ClawPump fork. Anyone who
|
|
1139
|
+
# installed upstream Hermes has origin=NousResearch here; without
|
|
1140
|
+
# this, every update pulls upstream (none of the ClawPump features —
|
|
1141
|
+
# x402, Pod, the ClawPump MCP) into the install. Force origin to our
|
|
1142
|
+
# fork so the fetch below lands the right source.
|
|
1143
|
+
local repo_repointed=""
|
|
1144
|
+
local current_origin
|
|
1145
|
+
current_origin="$(git remote get-url origin 2>/dev/null || echo '')"
|
|
1146
|
+
case "$current_origin" in
|
|
1147
|
+
*[Cc]lawpump/claw-agent*) : ;;
|
|
1148
|
+
*)
|
|
1149
|
+
log_warn "Re-pointing origin to the ClawPump fork (was: ${current_origin:-none})."
|
|
1150
|
+
git remote set-url origin "$REPO_URL_HTTPS" 2>/dev/null \
|
|
1151
|
+
|| git remote add origin "$REPO_URL_HTTPS"
|
|
1152
|
+
repo_repointed="yes"
|
|
1153
|
+
;;
|
|
1154
|
+
esac
|
|
1155
|
+
|
|
1138
1156
|
local autostash_ref=""
|
|
1139
1157
|
if [ -n "$(git status --porcelain)" ]; then
|
|
1140
1158
|
# A previously interrupted update can leave the index with
|
|
@@ -1164,11 +1182,23 @@ clone_repo() {
|
|
|
1164
1182
|
git remote set-branches origin "$BRANCH" 2>/dev/null || true
|
|
1165
1183
|
git fetch origin "$BRANCH"
|
|
1166
1184
|
git checkout "$BRANCH"
|
|
1167
|
-
|
|
1185
|
+
if [ "$repo_repointed" = "yes" ]; then
|
|
1186
|
+
# Upstream -> fork is a diverged history; a fast-forward is
|
|
1187
|
+
# impossible across the fork point. Hard-reset the branch onto
|
|
1188
|
+
# the fork so the working tree becomes the ClawPump source.
|
|
1189
|
+
log_info "Resetting $BRANCH to the ClawPump fork (origin/$BRANCH)..."
|
|
1190
|
+
git reset --hard "origin/$BRANCH"
|
|
1191
|
+
else
|
|
1192
|
+
git pull --ff-only origin "$BRANCH"
|
|
1193
|
+
fi
|
|
1168
1194
|
|
|
1169
1195
|
if [ -n "$autostash_ref" ]; then
|
|
1170
1196
|
local restore_now="yes"
|
|
1171
|
-
if [
|
|
1197
|
+
if [ "$repo_repointed" = "yes" ]; then
|
|
1198
|
+
# Don't replay upstream-Hermes local edits onto the fork —
|
|
1199
|
+
# they target different code and would only conflict.
|
|
1200
|
+
restore_now="no"
|
|
1201
|
+
elif [ -t 0 ] && [ -t 1 ]; then
|
|
1172
1202
|
echo
|
|
1173
1203
|
log_warn "Local changes were stashed before updating."
|
|
1174
1204
|
log_warn "Restoring them may reapply local customizations onto the updated codebase."
|
|
@@ -1774,6 +1804,30 @@ SOUL_EOF
|
|
|
1774
1804
|
fi
|
|
1775
1805
|
fi
|
|
1776
1806
|
fi
|
|
1807
|
+
|
|
1808
|
+
# Seed the ClawPump MCP (133 ClawPump tools: wallet, trading, marketplace,
|
|
1809
|
+
# perps, token launch) so it's connected out of the box instead of needing
|
|
1810
|
+
# a manual `hermes clawpump setup`. The remote entry is OAuth-deferred — the
|
|
1811
|
+
# sign-in browser opens on first connect, not here — so this only writes
|
|
1812
|
+
# config. Idempotent (skips if already configured) and best-effort: a
|
|
1813
|
+
# failure here must never fail the install.
|
|
1814
|
+
if [ -x "$INSTALL_DIR/venv/bin/python" ]; then
|
|
1815
|
+
log_info "Ensuring the ClawPump MCP is connected..."
|
|
1816
|
+
if "$INSTALL_DIR/venv/bin/python" - >/dev/null 2>&1 <<'PY'
|
|
1817
|
+
import sys
|
|
1818
|
+
try:
|
|
1819
|
+
from hermes_cli.clawpump_cli import _configured_entry
|
|
1820
|
+
from hermes_cli.mcp_picker import install_by_name
|
|
1821
|
+
sys.exit(0 if _configured_entry() else install_by_name("clawpump"))
|
|
1822
|
+
except Exception:
|
|
1823
|
+
sys.exit(1)
|
|
1824
|
+
PY
|
|
1825
|
+
then
|
|
1826
|
+
log_success "ClawPump MCP connected — sign in on first launch"
|
|
1827
|
+
else
|
|
1828
|
+
log_info "ClawPump MCP seed deferred (run 'hermes clawpump setup' to connect)"
|
|
1829
|
+
fi
|
|
1830
|
+
fi
|
|
1777
1831
|
}
|
|
1778
1832
|
|
|
1779
1833
|
find_system_browser() {
|
package/bin/cli.mjs
CHANGED
|
@@ -133,6 +133,24 @@ function main() {
|
|
|
133
133
|
run(uv, ["pip", "install", "--python", venvExe("python"), "-e", `${AGENT_DIR}[${EXTRA}]`]);
|
|
134
134
|
ok("dependencies installed");
|
|
135
135
|
|
|
136
|
+
// 3b) Seed the ClawPump MCP (133 tools — wallet, trading, marketplace) so
|
|
137
|
+
// it's connected out of the box. Idempotent (skips if already configured)
|
|
138
|
+
// and best-effort — a failure here must never abort the install. The remote
|
|
139
|
+
// entry is OAuth-deferred, so the sign-in browser opens on first connect.
|
|
140
|
+
try {
|
|
141
|
+
const seed = [
|
|
142
|
+
"import sys",
|
|
143
|
+
"try:",
|
|
144
|
+
" from hermes_cli.clawpump_cli import _configured_entry",
|
|
145
|
+
" from hermes_cli.mcp_picker import install_by_name",
|
|
146
|
+
" sys.exit(0 if _configured_entry() else install_by_name('clawpump'))",
|
|
147
|
+
"except Exception:",
|
|
148
|
+
" sys.exit(1)",
|
|
149
|
+
].join("\n");
|
|
150
|
+
const r = spawnSync(venvExe("python"), ["-c", seed], { stdio: "ignore" });
|
|
151
|
+
if (r.status === 0) ok("ClawPump MCP connected — sign in on first launch");
|
|
152
|
+
} catch { /* best-effort: connect manually with `claw clawpump setup` */ }
|
|
153
|
+
|
|
136
154
|
// 4) launcher
|
|
137
155
|
const onPath = makeLauncher();
|
|
138
156
|
ok(`launcher → ${path.join(BIN_DIR, "claw")}`);
|