@exaudeus/workrail 3.79.3 → 3.81.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/cli/commands/worktrain-diagnose.d.ts +114 -0
- package/dist/cli/commands/worktrain-diagnose.js +628 -0
- package/dist/cli-worktrain.js +85 -7
- package/dist/console-ui/assets/{index-pA7_pNwu.js → index-BgMh_c_3.js} +1 -1
- package/dist/console-ui/index.html +1 -1
- package/dist/daemon/active-sessions.d.ts +8 -5
- package/dist/daemon/active-sessions.js +11 -2
- package/dist/daemon/core/session-result.d.ts +2 -2
- package/dist/daemon/daemon-events.d.ts +17 -13
- package/dist/daemon/daemon-events.js +4 -0
- package/dist/daemon/runner/agent-loop-runner.d.ts +4 -4
- package/dist/daemon/runner/pre-agent-session.d.ts +2 -2
- package/dist/daemon/runner/pre-agent-session.js +2 -1
- package/dist/daemon/runner/runner-types.d.ts +4 -4
- package/dist/daemon/session-scope.d.ts +2 -2
- package/dist/daemon/startup-recovery.js +2 -1
- package/dist/daemon/tools/bash.d.ts +2 -2
- package/dist/daemon/tools/continue-workflow.d.ts +3 -3
- package/dist/daemon/tools/file-tools.d.ts +4 -4
- package/dist/daemon/tools/glob-grep.d.ts +3 -3
- package/dist/daemon/tools/report-issue.d.ts +2 -2
- package/dist/daemon/tools/signal-coordinator.d.ts +2 -2
- package/dist/daemon/tools/spawn-agent.d.ts +2 -2
- package/dist/daemon/types.d.ts +4 -2
- package/dist/daemon/workflow-runner.js +2 -1
- package/dist/manifest.json +55 -47
- package/docs/ideas/backlog.md +55 -491
- package/package.json +1 -1
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
export interface DiagnosticNotFound {
|
|
2
|
+
readonly kind: 'NOT_FOUND';
|
|
3
|
+
readonly sessionIdQuery: string;
|
|
4
|
+
readonly daysBack: number;
|
|
5
|
+
}
|
|
6
|
+
export interface DiagnosticAmbiguous {
|
|
7
|
+
readonly kind: 'AMBIGUOUS';
|
|
8
|
+
readonly sessionIdQuery: string;
|
|
9
|
+
readonly candidates: readonly string[];
|
|
10
|
+
}
|
|
11
|
+
export interface DiagnosticSuccess {
|
|
12
|
+
readonly kind: 'SUCCESS';
|
|
13
|
+
readonly sessionId: string;
|
|
14
|
+
readonly workflowId: string;
|
|
15
|
+
readonly startedAt: number | null;
|
|
16
|
+
readonly durationMs: number;
|
|
17
|
+
readonly metrics: SessionMetrics;
|
|
18
|
+
}
|
|
19
|
+
export interface DiagnosticConfigError {
|
|
20
|
+
readonly kind: 'CONFIG_ERROR';
|
|
21
|
+
readonly sessionId: string;
|
|
22
|
+
readonly workflowId: string;
|
|
23
|
+
readonly startedAt: number | null;
|
|
24
|
+
readonly durationMs: number;
|
|
25
|
+
readonly detail: string;
|
|
26
|
+
readonly detailTruncated: boolean;
|
|
27
|
+
readonly metrics: SessionMetrics;
|
|
28
|
+
readonly steps: readonly StepRecord[];
|
|
29
|
+
readonly processState: ProcessState;
|
|
30
|
+
}
|
|
31
|
+
export interface DiagnosticWorkflowStuck {
|
|
32
|
+
readonly kind: 'WORKFLOW_STUCK';
|
|
33
|
+
readonly sessionId: string;
|
|
34
|
+
readonly workflowId: string;
|
|
35
|
+
readonly startedAt: number | null;
|
|
36
|
+
readonly durationMs: number;
|
|
37
|
+
readonly stuckReason: 'repeated_tool_call' | 'no_progress' | 'stall';
|
|
38
|
+
readonly stuckDetail: string;
|
|
39
|
+
readonly toolName?: string;
|
|
40
|
+
readonly argsSummary?: string;
|
|
41
|
+
readonly metrics: SessionMetrics;
|
|
42
|
+
readonly steps: readonly StepRecord[];
|
|
43
|
+
readonly processState: ProcessState;
|
|
44
|
+
}
|
|
45
|
+
export interface DiagnosticWorkflowTimeout {
|
|
46
|
+
readonly kind: 'WORKFLOW_TIMEOUT';
|
|
47
|
+
readonly sessionId: string;
|
|
48
|
+
readonly workflowId: string;
|
|
49
|
+
readonly startedAt: number | null;
|
|
50
|
+
readonly durationMs: number;
|
|
51
|
+
readonly timeoutReason: 'wall_clock' | 'max_turns' | 'unknown';
|
|
52
|
+
readonly stepAdvances: number;
|
|
53
|
+
readonly metrics: SessionMetrics;
|
|
54
|
+
readonly steps: readonly StepRecord[];
|
|
55
|
+
readonly processState: ProcessState;
|
|
56
|
+
}
|
|
57
|
+
export interface DiagnosticInfraError {
|
|
58
|
+
readonly kind: 'INFRA_ERROR';
|
|
59
|
+
readonly sessionId: string;
|
|
60
|
+
readonly workflowId: string;
|
|
61
|
+
readonly startedAt: number | null;
|
|
62
|
+
readonly durationMs: number;
|
|
63
|
+
readonly infraReason: 'daemon_shutdown' | 'daemon_killed' | 'aborted' | 'network' | 'unknown';
|
|
64
|
+
readonly detail: string;
|
|
65
|
+
readonly metrics: SessionMetrics;
|
|
66
|
+
readonly steps: readonly StepRecord[];
|
|
67
|
+
readonly processState: ProcessState;
|
|
68
|
+
}
|
|
69
|
+
export interface DiagnosticOrphaned {
|
|
70
|
+
readonly kind: 'ORPHANED';
|
|
71
|
+
readonly sessionId: string;
|
|
72
|
+
readonly workflowId: string;
|
|
73
|
+
readonly startedAt: number | null;
|
|
74
|
+
readonly durationMs: number;
|
|
75
|
+
readonly lastEventKind: string | null;
|
|
76
|
+
readonly lastEventTs: number | null;
|
|
77
|
+
readonly metrics: SessionMetrics;
|
|
78
|
+
readonly steps: readonly StepRecord[];
|
|
79
|
+
}
|
|
80
|
+
export interface DiagnosticDefault {
|
|
81
|
+
readonly kind: 'DEFAULT';
|
|
82
|
+
readonly sessionId: string;
|
|
83
|
+
readonly workflowId: string;
|
|
84
|
+
readonly startedAt: number | null;
|
|
85
|
+
readonly durationMs: number;
|
|
86
|
+
readonly outcome: string;
|
|
87
|
+
readonly detail: string;
|
|
88
|
+
readonly rawEventLine: string;
|
|
89
|
+
readonly metrics: SessionMetrics;
|
|
90
|
+
readonly steps: readonly StepRecord[];
|
|
91
|
+
readonly processState: ProcessState;
|
|
92
|
+
}
|
|
93
|
+
export type DiagnosticResult = DiagnosticNotFound | DiagnosticAmbiguous | DiagnosticSuccess | DiagnosticConfigError | DiagnosticWorkflowStuck | DiagnosticWorkflowTimeout | DiagnosticInfraError | DiagnosticOrphaned | DiagnosticDefault;
|
|
94
|
+
export interface SessionMetrics {
|
|
95
|
+
readonly llmTurns: number;
|
|
96
|
+
readonly stepAdvances: number;
|
|
97
|
+
readonly toolCallsTotal: number;
|
|
98
|
+
readonly toolCallsFailed: number;
|
|
99
|
+
readonly inputTokens: number;
|
|
100
|
+
readonly outputTokens: number;
|
|
101
|
+
}
|
|
102
|
+
export interface StepRecord {
|
|
103
|
+
readonly index: number;
|
|
104
|
+
readonly status: 'completed' | 'terminal' | 'not_reached';
|
|
105
|
+
readonly turns: number;
|
|
106
|
+
}
|
|
107
|
+
export type ProcessState = 'STOPPED' | 'RUNNING' | 'UNKNOWN';
|
|
108
|
+
export declare function parseDaemonEvents(sessionIdQuery: string, eventsDir: string, daysBack: number, readFile: (path: string) => string | null): DiagnosticResult;
|
|
109
|
+
export interface FormatOptions {
|
|
110
|
+
readonly ascii?: boolean;
|
|
111
|
+
readonly noColor?: boolean;
|
|
112
|
+
}
|
|
113
|
+
export declare function formatDiagnosticCard(result: DiagnosticResult, opts?: FormatOptions): string;
|
|
114
|
+
export declare function formatDiagnosticJson(result: DiagnosticResult): string;
|