run402 4.39.0 → 4.39.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.
- package/git-remote-run402.mjs +15 -1
- package/package.json +1 -1
package/git-remote-run402.mjs
CHANGED
|
@@ -98,6 +98,7 @@
|
|
|
98
98
|
* the set `git ls-remote <url>` outside a checkout needs.
|
|
99
99
|
*/
|
|
100
100
|
|
|
101
|
+
import { realpathSync } from "node:fs";
|
|
101
102
|
import { createInterface } from "node:readline";
|
|
102
103
|
import { pathToFileURL } from "node:url";
|
|
103
104
|
import { getSdk } from "./lib/sdk.mjs";
|
|
@@ -666,7 +667,20 @@ async function main(argv) {
|
|
|
666
667
|
// directly; without this guard that import would block on stdin forever).
|
|
667
668
|
const invokedDirectly = (() => {
|
|
668
669
|
try {
|
|
669
|
-
|
|
670
|
+
if (process.argv[1] === undefined) return false;
|
|
671
|
+
// SYMLINK-SAFE, or every real install is dead (4.39.0 shipped without
|
|
672
|
+
// this and the helper silently no-opped for everyone): npm installs the
|
|
673
|
+
// bin as a SYMLINK (`/opt/homebrew/bin/git-remote-run402 -> ../lib/...`),
|
|
674
|
+
// and Node's ESM loader resolves `import.meta.url` through the symlink
|
|
675
|
+
// to the REAL file while `process.argv[1]` keeps the symlink path — a
|
|
676
|
+
// naive equality check therefore fails exactly and only in production,
|
|
677
|
+
// where `git push` then reads zero capabilities and aborts the session.
|
|
678
|
+
// Compare realpaths on both sides; a vanished argv[1] path falls through
|
|
679
|
+
// to the plain comparison rather than crashing the guard.
|
|
680
|
+
const argvReal = (() => {
|
|
681
|
+
try { return realpathSync(process.argv[1]); } catch { return process.argv[1]; }
|
|
682
|
+
})();
|
|
683
|
+
return import.meta.url === pathToFileURL(argvReal).href;
|
|
670
684
|
} catch {
|
|
671
685
|
return false;
|
|
672
686
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "run402",
|
|
3
|
-
"version": "4.39.
|
|
3
|
+
"version": "4.39.1",
|
|
4
4
|
"description": "CLI for Run402 — full-stack backend infrastructure for AI agents: Postgres, auth, storage, serverless functions and atomic deploys. Paid with x402/MPP. Includes $0.03 image generation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|