@sjawhar/pi-envoy 10.17.5 → 10.17.7
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/dispatch.js +28 -7
- package/dist/skills/envoy/SKILL.md +3 -1
- package/package.json +1 -1
package/dist/dispatch.js
CHANGED
|
@@ -15027,13 +15027,34 @@ function machineID() {
|
|
|
15027
15027
|
|
|
15028
15028
|
// ../envoy-client/src/dispatch-cwd.ts
|
|
15029
15029
|
var execFileAsync = promisify(execFile);
|
|
15030
|
-
var defaultExec = (file2, args,
|
|
15031
|
-
|
|
15030
|
+
var defaultExec = (file2, args, { cwd, signal }) => {
|
|
15031
|
+
const call = execFileAsync(file2, args, { cwd, signal });
|
|
15032
|
+
const kill = () => call.child.kill("SIGKILL");
|
|
15033
|
+
if (signal.aborted)
|
|
15034
|
+
kill();
|
|
15035
|
+
else
|
|
15036
|
+
signal.addEventListener("abort", kill, { once: true });
|
|
15037
|
+
return call;
|
|
15038
|
+
};
|
|
15039
|
+
var REMOTE_LOOKUP_MS = 5000;
|
|
15040
|
+
var TMUX_PANE_LOOKUP_MS = 1000;
|
|
15041
|
+
async function tryExec(exec, file2, args, cwd, limitMs) {
|
|
15042
|
+
const controller = new AbortController;
|
|
15043
|
+
const expired = Promise.withResolvers();
|
|
15044
|
+
const timer = setTimeout(() => {
|
|
15045
|
+
controller.abort();
|
|
15046
|
+
expired.resolve(null);
|
|
15047
|
+
}, limitMs);
|
|
15032
15048
|
try {
|
|
15033
|
-
const
|
|
15034
|
-
|
|
15049
|
+
const answer = await Promise.race([
|
|
15050
|
+
exec(file2, args, { cwd, signal: controller.signal }),
|
|
15051
|
+
expired.promise
|
|
15052
|
+
]);
|
|
15053
|
+
return answer?.stdout ?? null;
|
|
15035
15054
|
} catch {
|
|
15036
15055
|
return null;
|
|
15056
|
+
} finally {
|
|
15057
|
+
clearTimeout(timer);
|
|
15037
15058
|
}
|
|
15038
15059
|
}
|
|
15039
15060
|
function parseRemoteList(stdout) {
|
|
@@ -15072,12 +15093,12 @@ function parseGitHubRemoteUrl(url2) {
|
|
|
15072
15093
|
return null;
|
|
15073
15094
|
}
|
|
15074
15095
|
async function resolveCwdRepo(cwd, exec) {
|
|
15075
|
-
const jjOutput = await tryExec(exec, "jj", ["git", "remote", "list"], cwd);
|
|
15096
|
+
const jjOutput = await tryExec(exec, "jj", ["git", "remote", "list"], cwd, REMOTE_LOOKUP_MS);
|
|
15076
15097
|
if (jjOutput !== null) {
|
|
15077
15098
|
const url2 = selectRemoteUrl(parseRemoteList(jjOutput));
|
|
15078
15099
|
return url2 ? parseGitHubRemoteUrl(url2) : null;
|
|
15079
15100
|
}
|
|
15080
|
-
const originUrl = await tryExec(exec, "git", ["remote", "get-url", "origin"], cwd);
|
|
15101
|
+
const originUrl = await tryExec(exec, "git", ["remote", "get-url", "origin"], cwd, REMOTE_LOOKUP_MS);
|
|
15081
15102
|
return originUrl ? parseGitHubRemoteUrl(originUrl) : null;
|
|
15082
15103
|
}
|
|
15083
15104
|
async function resolveOrigin(env, exec, cwd) {
|
|
@@ -15087,7 +15108,7 @@ async function resolveOrigin(env, exec, cwd) {
|
|
|
15087
15108
|
};
|
|
15088
15109
|
const pane = env.TMUX_PANE;
|
|
15089
15110
|
if (pane) {
|
|
15090
|
-
const output = await tryExec(exec, "tmux", ["display-message", "-p", "-t", pane, "#S:#I.#P #{pane_id}"], cwd);
|
|
15111
|
+
const output = await tryExec(exec, "tmux", ["display-message", "-p", "-t", pane, "#S:#I.#P #{pane_id}"], cwd, TMUX_PANE_LOOKUP_MS);
|
|
15091
15112
|
const [target, paneId] = output?.trim().split(" ") ?? [];
|
|
15092
15113
|
if (target)
|
|
15093
15114
|
origin.tmux = target;
|
|
@@ -167,7 +167,9 @@ advertises.
|
|
|
167
167
|
Subscribe to `notifications.github.example-org.example-repo.pr.42.>` and end the turn. The single
|
|
168
168
|
`pr.42.checks` event whose `sha` is the current head wakes you when it settles (an earlier
|
|
169
169
|
commit's settlement can arrive first); a `pr.42` `closed` event with
|
|
170
|
-
`merged: true` tells you the PR merged. Do not create `gh` pollers.
|
|
170
|
+
`merged: true` tells you the PR merged. Do not create `gh` pollers. A Legion implementer waits this
|
|
171
|
+
way only on a re-run of a red its task names; otherwise it pushes and completes its phase, and the
|
|
172
|
+
daemon reads CI for it (`skill://legion-worker`).
|
|
171
173
|
Settlement waits for the commit to be quiet for a few seconds, every reported check run to finish,
|
|
172
174
|
and every recorded GitHub check suite to be `completed`. It covers those reported checks and suites
|
|
173
175
|
for that commit, not GitHub's required-checks set; until then, a silent subscription is normal.
|