marmonitor 0.1.6 → 0.1.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/bin/postinstall.cjs +29 -0
- package/dist/cli.js +16 -3
- package/dist/config/index.js +3 -3
- package/dist/output/utils.d.ts +1 -1
- package/dist/output/utils.js +2 -0
- package/dist/scanner/gemini.js +3 -1
- package/package.json +2 -2
- package/bin/postinstall.js +0 -20
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* postinstall script — show install guide.
|
|
5
|
+
* Runs after `npm install -g marmonitor`.
|
|
6
|
+
*
|
|
7
|
+
* npm suppresses stdout from postinstall scripts by default.
|
|
8
|
+
* Using stderr to ensure the message is always visible.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const msg = `
|
|
12
|
+
✓ marmonitor v${require("../package.json").version} installed
|
|
13
|
+
Monitor Claude Code, Codex & Gemini sessions from your tmux status bar.
|
|
14
|
+
|
|
15
|
+
Setup:
|
|
16
|
+
$ marmonitor setup tmux Add tmux plugin to ~/.tmux.conf
|
|
17
|
+
Then press prefix+I in tmux to activate.
|
|
18
|
+
|
|
19
|
+
Commands:
|
|
20
|
+
$ marmonitor status Show all AI sessions
|
|
21
|
+
$ marmonitor attention Sessions needing your input
|
|
22
|
+
$ marmonitor help All commands and shortcuts
|
|
23
|
+
|
|
24
|
+
Uninstall:
|
|
25
|
+
$ marmonitor uninstall-integration
|
|
26
|
+
$ npm uninstall -g marmonitor
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
process.stderr.write(msg + "\n");
|
package/dist/cli.js
CHANGED
|
@@ -97,6 +97,19 @@ function buildHelpAppendix() {
|
|
|
97
97
|
" performance Snapshot/cache TTL tuning",
|
|
98
98
|
" intervention Guard and policy rules (advanced / optional)",
|
|
99
99
|
"",
|
|
100
|
+
"Phase icons:",
|
|
101
|
+
" ⏳ permission Waiting for tool approval (user input needed)",
|
|
102
|
+
" 🤔 thinking AI generating response",
|
|
103
|
+
" 🔧 tool Approved tool executing",
|
|
104
|
+
" ✅ done Response complete",
|
|
105
|
+
"",
|
|
106
|
+
"Status labels:",
|
|
107
|
+
" [Active] CPU activity detected",
|
|
108
|
+
" [Idle] Process alive, no recent activity",
|
|
109
|
+
" [Stalled] No activity for extended period",
|
|
110
|
+
" [Dead] Session file exists but process gone",
|
|
111
|
+
" [Unmatched] AI process without matching session",
|
|
112
|
+
"",
|
|
100
113
|
"Default tmux shortcuts:",
|
|
101
114
|
" Prefix+a Attention popup",
|
|
102
115
|
" Prefix+j Jump popup",
|
|
@@ -758,12 +771,12 @@ program
|
|
|
758
771
|
program
|
|
759
772
|
.command("dock")
|
|
760
773
|
.description("Compact persistent monitor for tmux pane")
|
|
761
|
-
.option("--interval <sec>", "Refresh interval in seconds", "
|
|
774
|
+
.option("--interval <sec>", "Refresh interval in seconds", "2")
|
|
762
775
|
.option("--detail-interval <sec>", "Heavy enrichment interval", "30")
|
|
763
776
|
.option("--lines <n>", "Max display lines", "12")
|
|
764
777
|
.option("--config <path>", "Path to settings.json")
|
|
765
778
|
.action(async (opts) => {
|
|
766
|
-
const intervalMs = Math.max(Number(opts.interval) ||
|
|
779
|
+
const intervalMs = Math.max(Number(opts.interval) || 2, 2) * 1000;
|
|
767
780
|
const detailMs = Math.max(Number(opts.detailInterval) || 30, 5) * 1000;
|
|
768
781
|
const maxLines = Number(opts.lines) || 12;
|
|
769
782
|
const config = await loadConfig(resolveConfigPath(opts));
|
|
@@ -784,7 +797,7 @@ program
|
|
|
784
797
|
program
|
|
785
798
|
.command("watch")
|
|
786
799
|
.description("Refresh agent status in a long-lived loop")
|
|
787
|
-
.option("--interval <sec>", "Refresh interval in seconds", "
|
|
800
|
+
.option("--interval <sec>", "Refresh interval in seconds", "2")
|
|
788
801
|
.option("--detail-interval <sec>", "Heavy enrichment refresh interval in seconds", "30")
|
|
789
802
|
.option("--json", "Output as JSON")
|
|
790
803
|
.option("--config <path>", "Path to settings.json")
|
package/dist/config/index.js
CHANGED
|
@@ -85,9 +85,9 @@ const DEFAULTS = {
|
|
|
85
85
|
extraRoots: [],
|
|
86
86
|
},
|
|
87
87
|
performance: {
|
|
88
|
-
snapshotTtlMs:
|
|
89
|
-
statuslineTtlMs:
|
|
90
|
-
stdoutHeuristicTtlMs:
|
|
88
|
+
snapshotTtlMs: 2000,
|
|
89
|
+
statuslineTtlMs: 2000,
|
|
90
|
+
stdoutHeuristicTtlMs: 2000,
|
|
91
91
|
},
|
|
92
92
|
};
|
|
93
93
|
function cloneDefaults() {
|
package/dist/output/utils.d.ts
CHANGED
|
@@ -108,7 +108,7 @@ export interface SessionFileCandidate {
|
|
|
108
108
|
}
|
|
109
109
|
export declare function resolvePhaseWithDecay(currentPhase: SessionPhase, cachedPhase: SessionPhase, cachedDetectedAtMs: number | undefined, decay: PhaseDecayConfig, nowMs?: number): SessionPhase;
|
|
110
110
|
export declare function advanceJsonlCursor(previous: JsonlCursorState, chunk: string, maxLines: number): JsonlCursorState;
|
|
111
|
-
export declare function detectApprovalPromptPhase(output:
|
|
111
|
+
export declare function detectApprovalPromptPhase(output: unknown, patterns?: string[], clearPatterns?: string[]): SessionPhase;
|
|
112
112
|
export declare function updatePhaseHistory(previousPhase: SessionPhase, previousHistory: PhaseHistoryEntry[], nextPhase: SessionPhase, at: number, maxEntries?: number): {
|
|
113
113
|
previousPhase?: SessionPhase;
|
|
114
114
|
history: PhaseHistoryEntry[];
|
package/dist/output/utils.js
CHANGED
|
@@ -186,6 +186,8 @@ export function detectApprovalPromptPhase(output, patterns = [
|
|
|
186
186
|
"edited",
|
|
187
187
|
"changes applied",
|
|
188
188
|
]) {
|
|
189
|
+
if (!output || typeof output !== "string")
|
|
190
|
+
return undefined;
|
|
189
191
|
const recentLines = output
|
|
190
192
|
.split("\n")
|
|
191
193
|
.map((line) => line.trim())
|
package/dist/scanner/gemini.js
CHANGED
|
@@ -14,7 +14,9 @@ export function toEpochSec(value) {
|
|
|
14
14
|
export function parseGeminiSessionContent(raw) {
|
|
15
15
|
try {
|
|
16
16
|
const data = JSON.parse(raw);
|
|
17
|
-
const messages = Array.isArray(data.messages)
|
|
17
|
+
const messages = Array.isArray(data.messages)
|
|
18
|
+
? data.messages.filter((msg) => msg != null)
|
|
19
|
+
: [];
|
|
18
20
|
const latestMessage = messages.at(-1);
|
|
19
21
|
const latestGeminiMessage = [...messages].reverse().find((msg) => msg.type === "gemini");
|
|
20
22
|
const lastActivityAt = toEpochSec(data.lastUpdated) ??
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "marmonitor",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"author": "MJ JO <mjjo16@gmail.com>",
|
|
5
5
|
"description": "tmux status bar monitor for AI coding agents — track Claude Code, Codex, Gemini sessions, tokens, and phases in real time",
|
|
6
6
|
"type": "module",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"start": "node bin/marmonitor.js",
|
|
49
49
|
"lint": "biome check src tests",
|
|
50
50
|
"test": "node --test tests/*.test.mjs",
|
|
51
|
-
"postinstall": "node bin/postinstall.
|
|
51
|
+
"postinstall": "node bin/postinstall.cjs",
|
|
52
52
|
"preuninstall": "node bin/preuninstall.cjs",
|
|
53
53
|
"prepublishOnly": "npm run build && npm test"
|
|
54
54
|
},
|
package/bin/postinstall.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* postinstall script — show install banner + setup guide.
|
|
5
|
-
* Runs after `npm install -g marmonitor`.
|
|
6
|
-
*
|
|
7
|
-
* npm postinstall runs with stdin as pipe (non-TTY),
|
|
8
|
-
* so interactive prompts are not possible here.
|
|
9
|
-
* Actual tmux setup is done via `marmonitor setup tmux`.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
console.log("");
|
|
13
|
-
console.log(" ✓ marmonitor installed");
|
|
14
|
-
console.log(" Standing guard over your AI coding sessions");
|
|
15
|
-
console.log("");
|
|
16
|
-
console.log(" Quick start:");
|
|
17
|
-
console.log(" $ marmonitor setup tmux — auto-configure tmux integration");
|
|
18
|
-
console.log(" $ marmonitor status — show active AI sessions");
|
|
19
|
-
console.log(" $ marmonitor help — all commands and shortcuts");
|
|
20
|
-
console.log("");
|