@atolis-hq/wake 0.1.9 → 0.1.10
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/src/main.js +13 -1
- package/dist/src/version.js +1 -1
- package/docker/entrypoint.sh +20 -5
- package/package.json +1 -1
package/dist/src/main.js
CHANGED
|
@@ -52,6 +52,18 @@ function routesOnlyToFake(config) {
|
|
|
52
52
|
return first !== undefined && config.runners[first]?.kind === 'fake';
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
+
async function resolveSelfLogin(githubClient) {
|
|
56
|
+
if (githubClient === undefined) {
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
return await githubClient.getAuthenticatedLogin();
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
console.error(`wake: failed to resolve authenticated GitHub login; continuing without self-login bot detection: ${String(error)}`);
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
55
67
|
export function formatTickFailureDetails(runRecord) {
|
|
56
68
|
if (runRecord === null) {
|
|
57
69
|
return null;
|
|
@@ -180,7 +192,7 @@ export async function buildRuntime(args) {
|
|
|
180
192
|
// by direct API/CLI call (not through formatWakeComment, so it never
|
|
181
193
|
// carries the wake:agent marker) as bot-authored instead of a fresh human
|
|
182
194
|
// reply that would re-trigger another run against itself.
|
|
183
|
-
const selfLogin =
|
|
195
|
+
const selfLogin = await resolveSelfLogin(githubClient);
|
|
184
196
|
const artifactVerifier = prTrackingEnabled && githubClient !== undefined
|
|
185
197
|
? createGitHubArtifactVerifier({ client: githubClient })
|
|
186
198
|
: undefined;
|
package/dist/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const wakeVersion = "0.1.
|
|
1
|
+
export const wakeVersion = "0.1.10+g7ed704e";
|
package/docker/entrypoint.sh
CHANGED
|
@@ -44,6 +44,25 @@ req.setTimeout(1000, () => req.destroy());
|
|
|
44
44
|
echo "wake ui: ngrok tunnel started but public URL was not discovered; see /wake/logs/ngrok.log"
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
supervise_wake_start() {
|
|
48
|
+
local restart_delay="${WAKE_START_RESTART_DELAY_SECONDS:-10}"
|
|
49
|
+
|
|
50
|
+
while true; do
|
|
51
|
+
echo "wake start: starting resident loop"
|
|
52
|
+
node /app/dist/src/main.js start \
|
|
53
|
+
--wake-root /wake \
|
|
54
|
+
>> /wake/logs/start.log 2>&1 &
|
|
55
|
+
|
|
56
|
+
local child_pid="$!"
|
|
57
|
+
echo "${child_pid}" > /wake/logs/start.pid
|
|
58
|
+
|
|
59
|
+
wait "${child_pid}"
|
|
60
|
+
local exit_code="$?"
|
|
61
|
+
echo "wake start: resident loop exited with status ${exit_code}; restarting in ${restart_delay}s"
|
|
62
|
+
sleep "${restart_delay}"
|
|
63
|
+
done
|
|
64
|
+
}
|
|
65
|
+
|
|
47
66
|
if [ "${WAKE_UI_ENABLED:-false}" = "true" ]; then
|
|
48
67
|
echo "wake ui: starting on 0.0.0.0:${WAKE_UI_PORT:-4317}"
|
|
49
68
|
node /app/dist/src/main.js ui \
|
|
@@ -65,11 +84,7 @@ if [ "${WAKE_UI_ENABLED:-false}" = "true" ]; then
|
|
|
65
84
|
fi
|
|
66
85
|
|
|
67
86
|
if [ "${WAKE_START_ENABLED:-false}" = "true" ]; then
|
|
68
|
-
|
|
69
|
-
node /app/dist/src/main.js start \
|
|
70
|
-
--wake-root /wake \
|
|
71
|
-
>> /wake/logs/start.log 2>&1 &
|
|
72
|
-
echo "$!" > /wake/logs/start.pid
|
|
87
|
+
supervise_wake_start &
|
|
73
88
|
fi
|
|
74
89
|
|
|
75
90
|
exec sleep infinity
|