@nanocollective/roster 0.1.0-beta.1 → 0.1.0-beta.2
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 +1 -0
- package/dist/cli.js +17 -5
- package/dist/worker/index.js +17 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,6 +47,7 @@ roster run cto # one run now, followed to the end
|
|
|
47
47
|
roster doctor # is any of this actually wired up
|
|
48
48
|
roster fix # every finding, as one brief for a coding agent
|
|
49
49
|
roster portal # read every brain, and the docs, locally
|
|
50
|
+
roster portal deploy # the same portal on your own URL, behind Sign in with GitHub
|
|
50
51
|
roster prompt cto # the exact prompt a run will be sent
|
|
51
52
|
roster upgrade # take framework changes without losing your edits
|
|
52
53
|
roster retire cto # let someone go, with their brain kept
|
package/dist/cli.js
CHANGED
|
@@ -3038,11 +3038,22 @@ function githubClient(token, opts = {}) {
|
|
|
3038
3038
|
body2 = JSON.stringify(o.body);
|
|
3039
3039
|
h["content-type"] = "application/json";
|
|
3040
3040
|
}
|
|
3041
|
+
const reads = method === "GET" || o.retry === true;
|
|
3041
3042
|
let res;
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3043
|
+
for (let attempt = 0; ; attempt++) {
|
|
3044
|
+
try {
|
|
3045
|
+
res = await doFetch(url, { method, headers: h, body: body2 });
|
|
3046
|
+
} catch (err) {
|
|
3047
|
+
if (reads && attempt === 0) continue;
|
|
3048
|
+
return { ok: false, error: `GitHub could not be reached: ${err.message}` };
|
|
3049
|
+
}
|
|
3050
|
+
if (reads && attempt === 0 && [502, 503, 504].includes(res.status)) {
|
|
3051
|
+
await res.body?.cancel().catch(() => {
|
|
3052
|
+
});
|
|
3053
|
+
await new Promise((r) => setTimeout(r, 400));
|
|
3054
|
+
continue;
|
|
3055
|
+
}
|
|
3056
|
+
break;
|
|
3046
3057
|
}
|
|
3047
3058
|
if (res.status === 304 && kept) {
|
|
3048
3059
|
seen.delete(key);
|
|
@@ -3072,7 +3083,8 @@ function githubClient(token, opts = {}) {
|
|
|
3072
3083
|
const res = await request(
|
|
3073
3084
|
"POST",
|
|
3074
3085
|
"graphql",
|
|
3075
|
-
|
|
3086
|
+
// A query reads; a mutation writes, and is never asked twice.
|
|
3087
|
+
{ body: { query: query2, variables: vars }, retry: !/^\s*mutation\b/.test(query2) }
|
|
3076
3088
|
);
|
|
3077
3089
|
if (!res.ok) return { ok: false, status: res.status, error: res.error };
|
|
3078
3090
|
const errors = res.data?.errors ?? [];
|
package/dist/worker/index.js
CHANGED
|
@@ -35,11 +35,22 @@ function githubClient(token, opts = {}) {
|
|
|
35
35
|
body2 = JSON.stringify(o.body);
|
|
36
36
|
h["content-type"] = "application/json";
|
|
37
37
|
}
|
|
38
|
+
const reads = method === "GET" || o.retry === true;
|
|
38
39
|
let res;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
for (let attempt = 0; ; attempt++) {
|
|
41
|
+
try {
|
|
42
|
+
res = await doFetch(url, { method, headers: h, body: body2 });
|
|
43
|
+
} catch (err) {
|
|
44
|
+
if (reads && attempt === 0) continue;
|
|
45
|
+
return { ok: false, error: `GitHub could not be reached: ${err.message}` };
|
|
46
|
+
}
|
|
47
|
+
if (reads && attempt === 0 && [502, 503, 504].includes(res.status)) {
|
|
48
|
+
await res.body?.cancel().catch(() => {
|
|
49
|
+
});
|
|
50
|
+
await new Promise((r) => setTimeout(r, 400));
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
break;
|
|
43
54
|
}
|
|
44
55
|
if (res.status === 304 && kept) {
|
|
45
56
|
seen.delete(key);
|
|
@@ -69,7 +80,8 @@ function githubClient(token, opts = {}) {
|
|
|
69
80
|
const res = await request(
|
|
70
81
|
"POST",
|
|
71
82
|
"graphql",
|
|
72
|
-
|
|
83
|
+
// A query reads; a mutation writes, and is never asked twice.
|
|
84
|
+
{ body: { query: query2, variables: vars }, retry: !/^\s*mutation\b/.test(query2) }
|
|
73
85
|
);
|
|
74
86
|
if (!res.ok) return { ok: false, status: res.status, error: res.error };
|
|
75
87
|
const errors = res.data?.errors ?? [];
|