@proxygate/cli 0.1.2 → 0.1.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/README.md +2 -2
- package/dist/generated/skills.js +3 -3
- package/dist/generated/skills.js.map +1 -1
- package/dist/postinstall.js +81 -0
- package/dist/postinstall.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Terminal interface for [ProxyGate](https://proxygate.ai) — the Airbnb for AI A
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install -g proxygate
|
|
8
|
+
npm install -g @proxygate/cli
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
The installer offers to install Claude Code skills for AI-assisted workflows. If you skip this step, install them later with `proxygate skills install`.
|
|
@@ -13,7 +13,7 @@ The installer offers to install Claude Code skills for AI-assisted workflows. If
|
|
|
13
13
|
## Update
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
npm update -g proxygate
|
|
16
|
+
npm update -g @proxygate/cli
|
|
17
17
|
proxygate skills install # update Claude Code skills
|
|
18
18
|
```
|
|
19
19
|
|
package/dist/generated/skills.js
CHANGED
|
@@ -9,15 +9,15 @@ export const SKILLS = {
|
|
|
9
9
|
"references/commands.md": "# ProxyGate CLI Command Reference\n\nComplete reference for all `proxygate` CLI commands. Use `--json` on most commands for structured output.\n\n## Global Options\n\nAll commands accept:\n- `--gateway <url>` — Override gateway URL (default: https://gateway.proxygate.ai)\n- `--keypair <path>` — Path to Solana keypair JSON file\n- `--json` — Machine-readable JSON output\n\nConfig: `~/.proxygate/config.json`\n\n## Setup\n\n```bash\nproxygate init # save gateway URL + keypair\nproxygate init --keypair ~/.proxygate/k.json --gateway https://gateway.proxygate.ai\nproxygate getting-started # interactive setup guide\n```\n\n## Buyer Commands\n\n```bash\nproxygate balance # check USDC balance\nproxygate pricing # browse APIs with pricing\nproxygate pricing --service openai # filter by service\nproxygate apis # list all APIs\nproxygate services # list available services\nproxygate categories # list API categories\nproxygate proxy <listing-id> <path> -d '{}' # proxy a request\nproxygate proxy <id> <path> --stream -d '{}' # stream SSE responses\nproxygate deposit -a 5000000 # deposit 5 USDC\nproxygate withdraw -a 2000000 # withdraw 2 USDC\nproxygate withdraw-confirm -t <tx_sig> # confirm withdrawal TX\nproxygate usage # view usage history\nproxygate usage --service openai --limit 50\nproxygate rate <listing-id> -s 5 -c \"Great\" # rate a seller\n```\n\n## Seller Commands\n\n```bash\nproxygate listings list # list your listings\nproxygate listings list --table # table format\nproxygate listings create # create listing (interactive)\nproxygate tunnel # expose services (production)\nproxygate tunnel -c proxygate.tunnel.yaml # with config file\nproxygate dev # tunnel + request logging + config watch\nproxygate dev -c my-services.yaml\nproxygate settlements # view earnings summary\n```\n\n## Agent Builder Commands\n\n```bash\nproxygate create # scaffold agent project (interactive)\nproxygate create my-agent --template http-api --port 3000\nproxygate test # validate local endpoints\nproxygate test --endpoint \"POST /v1/analyze\" --payload '{\"code\":\"x=1\"}'\n```\n\n## Job Marketplace\n\n```bash\nproxygate jobs list # list available jobs\nproxygate jobs claim <job-id> # claim a job\nproxygate jobs submit <job-id> -d '{}' # submit job result\n```\n\n## Skills Management\n\n```bash\nproxygate skills install # install Claude Code skills\nproxygate skills install --json # JSON output\n```\n\n## Important Notes\n\n- All USDC amounts are in base units (lamports): 1 USDC = 1,000,000\n- Keypair is a standard Solana keypair (JSON array of 64 numbers)\n- Generate keypair: `solana-keygen new --outfile ~/.proxygate/keypair.json --no-bip39-passphrase`\n- Gateway docs: https://gateway.proxygate.ai/docs\n"
|
|
10
10
|
},
|
|
11
11
|
"pg-setup": {
|
|
12
|
-
"SKILL.md": "---\nname: pg-setup\ndescription: Use when setting up ProxyGate for the first time, installing the CLI, configuring a Solana wallet keypair, or connecting to the gateway. Make sure to use this skill whenever someone mentions \"get started with proxygate\", \"install proxygate\", \"setup wallet\", \"configure proxygate\", or wants to start using ProxyGate APIs, even if they don't explicitly say \"setup\".\n---\n\n# ProxyGate Setup\n\nFirst-time setup for ProxyGate — install CLI, configure wallet, connect to gateway.\n\n<purpose>\nWalk the user through ProxyGate first-time setup: install the CLI, locate or create a Solana keypair, configure the gateway connection, and verify everything works.\n</purpose>\n\n<process>\n\n<step name=\"check_existing_install\">\nCheck if ProxyGate CLI is already installed:\n\n```bash\nproxygate --version 2>/dev/null || echo \"NOT_INSTALLED\"\n```\n\nIf installed, check if configured:\n```bash\ncat ~/.proxygate/config.json 2>/dev/null || echo \"NOT_CONFIGURED\"\n```\n\n- If installed and configured: skip to verify step\n- If installed but not configured: skip to configure step\n- If not installed: start from install step\n</step>\n\n<step name=\"install_cli\">\nInstall the CLI globally:\n\n```bash\nnpm install -g proxygate\nproxygate --version\n```\n\nIf npm is not available, check for pnpm or yarn:\n```bash\npnpm add -g proxygate # alternative\n```\n</step>\n\n<step name=\"find_or_create_keypair\">\nLocate an existing Solana keypair or create one.\n\nCommon locations to check:\n```bash\nls ~/.config/solana/id.json 2>/dev/null\nls ~/.proxygate/keypair.json 2>/dev/null\n```\n\nIf no keypair exists, create one:\n```bash\nsolana-keygen new --outfile ~/.proxygate/keypair.json --no-bip39-passphrase\n```\n\nIf `solana-keygen` is not installed, the CLI's `getting-started` command can generate one too.\n</step>\n\n<step name=\"configure\">\nRun the interactive setup (recommended for first time):\n\n```bash\nproxygate getting-started\n```\n\nOr configure manually:\n```bash\nproxygate init --keypair <path-to-keypair>\nproxygate init --keypair ~/.proxygate/keypair.json --gateway https://gateway.proxygate.ai\n```\n\nConfig is saved to `~/.proxygate/config.json`.\n</step>\n\n<step name=\"verify\">\nTest the connection:\n\n```bash\nproxygate balance\nproxygate pricing\n```\n\n- If balance is 0: user needs to deposit USDC — hand off to `/pg-buy`\n- If gateway unreachable: check `--gateway` URL\n- If keypair error: check path in `~/.proxygate/config.json`\n</step>\n\n</process>\n\n<troubleshooting>\n\n| Problem | Fix |\n|---------|-----|\n| `command not found: proxygate` | `npm install -g proxygate` |\n| `ENOENT keypair` | Check path in `~/.proxygate/config.json` |\n| `Gateway unreachable` | Verify URL, try `https://gateway.proxygate.ai` |\n| Balance shows 0 | Need to deposit: use `/pg-buy` |\n| `solana-keygen: command not found` | Use `proxygate getting-started` instead (handles keypair creation) |\n\n</troubleshooting>\n\n<success_criteria>\n- [ ] CLI installed and `proxygate --version` returns a version\n- [ ] Keypair file exists and is readable\n- [ ] `~/.proxygate/config.json` has `gatewayUrl` and `keypairPath`\n- [ ] `proxygate balance` returns a response (even if 0)\n- [ ] `proxygate pricing` shows available APIs\n</success_criteria>\n\n## Scope\n\n| Need | Skill |\n|------|-------|\n| First-time setup | **This skill** (`pg-setup`) |\n| Buy API access | `/pg-buy` |\n| Sell API capacity | `/pg-sell` |\n| Check status | `/pg-status` |\n| Update CLI | `/pg-update` |\n\n## Reference\n\nFor full CLI command reference, see [references/commands.md](references/commands.md).\n",
|
|
12
|
+
"SKILL.md": "---\nname: pg-setup\ndescription: Use when setting up ProxyGate for the first time, installing the CLI, configuring a Solana wallet keypair, or connecting to the gateway. Make sure to use this skill whenever someone mentions \"get started with proxygate\", \"install proxygate\", \"setup wallet\", \"configure proxygate\", or wants to start using ProxyGate APIs, even if they don't explicitly say \"setup\".\n---\n\n# ProxyGate Setup\n\nFirst-time setup for ProxyGate — install CLI, configure wallet, connect to gateway.\n\n<purpose>\nWalk the user through ProxyGate first-time setup: install the CLI, locate or create a Solana keypair, configure the gateway connection, and verify everything works.\n</purpose>\n\n<process>\n\n<step name=\"check_existing_install\">\nCheck if ProxyGate CLI is already installed:\n\n```bash\nproxygate --version 2>/dev/null || echo \"NOT_INSTALLED\"\n```\n\nIf installed, check if configured:\n```bash\ncat ~/.proxygate/config.json 2>/dev/null || echo \"NOT_CONFIGURED\"\n```\n\n- If installed and configured: skip to verify step\n- If installed but not configured: skip to configure step\n- If not installed: start from install step\n</step>\n\n<step name=\"install_cli\">\nInstall the CLI globally:\n\n```bash\nnpm install -g @proxygate/cli\nproxygate --version\n```\n\nIf npm is not available, check for pnpm or yarn:\n```bash\npnpm add -g @proxygate/cli # alternative\n```\n</step>\n\n<step name=\"find_or_create_keypair\">\nLocate an existing Solana keypair or create one.\n\nCommon locations to check:\n```bash\nls ~/.config/solana/id.json 2>/dev/null\nls ~/.proxygate/keypair.json 2>/dev/null\n```\n\nIf no keypair exists, create one:\n```bash\nsolana-keygen new --outfile ~/.proxygate/keypair.json --no-bip39-passphrase\n```\n\nIf `solana-keygen` is not installed, the CLI's `getting-started` command can generate one too.\n</step>\n\n<step name=\"configure\">\nRun the interactive setup (recommended for first time):\n\n```bash\nproxygate getting-started\n```\n\nOr configure manually:\n```bash\nproxygate init --keypair <path-to-keypair>\nproxygate init --keypair ~/.proxygate/keypair.json --gateway https://gateway.proxygate.ai\n```\n\nConfig is saved to `~/.proxygate/config.json`.\n</step>\n\n<step name=\"verify\">\nTest the connection:\n\n```bash\nproxygate balance\nproxygate pricing\n```\n\n- If balance is 0: user needs to deposit USDC — hand off to `/pg-buy`\n- If gateway unreachable: check `--gateway` URL\n- If keypair error: check path in `~/.proxygate/config.json`\n</step>\n\n</process>\n\n<troubleshooting>\n\n| Problem | Fix |\n|---------|-----|\n| `command not found: proxygate` | `npm install -g @proxygate/cli` |\n| `ENOENT keypair` | Check path in `~/.proxygate/config.json` |\n| `Gateway unreachable` | Verify URL, try `https://gateway.proxygate.ai` |\n| Balance shows 0 | Need to deposit: use `/pg-buy` |\n| `solana-keygen: command not found` | Use `proxygate getting-started` instead (handles keypair creation) |\n\n</troubleshooting>\n\n<success_criteria>\n- [ ] CLI installed and `proxygate --version` returns a version\n- [ ] Keypair file exists and is readable\n- [ ] `~/.proxygate/config.json` has `gatewayUrl` and `keypairPath`\n- [ ] `proxygate balance` returns a response (even if 0)\n- [ ] `proxygate pricing` shows available APIs\n</success_criteria>\n\n## Scope\n\n| Need | Skill |\n|------|-------|\n| First-time setup | **This skill** (`pg-setup`) |\n| Buy API access | `/pg-buy` |\n| Sell API capacity | `/pg-sell` |\n| Check status | `/pg-status` |\n| Update CLI | `/pg-update` |\n\n## Reference\n\nFor full CLI command reference, see [references/commands.md](references/commands.md).\n",
|
|
13
13
|
"references/commands.md": "# ProxyGate CLI Command Reference\n\nComplete reference for all `proxygate` CLI commands. Use `--json` on most commands for structured output.\n\n## Global Options\n\nAll commands accept:\n- `--gateway <url>` — Override gateway URL (default: https://gateway.proxygate.ai)\n- `--keypair <path>` — Path to Solana keypair JSON file\n- `--json` — Machine-readable JSON output\n\nConfig: `~/.proxygate/config.json`\n\n## Setup\n\n```bash\nproxygate init # save gateway URL + keypair\nproxygate init --keypair ~/.proxygate/k.json --gateway https://gateway.proxygate.ai\nproxygate getting-started # interactive setup guide\n```\n\n## Buyer Commands\n\n```bash\nproxygate balance # check USDC balance\nproxygate pricing # browse APIs with pricing\nproxygate pricing --service openai # filter by service\nproxygate apis # list all APIs\nproxygate services # list available services\nproxygate categories # list API categories\nproxygate proxy <listing-id> <path> -d '{}' # proxy a request\nproxygate proxy <id> <path> --stream -d '{}' # stream SSE responses\nproxygate deposit -a 5000000 # deposit 5 USDC\nproxygate withdraw -a 2000000 # withdraw 2 USDC\nproxygate withdraw-confirm -t <tx_sig> # confirm withdrawal TX\nproxygate usage # view usage history\nproxygate usage --service openai --limit 50\nproxygate rate <listing-id> -s 5 -c \"Great\" # rate a seller\n```\n\n## Seller Commands\n\n```bash\nproxygate listings list # list your listings\nproxygate listings list --table # table format\nproxygate listings create # create listing (interactive)\nproxygate tunnel # expose services (production)\nproxygate tunnel -c proxygate.tunnel.yaml # with config file\nproxygate dev # tunnel + request logging + config watch\nproxygate dev -c my-services.yaml\nproxygate settlements # view earnings summary\n```\n\n## Agent Builder Commands\n\n```bash\nproxygate create # scaffold agent project (interactive)\nproxygate create my-agent --template http-api --port 3000\nproxygate test # validate local endpoints\nproxygate test --endpoint \"POST /v1/analyze\" --payload '{\"code\":\"x=1\"}'\n```\n\n## Job Marketplace\n\n```bash\nproxygate jobs list # list available jobs\nproxygate jobs claim <job-id> # claim a job\nproxygate jobs submit <job-id> -d '{}' # submit job result\n```\n\n## Skills Management\n\n```bash\nproxygate skills install # install Claude Code skills\nproxygate skills install --json # JSON output\n```\n\n## Important Notes\n\n- All USDC amounts are in base units (lamports): 1 USDC = 1,000,000\n- Keypair is a standard Solana keypair (JSON array of 64 numbers)\n- Generate keypair: `solana-keygen new --outfile ~/.proxygate/keypair.json --no-bip39-passphrase`\n- Gateway docs: https://gateway.proxygate.ai/docs\n"
|
|
14
14
|
},
|
|
15
15
|
"pg-status": {
|
|
16
16
|
"SKILL.md": "---\nname: pg-status\ndescription: Use when checking ProxyGate status — balance, usage, listings, tunnel health, or earnings. Make sure to use this skill whenever someone mentions \"check balance\", \"proxygate status\", \"my usage\", \"my earnings\", \"what's my balance\", \"how much have I spent\", or wants any kind of status overview.\n---\n\n# ProxyGate Status\n\nQuick status checks for buyers and sellers.\n\n<process>\n\n<step name=\"buyer_status\">\n```bash\nproxygate balance # USDC balance + pending settlement\nproxygate usage # recent request history\nproxygate usage --limit 10 # last 10 requests\nproxygate usage --json # machine-readable\n```\n</step>\n\n<step name=\"seller_status\">\n```bash\nproxygate listings list # active listings\nproxygate listings list --table # table format\nproxygate settlements # earnings summary\n```\n</step>\n\n</process>\n\n<troubleshooting>\n\n| Symptom | Check |\n|---------|-------|\n| Balance 0 | `proxygate deposit -a <amount>` — see `/pg-buy` |\n| Proxy returns 503 | Listing may be paused or seller tunnel is down |\n| \"Unauthorized\" | Run `proxygate init` to reconfigure keypair — see `/pg-setup` |\n| Tunnel disconnects | Check `proxygate dev` logs, verify local port is open |\n| Gateway unreachable | Verify URL: `proxygate balance --gateway https://gateway.proxygate.ai` |\n\n</troubleshooting>\n\n## Scope\n\n| Need | Skill |\n|------|-------|\n| First-time setup | `/pg-setup` |\n| Buy API access | `/pg-buy` |\n| Sell API capacity | `/pg-sell` |\n| Check status | **This skill** (`pg-status`) |\n| Update CLI | `/pg-update` |\n"
|
|
17
17
|
},
|
|
18
18
|
"pg-update": {
|
|
19
|
-
"SKILL.md": "---\nname: pg-update\ndescription: Use when updating ProxyGate CLI or SDK to latest version. Also triggers proactively when ~/.claude/cache/proxygate-update-check.json indicates an update is available and the statusline shows the update indicator. Make sure to use this whenever someone says \"update proxygate\", \"upgrade cli\", or when a session starts with an update notification.\n---\n\n# ProxyGate Update\n\nCheck for and install updates to proxygate.\n\n<process>\n\n<step name=\"get_installed_version\">\n```bash\nproxygate --version 2>/dev/null || echo \"NOT_INSTALLED\"\n```\n\nIf not installed, direct user to `/pg-setup`.\n</step>\n\n<step name=\"check_latest_version\">\n```bash\nnpm view proxygate version 2>/dev/null || echo \"UNAVAILABLE\"\n```\n\nIf npm check fails, suggest manual update: `npm install -g proxygate@latest`\n</step>\n\n<step name=\"compare_versions\">\n- If installed == latest: \"You're already on the latest version.\"\n- If installed < latest: show both versions and proceed to update\n- If not installed: direct to `/pg-setup`\n</step>\n\n<step name=\"run_update\">\n```bash\nnpm install -g proxygate@latest\n```\n\nVerify:\n```bash\nproxygate --version\n```\n</step>\n\n<step name=\"update_skills\">\nSkills are bundled in the CLI, so a new version may include updated skills:\n\n```bash\nproxygate skills install\n```\n</step>\n\n<step name=\"clear_cache\">\n```bash\nrm -f ~/.claude/cache/proxygate-update-check.json\n```\n</step>\n\n</process>\n\n## SDK Update\n\nIf `@proxygate/sdk` is in the project's dependencies:\n\n```bash\nnpm install @proxygate/sdk@latest\n# or\npnpm add @proxygate/sdk@latest\n```\n\n<success_criteria>\n- [ ] Installed version detected correctly\n- [ ] Latest version checked via npm\n- [ ] Update skipped if already current\n- [ ] CLI updated successfully\n- [ ] Skills updated via `proxygate skills install`\n- [ ] Update cache cleared\n</success_criteria>\n",
|
|
20
|
-
"scripts/check-update.sh": "#!/usr/bin/env bash\n# ProxyGate update checker — runs on Claude Code SessionStart.\n# Writes result to ~/.claude/cache/proxygate-update-check.json.\n# Exits quickly; never blocks session startup.\n\nset -euo pipefail\n\nCACHE_DIR=\"$HOME/.claude/cache\"\nCACHE_FILE=\"$CACHE_DIR/proxygate-update-check.json\"\n\nmkdir -p \"$CACHE_DIR\"\n\n# Skip if checked within last hour\nif [ -f \"$CACHE_FILE\" ]; then\n if [ \"$(uname)\" = \"Darwin\" ]; then\n age=$(( $(date +%s) - $(stat -f %m \"$CACHE_FILE\") ))\n else\n age=$(( $(date +%s) - $(stat -c %Y \"$CACHE_FILE\") ))\n fi\n if [ \"$age\" -lt 3600 ]; then\n exit 0\n fi\nfi\n\ncurrent=$(proxygate --version 2>/dev/null || echo \"0.0.0\")\nlatest=$(npm view proxygate version 2>/dev/null || echo \"0.0.0\")\n\nif [ \"$current\" = \"$latest\" ] || [ \"$latest\" = \"0.0.0\" ]; then\n cat > \"$CACHE_FILE\" <<JSON\n{\"update_available\":false,\"current\":\"$current\",\"latest\":\"$latest\",\"checked_at\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"}\nJSON\nelse\n cat > \"$CACHE_FILE\" <<JSON\n{\"update_available\":true,\"current\":\"$current\",\"latest\":\"$latest\",\"checked_at\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"}\nJSON\nfi\n"
|
|
19
|
+
"SKILL.md": "---\nname: pg-update\ndescription: Use when updating ProxyGate CLI or SDK to latest version. Also triggers proactively when ~/.claude/cache/proxygate-update-check.json indicates an update is available and the statusline shows the update indicator. Make sure to use this whenever someone says \"update proxygate\", \"upgrade cli\", or when a session starts with an update notification.\n---\n\n# ProxyGate Update\n\nCheck for and install updates to proxygate.\n\n<process>\n\n<step name=\"get_installed_version\">\n```bash\nproxygate --version 2>/dev/null || echo \"NOT_INSTALLED\"\n```\n\nIf not installed, direct user to `/pg-setup`.\n</step>\n\n<step name=\"check_latest_version\">\n```bash\nnpm view @proxygate/cli version 2>/dev/null || echo \"UNAVAILABLE\"\n```\n\nIf npm check fails, suggest manual update: `npm install -g @proxygate/cli@latest`\n</step>\n\n<step name=\"compare_versions\">\n- If installed == latest: \"You're already on the latest version.\"\n- If installed < latest: show both versions and proceed to update\n- If not installed: direct to `/pg-setup`\n</step>\n\n<step name=\"run_update\">\n```bash\nnpm install -g @proxygate/cli@latest\n```\n\nVerify:\n```bash\nproxygate --version\n```\n</step>\n\n<step name=\"update_skills\">\nSkills are bundled in the CLI, so a new version may include updated skills:\n\n```bash\nproxygate skills install\n```\n</step>\n\n<step name=\"clear_cache\">\n```bash\nrm -f ~/.claude/cache/proxygate-update-check.json\n```\n</step>\n\n</process>\n\n## SDK Update\n\nIf `@proxygate/sdk` is in the project's dependencies:\n\n```bash\nnpm install @proxygate/sdk@latest\n# or\npnpm add @proxygate/sdk@latest\n```\n\n<success_criteria>\n- [ ] Installed version detected correctly\n- [ ] Latest version checked via npm\n- [ ] Update skipped if already current\n- [ ] CLI updated successfully\n- [ ] Skills updated via `proxygate skills install`\n- [ ] Update cache cleared\n</success_criteria>\n",
|
|
20
|
+
"scripts/check-update.sh": "#!/usr/bin/env bash\n# ProxyGate update checker — runs on Claude Code SessionStart.\n# Writes result to ~/.claude/cache/proxygate-update-check.json.\n# Exits quickly; never blocks session startup.\n\nset -euo pipefail\n\nCACHE_DIR=\"$HOME/.claude/cache\"\nCACHE_FILE=\"$CACHE_DIR/proxygate-update-check.json\"\n\nmkdir -p \"$CACHE_DIR\"\n\n# Skip if checked within last hour\nif [ -f \"$CACHE_FILE\" ]; then\n if [ \"$(uname)\" = \"Darwin\" ]; then\n age=$(( $(date +%s) - $(stat -f %m \"$CACHE_FILE\") ))\n else\n age=$(( $(date +%s) - $(stat -c %Y \"$CACHE_FILE\") ))\n fi\n if [ \"$age\" -lt 3600 ]; then\n exit 0\n fi\nfi\n\ncurrent=$(proxygate --version 2>/dev/null || echo \"0.0.0\")\nlatest=$(npm view @proxygate/cli version 2>/dev/null || echo \"0.0.0\")\n\nif [ \"$current\" = \"$latest\" ] || [ \"$latest\" = \"0.0.0\" ]; then\n cat > \"$CACHE_FILE\" <<JSON\n{\"update_available\":false,\"current\":\"$current\",\"latest\":\"$latest\",\"checked_at\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"}\nJSON\nelse\n cat > \"$CACHE_FILE\" <<JSON\n{\"update_available\":true,\"current\":\"$current\",\"latest\":\"$latest\",\"checked_at\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"}\nJSON\n echo \"ProxyGate update available: $current → $latest. Run /pg-update to upgrade.\"\nfi\n"
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
//# sourceMappingURL=skills.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills.js","sourceRoot":"","sources":["../../src/generated/skills.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,MAAM,CAAC,MAAM,MAAM,GAA2C;IAC5D,QAAQ,EAAE;QACR,UAAU,EAAE,8+IAA8+I;QAC1/I,wBAAwB,EAAE,gqGAAgqG;KAC3rG;IACD,SAAS,EAAE;QACT,UAAU,EAAE,soIAAsoI;QAClpI,wBAAwB,EAAE,gqGAAgqG;KAC3rG;IACD,UAAU,EAAE;QACV,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"skills.js","sourceRoot":"","sources":["../../src/generated/skills.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,MAAM,CAAC,MAAM,MAAM,GAA2C;IAC5D,QAAQ,EAAE;QACR,UAAU,EAAE,8+IAA8+I;QAC1/I,wBAAwB,EAAE,gqGAAgqG;KAC3rG;IACD,SAAS,EAAE;QACT,UAAU,EAAE,soIAAsoI;QAClpI,wBAAwB,EAAE,gqGAAgqG;KAC3rG;IACD,UAAU,EAAE;QACV,UAAU,EAAE,wlHAAwlH;QACpmH,wBAAwB,EAAE,gqGAAgqG;KAC3rG;IACD,WAAW,EAAE;QACX,UAAU,EAAE,gpDAAgpD;KAC7pD;IACD,WAAW,EAAE;QACX,UAAU,EAAE,25DAA25D;QACv6D,yBAAyB,EAAE,kwCAAkwC;KAC9xC;CACF,CAAC"}
|
package/dist/postinstall.js
CHANGED
|
@@ -62,8 +62,89 @@ async function postinstall() {
|
|
|
62
62
|
catch {
|
|
63
63
|
// Non-fatal
|
|
64
64
|
}
|
|
65
|
+
// Install statusline script
|
|
66
|
+
const hooksDir = join(claudeDir, 'hooks');
|
|
67
|
+
const statuslinePath = join(hooksDir, 'proxygate-statusline.js');
|
|
68
|
+
await mkdir(hooksDir, { recursive: true });
|
|
69
|
+
await writeFile(statuslinePath, STATUSLINE_SCRIPT, 'utf-8');
|
|
70
|
+
// Register statusline in settings (only if not already ours)
|
|
71
|
+
try {
|
|
72
|
+
const raw = await readFile(settingsPath, 'utf-8');
|
|
73
|
+
const settings = JSON.parse(raw);
|
|
74
|
+
const currentStatusline = settings.statusLine;
|
|
75
|
+
if (!currentStatusline?.command?.includes('proxygate-statusline')) {
|
|
76
|
+
settings.statusLine = {
|
|
77
|
+
type: 'command',
|
|
78
|
+
command: `node "${statuslinePath}"`,
|
|
79
|
+
};
|
|
80
|
+
await writeFile(settingsPath, JSON.stringify(settings, null, 2) + '\n', 'utf-8');
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
// Non-fatal
|
|
85
|
+
}
|
|
65
86
|
console.log(`\x1b[32m+\x1b[0m Installed ${count} ProxyGate skills to ${baseDir}`);
|
|
66
87
|
}
|
|
88
|
+
const STATUSLINE_SCRIPT = `#!/usr/bin/env node
|
|
89
|
+
const fs = require('fs');
|
|
90
|
+
const path = require('path');
|
|
91
|
+
const os = require('os');
|
|
92
|
+
let input = '';
|
|
93
|
+
const timeout = setTimeout(() => process.exit(0), 3000);
|
|
94
|
+
process.stdin.setEncoding('utf8');
|
|
95
|
+
process.stdin.on('data', chunk => input += chunk);
|
|
96
|
+
process.stdin.on('end', () => {
|
|
97
|
+
clearTimeout(timeout);
|
|
98
|
+
try {
|
|
99
|
+
const data = JSON.parse(input);
|
|
100
|
+
const model = data.model?.display_name || 'Claude';
|
|
101
|
+
const dir = path.basename(data.workspace?.current_dir || process.cwd());
|
|
102
|
+
const remaining = data.context_window?.remaining_percentage;
|
|
103
|
+
const claudeDir = path.join(os.homedir(), '.claude');
|
|
104
|
+
const AUTO_COMPACT_BUFFER_PCT = 16.5;
|
|
105
|
+
let ctx = '';
|
|
106
|
+
if (remaining != null) {
|
|
107
|
+
const usable = 100 - AUTO_COMPACT_BUFFER_PCT;
|
|
108
|
+
const used = Math.min(100, Math.round(((usable - remaining) / usable) * 100));
|
|
109
|
+
const blocks = 10;
|
|
110
|
+
const filled = Math.round((used / 100) * blocks);
|
|
111
|
+
const bar = String.fromCharCode(9608).repeat(filled) + String.fromCharCode(9617).repeat(blocks - filled);
|
|
112
|
+
const color = used >= 90 ? '\\x1b[31m' : used >= 70 ? '\\x1b[33m' : '\\x1b[32m';
|
|
113
|
+
ctx = \` \${color}\${bar} \${used}%\\x1b[0m\`;
|
|
114
|
+
}
|
|
115
|
+
let task = '';
|
|
116
|
+
try {
|
|
117
|
+
const stateFile = path.join(claudeDir, 'get-shit-done', 'STATE.json');
|
|
118
|
+
if (fs.existsSync(stateFile)) {
|
|
119
|
+
const state = JSON.parse(fs.readFileSync(stateFile, 'utf8'));
|
|
120
|
+
if (state.current_task) task = state.current_task;
|
|
121
|
+
}
|
|
122
|
+
} catch (e) {}
|
|
123
|
+
let gsdUpdate = '';
|
|
124
|
+
const gsdCache = path.join(claudeDir, 'cache', 'gsd-update-check.json');
|
|
125
|
+
if (fs.existsSync(gsdCache)) {
|
|
126
|
+
try {
|
|
127
|
+
const c = JSON.parse(fs.readFileSync(gsdCache, 'utf8'));
|
|
128
|
+
if (c.update_available) gsdUpdate = '\\x1b[33m\\u2B06 /gsd:update\\x1b[0m \\u2502 ';
|
|
129
|
+
} catch (e) {}
|
|
130
|
+
}
|
|
131
|
+
let pgUpdate = '';
|
|
132
|
+
const pgCache = path.join(claudeDir, 'cache', 'proxygate-update-check.json');
|
|
133
|
+
if (fs.existsSync(pgCache)) {
|
|
134
|
+
try {
|
|
135
|
+
const c = JSON.parse(fs.readFileSync(pgCache, 'utf8'));
|
|
136
|
+
if (c.update_available) pgUpdate = '\\x1b[36m\\u2B06 /pg-update\\x1b[0m \\u2502 ';
|
|
137
|
+
} catch (e) {}
|
|
138
|
+
}
|
|
139
|
+
const updates = gsdUpdate + pgUpdate;
|
|
140
|
+
if (task) {
|
|
141
|
+
process.stdout.write(\`\${updates}\\x1b[2m\${model}\\x1b[0m \\u2502 \\x1b[1m\${task}\\x1b[0m \\u2502 \\x1b[2m\${dir}\\x1b[0m\${ctx}\`);
|
|
142
|
+
} else {
|
|
143
|
+
process.stdout.write(\`\${updates}\\x1b[2m\${model}\\x1b[0m \\u2502 \\x1b[2m\${dir}\\x1b[0m\${ctx}\`);
|
|
144
|
+
}
|
|
145
|
+
} catch (e) {}
|
|
146
|
+
});
|
|
147
|
+
`;
|
|
67
148
|
postinstall().catch(() => {
|
|
68
149
|
// Silent fail — postinstall should never block npm install
|
|
69
150
|
});
|
package/dist/postinstall.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postinstall.js","sourceRoot":"","sources":["../src/postinstall.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,gBAAgB,GAAG,IAAI,CAC3B,OAAO,EAAE,EACT,SAAS,EACT,QAAQ,EACR,WAAW,EACX,SAAS,EACT,iBAAiB,CAClB,CAAC;AACF,MAAM,WAAW,GAAG,wBAAwB,CAAC;AAE7C,KAAK,UAAU,WAAW;IACxB,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvC,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAEpC,kDAAk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