@staff0rd/assist 0.442.1 → 0.442.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/commands/sessions/web/bundle.js +58 -58
- package/dist/index.js +23 -17
- 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.442.
|
|
9
|
+
version: "0.442.2",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -27716,6 +27716,11 @@ function deriveRestoreStatus(persisted) {
|
|
|
27716
27716
|
return deriveTranscriptStatus(entries) === "running" ? "running" : "waiting";
|
|
27717
27717
|
}
|
|
27718
27718
|
|
|
27719
|
+
// src/commands/sessions/daemon/hasTranscriptOnDisk.ts
|
|
27720
|
+
function hasTranscriptOnDisk(persisted) {
|
|
27721
|
+
return !!persisted.claudeSessionId && !!findTranscriptPathSync(persisted.cwd, persisted.claudeSessionId);
|
|
27722
|
+
}
|
|
27723
|
+
|
|
27719
27724
|
// src/commands/sessions/daemon/runningSession.ts
|
|
27720
27725
|
function runningSession(base, persisted, pty2) {
|
|
27721
27726
|
return restoredSession(base, persisted, pty2, "running");
|
|
@@ -27769,9 +27774,6 @@ function resumeViaClaude(id, persisted, base, idle) {
|
|
|
27769
27774
|
);
|
|
27770
27775
|
return idle ? waitingSession(base, persisted, pty2) : runningSession(base, persisted, pty2);
|
|
27771
27776
|
}
|
|
27772
|
-
function hasTranscriptOnDisk(persisted) {
|
|
27773
|
-
return !!persisted.claudeSessionId && !!findTranscriptPathSync(persisted.cwd, persisted.claudeSessionId);
|
|
27774
|
-
}
|
|
27775
27777
|
function unrecoverableClaude(id, persisted) {
|
|
27776
27778
|
return errorSession(
|
|
27777
27779
|
id,
|
|
@@ -27808,6 +27810,18 @@ function isUpdate(persisted) {
|
|
|
27808
27810
|
return persisted.commandType === "assist" && persisted.assistArgs?.[0] === "update";
|
|
27809
27811
|
}
|
|
27810
27812
|
|
|
27813
|
+
// src/commands/sessions/daemon/needsWrapperRelaunch.ts
|
|
27814
|
+
var LAUNCH_COMMANDS = ["draft", "feat", "bug", "refine"];
|
|
27815
|
+
function needsWrapperRelaunch(persisted) {
|
|
27816
|
+
return isBacklogRun(persisted) || isOnceLaunch(persisted);
|
|
27817
|
+
}
|
|
27818
|
+
function isBacklogRun(persisted) {
|
|
27819
|
+
return persisted.commandType === "assist" && persisted.assistArgs?.[0] === "backlog" && persisted.assistArgs?.[1] === "run";
|
|
27820
|
+
}
|
|
27821
|
+
function isOnceLaunch(persisted) {
|
|
27822
|
+
return persisted.commandType === "assist" && !!persisted.assistArgs && LAUNCH_COMMANDS.includes(persisted.assistArgs[0]) && persisted.assistArgs.includes("--once");
|
|
27823
|
+
}
|
|
27824
|
+
|
|
27811
27825
|
// src/commands/sessions/daemon/restoreSession.ts
|
|
27812
27826
|
function restoreSession(id, persisted) {
|
|
27813
27827
|
const base = restoreBase(id, persisted);
|
|
@@ -27815,26 +27829,18 @@ function restoreSession(id, persisted) {
|
|
|
27815
27829
|
if (isUpdate(persisted)) return updatedSession(id, persisted);
|
|
27816
27830
|
const idle = deriveRestoreStatus(persisted) !== "running";
|
|
27817
27831
|
if (needsWrapperRelaunch(persisted)) {
|
|
27832
|
+
const resumesWrittenConversation = hasTranscriptOnDisk(persisted);
|
|
27833
|
+
const reattachesIdleConversation = idle && resumesWrittenConversation;
|
|
27818
27834
|
const pty2 = spawnPty(
|
|
27819
|
-
assistResumeArgs(persisted),
|
|
27835
|
+
resumesWrittenConversation ? assistResumeArgs(persisted) : assistResumeArgs({ assistArgs: persisted.assistArgs }),
|
|
27820
27836
|
persisted.cwd,
|
|
27821
27837
|
id,
|
|
27822
|
-
|
|
27838
|
+
reattachesIdleConversation ? { ASSIST_RESUME_IDLE: "1" } : void 0
|
|
27823
27839
|
);
|
|
27824
|
-
return
|
|
27840
|
+
return reattachesIdleConversation ? waitingSession(base, persisted, pty2) : runningSession(base, persisted, pty2);
|
|
27825
27841
|
}
|
|
27826
27842
|
return restoreInteractiveSession(id, persisted, base, idle);
|
|
27827
27843
|
}
|
|
27828
|
-
function needsWrapperRelaunch(persisted) {
|
|
27829
|
-
return isBacklogRun(persisted) || isOnceLaunch(persisted) && !!persisted.claudeSessionId;
|
|
27830
|
-
}
|
|
27831
|
-
function isBacklogRun(persisted) {
|
|
27832
|
-
return persisted.commandType === "assist" && persisted.assistArgs?.[0] === "backlog" && persisted.assistArgs?.[1] === "run";
|
|
27833
|
-
}
|
|
27834
|
-
var LAUNCH_COMMANDS = ["draft", "feat", "bug", "refine"];
|
|
27835
|
-
function isOnceLaunch(persisted) {
|
|
27836
|
-
return persisted.commandType === "assist" && !!persisted.assistArgs && LAUNCH_COMMANDS.includes(persisted.assistArgs[0]) && persisted.assistArgs.includes("--once");
|
|
27837
|
-
}
|
|
27838
27844
|
|
|
27839
27845
|
// src/commands/sessions/daemon/restoreOne.ts
|
|
27840
27846
|
function restoreOne(persisted, spawn12, sessions) {
|