claude-threads 1.9.2 → 1.9.4
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/CHANGELOG.md +14 -0
- package/dist/index.js +484 -431
- package/dist/mcp/permission-server.js +75 -48
- package/package.json +1 -1
|
@@ -52899,9 +52899,36 @@ class MessageManager {
|
|
|
52899
52899
|
}
|
|
52900
52900
|
dispose() {
|
|
52901
52901
|
this.cancelScheduledFlush();
|
|
52902
|
+
this.postTracker.clearSession(this.sessionId);
|
|
52902
52903
|
this.reset();
|
|
52903
52904
|
}
|
|
52904
52905
|
}
|
|
52906
|
+
// src/session/lifecycle-fsm.ts
|
|
52907
|
+
var log4 = createLogger("fsm");
|
|
52908
|
+
var ALLOWED_TRANSITIONS = {
|
|
52909
|
+
starting: new Set(["active", "paused", "interrupted", "cancelling", "restarting"]),
|
|
52910
|
+
active: new Set([
|
|
52911
|
+
"active",
|
|
52912
|
+
"processing",
|
|
52913
|
+
"paused",
|
|
52914
|
+
"interrupted",
|
|
52915
|
+
"restarting",
|
|
52916
|
+
"cancelling",
|
|
52917
|
+
"ending"
|
|
52918
|
+
]),
|
|
52919
|
+
processing: new Set([
|
|
52920
|
+
"active",
|
|
52921
|
+
"paused",
|
|
52922
|
+
"interrupted",
|
|
52923
|
+
"restarting",
|
|
52924
|
+
"cancelling"
|
|
52925
|
+
]),
|
|
52926
|
+
paused: new Set(["active", "cancelling", "restarting"]),
|
|
52927
|
+
interrupted: new Set(["active", "cancelling", "restarting", "paused"]),
|
|
52928
|
+
restarting: new Set(["active", "paused", "cancelling"]),
|
|
52929
|
+
cancelling: new Set(["ending"]),
|
|
52930
|
+
ending: new Set
|
|
52931
|
+
};
|
|
52905
52932
|
// src/config/index.ts
|
|
52906
52933
|
import { resolve as resolve2, dirname as dirname2 } from "path";
|
|
52907
52934
|
import { homedir } from "os";
|
|
@@ -55659,7 +55686,7 @@ function formatReleaseNotes(notes, formatter) {
|
|
|
55659
55686
|
|
|
55660
55687
|
// src/utils/keep-alive.ts
|
|
55661
55688
|
import { spawn } from "child_process";
|
|
55662
|
-
var
|
|
55689
|
+
var log5 = createLogger("keepalive");
|
|
55663
55690
|
|
|
55664
55691
|
class KeepAliveManager {
|
|
55665
55692
|
activeSessionCount = 0;
|
|
@@ -55674,7 +55701,7 @@ class KeepAliveManager {
|
|
|
55674
55701
|
if (!enabled && this.keepAliveProcess) {
|
|
55675
55702
|
this.stopKeepAlive();
|
|
55676
55703
|
}
|
|
55677
|
-
|
|
55704
|
+
log5.debug(`Keep-alive ${enabled ? "enabled" : "disabled"}`);
|
|
55678
55705
|
}
|
|
55679
55706
|
isEnabled() {
|
|
55680
55707
|
return this.enabled;
|
|
@@ -55684,7 +55711,7 @@ class KeepAliveManager {
|
|
|
55684
55711
|
}
|
|
55685
55712
|
sessionStarted() {
|
|
55686
55713
|
this.activeSessionCount++;
|
|
55687
|
-
|
|
55714
|
+
log5.debug(`Session started (${this.activeSessionCount} active)`);
|
|
55688
55715
|
if (this.activeSessionCount === 1) {
|
|
55689
55716
|
this.startKeepAlive();
|
|
55690
55717
|
}
|
|
@@ -55693,7 +55720,7 @@ class KeepAliveManager {
|
|
|
55693
55720
|
if (this.activeSessionCount > 0) {
|
|
55694
55721
|
this.activeSessionCount--;
|
|
55695
55722
|
}
|
|
55696
|
-
|
|
55723
|
+
log5.debug(`Session ended (${this.activeSessionCount} active)`);
|
|
55697
55724
|
if (this.activeSessionCount === 0) {
|
|
55698
55725
|
this.stopKeepAlive();
|
|
55699
55726
|
}
|
|
@@ -55707,11 +55734,11 @@ class KeepAliveManager {
|
|
|
55707
55734
|
}
|
|
55708
55735
|
startKeepAlive() {
|
|
55709
55736
|
if (!this.enabled) {
|
|
55710
|
-
|
|
55737
|
+
log5.debug("Keep-alive disabled, skipping");
|
|
55711
55738
|
return;
|
|
55712
55739
|
}
|
|
55713
55740
|
if (this.keepAliveProcess) {
|
|
55714
|
-
|
|
55741
|
+
log5.debug("Keep-alive already running");
|
|
55715
55742
|
return;
|
|
55716
55743
|
}
|
|
55717
55744
|
switch (this.platform) {
|
|
@@ -55725,12 +55752,12 @@ class KeepAliveManager {
|
|
|
55725
55752
|
this.startWindowsKeepAlive();
|
|
55726
55753
|
break;
|
|
55727
55754
|
default:
|
|
55728
|
-
|
|
55755
|
+
log5.warn(`Keep-alive not supported on ${this.platform}`);
|
|
55729
55756
|
}
|
|
55730
55757
|
}
|
|
55731
55758
|
stopKeepAlive() {
|
|
55732
55759
|
if (this.keepAliveProcess) {
|
|
55733
|
-
|
|
55760
|
+
log5.debug("Stopping keep-alive");
|
|
55734
55761
|
this.keepAliveProcess.kill();
|
|
55735
55762
|
this.keepAliveProcess = null;
|
|
55736
55763
|
}
|
|
@@ -55742,18 +55769,18 @@ class KeepAliveManager {
|
|
|
55742
55769
|
detached: false
|
|
55743
55770
|
});
|
|
55744
55771
|
this.keepAliveProcess.on("error", (err) => {
|
|
55745
|
-
|
|
55772
|
+
log5.error(`Failed to start caffeinate: ${err.message}`);
|
|
55746
55773
|
this.keepAliveProcess = null;
|
|
55747
55774
|
});
|
|
55748
55775
|
this.keepAliveProcess.on("exit", (code) => {
|
|
55749
55776
|
if (code !== null && code !== 0 && this.activeSessionCount > 0) {
|
|
55750
|
-
|
|
55777
|
+
log5.debug(`caffeinate exited with code ${code}`);
|
|
55751
55778
|
}
|
|
55752
55779
|
this.keepAliveProcess = null;
|
|
55753
55780
|
});
|
|
55754
|
-
|
|
55781
|
+
log5.info("Sleep prevention active (caffeinate)");
|
|
55755
55782
|
} catch (err) {
|
|
55756
|
-
|
|
55783
|
+
log5.error(`Failed to start caffeinate: ${err}`);
|
|
55757
55784
|
}
|
|
55758
55785
|
}
|
|
55759
55786
|
startLinuxKeepAlive() {
|
|
@@ -55769,19 +55796,19 @@ class KeepAliveManager {
|
|
|
55769
55796
|
detached: false
|
|
55770
55797
|
});
|
|
55771
55798
|
this.keepAliveProcess.on("error", (err) => {
|
|
55772
|
-
|
|
55799
|
+
log5.debug(`systemd-inhibit not available: ${err.message}`);
|
|
55773
55800
|
this.keepAliveProcess = null;
|
|
55774
55801
|
this.startLinuxKeepAliveFallback();
|
|
55775
55802
|
});
|
|
55776
55803
|
this.keepAliveProcess.on("exit", (code) => {
|
|
55777
55804
|
if (code !== null && code !== 0 && this.activeSessionCount > 0) {
|
|
55778
|
-
|
|
55805
|
+
log5.debug(`systemd-inhibit exited with code ${code}`);
|
|
55779
55806
|
}
|
|
55780
55807
|
this.keepAliveProcess = null;
|
|
55781
55808
|
});
|
|
55782
|
-
|
|
55809
|
+
log5.info("Sleep prevention active (systemd-inhibit)");
|
|
55783
55810
|
} catch (err) {
|
|
55784
|
-
|
|
55811
|
+
log5.debug(`Failed to start systemd-inhibit: ${err}`);
|
|
55785
55812
|
this.startLinuxKeepAliveFallback();
|
|
55786
55813
|
}
|
|
55787
55814
|
}
|
|
@@ -55795,15 +55822,15 @@ class KeepAliveManager {
|
|
|
55795
55822
|
detached: false
|
|
55796
55823
|
});
|
|
55797
55824
|
this.keepAliveProcess.on("error", (err) => {
|
|
55798
|
-
|
|
55825
|
+
log5.warn(`Linux keep-alive fallback not available: ${err.message}`);
|
|
55799
55826
|
this.keepAliveProcess = null;
|
|
55800
55827
|
});
|
|
55801
55828
|
this.keepAliveProcess.on("exit", () => {
|
|
55802
55829
|
this.keepAliveProcess = null;
|
|
55803
55830
|
});
|
|
55804
|
-
|
|
55831
|
+
log5.info("Sleep prevention active (xdg-screensaver)");
|
|
55805
55832
|
} catch (err) {
|
|
55806
|
-
|
|
55833
|
+
log5.warn(`Linux keep-alive not available: ${err}`);
|
|
55807
55834
|
}
|
|
55808
55835
|
}
|
|
55809
55836
|
startWindowsKeepAlive() {
|
|
@@ -55828,25 +55855,25 @@ class KeepAliveManager {
|
|
|
55828
55855
|
windowsHide: true
|
|
55829
55856
|
});
|
|
55830
55857
|
this.keepAliveProcess.on("error", (err) => {
|
|
55831
|
-
|
|
55858
|
+
log5.warn(`Windows keep-alive not available: ${err.message}`);
|
|
55832
55859
|
this.keepAliveProcess = null;
|
|
55833
55860
|
});
|
|
55834
55861
|
this.keepAliveProcess.on("exit", (code) => {
|
|
55835
55862
|
if (code !== null && code !== 0 && this.activeSessionCount > 0) {
|
|
55836
|
-
|
|
55863
|
+
log5.debug(`PowerShell keep-alive exited with code ${code}`);
|
|
55837
55864
|
}
|
|
55838
55865
|
this.keepAliveProcess = null;
|
|
55839
55866
|
});
|
|
55840
|
-
|
|
55867
|
+
log5.info("Sleep prevention active (SetThreadExecutionState)");
|
|
55841
55868
|
} catch (err) {
|
|
55842
|
-
|
|
55869
|
+
log5.warn(`Windows keep-alive not available: ${err}`);
|
|
55843
55870
|
}
|
|
55844
55871
|
}
|
|
55845
55872
|
}
|
|
55846
55873
|
var keepAlive = new KeepAliveManager;
|
|
55847
55874
|
|
|
55848
55875
|
// src/operations/sticky-message/handler.ts
|
|
55849
|
-
var
|
|
55876
|
+
var log6 = createLogger("sticky");
|
|
55850
55877
|
var botStartedAt = new Date;
|
|
55851
55878
|
var stickyPostIds = new Map;
|
|
55852
55879
|
var needsBump = new Map;
|
|
@@ -56086,7 +56113,7 @@ class Redactor {
|
|
|
56086
56113
|
// src/persistence/thread-logger.ts
|
|
56087
56114
|
import { homedir as homedir2 } from "os";
|
|
56088
56115
|
import { join as join2, dirname as dirname4 } from "path";
|
|
56089
|
-
var
|
|
56116
|
+
var log7 = createLogger("thread-log");
|
|
56090
56117
|
var LOGS_BASE_DIR = join2(homedir2(), ".claude-threads", "logs");
|
|
56091
56118
|
|
|
56092
56119
|
// src/operations/bug-report/handler.ts
|
|
@@ -56190,7 +56217,7 @@ function extractResetAt(text, now) {
|
|
|
56190
56217
|
}
|
|
56191
56218
|
|
|
56192
56219
|
// src/claude/cli.ts
|
|
56193
|
-
var
|
|
56220
|
+
var log8 = createLogger("claude");
|
|
56194
56221
|
function cleanupBrowserBridgeSockets() {
|
|
56195
56222
|
try {
|
|
56196
56223
|
const tempDir = tmpdir();
|
|
@@ -56202,13 +56229,13 @@ function cleanupBrowserBridgeSockets() {
|
|
|
56202
56229
|
const stats = statSync(filePath);
|
|
56203
56230
|
if (stats.isSocket()) {
|
|
56204
56231
|
unlinkSync(filePath);
|
|
56205
|
-
|
|
56232
|
+
log8.debug(`Removed stale browser bridge socket: ${file2}`);
|
|
56206
56233
|
}
|
|
56207
56234
|
} catch {}
|
|
56208
56235
|
}
|
|
56209
56236
|
}
|
|
56210
56237
|
} catch (err) {
|
|
56211
|
-
|
|
56238
|
+
log8.debug(`Browser bridge cleanup failed: ${err}`);
|
|
56212
56239
|
}
|
|
56213
56240
|
}
|
|
56214
56241
|
function buildClaudeChildEnv(parentEnv, account) {
|
|
@@ -56239,7 +56266,7 @@ function isErrorResultEvent(event) {
|
|
|
56239
56266
|
return false;
|
|
56240
56267
|
}
|
|
56241
56268
|
function materializeMcpConfig(config3, sessionId, opts = {}) {
|
|
56242
|
-
if (opts.inline
|
|
56269
|
+
if (opts.inline) {
|
|
56243
56270
|
return { mode: "inline", value: JSON.stringify(config3) };
|
|
56244
56271
|
}
|
|
56245
56272
|
const dir = opts.tmpDirOverride ?? tmpdir();
|
|
@@ -57181,7 +57208,7 @@ ${avoidCommands.map((c) => `- \`!${c.command}\` - ${c.reason}`).join(`
|
|
|
57181
57208
|
`.trim();
|
|
57182
57209
|
}
|
|
57183
57210
|
// src/utils/error-handler/index.ts
|
|
57184
|
-
var
|
|
57211
|
+
var log9 = createLogger("error");
|
|
57185
57212
|
|
|
57186
57213
|
// src/utils/session-log.ts
|
|
57187
57214
|
function createSessionLog(baseLog) {
|
|
@@ -57199,32 +57226,32 @@ init_emoji();
|
|
|
57199
57226
|
// src/git/worktree.ts
|
|
57200
57227
|
import * as path from "path";
|
|
57201
57228
|
import { homedir as homedir3 } from "os";
|
|
57202
|
-
var
|
|
57229
|
+
var log10 = createLogger("git-wt");
|
|
57203
57230
|
var WORKTREES_DIR = path.join(homedir3(), ".claude-threads", "worktrees");
|
|
57204
57231
|
var METADATA_STORE_PATH = path.join(homedir3(), ".claude-threads", "worktree-metadata.json");
|
|
57205
57232
|
|
|
57206
57233
|
// src/operations/post-helpers/index.ts
|
|
57207
|
-
var
|
|
57208
|
-
var sessionLog = createSessionLog(
|
|
57234
|
+
var log11 = createLogger("helpers");
|
|
57235
|
+
var sessionLog = createSessionLog(log11);
|
|
57209
57236
|
|
|
57210
57237
|
// src/claude/quick-query.ts
|
|
57211
|
-
var
|
|
57238
|
+
var log12 = createLogger("query");
|
|
57212
57239
|
|
|
57213
57240
|
// src/operations/suggestions/title.ts
|
|
57214
|
-
var
|
|
57241
|
+
var log13 = createLogger("title");
|
|
57215
57242
|
|
|
57216
57243
|
// src/operations/suggestions/tag.ts
|
|
57217
|
-
var
|
|
57244
|
+
var log14 = createLogger("tags");
|
|
57218
57245
|
|
|
57219
57246
|
// src/operations/context-prompt/handler.ts
|
|
57220
57247
|
init_emoji();
|
|
57221
|
-
var
|
|
57222
|
-
var sessionLog2 = createSessionLog(
|
|
57248
|
+
var log15 = createLogger("context");
|
|
57249
|
+
var sessionLog2 = createSessionLog(log15);
|
|
57223
57250
|
var contextPromptTimeouts = new Map;
|
|
57224
57251
|
var contextPromptFiles = new Map;
|
|
57225
57252
|
// src/session/lifecycle.ts
|
|
57226
|
-
var
|
|
57227
|
-
var sessionLog3 = createSessionLog(
|
|
57253
|
+
var log16 = createLogger("lifecycle");
|
|
57254
|
+
var sessionLog3 = createSessionLog(log16);
|
|
57228
57255
|
var CHAT_PLATFORM_PROMPT = generateChatPlatformPrompt();
|
|
57229
57256
|
|
|
57230
57257
|
// src/update-notifier.ts
|
|
@@ -57232,22 +57259,22 @@ var import_semver2 = __toESM(require_semver2(), 1);
|
|
|
57232
57259
|
|
|
57233
57260
|
// src/operations/commands/handler.ts
|
|
57234
57261
|
init_emoji();
|
|
57235
|
-
var
|
|
57236
|
-
var sessionLog4 = createSessionLog(
|
|
57262
|
+
var log17 = createLogger("commands");
|
|
57263
|
+
var sessionLog4 = createSessionLog(log17);
|
|
57237
57264
|
// src/operations/suggestions/branch.ts
|
|
57238
57265
|
import { exec as exec2 } from "child_process";
|
|
57239
57266
|
import { promisify as promisify2 } from "util";
|
|
57240
57267
|
var execAsync2 = promisify2(exec2);
|
|
57241
|
-
var
|
|
57268
|
+
var log18 = createLogger("branch");
|
|
57242
57269
|
|
|
57243
57270
|
// src/operations/worktree/handler.ts
|
|
57244
|
-
var
|
|
57245
|
-
var sessionLog5 = createSessionLog(
|
|
57271
|
+
var log19 = createLogger("worktree");
|
|
57272
|
+
var sessionLog5 = createSessionLog(log19);
|
|
57246
57273
|
// src/operations/events/handler.ts
|
|
57247
|
-
var
|
|
57248
|
-
var sessionLog6 = createSessionLog(
|
|
57274
|
+
var log20 = createLogger("events");
|
|
57275
|
+
var sessionLog6 = createSessionLog(log20);
|
|
57249
57276
|
// src/operations/monitor/handler.ts
|
|
57250
|
-
var
|
|
57277
|
+
var log21 = createLogger("monitor");
|
|
57251
57278
|
var DEFAULT_INTERVAL_MS = 60 * 1000;
|
|
57252
57279
|
// src/utils/websocket.ts
|
|
57253
57280
|
var WS;
|