@ra3orblade/swarm 0.13.0 → 0.13.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/dist/swarm-hook.js +9 -5
- package/dist/swarm-mcp.js +994 -1376
- package/dist/swarm.js +47 -47
- package/dist/swarmd.js +467 -418
- package/package.json +1 -1
- package/web/dashboard.css +1 -1
- package/web/dashboard.js +22 -17
- package/web/index.html +2 -3
- package/web/menus.js +7 -7
- package/web/release-notes.js +1 -1
package/dist/swarm-hook.js
CHANGED
|
@@ -196,22 +196,26 @@ function otherLiveInSameTree(current, sessions, now, withinMs = LIVE_WINDOW_MS)
|
|
|
196
196
|
}
|
|
197
197
|
return null;
|
|
198
198
|
}
|
|
199
|
+
var GIT_GLOBAL_OPTS = "(?:\\s+(?:-C\\s+\\S+|-c\\s+\\S+|--git-dir(?:=|\\s+)\\S+|--work-tree(?:=|\\s+)\\S+|--namespace(?:=|\\s+)\\S+|--no-pager|--paginate|--bare|--literal-pathspecs|--exec-path(?:=\\S+)?))*";
|
|
200
|
+
function gitVerb(verb, tail) {
|
|
201
|
+
return new RegExp(`\\bgit${GIT_GLOBAL_OPTS}\\s+${verb}${tail}`);
|
|
202
|
+
}
|
|
199
203
|
function isBroadStage(cmd) {
|
|
200
204
|
const c = cmd.trim();
|
|
201
|
-
if (
|
|
205
|
+
if (gitVerb("add", "\\s+(-A\\b|--all\\b|\\.(\\s|$))").test(c))
|
|
202
206
|
return true;
|
|
203
|
-
if (
|
|
207
|
+
if (gitVerb("commit", "\\b[^|&;]*\\s-[a-zA-Z]*a").test(c))
|
|
204
208
|
return true;
|
|
205
|
-
if (
|
|
209
|
+
if (gitVerb("add", "\\s*$").test(c))
|
|
206
210
|
return true;
|
|
207
211
|
return false;
|
|
208
212
|
}
|
|
209
213
|
function isDestructiveGit(cmd) {
|
|
210
214
|
const c = cmd.trim();
|
|
211
|
-
return
|
|
215
|
+
return gitVerb("reset", "\\s+[^|&;]*--hard\\b").test(c) || gitVerb("checkout", "\\s+(--\\s+)?\\.(\\s|$)").test(c) || gitVerb("checkout", "\\s+-f\\b").test(c) || gitVerb("restore", "\\s+(--\\s+)?\\.(\\s|$)").test(c) || gitVerb("clean", "\\s+[^|&;]*-[a-zA-Z]*f").test(c) || gitVerb("stash", "\\s+(drop|clear)\\b").test(c) || gitVerb("branch", "\\s+[^|&;]*-[a-zA-Z]*D").test(c);
|
|
212
216
|
}
|
|
213
217
|
function isPatternKill(cmd) {
|
|
214
|
-
return /\bpkill\s
|
|
218
|
+
return /\bpkill\s+(-[a-zA-Z]*f\b|--full\b)/.test(cmd) || /\bkillall\b/.test(cmd) || /\bpgrep\s+(-[a-zA-Z]*f\b|--full\b)[^|]*\|\s*[^|]*\bkill\b/.test(cmd);
|
|
215
219
|
}
|
|
216
220
|
function killedPorts(cmd) {
|
|
217
221
|
const ports = new Set;
|