@node9/proxy 1.58.0 → 1.58.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/dist/cli.js +17 -3
- package/dist/cli.mjs +17 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -53001,8 +53001,17 @@ function ghHeaders() {
|
|
|
53001
53001
|
return h;
|
|
53002
53002
|
}
|
|
53003
53003
|
async function ghGet(url) {
|
|
53004
|
-
|
|
53005
|
-
|
|
53004
|
+
let res;
|
|
53005
|
+
try {
|
|
53006
|
+
res = await (0, import_undici.request)(url, {
|
|
53007
|
+
headers: ghHeaders(),
|
|
53008
|
+
headersTimeout: 1e4,
|
|
53009
|
+
bodyTimeout: 1e4
|
|
53010
|
+
});
|
|
53011
|
+
} catch {
|
|
53012
|
+
return { status: 0, json: null };
|
|
53013
|
+
}
|
|
53014
|
+
const body = await res.body.text().catch(() => "");
|
|
53006
53015
|
let json = null;
|
|
53007
53016
|
try {
|
|
53008
53017
|
json = JSON.parse(body);
|
|
@@ -53011,6 +53020,7 @@ async function ghGet(url) {
|
|
|
53011
53020
|
return { status: res.statusCode, json };
|
|
53012
53021
|
}
|
|
53013
53022
|
var RATE_LIMIT_NOTE = "GitHub rate limit hit \u2014 results may be INCOMPLETE (a missing file could be unread, not absent). Set GITHUB_TOKEN.";
|
|
53023
|
+
var NETWORK_NOTE = "A network error/timeout occurred \u2014 results may be INCOMPLETE (some files were not fetched).";
|
|
53014
53024
|
async function fetchOne(owner, repo, filePath, notes) {
|
|
53015
53025
|
const url = `https://api.github.com/repos/${owner}/${repo}/contents/${filePath}`;
|
|
53016
53026
|
const { status, json } = await ghGet(url);
|
|
@@ -53018,6 +53028,10 @@ async function fetchOne(owner, repo, filePath, notes) {
|
|
|
53018
53028
|
if (!notes.includes(RATE_LIMIT_NOTE)) notes.push(RATE_LIMIT_NOTE);
|
|
53019
53029
|
return null;
|
|
53020
53030
|
}
|
|
53031
|
+
if (status === 0) {
|
|
53032
|
+
if (!notes.includes(NETWORK_NOTE)) notes.push(NETWORK_NOTE);
|
|
53033
|
+
return null;
|
|
53034
|
+
}
|
|
53021
53035
|
if (status !== 200 || !json || typeof json !== "object") return null;
|
|
53022
53036
|
const f = json;
|
|
53023
53037
|
if (f.type !== "file" || typeof f.content !== "string") return null;
|
|
@@ -53166,7 +53180,7 @@ function hasActorGate(wf, raw) {
|
|
|
53166
53180
|
function permsElevated(wf) {
|
|
53167
53181
|
const check = (p) => {
|
|
53168
53182
|
const s = str(p);
|
|
53169
|
-
return /contents
|
|
53183
|
+
return /["']?(contents|id-token|packages)["']?\s*:\s*["']?write/i.test(s);
|
|
53170
53184
|
};
|
|
53171
53185
|
return check(wf.permissions) || Object.values(wf.jobs ?? {}).some((j) => check(j.permissions));
|
|
53172
53186
|
}
|
package/dist/cli.mjs
CHANGED
|
@@ -52994,8 +52994,17 @@ function ghHeaders() {
|
|
|
52994
52994
|
return h;
|
|
52995
52995
|
}
|
|
52996
52996
|
async function ghGet(url) {
|
|
52997
|
-
|
|
52998
|
-
|
|
52997
|
+
let res;
|
|
52998
|
+
try {
|
|
52999
|
+
res = await (0, import_undici.request)(url, {
|
|
53000
|
+
headers: ghHeaders(),
|
|
53001
|
+
headersTimeout: 1e4,
|
|
53002
|
+
bodyTimeout: 1e4
|
|
53003
|
+
});
|
|
53004
|
+
} catch {
|
|
53005
|
+
return { status: 0, json: null };
|
|
53006
|
+
}
|
|
53007
|
+
const body = await res.body.text().catch(() => "");
|
|
52999
53008
|
let json = null;
|
|
53000
53009
|
try {
|
|
53001
53010
|
json = JSON.parse(body);
|
|
@@ -53004,6 +53013,7 @@ async function ghGet(url) {
|
|
|
53004
53013
|
return { status: res.statusCode, json };
|
|
53005
53014
|
}
|
|
53006
53015
|
var RATE_LIMIT_NOTE = "GitHub rate limit hit \u2014 results may be INCOMPLETE (a missing file could be unread, not absent). Set GITHUB_TOKEN.";
|
|
53016
|
+
var NETWORK_NOTE = "A network error/timeout occurred \u2014 results may be INCOMPLETE (some files were not fetched).";
|
|
53007
53017
|
async function fetchOne(owner, repo, filePath, notes) {
|
|
53008
53018
|
const url = `https://api.github.com/repos/${owner}/${repo}/contents/${filePath}`;
|
|
53009
53019
|
const { status, json } = await ghGet(url);
|
|
@@ -53011,6 +53021,10 @@ async function fetchOne(owner, repo, filePath, notes) {
|
|
|
53011
53021
|
if (!notes.includes(RATE_LIMIT_NOTE)) notes.push(RATE_LIMIT_NOTE);
|
|
53012
53022
|
return null;
|
|
53013
53023
|
}
|
|
53024
|
+
if (status === 0) {
|
|
53025
|
+
if (!notes.includes(NETWORK_NOTE)) notes.push(NETWORK_NOTE);
|
|
53026
|
+
return null;
|
|
53027
|
+
}
|
|
53014
53028
|
if (status !== 200 || !json || typeof json !== "object") return null;
|
|
53015
53029
|
const f = json;
|
|
53016
53030
|
if (f.type !== "file" || typeof f.content !== "string") return null;
|
|
@@ -53159,7 +53173,7 @@ function hasActorGate(wf, raw) {
|
|
|
53159
53173
|
function permsElevated(wf) {
|
|
53160
53174
|
const check = (p) => {
|
|
53161
53175
|
const s = str(p);
|
|
53162
|
-
return /contents
|
|
53176
|
+
return /["']?(contents|id-token|packages)["']?\s*:\s*["']?write/i.test(s);
|
|
53163
53177
|
};
|
|
53164
53178
|
return check(wf.permissions) || Object.values(wf.jobs ?? {}).some((j) => check(j.permissions));
|
|
53165
53179
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node9/proxy",
|
|
3
|
-
"version": "1.58.
|
|
3
|
+
"version": "1.58.1",
|
|
4
4
|
"description": "The Sudo Command for AI Agents. Execution Security for Claude Code, Codex, Gemini, Cursor, Opencode, Pi, and any MCP server.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|