Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Generate Privy wallet security policy rules from natural language and submit them for on-chain user approval.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
utils/propose.sh
1#!/usr/bin/env bash2# Self-bootstrapping wrapper for propose.mjs.3#4# Why this exists: Node resolves ES-module imports against the script's own5# directory, not the cwd. If we asked users to `npm install viem` in their6# project and then `node /plugin/path/propose.mjs`, Node would look for viem7# in the plugin directory's node_modules (which is empty) and fail with8# ERR_MODULE_NOT_FOUND. This wrapper copies propose.mjs + package.json into9# a stable cache dir (~/.monskills/propose-deps/), installs deps there once,10# and runs propose.mjs from that cache — so imports resolve cleanly no matter11# where the user invokes it from.12#13# Usage (from SAFE_WALLET_MANAGEMENT.md):14# CHAIN_ID=... SAFE_ADDRESS=... PRIVATE_KEY=... DEPLOYMENT_BYTECODE=... \15# bash <plugin-root>/wallet/utils/propose.sh16set -e1718SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"19DEPS_DIR="${HOME}/.monskills/propose-deps"2021mkdir -p "$DEPS_DIR"22cp "$SCRIPT_DIR/propose.mjs" "$DEPS_DIR/propose.mjs"23cp "$SCRIPT_DIR/package.json" "$DEPS_DIR/package.json"2425if [ ! -d "$DEPS_DIR/node_modules" ]; then26echo "📦 Installing propose.mjs dependencies (one-time, cached in $DEPS_DIR)..."27(cd "$DEPS_DIR" && npm install --silent --no-audit --no-fund --loglevel=error)28fi2930exec node "$DEPS_DIR/propose.mjs" "$@"31