@exaudeus/workrail 3.75.0 → 3.77.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/console-ui/assets/index-D9pYbwS0.js +28 -0
- package/dist/console-ui/index.html +1 -1
- package/dist/coordinators/adaptive-pipeline.d.ts +8 -0
- package/dist/coordinators/context-assembly.d.ts +4 -0
- package/dist/coordinators/context-assembly.js +156 -0
- package/dist/coordinators/modes/full-pipeline.d.ts +1 -1
- package/dist/coordinators/modes/full-pipeline.js +140 -27
- package/dist/coordinators/modes/implement-shared.d.ts +3 -2
- package/dist/coordinators/modes/implement-shared.js +16 -6
- package/dist/coordinators/modes/implement.js +49 -3
- package/dist/coordinators/pipeline-run-context.d.ts +1811 -0
- package/dist/coordinators/pipeline-run-context.js +114 -0
- package/dist/daemon/context-loader.d.ts +1 -1
- package/dist/daemon/core/agent-client.d.ts +7 -0
- package/dist/daemon/core/agent-client.js +31 -0
- package/dist/daemon/core/index.d.ts +6 -0
- package/dist/daemon/core/index.js +19 -0
- package/dist/daemon/core/session-context.d.ts +14 -0
- package/dist/daemon/core/session-context.js +24 -0
- package/dist/daemon/core/session-result.d.ts +10 -0
- package/dist/daemon/core/session-result.js +92 -0
- package/dist/daemon/core/system-prompt.d.ts +6 -0
- package/dist/daemon/core/system-prompt.js +151 -0
- package/dist/daemon/io/conversation-log.d.ts +2 -0
- package/dist/daemon/io/conversation-log.js +45 -0
- package/dist/daemon/io/execution-stats.d.ts +7 -0
- package/dist/daemon/io/execution-stats.js +86 -0
- package/dist/daemon/io/index.d.ts +5 -0
- package/dist/daemon/io/index.js +24 -0
- package/dist/daemon/io/session-notes-loader.d.ts +4 -0
- package/dist/daemon/io/session-notes-loader.js +45 -0
- package/dist/daemon/io/soul-loader.d.ts +3 -0
- package/dist/daemon/io/soul-loader.js +68 -0
- package/dist/daemon/io/workspace-context-loader.d.ts +17 -0
- package/dist/daemon/io/workspace-context-loader.js +137 -0
- package/dist/daemon/runner/agent-loop-runner.d.ts +28 -0
- package/dist/daemon/runner/agent-loop-runner.js +250 -0
- package/dist/daemon/runner/construct-tools.d.ts +5 -0
- package/dist/daemon/runner/construct-tools.js +30 -0
- package/dist/daemon/runner/finalize-session.d.ts +3 -0
- package/dist/daemon/runner/finalize-session.js +75 -0
- package/dist/daemon/runner/index.d.ts +8 -0
- package/dist/daemon/runner/index.js +18 -0
- package/dist/daemon/runner/pre-agent-session.d.ts +7 -0
- package/dist/daemon/runner/pre-agent-session.js +227 -0
- package/dist/daemon/runner/runner-types.d.ts +73 -0
- package/dist/daemon/runner/runner-types.js +39 -0
- package/dist/daemon/runner/tool-schemas.d.ts +1 -0
- package/dist/daemon/runner/tool-schemas.js +151 -0
- package/dist/daemon/session-scope.d.ts +1 -1
- package/dist/daemon/startup-recovery.d.ts +20 -0
- package/dist/daemon/startup-recovery.js +323 -0
- package/dist/daemon/state/index.d.ts +6 -0
- package/dist/daemon/state/index.js +14 -0
- package/dist/daemon/state/session-state.d.ts +23 -0
- package/dist/daemon/state/session-state.js +44 -0
- package/dist/daemon/state/stuck-detection.d.ts +22 -0
- package/dist/daemon/state/stuck-detection.js +25 -0
- package/dist/daemon/state/terminal-signal.d.ts +9 -0
- package/dist/daemon/state/terminal-signal.js +10 -0
- package/dist/daemon/tools/file-tools.d.ts +1 -1
- package/dist/daemon/turn-end/detect-stuck.d.ts +2 -2
- package/dist/daemon/turn-end/detect-stuck.js +2 -2
- package/dist/daemon/turn-end/step-injector.d.ts +1 -1
- package/dist/daemon/types.d.ts +105 -0
- package/dist/daemon/types.js +11 -0
- package/dist/daemon/workflow-enricher.d.ts +16 -0
- package/dist/daemon/workflow-enricher.js +58 -0
- package/dist/daemon/workflow-runner.d.ts +13 -277
- package/dist/daemon/workflow-runner.js +63 -1421
- package/dist/manifest.json +280 -56
- package/dist/trigger/coordinator-deps.d.ts +1 -1
- package/dist/trigger/coordinator-deps.js +131 -0
- package/dist/trigger/delivery-client.d.ts +1 -1
- package/dist/trigger/delivery-pipeline.d.ts +1 -1
- package/dist/trigger/notification-service.d.ts +1 -1
- package/dist/trigger/trigger-listener.js +6 -2
- package/dist/trigger/trigger-router.d.ts +2 -2
- package/dist/v2/durable-core/domain/artifact-contract-validator.js +99 -0
- package/dist/v2/durable-core/schemas/artifacts/discovery-handoff.d.ts +39 -0
- package/dist/v2/durable-core/schemas/artifacts/discovery-handoff.js +10 -1
- package/dist/v2/durable-core/schemas/artifacts/index.d.ts +2 -1
- package/dist/v2/durable-core/schemas/artifacts/index.js +12 -1
- package/dist/v2/durable-core/schemas/artifacts/phase-handoff.d.ts +89 -0
- package/dist/v2/durable-core/schemas/artifacts/phase-handoff.js +56 -0
- package/docs/authoring-v2.md +12 -0
- package/docs/ideas/backlog.md +639 -25
- package/docs/reference/worktrain-daemon-invariants.md +33 -49
- package/docs/vision.md +5 -15
- package/package.json +2 -2
- package/workflows/coding-task-workflow-agentic.json +9 -6
- package/workflows/mr-review-workflow.agentic.v2.json +2 -2
- package/workflows/wr.discovery.json +2 -1
- package/workflows/wr.shaping.json +7 -4
- package/dist/console-ui/assets/index-BvBihscd.js +0 -28
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.finalizeSession = finalizeSession;
|
|
37
|
+
const fs = __importStar(require("node:fs/promises"));
|
|
38
|
+
const path = __importStar(require("node:path"));
|
|
39
|
+
const index_js_1 = require("../core/index.js");
|
|
40
|
+
const index_js_2 = require("../io/index.js");
|
|
41
|
+
const _shared_js_1 = require("../tools/_shared.js");
|
|
42
|
+
const assert_never_js_1 = require("../../runtime/assert-never.js");
|
|
43
|
+
async function finalizeSession(result, ctx) {
|
|
44
|
+
const outcome = (0, index_js_1.tagToStatsOutcome)(result._tag);
|
|
45
|
+
const detail = result._tag === 'stuck' ? result.reason
|
|
46
|
+
: result._tag === 'timeout' ? result.reason
|
|
47
|
+
: result._tag === 'error' ? result.message.slice(0, 200)
|
|
48
|
+
: result._tag === 'delivery_failed' ? result.deliveryError.slice(0, 200)
|
|
49
|
+
: result.stopReason;
|
|
50
|
+
ctx.emitter?.emit({
|
|
51
|
+
kind: 'session_completed',
|
|
52
|
+
sessionId: ctx.sessionId,
|
|
53
|
+
workflowId: ctx.workflowId,
|
|
54
|
+
outcome,
|
|
55
|
+
detail,
|
|
56
|
+
...(0, _shared_js_1.withWorkrailSession)(ctx.workrailSessionId),
|
|
57
|
+
});
|
|
58
|
+
if (ctx.workrailSessionId !== null) {
|
|
59
|
+
ctx.daemonRegistry?.unregister(ctx.workrailSessionId, result._tag === 'success' || result._tag === 'delivery_failed' ? 'completed' : 'failed');
|
|
60
|
+
}
|
|
61
|
+
(0, index_js_2.writeExecutionStats)(ctx.statsDir, ctx.sessionId, ctx.workflowId, ctx.startMs, outcome, ctx.stepAdvanceCount);
|
|
62
|
+
const lifecycle = (0, index_js_1.sidecardLifecycleFor)(result._tag, ctx.branchStrategy);
|
|
63
|
+
switch (lifecycle.kind) {
|
|
64
|
+
case 'delete_now':
|
|
65
|
+
await fs.unlink(path.join(ctx.sessionsDir, `${ctx.sessionId}.json`)).catch(() => { });
|
|
66
|
+
break;
|
|
67
|
+
case 'retain_for_delivery':
|
|
68
|
+
break;
|
|
69
|
+
default:
|
|
70
|
+
(0, assert_never_js_1.assertNever)(lifecycle);
|
|
71
|
+
}
|
|
72
|
+
if (result._tag === 'success' && ctx.branchStrategy !== 'worktree') {
|
|
73
|
+
await fs.unlink(ctx.conversationPath).catch(() => { });
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { WORKTREES_DIR } from './runner-types.js';
|
|
2
|
+
export type { PreAgentSession, PreAgentSessionResult, AgentReadySession, SessionOutcome, FinalizationContext, } from './runner-types.js';
|
|
3
|
+
export { getSchemas } from './tool-schemas.js';
|
|
4
|
+
export { constructTools } from './construct-tools.js';
|
|
5
|
+
export { finalizeSession } from './finalize-session.js';
|
|
6
|
+
export { buildPreAgentSession } from './pre-agent-session.js';
|
|
7
|
+
export type { TurnEndSubscriberContext } from './agent-loop-runner.js';
|
|
8
|
+
export { buildTurnEndSubscriber, buildAgentCallbacks, buildAgentReadySession, runAgentLoop, } from './agent-loop-runner.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runAgentLoop = exports.buildAgentReadySession = exports.buildAgentCallbacks = exports.buildTurnEndSubscriber = exports.buildPreAgentSession = exports.finalizeSession = exports.constructTools = exports.getSchemas = exports.WORKTREES_DIR = void 0;
|
|
4
|
+
var runner_types_js_1 = require("./runner-types.js");
|
|
5
|
+
Object.defineProperty(exports, "WORKTREES_DIR", { enumerable: true, get: function () { return runner_types_js_1.WORKTREES_DIR; } });
|
|
6
|
+
var tool_schemas_js_1 = require("./tool-schemas.js");
|
|
7
|
+
Object.defineProperty(exports, "getSchemas", { enumerable: true, get: function () { return tool_schemas_js_1.getSchemas; } });
|
|
8
|
+
var construct_tools_js_1 = require("./construct-tools.js");
|
|
9
|
+
Object.defineProperty(exports, "constructTools", { enumerable: true, get: function () { return construct_tools_js_1.constructTools; } });
|
|
10
|
+
var finalize_session_js_1 = require("./finalize-session.js");
|
|
11
|
+
Object.defineProperty(exports, "finalizeSession", { enumerable: true, get: function () { return finalize_session_js_1.finalizeSession; } });
|
|
12
|
+
var pre_agent_session_js_1 = require("./pre-agent-session.js");
|
|
13
|
+
Object.defineProperty(exports, "buildPreAgentSession", { enumerable: true, get: function () { return pre_agent_session_js_1.buildPreAgentSession; } });
|
|
14
|
+
var agent_loop_runner_js_1 = require("./agent-loop-runner.js");
|
|
15
|
+
Object.defineProperty(exports, "buildTurnEndSubscriber", { enumerable: true, get: function () { return agent_loop_runner_js_1.buildTurnEndSubscriber; } });
|
|
16
|
+
Object.defineProperty(exports, "buildAgentCallbacks", { enumerable: true, get: function () { return agent_loop_runner_js_1.buildAgentCallbacks; } });
|
|
17
|
+
Object.defineProperty(exports, "buildAgentReadySession", { enumerable: true, get: function () { return agent_loop_runner_js_1.buildAgentReadySession; } });
|
|
18
|
+
Object.defineProperty(exports, "runAgentLoop", { enumerable: true, get: function () { return agent_loop_runner_js_1.runAgentLoop; } });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { V2ToolContext } from '../../mcp/types.js';
|
|
2
|
+
import type { DaemonRegistry } from '../../v2/infra/in-memory/daemon-registry/index.js';
|
|
3
|
+
import type { DaemonEventEmitter } from '../daemon-events.js';
|
|
4
|
+
import { ActiveSessionSet } from '../active-sessions.js';
|
|
5
|
+
import type { WorkflowTrigger, SessionSource } from '../types.js';
|
|
6
|
+
import type { PreAgentSessionResult } from './runner-types.js';
|
|
7
|
+
export declare function buildPreAgentSession(trigger: WorkflowTrigger, ctx: V2ToolContext, apiKey: string, sessionId: string, startMs: number, statsDir: string, sessionsDir: string, emitter: DaemonEventEmitter | undefined, daemonRegistry: DaemonRegistry | undefined, activeSessionSet: ActiveSessionSet | undefined, source?: SessionSource): Promise<PreAgentSessionResult>;
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.buildPreAgentSession = buildPreAgentSession;
|
|
37
|
+
const fs = __importStar(require("node:fs/promises"));
|
|
38
|
+
const path = __importStar(require("node:path"));
|
|
39
|
+
const node_child_process_1 = require("node:child_process");
|
|
40
|
+
const node_util_1 = require("node:util");
|
|
41
|
+
const start_js_1 = require("../../mcp/handlers/v2-execution/start.js");
|
|
42
|
+
const v2_token_ops_js_1 = require("../../mcp/handlers/v2-token-ops.js");
|
|
43
|
+
const index_js_1 = require("../state/index.js");
|
|
44
|
+
const index_js_2 = require("../core/index.js");
|
|
45
|
+
const _shared_js_1 = require("../tools/_shared.js");
|
|
46
|
+
const runner_types_js_1 = require("./runner-types.js");
|
|
47
|
+
const execFileAsync = (0, node_util_1.promisify)(node_child_process_1.execFile);
|
|
48
|
+
async function buildPreAgentSession(trigger, ctx, apiKey, sessionId, startMs, statsDir, sessionsDir, emitter, daemonRegistry, activeSessionSet, source) {
|
|
49
|
+
let agentClient;
|
|
50
|
+
let modelId;
|
|
51
|
+
try {
|
|
52
|
+
({ agentClient, modelId } = (0, index_js_2.buildAgentClient)(trigger, apiKey, process.env));
|
|
53
|
+
if (trigger.agentConfig?.model) {
|
|
54
|
+
console.log(`[WorkflowRunner] Model: ${modelId} (override from agentConfig.model)`);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
const usesBedrock = !!process.env['AWS_PROFILE'] || !!process.env['AWS_ACCESS_KEY_ID'];
|
|
58
|
+
if (usesBedrock) {
|
|
59
|
+
console.log(`[WorkflowRunner] Model: ${modelId} (amazon-bedrock, detected from AWS env)`);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
console.log(`[WorkflowRunner] Model: ${modelId} (anthropic direct). Set agentConfig.model or AWS env vars to use Bedrock.`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
catch (e) {
|
|
67
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
68
|
+
return { kind: 'complete', result: { _tag: 'error', workflowId: trigger.workflowId, message, stopReason: 'error' }, workrailSessionId: null, handle: undefined };
|
|
69
|
+
}
|
|
70
|
+
const state = (0, index_js_1.createSessionState)('');
|
|
71
|
+
let continueToken;
|
|
72
|
+
let checkpointToken;
|
|
73
|
+
let firstStepPrompt;
|
|
74
|
+
let isComplete;
|
|
75
|
+
const effectiveSource = source ?? { kind: 'allocate', trigger };
|
|
76
|
+
if (effectiveSource.kind === 'pre_allocated') {
|
|
77
|
+
const s = effectiveSource.session;
|
|
78
|
+
continueToken = s.continueToken;
|
|
79
|
+
checkpointToken = s.checkpointToken ?? null;
|
|
80
|
+
firstStepPrompt = s.firstStepPrompt;
|
|
81
|
+
isComplete = s.isComplete;
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
const startResult = await (0, start_js_1.executeStartWorkflow)({ workflowId: trigger.workflowId, workspacePath: trigger.workspacePath, goal: trigger.goal }, ctx, { is_autonomous: 'true', workspacePath: trigger.workspacePath, triggerSource: 'daemon' });
|
|
85
|
+
if (startResult.isErr()) {
|
|
86
|
+
return {
|
|
87
|
+
kind: 'complete',
|
|
88
|
+
result: {
|
|
89
|
+
_tag: 'error',
|
|
90
|
+
workflowId: trigger.workflowId,
|
|
91
|
+
message: `start_workflow failed: ${startResult.error.kind} -- ${JSON.stringify(startResult.error)}`,
|
|
92
|
+
stopReason: 'error',
|
|
93
|
+
},
|
|
94
|
+
workrailSessionId: null,
|
|
95
|
+
handle: undefined,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
const r = startResult.value.response;
|
|
99
|
+
continueToken = r.continueToken ?? '';
|
|
100
|
+
checkpointToken = r.checkpointToken ?? null;
|
|
101
|
+
firstStepPrompt = r.pending?.prompt ?? '';
|
|
102
|
+
isComplete = r.isComplete;
|
|
103
|
+
}
|
|
104
|
+
(0, index_js_1.updateToken)(state, continueToken);
|
|
105
|
+
if (continueToken) {
|
|
106
|
+
const decoded = await (0, v2_token_ops_js_1.parseContinueTokenOrFail)(continueToken, ctx.v2.tokenCodecPorts, ctx.v2.tokenAliasStore);
|
|
107
|
+
if (decoded.isOk()) {
|
|
108
|
+
(0, index_js_1.setSessionId)(state, decoded.value.sessionId);
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
console.error(`[WorkflowRunner] Error: could not decode WorkRail session ID from continueToken -- isLive and liveActivity will not work. Reason: ${decoded.error.message}`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (continueToken) {
|
|
115
|
+
const persistResult = await (0, _shared_js_1.persistTokens)(sessionId, continueToken, checkpointToken, undefined, {
|
|
116
|
+
workflowId: trigger.workflowId,
|
|
117
|
+
goal: trigger.goal,
|
|
118
|
+
workspacePath: trigger.workspacePath,
|
|
119
|
+
});
|
|
120
|
+
if (persistResult.kind === 'err') {
|
|
121
|
+
return {
|
|
122
|
+
kind: 'complete',
|
|
123
|
+
result: {
|
|
124
|
+
_tag: 'error',
|
|
125
|
+
workflowId: trigger.workflowId,
|
|
126
|
+
message: `Initial token persist failed: ${persistResult.error.code} -- ${persistResult.error.message}`,
|
|
127
|
+
stopReason: 'error',
|
|
128
|
+
},
|
|
129
|
+
workrailSessionId: state.workrailSessionId,
|
|
130
|
+
handle: undefined,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
let sessionWorkspacePath = trigger.workspacePath;
|
|
135
|
+
let sessionWorktreePath;
|
|
136
|
+
if (effectiveSource.kind === 'pre_allocated' && effectiveSource.session.sessionWorkspacePath !== undefined) {
|
|
137
|
+
sessionWorkspacePath = effectiveSource.session.sessionWorkspacePath;
|
|
138
|
+
sessionWorktreePath = effectiveSource.session.sessionWorkspacePath;
|
|
139
|
+
}
|
|
140
|
+
if (trigger.branchStrategy === 'worktree') {
|
|
141
|
+
const branchPrefix = trigger.branchPrefix ?? 'worktrain/';
|
|
142
|
+
const baseBranch = trigger.baseBranch ?? 'main';
|
|
143
|
+
sessionWorkspacePath = path.join(runner_types_js_1.WORKTREES_DIR, sessionId);
|
|
144
|
+
sessionWorktreePath = sessionWorkspacePath;
|
|
145
|
+
try {
|
|
146
|
+
await fs.mkdir(runner_types_js_1.WORKTREES_DIR, { recursive: true });
|
|
147
|
+
await execFileAsync('git', ['-C', trigger.workspacePath, 'fetch', 'origin', baseBranch]);
|
|
148
|
+
await execFileAsync('git', [
|
|
149
|
+
'-C', trigger.workspacePath,
|
|
150
|
+
'worktree', 'add',
|
|
151
|
+
sessionWorkspacePath,
|
|
152
|
+
'-b', `${branchPrefix}${sessionId}`,
|
|
153
|
+
`origin/${baseBranch}`,
|
|
154
|
+
]);
|
|
155
|
+
const worktreePersistResult = await (0, _shared_js_1.persistTokens)(sessionId, continueToken ?? state.currentContinueToken, checkpointToken, sessionWorktreePath, { workflowId: trigger.workflowId, goal: trigger.goal, workspacePath: trigger.workspacePath });
|
|
156
|
+
if (worktreePersistResult.kind === 'err') {
|
|
157
|
+
console.error(`[WorkflowRunner] Worktree sidecar persist failed: ${worktreePersistResult.error.code} -- ${worktreePersistResult.error.message}`);
|
|
158
|
+
try {
|
|
159
|
+
await execFileAsync('git', ['-C', trigger.workspacePath, 'worktree', 'remove', '--force', sessionWorkspacePath]);
|
|
160
|
+
}
|
|
161
|
+
catch { }
|
|
162
|
+
return {
|
|
163
|
+
kind: 'complete',
|
|
164
|
+
result: {
|
|
165
|
+
_tag: 'error',
|
|
166
|
+
workflowId: trigger.workflowId,
|
|
167
|
+
message: `Worktree sidecar persist failed: ${worktreePersistResult.error.code} -- ${worktreePersistResult.error.message}`,
|
|
168
|
+
stopReason: 'error',
|
|
169
|
+
},
|
|
170
|
+
workrailSessionId: state.workrailSessionId,
|
|
171
|
+
handle: undefined,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
console.log(`[WorkflowRunner] Worktree created: sessionId=${sessionId} branch=${branchPrefix}${sessionId} path=${sessionWorkspacePath}`);
|
|
175
|
+
}
|
|
176
|
+
catch (e) {
|
|
177
|
+
const errMsg = e instanceof Error ? e.message : String(e);
|
|
178
|
+
console.error(`[WorkflowRunner] Worktree creation failed: sessionId=${sessionId} error=${errMsg}`);
|
|
179
|
+
return {
|
|
180
|
+
kind: 'complete',
|
|
181
|
+
result: { _tag: 'error', workflowId: trigger.workflowId, message: `Worktree creation failed: ${errMsg}`, stopReason: 'error' },
|
|
182
|
+
workrailSessionId: state.workrailSessionId,
|
|
183
|
+
handle: undefined,
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
let handle;
|
|
188
|
+
if (state.workrailSessionId !== null) {
|
|
189
|
+
daemonRegistry?.register(state.workrailSessionId, trigger.workflowId);
|
|
190
|
+
handle = activeSessionSet?.register(state.workrailSessionId, (text) => { state.pendingSteerParts.push(text); });
|
|
191
|
+
}
|
|
192
|
+
if (isComplete) {
|
|
193
|
+
return {
|
|
194
|
+
kind: 'complete',
|
|
195
|
+
result: {
|
|
196
|
+
_tag: 'success',
|
|
197
|
+
workflowId: trigger.workflowId,
|
|
198
|
+
stopReason: 'stop',
|
|
199
|
+
...(sessionWorktreePath !== undefined ? { sessionWorkspacePath: sessionWorktreePath } : {}),
|
|
200
|
+
...(sessionWorktreePath !== undefined ? { sessionId } : {}),
|
|
201
|
+
...(trigger.botIdentity !== undefined ? { botIdentity: trigger.botIdentity } : {}),
|
|
202
|
+
},
|
|
203
|
+
workrailSessionId: state.workrailSessionId,
|
|
204
|
+
handle,
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
return {
|
|
208
|
+
kind: 'ready',
|
|
209
|
+
session: {
|
|
210
|
+
sessionId,
|
|
211
|
+
workrailSessionId: state.workrailSessionId,
|
|
212
|
+
continueToken,
|
|
213
|
+
checkpointToken,
|
|
214
|
+
sessionWorkspacePath,
|
|
215
|
+
sessionWorktreePath,
|
|
216
|
+
firstStepPrompt,
|
|
217
|
+
state,
|
|
218
|
+
spawnCurrentDepth: trigger.spawnDepth ?? 0,
|
|
219
|
+
spawnMaxDepth: trigger.agentConfig?.maxSubagentDepth ?? 3,
|
|
220
|
+
readFileState: new Map(),
|
|
221
|
+
agentClient,
|
|
222
|
+
modelId,
|
|
223
|
+
startMs,
|
|
224
|
+
...(handle !== undefined ? { handle } : {}),
|
|
225
|
+
},
|
|
226
|
+
};
|
|
227
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { AgentLoop, AgentTool } from '../agent-loop.js';
|
|
2
|
+
import type { SessionState } from '../state/session-state.js';
|
|
3
|
+
import type { SessionContext } from '../core/session-context.js';
|
|
4
|
+
import type { ContextBundle } from '../context-loader.js';
|
|
5
|
+
import type { SessionScope } from '../session-scope.js';
|
|
6
|
+
import type { SessionHandle } from '../active-sessions.js';
|
|
7
|
+
import type { DaemonEventEmitter } from '../daemon-events.js';
|
|
8
|
+
import type { DaemonRegistry } from '../../v2/infra/in-memory/daemon-registry/index.js';
|
|
9
|
+
import type { WorkflowRunResult } from '../types.js';
|
|
10
|
+
import type { ReadFileState } from '../types.js';
|
|
11
|
+
import Anthropic from '@anthropic-ai/sdk';
|
|
12
|
+
import { AnthropicBedrock } from '@anthropic-ai/bedrock-sdk';
|
|
13
|
+
export declare const WORKTREES_DIR: string;
|
|
14
|
+
export interface PreAgentSession {
|
|
15
|
+
readonly sessionId: string;
|
|
16
|
+
readonly workrailSessionId: string | null;
|
|
17
|
+
readonly continueToken: string;
|
|
18
|
+
readonly checkpointToken: string | null;
|
|
19
|
+
readonly sessionWorkspacePath: string;
|
|
20
|
+
readonly sessionWorktreePath: string | undefined;
|
|
21
|
+
readonly firstStepPrompt: string;
|
|
22
|
+
readonly state: SessionState;
|
|
23
|
+
readonly spawnCurrentDepth: number;
|
|
24
|
+
readonly spawnMaxDepth: number;
|
|
25
|
+
readonly readFileState: Map<string, ReadFileState>;
|
|
26
|
+
readonly agentClient: Anthropic | AnthropicBedrock;
|
|
27
|
+
readonly modelId: string;
|
|
28
|
+
readonly startMs: number;
|
|
29
|
+
readonly handle?: SessionHandle;
|
|
30
|
+
}
|
|
31
|
+
export type PreAgentSessionResult = {
|
|
32
|
+
readonly kind: 'ready';
|
|
33
|
+
readonly session: PreAgentSession;
|
|
34
|
+
} | {
|
|
35
|
+
readonly kind: 'complete';
|
|
36
|
+
readonly result: WorkflowRunResult;
|
|
37
|
+
readonly workrailSessionId: string | null;
|
|
38
|
+
readonly handle: SessionHandle | undefined;
|
|
39
|
+
};
|
|
40
|
+
export interface AgentReadySession {
|
|
41
|
+
readonly preAgentSession: PreAgentSession;
|
|
42
|
+
readonly contextBundle: ContextBundle;
|
|
43
|
+
readonly scope: SessionScope;
|
|
44
|
+
readonly tools: readonly AgentTool[];
|
|
45
|
+
readonly sessionCtx: SessionContext;
|
|
46
|
+
readonly handle: SessionHandle | undefined;
|
|
47
|
+
readonly sessionId: string;
|
|
48
|
+
readonly workflowId: string;
|
|
49
|
+
readonly worktreePath: string | undefined;
|
|
50
|
+
readonly agent: AgentLoop;
|
|
51
|
+
readonly stuckRepeatThreshold: number;
|
|
52
|
+
}
|
|
53
|
+
export type SessionOutcome = {
|
|
54
|
+
readonly kind: 'completed';
|
|
55
|
+
readonly stopReason: string;
|
|
56
|
+
readonly errorMessage?: string;
|
|
57
|
+
} | {
|
|
58
|
+
readonly kind: 'aborted';
|
|
59
|
+
readonly errorMessage?: string;
|
|
60
|
+
};
|
|
61
|
+
export interface FinalizationContext {
|
|
62
|
+
readonly sessionId: string;
|
|
63
|
+
readonly workrailSessionId: string | null;
|
|
64
|
+
readonly startMs: number;
|
|
65
|
+
readonly stepAdvanceCount: number;
|
|
66
|
+
readonly branchStrategy: 'worktree' | 'none' | undefined;
|
|
67
|
+
readonly statsDir: string;
|
|
68
|
+
readonly sessionsDir: string;
|
|
69
|
+
readonly conversationPath: string;
|
|
70
|
+
readonly emitter: DaemonEventEmitter | undefined;
|
|
71
|
+
readonly daemonRegistry: DaemonRegistry | undefined;
|
|
72
|
+
readonly workflowId: string;
|
|
73
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.WORKTREES_DIR = void 0;
|
|
37
|
+
const path = __importStar(require("node:path"));
|
|
38
|
+
const os = __importStar(require("node:os"));
|
|
39
|
+
exports.WORKTREES_DIR = path.join(os.homedir(), '.workrail', 'worktrees');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getSchemas(): Record<string, any>;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSchemas = getSchemas;
|
|
4
|
+
let _schemas = null;
|
|
5
|
+
function getSchemas() {
|
|
6
|
+
if (_schemas)
|
|
7
|
+
return _schemas;
|
|
8
|
+
_schemas = {
|
|
9
|
+
ContinueWorkflowParams: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
continueToken: {
|
|
13
|
+
type: 'string',
|
|
14
|
+
description: 'The continueToken from the previous start_workflow or continue_workflow call. Round-trip exactly as received.',
|
|
15
|
+
},
|
|
16
|
+
intent: {
|
|
17
|
+
type: 'string',
|
|
18
|
+
enum: ['advance', 'rehydrate'],
|
|
19
|
+
description: 'advance: I completed this step. rehydrate: remind me what the current step is.',
|
|
20
|
+
},
|
|
21
|
+
notesMarkdown: {
|
|
22
|
+
type: 'string',
|
|
23
|
+
description: 'Notes on what you did in this step (10-30 lines, markdown).',
|
|
24
|
+
},
|
|
25
|
+
artifacts: {
|
|
26
|
+
type: 'array',
|
|
27
|
+
items: {},
|
|
28
|
+
description: 'Optional structured artifacts to attach to this step. ' +
|
|
29
|
+
'Include wr.assessment objects here when the step requires an assessment gate. ' +
|
|
30
|
+
'Example: [{ "kind": "wr.assessment", "assessmentId": "<id>", "dimensions": { "<dimensionId>": "high" } }]',
|
|
31
|
+
},
|
|
32
|
+
context: {
|
|
33
|
+
type: 'object',
|
|
34
|
+
additionalProperties: true,
|
|
35
|
+
description: 'Updated context variables (only changed values). Exception: metrics_commit_shas must always contain the FULL accumulated list of all commit SHAs from this session -- never send only new SHAs.',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
required: ['continueToken'],
|
|
39
|
+
},
|
|
40
|
+
CompleteStepParams: {
|
|
41
|
+
type: 'object',
|
|
42
|
+
properties: {
|
|
43
|
+
notes: {
|
|
44
|
+
type: 'string',
|
|
45
|
+
minLength: 50,
|
|
46
|
+
description: 'What you did in this step (required, at least 50 characters). Write for a human reader. ' +
|
|
47
|
+
'Include: what you did and key decisions, what you produced (files, tests, numbers), ' +
|
|
48
|
+
'anything notable (risks, open questions, things you chose NOT to do and why). ' +
|
|
49
|
+
'Use markdown: headings, bullets, bold. 10-30 lines is ideal.',
|
|
50
|
+
},
|
|
51
|
+
artifacts: {
|
|
52
|
+
type: 'array',
|
|
53
|
+
items: {},
|
|
54
|
+
description: 'Optional structured artifacts to attach to this step. ' +
|
|
55
|
+
'Include wr.assessment objects here when the step requires an assessment gate. ' +
|
|
56
|
+
'Example: [{ "kind": "wr.assessment", "assessmentId": "<id>", "dimensions": { "<dimensionId>": "high" } }]',
|
|
57
|
+
},
|
|
58
|
+
context: {
|
|
59
|
+
type: 'object',
|
|
60
|
+
additionalProperties: true,
|
|
61
|
+
description: 'Updated context variables (only changed values). Omit entirely if no facts changed. Exception: metrics_commit_shas must always contain the FULL accumulated list of all commit SHAs from this session -- never send only new SHAs.',
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
required: ['notes'],
|
|
65
|
+
additionalProperties: false,
|
|
66
|
+
},
|
|
67
|
+
BashParams: {
|
|
68
|
+
type: 'object',
|
|
69
|
+
properties: {
|
|
70
|
+
command: { type: 'string', description: 'Shell command to execute' },
|
|
71
|
+
cwd: { type: 'string', description: 'Working directory for the command' },
|
|
72
|
+
},
|
|
73
|
+
required: ['command'],
|
|
74
|
+
},
|
|
75
|
+
ReadParams: {
|
|
76
|
+
type: 'object',
|
|
77
|
+
properties: {
|
|
78
|
+
filePath: { type: 'string', description: 'Absolute path to the file to read. Content is returned in cat -n format: each line prefixed with its 1-indexed line number and a tab character.' },
|
|
79
|
+
offset: { type: 'number', description: '0-indexed line number to start reading from (inclusive). Omit to read from the beginning.' },
|
|
80
|
+
limit: { type: 'number', description: 'Maximum number of lines to return. Omit to read to end of file.' },
|
|
81
|
+
},
|
|
82
|
+
required: ['filePath'],
|
|
83
|
+
},
|
|
84
|
+
WriteParams: {
|
|
85
|
+
type: 'object',
|
|
86
|
+
properties: {
|
|
87
|
+
filePath: { type: 'string', description: 'Absolute path to the file to write' },
|
|
88
|
+
content: { type: 'string', description: 'Content to write to the file' },
|
|
89
|
+
},
|
|
90
|
+
required: ['filePath', 'content'],
|
|
91
|
+
},
|
|
92
|
+
GlobParams: {
|
|
93
|
+
type: 'object',
|
|
94
|
+
properties: {
|
|
95
|
+
pattern: { type: 'string', description: 'Glob pattern to match (e.g. "**/*.ts"). Supports standard glob syntax.' },
|
|
96
|
+
path: { type: 'string', description: 'Absolute path to search root. Defaults to the workspace root.' },
|
|
97
|
+
},
|
|
98
|
+
required: ['pattern'],
|
|
99
|
+
},
|
|
100
|
+
GrepParams: {
|
|
101
|
+
type: 'object',
|
|
102
|
+
properties: {
|
|
103
|
+
pattern: { type: 'string', description: 'Regular expression pattern to search for in file contents.' },
|
|
104
|
+
path: { type: 'string', description: 'Absolute path to search in. Defaults to the workspace root.' },
|
|
105
|
+
glob: { type: 'string', description: 'Glob pattern to restrict which files are searched (e.g. "*.ts").' },
|
|
106
|
+
type: { type: 'string', description: 'File type filter for ripgrep (e.g. "ts", "js", "py").' },
|
|
107
|
+
output_mode: { type: 'string', enum: ['content', 'files_with_matches', 'count'], description: 'Output mode. "files_with_matches": only file paths (default). "content": matching lines with context. "count": match counts per file.' },
|
|
108
|
+
head_limit: { type: 'number', description: 'Maximum number of output lines to return. Default: 250.' },
|
|
109
|
+
context: { type: 'number', description: 'Number of lines of context to show before and after each match (output_mode=content only).' },
|
|
110
|
+
'-i': { type: 'boolean', description: 'Case-insensitive search.' },
|
|
111
|
+
},
|
|
112
|
+
required: ['pattern'],
|
|
113
|
+
},
|
|
114
|
+
EditParams: {
|
|
115
|
+
type: 'object',
|
|
116
|
+
properties: {
|
|
117
|
+
file_path: { type: 'string', description: 'Absolute path to the file to edit. The file must have been read in this session via the Read tool.' },
|
|
118
|
+
old_string: { type: 'string', description: 'Exact string to find and replace. Must appear exactly once in the file (or use replace_all=true for multiple occurrences). Do NOT include line-number prefixes from Read output.' },
|
|
119
|
+
new_string: { type: 'string', description: 'Replacement string. Must differ from old_string.' },
|
|
120
|
+
replace_all: { type: 'boolean', description: 'Replace all occurrences of old_string. Default: false (fails if more than one match).' },
|
|
121
|
+
},
|
|
122
|
+
required: ['file_path', 'old_string', 'new_string'],
|
|
123
|
+
additionalProperties: false,
|
|
124
|
+
},
|
|
125
|
+
SpawnAgentParams: {
|
|
126
|
+
type: 'object',
|
|
127
|
+
properties: {
|
|
128
|
+
workflowId: {
|
|
129
|
+
type: 'string',
|
|
130
|
+
description: 'ID of the workflow to run in the child session (e.g. "wr.discovery").',
|
|
131
|
+
},
|
|
132
|
+
goal: {
|
|
133
|
+
type: 'string',
|
|
134
|
+
description: 'One-sentence description of what the child session should accomplish.',
|
|
135
|
+
},
|
|
136
|
+
workspacePath: {
|
|
137
|
+
type: 'string',
|
|
138
|
+
description: 'Absolute path to the workspace directory for the child session.',
|
|
139
|
+
},
|
|
140
|
+
context: {
|
|
141
|
+
type: 'object',
|
|
142
|
+
additionalProperties: true,
|
|
143
|
+
description: 'Optional initial context variables to pass to the child workflow.',
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
required: ['workflowId', 'goal', 'workspacePath'],
|
|
147
|
+
additionalProperties: false,
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
return _schemas;
|
|
151
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReadFileState } from './
|
|
1
|
+
import type { ReadFileState } from './types.js';
|
|
2
2
|
import type { ActiveSessionSet } from './active-sessions.js';
|
|
3
3
|
import type { DaemonEventEmitter } from './daemon-events.js';
|
|
4
4
|
export interface FileStateTracker {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import type { V2ToolContext } from '../mcp/types.js';
|
|
3
|
+
import { executeContinueWorkflow } from '../mcp/handlers/v2-execution/index.js';
|
|
4
|
+
import type { ContinueTokenResolved } from '../mcp/handlers/v2-token-ops.js';
|
|
5
|
+
import type { SessionEventLogReadonlyStorePortV2 } from '../v2/ports/session-event-log-store.port.js';
|
|
6
|
+
import type { ToolFailure } from '../mcp/handlers/v2-execution-helpers.js';
|
|
7
|
+
import type { ResultAsync } from 'neverthrow';
|
|
8
|
+
import type { OrphanedSession } from './types.js';
|
|
9
|
+
import { runWorkflow } from './workflow-runner.js';
|
|
10
|
+
export declare function readDaemonSessionState(sessionId: string): Promise<{
|
|
11
|
+
continueToken: string;
|
|
12
|
+
checkpointToken: string | null;
|
|
13
|
+
} | null>;
|
|
14
|
+
export declare function readAllDaemonSessions(sessionsDir?: string): Promise<OrphanedSession[]>;
|
|
15
|
+
export declare function runStartupRecovery(sessionsDir?: string, execFn?: (file: string, args: string[]) => Promise<{
|
|
16
|
+
stdout: string;
|
|
17
|
+
stderr: string;
|
|
18
|
+
}>, ctx?: V2ToolContext, _countStepAdvancesFn?: typeof countOrphanStepAdvances, _executeContinueWorkflowFn?: typeof executeContinueWorkflow, _runWorkflowFn?: typeof runWorkflow, apiKey?: string): Promise<void>;
|
|
19
|
+
export declare function countOrphanStepAdvances(continueToken: string, ctx: V2ToolContext, _parseFn?: ((raw: string) => ResultAsync<ContinueTokenResolved, ToolFailure>) | undefined, _loadFn?: SessionEventLogReadonlyStorePortV2['loadValidatedPrefix'] | undefined): Promise<number>;
|
|
20
|
+
export declare function clearQueueIssueSidecars(sessionsDir: string): Promise<void>;
|