@exaudeus/workrail 3.70.6 → 3.71.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-daemon.d.ts +3 -0
- package/dist/cli/commands/worktrain-daemon.js +122 -47
- package/dist/cli-worktrain.js +6 -2
- package/dist/console-ui/assets/index-DyREuUoq.js +28 -0
- package/dist/console-ui/index.html +1 -1
- package/dist/daemon/workflow-runner.d.ts +76 -1
- package/dist/daemon/workflow-runner.js +328 -228
- package/dist/manifest.json +14 -14
- package/docs/ideas/backlog.md +604 -7512
- package/docs/reference/worktrain-daemon-invariants.md +225 -0
- package/package.json +5 -5
- package/spec/workflow-tags.json +6 -0
- package/workflows/wr.competitive-analysis.json +473 -0
- package/dist/console-ui/assets/index-RNEvfTvk.js +0 -28
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>WorkRail Console</title>
|
|
7
|
-
<script type="module" crossorigin src="/console/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/console/assets/index-DyREuUoq.js"></script>
|
|
8
8
|
<link rel="stylesheet" crossorigin href="/console/assets/index-DHrKiMCf.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import 'reflect-metadata';
|
|
2
|
+
import Anthropic from '@anthropic-ai/sdk';
|
|
3
|
+
import { AnthropicBedrock } from '@anthropic-ai/bedrock-sdk';
|
|
2
4
|
import type { AgentTool } from "./agent-loop.js";
|
|
3
5
|
import type { V2ToolContext } from '../mcp/types.js';
|
|
4
6
|
import { executeContinueWorkflow } from '../mcp/handlers/v2-execution/index.js';
|
|
@@ -9,6 +11,8 @@ import type { SessionEventLogReadonlyStorePortV2 } from '../v2/ports/session-eve
|
|
|
9
11
|
import type { ToolFailure } from '../mcp/handlers/v2-execution-helpers.js';
|
|
10
12
|
import type { ResultAsync } from 'neverthrow';
|
|
11
13
|
import type { DaemonEventEmitter } from './daemon-events.js';
|
|
14
|
+
export declare const DEFAULT_SESSION_TIMEOUT_MINUTES = 30;
|
|
15
|
+
export declare const DEFAULT_MAX_TURNS = 200;
|
|
12
16
|
export declare const DAEMON_SESSIONS_DIR: string;
|
|
13
17
|
export declare const WORKTREES_DIR: string;
|
|
14
18
|
export { DAEMON_SOUL_DEFAULT, DAEMON_SOUL_TEMPLATE } from './soul-template.js';
|
|
@@ -127,4 +131,75 @@ export declare const DAEMON_SIGNALS_DIR: string;
|
|
|
127
131
|
export declare function makeSignalCoordinatorTool(sessionId: string, emitter?: DaemonEventEmitter, workrailSessionId?: string | null, signalsDirOverride?: string): AgentTool;
|
|
128
132
|
export declare function buildSessionRecap(notes: readonly string[]): string;
|
|
129
133
|
export declare function buildSystemPrompt(trigger: WorkflowTrigger, sessionState: string, soulContent: string, workspaceContext: string | null): string;
|
|
130
|
-
export declare function
|
|
134
|
+
export declare function tagToStatsOutcome(tag: WorkflowRunResult['_tag']): 'success' | 'error' | 'timeout' | 'stuck';
|
|
135
|
+
export declare function buildAgentClient(trigger: WorkflowTrigger, apiKey: string, env: NodeJS.ProcessEnv): {
|
|
136
|
+
agentClient: Anthropic | AnthropicBedrock;
|
|
137
|
+
modelId: string;
|
|
138
|
+
};
|
|
139
|
+
export interface SessionState {
|
|
140
|
+
isComplete: boolean;
|
|
141
|
+
lastStepNotes: string | undefined;
|
|
142
|
+
lastStepArtifacts: readonly unknown[] | undefined;
|
|
143
|
+
currentContinueToken: string;
|
|
144
|
+
workrailSessionId: string | null;
|
|
145
|
+
stepAdvanceCount: number;
|
|
146
|
+
lastNToolCalls: Array<{
|
|
147
|
+
toolName: string;
|
|
148
|
+
argsSummary: string;
|
|
149
|
+
}>;
|
|
150
|
+
issueSummaries: string[];
|
|
151
|
+
pendingSteerParts: string[];
|
|
152
|
+
stuckReason: 'repeated_tool_call' | 'no_progress' | null;
|
|
153
|
+
timeoutReason: 'wall_clock' | 'max_turns' | null;
|
|
154
|
+
turnCount: number;
|
|
155
|
+
}
|
|
156
|
+
export declare function createSessionState(initialToken: string): SessionState;
|
|
157
|
+
export interface StuckConfig {
|
|
158
|
+
maxTurns: number;
|
|
159
|
+
stuckAbortPolicy: 'abort' | 'notify_only';
|
|
160
|
+
noProgressAbortEnabled: boolean;
|
|
161
|
+
stuckRepeatThreshold: number;
|
|
162
|
+
}
|
|
163
|
+
export type StuckSignal = {
|
|
164
|
+
kind: 'repeated_tool_call';
|
|
165
|
+
toolName: string;
|
|
166
|
+
argsSummary: string;
|
|
167
|
+
} | {
|
|
168
|
+
kind: 'no_progress';
|
|
169
|
+
turnCount: number;
|
|
170
|
+
maxTurns: number;
|
|
171
|
+
} | {
|
|
172
|
+
kind: 'max_turns_exceeded';
|
|
173
|
+
} | {
|
|
174
|
+
kind: 'timeout_imminent';
|
|
175
|
+
timeoutReason: 'wall_clock' | 'max_turns';
|
|
176
|
+
};
|
|
177
|
+
export declare function evaluateStuckSignals(state: Readonly<SessionState>, config: StuckConfig): StuckSignal | null;
|
|
178
|
+
export interface FinalizationContext {
|
|
179
|
+
readonly sessionId: string;
|
|
180
|
+
readonly workrailSessionId: string | null;
|
|
181
|
+
readonly startMs: number;
|
|
182
|
+
readonly stepAdvanceCount: number;
|
|
183
|
+
readonly branchStrategy: 'worktree' | 'none' | undefined;
|
|
184
|
+
readonly statsDir: string;
|
|
185
|
+
readonly sessionsDir: string;
|
|
186
|
+
readonly conversationPath: string;
|
|
187
|
+
readonly emitter: DaemonEventEmitter | undefined;
|
|
188
|
+
readonly daemonRegistry: DaemonRegistry | undefined;
|
|
189
|
+
readonly workflowId: string;
|
|
190
|
+
}
|
|
191
|
+
export declare function finalizeSession(result: WorkflowRunResult, ctx: FinalizationContext): Promise<void>;
|
|
192
|
+
export interface SessionContextInputs {
|
|
193
|
+
readonly soulContent: string;
|
|
194
|
+
readonly workspaceContext: string | null;
|
|
195
|
+
readonly sessionNotes: readonly string[];
|
|
196
|
+
readonly firstStepPrompt: string;
|
|
197
|
+
}
|
|
198
|
+
export interface SessionContext {
|
|
199
|
+
readonly systemPrompt: string;
|
|
200
|
+
readonly initialPrompt: string;
|
|
201
|
+
readonly sessionTimeoutMs: number;
|
|
202
|
+
readonly maxTurns: number;
|
|
203
|
+
}
|
|
204
|
+
export declare function buildSessionContext(trigger: WorkflowTrigger, inputs: SessionContextInputs): SessionContext;
|
|
205
|
+
export declare function runWorkflow(trigger: WorkflowTrigger, ctx: V2ToolContext, apiKey: string, daemonRegistry?: DaemonRegistry, emitter?: DaemonEventEmitter, steerRegistry?: SteerRegistry, abortRegistry?: AbortRegistry, _statsDir?: string, _sessionsDir?: string): Promise<WorkflowRunResult>;
|