@scrylog/cli 0.3.0 → 0.3.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/assets/highlights-eq9cgrbb.scm +604 -0
- package/dist/assets/highlights-ghv9g403.scm +205 -0
- package/dist/assets/highlights-hk7bwhj4.scm +284 -0
- package/dist/assets/highlights-r812a2qc.scm +150 -0
- package/dist/assets/highlights-x6tmsnaa.scm +115 -0
- package/dist/assets/injections-73j83es3.scm +27 -0
- package/dist/assets/parser.worker-xyhf83rf.js +4563 -0
- package/dist/assets/tree-sitter-3jzf13jk.wasm +0 -0
- package/dist/assets/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
- package/dist/assets/tree-sitter-markdown-411r6y9b.wasm +0 -0
- package/dist/assets/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
- package/dist/assets/tree-sitter-typescript-zxjzwt75.wasm +0 -0
- package/dist/assets/tree-sitter-zig-e78zbjpm.wasm +0 -0
- package/dist/cli/index.js +499 -0
- package/dist/cli/index.js.map +61 -0
- package/dist/daemon/index.js +670 -0
- package/dist/daemon/index.js.map +1475 -0
- package/dist/hooks/claude.js +6 -0
- package/dist/hooks/claude.js.map +11 -0
- package/dist/hooks/codex.js +10 -0
- package/dist/hooks/codex.js.map +11 -0
- package/dist/mcp/index.js +100 -0
- package/dist/mcp/index.js.map +231 -0
- package/dist/oc/index.js +21 -0
- package/dist/oc/index.js.map +10 -0
- package/package.json +16 -13
- package/src/api/docs/sessions.keys.ts +0 -6
- package/src/api/docs/sessions.ts +0 -82
- package/src/api/docs/system.keys.ts +0 -5
- package/src/api/docs/system.ts +0 -69
- package/src/api/docs/usage.keys.ts +0 -3
- package/src/api/docs/usage.ts +0 -24
- package/src/api/docs/webhooks.keys.ts +0 -5
- package/src/api/docs/webhooks.ts +0 -78
- package/src/api/index.ts +0 -18
- package/src/api/lib/auth.ts +0 -43
- package/src/api/lib/errors.ts +0 -28
- package/src/api/lib/route.ts +0 -18
- package/src/api/models/claude.ts +0 -4
- package/src/api/models/codex.ts +0 -4
- package/src/api/models/opencode.ts +0 -11
- package/src/api/routes/sessions.ts +0 -51
- package/src/api/routes/system.ts +0 -106
- package/src/api/routes/usage.ts +0 -15
- package/src/api/routes/webhooks/claude.ts +0 -149
- package/src/api/routes/webhooks/codex.ts +0 -175
- package/src/api/routes/webhooks/opencode.ts +0 -112
- package/src/api/routes.ts +0 -93
- package/src/api/schemas/common.ts +0 -29
- package/src/api/schemas/sessions.ts +0 -86
- package/src/api/schemas/usage.ts +0 -51
- package/src/api/schemas/webhooks/claude.ts +0 -32
- package/src/api/schemas/webhooks/codex.ts +0 -34
- package/src/api/schemas/webhooks/opencode.ts +0 -29
- package/src/api/services/claude-session.ts +0 -9
- package/src/api/services/codex-session.ts +0 -8
- package/src/api/services/opencode-session.ts +0 -73
- package/src/classifier.ts +0 -206
- package/src/cli/commands.ts +0 -714
- package/src/cli/index.ts +0 -18
- package/src/cli/program.ts +0 -175
- package/src/cli/prompt.ts +0 -44
- package/src/daemon/cli.ts +0 -27
- package/src/daemon/collectors/claude/README.md +0 -108
- package/src/daemon/collectors/claude/collector.ts +0 -423
- package/src/daemon/collectors/claude/discovery.ts +0 -127
- package/src/daemon/collectors/claude/hooks.ts +0 -181
- package/src/daemon/collectors/claude/index.ts +0 -8
- package/src/daemon/collectors/claude/jsonl.ts +0 -85
- package/src/daemon/collectors/claude/transcript.ts +0 -246
- package/src/daemon/collectors/codex/README.md +0 -147
- package/src/daemon/collectors/codex/collector.ts +0 -661
- package/src/daemon/collectors/codex/discovery.ts +0 -104
- package/src/daemon/collectors/codex/hooks.ts +0 -179
- package/src/daemon/collectors/codex/index.ts +0 -7
- package/src/daemon/collectors/codex/jsonl.ts +0 -108
- package/src/daemon/collectors/codex/transcript.ts +0 -299
- package/src/daemon/collectors/git.ts +0 -353
- package/src/daemon/collectors/herdr/collector.ts +0 -128
- package/src/daemon/collectors/herdr/index.ts +0 -2
- package/src/daemon/collectors/herdr/normalization.ts +0 -111
- package/src/daemon/collectors/opencode/README.md +0 -106
- package/src/daemon/collectors/opencode/collector.ts +0 -545
- package/src/daemon/collectors/opencode/discovery.ts +0 -257
- package/src/daemon/collectors/opencode/index.ts +0 -5
- package/src/daemon/collectors/opencode/session-builder.ts +0 -59
- package/src/daemon/collectors/opencode-db.ts +0 -294
- package/src/daemon/collectors/process.ts +0 -201
- package/src/daemon/collectors/tmux/README.md +0 -128
- package/src/daemon/collectors/tmux/collector.ts +0 -492
- package/src/daemon/collectors/tmux/enrichment.ts +0 -242
- package/src/daemon/collectors/tmux/index.ts +0 -4
- package/src/daemon/collectors/tmux/parse.ts +0 -128
- package/src/daemon/collectors/usage.ts +0 -259
- package/src/daemon/index.ts +0 -209
- package/src/daemon/scheduler.ts +0 -86
- package/src/daemon/store.ts +0 -630
- package/src/detect.ts +0 -143
- package/src/hooks/claude.ts +0 -596
- package/src/hooks/codex.ts +0 -517
- package/src/legacy/classifier.ts +0 -215
- package/src/legacy/detect.ts +0 -143
- package/src/mcp/client-server.ts +0 -21
- package/src/mcp/http-handler.ts +0 -126
- package/src/mcp/index.ts +0 -61
- package/src/mcp/resources/config-current.ts +0 -19
- package/src/mcp/resources/index.ts +0 -11
- package/src/mcp/resources/sessions-active.ts +0 -19
- package/src/mcp/resources/sessions-all.ts +0 -19
- package/src/mcp/schemas/sessions.ts +0 -3
- package/src/mcp/server.ts +0 -17
- package/src/mcp/services/api-adapter.ts +0 -48
- package/src/mcp/services/data-source.ts +0 -22
- package/src/mcp/services/store-adapter.ts +0 -40
- package/src/mcp/tools/get-active-sessions.ts +0 -16
- package/src/mcp/tools/get-session-children.ts +0 -24
- package/src/mcp/tools/get-session-messages.ts +0 -24
- package/src/mcp/tools/get-session.ts +0 -23
- package/src/mcp/tools/index.ts +0 -15
- package/src/mcp/tools/list-sessions.ts +0 -16
- package/src/oc/index.ts +0 -302
- package/src/service/manager.ts +0 -284
- package/src/shared/config.ts +0 -511
- package/src/shared/ipc.ts +0 -80
- package/src/shared/logger.ts +0 -248
- package/src/shared/paths.ts +0 -73
- package/src/shared/platform.ts +0 -110
- package/src/shared/session-exclusions.ts +0 -5
- package/src/shared/session-view.ts +0 -302
- package/src/shared/terminal-capabilities.ts +0 -130
- package/src/shared/types.ts +0 -330
- package/src/shared/utils.ts +0 -339
- package/src/shared/version.ts +0 -44
- package/src/tui/App.tsx +0 -240
- package/src/tui/client.ts +0 -163
- package/src/tui/components/BindingsModal.tsx +0 -82
- package/src/tui/components/DashboardHeader.tsx +0 -256
- package/src/tui/components/KeyBar.tsx +0 -67
- package/src/tui/components/SessionDetailModal.tsx +0 -169
- package/src/tui/components/SessionsView.tsx +0 -184
- package/src/tui/components/TabBar.tsx +0 -40
- package/src/tui/components/UsageSummaryPane.tsx +0 -272
- package/src/tui/components/UsageView.tsx +0 -242
- package/src/tui/components/tool-icons.ts +0 -24
- package/src/tui/index.tsx +0 -106
- package/src/tui/keybindings.ts +0 -49
- package/src/tui/model.ts +0 -295
- package/src/tui/state.ts +0 -77
- package/src/tui/theme.ts +0 -110
- package/src/types.ts +0 -113
- package/src/usage/README.md +0 -323
- package/src/usage/api.ts +0 -99
- package/src/usage/client.ts +0 -3
- package/src/usage/clients/anthropic-oauth-usage.ts +0 -258
- package/src/usage/clients/anthropic-web-usage.ts +0 -329
- package/src/usage/clients/claude-cli-probe.ts +0 -513
- package/src/usage/clients/codex-app-server.ts +0 -354
- package/src/usage/clients/codex-oauth-usage.ts +0 -240
- package/src/usage/clients/opencode-go-api.ts +0 -100
- package/src/usage/clients/opencode-go-usage.ts +0 -577
- package/src/usage/errors.ts +0 -33
- package/src/usage/index.ts +0 -20
- package/src/usage/local/opencode-go-local.ts +0 -194
- package/src/usage/mappers.ts +0 -282
- package/src/usage/planner.ts +0 -118
- package/src/usage/providers/claude.ts +0 -233
- package/src/usage/providers/codex.ts +0 -115
- package/src/usage/providers/opencode-go.ts +0 -115
- package/src/usage/resolver.ts +0 -4
- package/src/usage/resolvers/browser-cookies.ts +0 -808
- package/src/usage/resolvers/claude-auth.ts +0 -208
- package/src/usage/resolvers/claude-cli.ts +0 -24
- package/src/usage/resolvers/claude-desktop-auth.ts +0 -170
- package/src/usage/resolvers/claude-web.ts +0 -82
- package/src/usage/resolvers/codex-auth.ts +0 -174
- package/src/usage/resolvers/keychain-coordinator.ts +0 -397
- package/src/usage/resolvers/opencode-go-web.ts +0 -55
- package/src/usage/types.ts +0 -225
- package/src/usage/web-session-cache.ts +0 -37
- /package/{src/tui → dist/cli}/assets/providers/SOURCES.md +0 -0
- /package/{src/tui → dist/cli}/assets/providers/claude-terminal.png +0 -0
- /package/{src/tui → dist/cli}/assets/providers/claude-terminal.svg +0 -0
- /package/{src/tui → dist/cli}/assets/providers/claude.png +0 -0
- /package/{src/tui → dist/cli}/assets/providers/copilot.png +0 -0
- /package/{src/tui → dist/cli}/assets/providers/copilot.svg +0 -0
- /package/{src/tui → dist/cli}/assets/providers/openai-terminal.png +0 -0
- /package/{src/tui → dist/cli}/assets/providers/openai-terminal.svg +0 -0
- /package/{src/tui → dist/cli}/assets/providers/openai.png +0 -0
- /package/{src/tui → dist/cli}/assets/providers/opencode-terminal.png +0 -0
- /package/{src/tui → dist/cli}/assets/providers/opencode-terminal.svg +0 -0
- /package/{src/tui → dist/cli}/assets/providers/opencode.png +0 -0
- /package/{src/tui → dist/cli}/assets/providers/shell.png +0 -0
- /package/{src/tui → dist/cli}/assets/providers/shell.svg +0 -0
- /package/{src/tui → dist/cli}/assets/providers/unknown.png +0 -0
- /package/{src/tui → dist/cli}/assets/providers/unknown.svg +0 -0
package/src/detect.ts
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import type { DetectionReason, PaneSample, ProcessInfo, ToolKind } from "./types";
|
|
2
|
-
import { compactWhitespace, isMostlyUiNoise, isOpencodeFooterLine, isSuggestionStyleText, pickMeaningfulTail, stripAnsiAndUi } from "./shared/utils";
|
|
3
|
-
|
|
4
|
-
const ACTIVITY_PATTERN = /(thinking|generating|executing|applying|running|streaming|analyzing|^working\s*\(|background terminal running|waited for background terminal|creating|created\s+\d+)/i;
|
|
5
|
-
const PROMPT_PATTERN = /(press enter|continue\?|y\/n|confirm(?:a|as|ar)?\b|waiting for input|type your own answer|send a message|^>\s|^>\b|^\?\s|pregunta clave|^\-\s+¿|^¿)/im;
|
|
6
|
-
const COMPLETION_PATTERN = /(worked for\s+\d|all done|completed|finished|done\b|se cre[oó]\b|cada archivo contiene|ya se escribieron\s+\d+\s+a\s+\d+|contin[uú]o hasta que termine|proceso ya pas[oó]|termin[oó]\s+bien)/i;
|
|
7
|
-
|
|
8
|
-
const TOOL_PATTERNS: Array<{ tool: ToolKind; regex: RegExp; label: string }> = [
|
|
9
|
-
{ tool: "opencode", regex: /(^|\b)(opencode)(\b|$)/i, label: "process matched opencode" },
|
|
10
|
-
{ tool: "claude", regex: /(?:^|\s|\/)(claude)(?:\s|$)/i, label: "process matched claude" },
|
|
11
|
-
{ tool: "codex", regex: /(^|\b)(codexcli|codex)(\b|$)/i, label: "process matched codex" },
|
|
12
|
-
{ tool: "copilotcli", regex: /(^|\b)(copilotcli|copilot)(\b|$)/i, label: "process matched copilot" },
|
|
13
|
-
];
|
|
14
|
-
|
|
15
|
-
const SHELL_PATTERN = /(^|\b)(bash|zsh|fish|sh|tmux)(\b|$)/i;
|
|
16
|
-
|
|
17
|
-
export function detectTool(currentCommand: string, processTree: ProcessInfo[]): { tool: ToolKind; reasons: DetectionReason[] } {
|
|
18
|
-
const reasons: DetectionReason[] = [];
|
|
19
|
-
const candidates = [currentCommand, ...processTree.map((process) => `${process.comm} ${process.command}`)];
|
|
20
|
-
|
|
21
|
-
for (const candidate of candidates) {
|
|
22
|
-
for (const pattern of TOOL_PATTERNS) {
|
|
23
|
-
if (pattern.regex.test(candidate)) {
|
|
24
|
-
reasons.push({
|
|
25
|
-
label: pattern.label,
|
|
26
|
-
detail: compactWhitespace(candidate),
|
|
27
|
-
});
|
|
28
|
-
return { tool: pattern.tool, reasons };
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (candidates.some((candidate) => SHELL_PATTERN.test(candidate))) {
|
|
34
|
-
reasons.push({
|
|
35
|
-
label: "shell foreground detected",
|
|
36
|
-
detail: compactWhitespace(currentCommand || processTree[0]?.command || "shell"),
|
|
37
|
-
});
|
|
38
|
-
return { tool: "shell", reasons };
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
reasons.push({
|
|
42
|
-
label: "no supported tool match",
|
|
43
|
-
detail: compactWhitespace(candidates.join(" | ")) || "no command context",
|
|
44
|
-
});
|
|
45
|
-
return { tool: "unknown", reasons };
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export function previewSignals(sample: PaneSample | null): DetectionReason[] {
|
|
49
|
-
if (!sample || sample.lines.length === 0) {
|
|
50
|
-
return [];
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const normalizedLines = sample.lines.map((line) => compactWhitespace(stripAnsiAndUi(line))).filter(Boolean);
|
|
54
|
-
const recentLines = normalizedLines.slice(-8);
|
|
55
|
-
const tailWindow = recentLines.filter((line) => !isMostlyUiNoise(line));
|
|
56
|
-
const preview = pickMeaningfulTail(tailWindow, sample.preview);
|
|
57
|
-
const reasons: DetectionReason[] = [];
|
|
58
|
-
const activityMatch = findMatchingLine(tailWindow, ACTIVITY_PATTERN);
|
|
59
|
-
const promptMatch = findMatchingLine(tailWindow, PROMPT_PATTERN, { excludeSuggestions: true });
|
|
60
|
-
const completionMatch = findMatchingLine(tailWindow, COMPLETION_PATTERN);
|
|
61
|
-
const opencodeFooterMatch = findOpencodeFooterSignal(recentLines);
|
|
62
|
-
|
|
63
|
-
if (activityMatch) {
|
|
64
|
-
reasons.push({ label: "activity keywords", detail: activityMatch });
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (promptMatch) {
|
|
68
|
-
reasons.push({ label: "input prompt keywords", detail: promptMatch });
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (completionMatch) {
|
|
72
|
-
reasons.push({ label: "completion keywords", detail: completionMatch });
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (opencodeFooterMatch) {
|
|
76
|
-
reasons.push({ label: "opencode footer activity", detail: opencodeFooterMatch });
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const lastMeaningful = tailWindow.at(-1) ?? preview;
|
|
80
|
-
if (!isSuggestionStyleText(lastMeaningful) && (/[:>]\s*$/.test(lastMeaningful) || /^>\s+/.test(lastMeaningful) || /^\?\s+/.test(lastMeaningful))) {
|
|
81
|
-
reasons.push({ label: "prompt-like tail", detail: lastMeaningful });
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return reasons;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export function getPreviewMatchPositions(sample: PaneSample | null): { activityIndex: number; promptIndex: number; completionIndex: number } {
|
|
88
|
-
if (!sample || sample.lines.length === 0) {
|
|
89
|
-
return { activityIndex: -1, promptIndex: -1, completionIndex: -1 };
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
const normalizedLines = sample.lines.map((line) => compactWhitespace(stripAnsiAndUi(line)));
|
|
93
|
-
let activityIndex = -1;
|
|
94
|
-
let promptIndex = -1;
|
|
95
|
-
let completionIndex = -1;
|
|
96
|
-
|
|
97
|
-
for (let index = 0; index < normalizedLines.length; index += 1) {
|
|
98
|
-
const line = normalizedLines[index] ?? "";
|
|
99
|
-
if (!line) {
|
|
100
|
-
continue;
|
|
101
|
-
}
|
|
102
|
-
if (ACTIVITY_PATTERN.test(line) || isOpencodeFooterLine(line)) {
|
|
103
|
-
activityIndex = index;
|
|
104
|
-
}
|
|
105
|
-
if (isMostlyUiNoise(line) && !isOpencodeFooterLine(line)) {
|
|
106
|
-
continue;
|
|
107
|
-
}
|
|
108
|
-
if (PROMPT_PATTERN.test(line) && !isSuggestionStyleText(line)) {
|
|
109
|
-
promptIndex = index;
|
|
110
|
-
}
|
|
111
|
-
if (COMPLETION_PATTERN.test(line)) {
|
|
112
|
-
completionIndex = index;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return { activityIndex, promptIndex, completionIndex };
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
function findMatchingLine(lines: string[], pattern: RegExp, options?: { excludeSuggestions?: boolean }): string | null {
|
|
120
|
-
for (let index = lines.length - 1; index >= 0; index -= 1) {
|
|
121
|
-
const line = lines[index] ?? "";
|
|
122
|
-
if (options?.excludeSuggestions && isSuggestionStyleText(line)) {
|
|
123
|
-
continue;
|
|
124
|
-
}
|
|
125
|
-
if (pattern.test(line)) {
|
|
126
|
-
return line;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
return null;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
function findOpencodeFooterSignal(lines: string[]): string | null {
|
|
134
|
-
const tailLines = lines.slice(-3);
|
|
135
|
-
for (let index = tailLines.length - 1; index >= 0; index -= 1) {
|
|
136
|
-
const line = tailLines[index] ?? "";
|
|
137
|
-
if (isOpencodeFooterLine(line)) {
|
|
138
|
-
return line;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
return null;
|
|
143
|
-
}
|