@staff0rd/assist 0.415.0 → 0.416.0
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/commands/sessions/web/bundle.js +353 -353
- package/dist/index.js +25 -27
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@staff0rd/assist",
|
|
9
|
-
version: "0.
|
|
9
|
+
version: "0.416.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -220,15 +220,38 @@ function mergeDenyRules(globalDeny, projectDeny) {
|
|
|
220
220
|
const globalOnly = globalDeny.filter((r) => !projectPatterns.has(r.pattern));
|
|
221
221
|
return [...globalOnly, ...projectDeny];
|
|
222
222
|
}
|
|
223
|
+
function runKey(r) {
|
|
224
|
+
return typeof r.name === "string" ? r.name : void 0;
|
|
225
|
+
}
|
|
226
|
+
function mergeRunConfigs(globalRun, projectRun) {
|
|
227
|
+
if (!globalRun && !projectRun) return void 0;
|
|
228
|
+
if (!globalRun) return projectRun;
|
|
229
|
+
if (!projectRun) return globalRun;
|
|
230
|
+
const projectNames = new Set(
|
|
231
|
+
projectRun.map(runKey).filter((n) => n !== void 0)
|
|
232
|
+
);
|
|
233
|
+
const globalOnly = globalRun.filter((r) => {
|
|
234
|
+
const key = runKey(r);
|
|
235
|
+
return key === void 0 || !projectNames.has(key);
|
|
236
|
+
});
|
|
237
|
+
return [...globalOnly, ...projectRun];
|
|
238
|
+
}
|
|
223
239
|
function mergeRawConfigs(globalRaw, projectRaw) {
|
|
224
240
|
const deny = mergeDenyRules(
|
|
225
241
|
globalRaw.deny,
|
|
226
242
|
projectRaw.deny
|
|
227
243
|
);
|
|
244
|
+
const run4 = mergeRunConfigs(
|
|
245
|
+
globalRaw.run,
|
|
246
|
+
projectRaw.run
|
|
247
|
+
);
|
|
228
248
|
const merged = { ...globalRaw, ...projectRaw };
|
|
229
249
|
if (deny !== void 0) {
|
|
230
250
|
merged.deny = deny;
|
|
231
251
|
}
|
|
252
|
+
if (run4 !== void 0) {
|
|
253
|
+
merged.run = run4;
|
|
254
|
+
}
|
|
232
255
|
const globalSubtasks = globalRaw.subtasks;
|
|
233
256
|
const projectSubtasks = projectRaw.subtasks;
|
|
234
257
|
if (globalSubtasks || projectSubtasks) {
|
|
@@ -24810,7 +24833,6 @@ function toSessionInfo({
|
|
|
24810
24833
|
cwd,
|
|
24811
24834
|
restored,
|
|
24812
24835
|
error,
|
|
24813
|
-
errorOutput,
|
|
24814
24836
|
activity: activity2,
|
|
24815
24837
|
autoRun,
|
|
24816
24838
|
autoAdvance,
|
|
@@ -24838,7 +24860,6 @@ function toSessionInfo({
|
|
|
24838
24860
|
cwd,
|
|
24839
24861
|
restored,
|
|
24840
24862
|
error,
|
|
24841
|
-
errorOutput,
|
|
24842
24863
|
activity: activity2,
|
|
24843
24864
|
autoRun,
|
|
24844
24865
|
autoAdvance,
|
|
@@ -25497,26 +25518,6 @@ function makeStatusChangeHandler(dismiss, notify2, reuseForRun) {
|
|
|
25497
25518
|
return (s, status3, exitCode) => applyStatusChange(s, status3, exitCode, dismiss, notify2, reuseForRun);
|
|
25498
25519
|
}
|
|
25499
25520
|
|
|
25500
|
-
// src/commands/sessions/daemon/errorTail.ts
|
|
25501
|
-
var ESC3 = String.fromCharCode(27);
|
|
25502
|
-
var CSI = String.fromCharCode(155);
|
|
25503
|
-
var BEL = String.fromCharCode(7);
|
|
25504
|
-
var ANSI = new RegExp(
|
|
25505
|
-
String.raw`[${ESC3}${CSI}][[\]()#;?]*(?:(?:[a-zA-Z\d]*(?:;[a-zA-Z\d]*)*)?${BEL}|(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-ntqry=><~])`,
|
|
25506
|
-
"g"
|
|
25507
|
-
);
|
|
25508
|
-
var MAX_TAIL_LINES = 40;
|
|
25509
|
-
var MAX_TAIL_CHARS = 4e3;
|
|
25510
|
-
function stripAnsi(text17) {
|
|
25511
|
-
return text17.replace(ANSI, "");
|
|
25512
|
-
}
|
|
25513
|
-
function errorTail(scrollback) {
|
|
25514
|
-
const clean = stripAnsi(scrollback).replace(/\r\n?/g, "\n").replace(/[ \t]+\n/g, "\n").trimEnd();
|
|
25515
|
-
if (clean.length === 0) return "";
|
|
25516
|
-
const tail = clean.split("\n").slice(-MAX_TAIL_LINES).join("\n");
|
|
25517
|
-
return tail.length > MAX_TAIL_CHARS ? tail.slice(-MAX_TAIL_CHARS) : tail;
|
|
25518
|
-
}
|
|
25519
|
-
|
|
25520
25521
|
// src/commands/sessions/daemon/handleFailedResume.ts
|
|
25521
25522
|
function handleFailedResume(session, exitCode, onStatusChange) {
|
|
25522
25523
|
const failed2 = session.restored === true && exitCode !== 0 && session.scrollback.length === 0;
|
|
@@ -25650,12 +25651,9 @@ function handlePtyExit(session, exitCode, onStatusChange) {
|
|
|
25650
25651
|
if (handleFailedResume(session, exitCode, onStatusChange)) return;
|
|
25651
25652
|
const priorStatus = session.status;
|
|
25652
25653
|
if (exitCode !== 0) {
|
|
25653
|
-
const tail = errorTail(session.scrollback);
|
|
25654
25654
|
session.error = `process exited with code ${exitCode}`;
|
|
25655
|
-
session.errorOutput = tail || void 0;
|
|
25656
25655
|
daemonLog(
|
|
25657
|
-
`session ${session.id} ("${session.name}") pty exited with code ${exitCode} from status "${priorStatus}" \u2014 unexpected exit, marking error
|
|
25658
|
-
${tail || "(no output captured)"}`
|
|
25656
|
+
`session ${session.id} ("${session.name}") pty exited with code ${exitCode} from status "${priorStatus}" \u2014 unexpected exit, marking error`
|
|
25659
25657
|
);
|
|
25660
25658
|
onStatusChange(session, "error", exitCode);
|
|
25661
25659
|
return;
|