@plusplusoneplusplus/coc 1.0.4 → 1.0.5
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.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/server/api-handler.d.ts +2 -2
- package/dist/server/api-handler.d.ts.map +1 -1
- package/dist/server/diff-comments-ai.d.ts +8 -0
- package/dist/server/diff-comments-ai.d.ts.map +1 -1
- package/dist/server/diff-comments-ai.js +62 -0
- package/dist/server/diff-comments-ai.js.map +1 -1
- package/dist/server/diff-comments-handler.d.ts.map +1 -1
- package/dist/server/diff-comments-handler.js +115 -0
- package/dist/server/diff-comments-handler.js.map +1 -1
- package/dist/server/executors/base-executor.d.ts.map +1 -1
- package/dist/server/executors/base-executor.js +1 -29
- package/dist/server/executors/base-executor.js.map +1 -1
- package/dist/server/executors/executor-registry.d.ts +55 -0
- package/dist/server/executors/executor-registry.d.ts.map +1 -0
- package/dist/server/executors/executor-registry.js +98 -0
- package/dist/server/executors/executor-registry.js.map +1 -0
- package/dist/server/executors/executor-types.d.ts +6 -0
- package/dist/server/executors/executor-types.d.ts.map +1 -0
- package/dist/server/executors/executor-types.js +3 -0
- package/dist/server/executors/executor-types.js.map +1 -0
- package/dist/server/executors/follow-up-executor.d.ts +1 -1
- package/dist/server/executors/follow-up-executor.d.ts.map +1 -1
- package/dist/server/executors/follow-up-executor.js +64 -121
- package/dist/server/executors/follow-up-executor.js.map +1 -1
- package/dist/server/executors/process-lifecycle-runner.d.ts +1 -1
- package/dist/server/executors/process-lifecycle-runner.d.ts.map +1 -1
- package/dist/server/executors/process-lifecycle-runner.js +60 -48
- package/dist/server/executors/process-lifecycle-runner.js.map +1 -1
- package/dist/server/executors/prompt-builder.d.ts +3 -3
- package/dist/server/executors/prompt-builder.d.ts.map +1 -1
- package/dist/server/executors/prompt-builder.js +4 -9
- package/dist/server/executors/prompt-builder.js.map +1 -1
- package/dist/server/executors/resolve-comments-executor.d.ts.map +1 -1
- package/dist/server/executors/resolve-comments-executor.js +33 -3
- package/dist/server/executors/resolve-comments-executor.js.map +1 -1
- package/dist/server/executors/task-generation-executor.d.ts.map +1 -1
- package/dist/server/executors/task-generation-executor.js +1 -7
- package/dist/server/executors/task-generation-executor.js.map +1 -1
- package/dist/server/executors/wrapped-task-executor.d.ts +26 -0
- package/dist/server/executors/wrapped-task-executor.d.ts.map +1 -0
- package/dist/server/executors/wrapped-task-executor.js +88 -0
- package/dist/server/executors/wrapped-task-executor.js.map +1 -0
- package/dist/server/in-memory-process-store.d.ts.map +1 -1
- package/dist/server/in-memory-process-store.js +62 -0
- package/dist/server/in-memory-process-store.js.map +1 -1
- package/dist/server/index.d.ts +4 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +5 -2
- package/dist/server/index.js.map +1 -1
- package/dist/server/memory/conversation-recorder.d.ts.map +1 -1
- package/dist/server/memory/conversation-recorder.js +35 -1
- package/dist/server/memory/conversation-recorder.js.map +1 -1
- package/dist/server/memory/memory-aggregate-executor.d.ts +18 -0
- package/dist/server/memory/memory-aggregate-executor.d.ts.map +1 -0
- package/dist/server/memory/memory-aggregate-executor.js +210 -0
- package/dist/server/memory/memory-aggregate-executor.js.map +1 -0
- package/dist/server/memory/memory-routes.d.ts.map +1 -1
- package/dist/server/memory/memory-routes.js +15 -4
- package/dist/server/memory/memory-routes.js.map +1 -1
- package/dist/server/memory/repo-memory-handler.d.ts +5 -2
- package/dist/server/memory/repo-memory-handler.d.ts.map +1 -1
- package/dist/server/memory/repo-memory-handler.js +103 -112
- package/dist/server/memory/repo-memory-handler.js.map +1 -1
- package/dist/server/memory/repo-memory-migration.d.ts +58 -0
- package/dist/server/memory/repo-memory-migration.d.ts.map +1 -0
- package/dist/server/memory/repo-memory-migration.js +289 -0
- package/dist/server/memory/repo-memory-migration.js.map +1 -0
- package/dist/server/multi-repo-executor-bridge.d.ts +2 -2
- package/dist/server/multi-repo-executor-bridge.d.ts.map +1 -1
- package/dist/server/multi-repo-executor-bridge.js +4 -4
- package/dist/server/multi-repo-executor-bridge.js.map +1 -1
- package/dist/server/prompt-handler.d.ts.map +1 -1
- package/dist/server/prompt-handler.js +4 -12
- package/dist/server/prompt-handler.js.map +1 -1
- package/dist/server/queue-executor-bridge.d.ts +9 -16
- package/dist/server/queue-executor-bridge.d.ts.map +1 -1
- package/dist/server/queue-executor-bridge.js +25 -62
- package/dist/server/queue-executor-bridge.js.map +1 -1
- package/dist/server/replicate-apply-handler.d.ts.map +1 -1
- package/dist/server/replicate-apply-handler.js +5 -12
- package/dist/server/replicate-apply-handler.js.map +1 -1
- package/dist/server/routes/api-git-branch-routes.d.ts.map +1 -1
- package/dist/server/routes/api-git-branch-routes.js +165 -0
- package/dist/server/routes/api-git-branch-routes.js.map +1 -1
- package/dist/server/routes/api-git-working-tree-routes.d.ts.map +1 -1
- package/dist/server/routes/api-git-working-tree-routes.js +4 -2
- package/dist/server/routes/api-git-working-tree-routes.js.map +1 -1
- package/dist/server/routes/api-process-routes.d.ts.map +1 -1
- package/dist/server/routes/api-process-routes.js +8 -34
- package/dist/server/routes/api-process-routes.js.map +1 -1
- package/dist/server/routes/index.d.ts.map +1 -1
- package/dist/server/routes/index.js +1 -0
- package/dist/server/routes/index.js.map +1 -1
- package/dist/server/shared/queue-utils.d.ts +1 -1
- package/dist/server/shared/queue-utils.d.ts.map +1 -1
- package/dist/server/shared/queue-utils.js +2 -1
- package/dist/server/shared/queue-utils.js.map +1 -1
- package/dist/server/skill-handler.d.ts +3 -0
- package/dist/server/skill-handler.d.ts.map +1 -1
- package/dist/server/skill-handler.js +8 -5
- package/dist/server/skill-handler.js.map +1 -1
- package/dist/server/spa/client/dist/bundle.css +81 -0
- package/dist/server/spa/client/dist/bundle.js +13526 -12306
- package/dist/server/sse-handler.d.ts.map +1 -1
- package/dist/server/sse-handler.js +3 -0
- package/dist/server/sse-handler.js.map +1 -1
- package/dist/server/task-comments-handler.d.ts.map +1 -1
- package/dist/server/task-comments-handler.js +16 -8
- package/dist/server/task-comments-handler.js.map +1 -1
- package/dist/server/task-types.d.ts +24 -1
- package/dist/server/task-types.d.ts.map +1 -1
- package/dist/server/task-types.js +9 -0
- package/dist/server/task-types.js.map +1 -1
- package/dist/server/templates-handler.d.ts.map +1 -1
- package/dist/server/templates-handler.js +19 -29
- package/dist/server/templates-handler.js.map +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/copilot-sdk-wrapper/model-registry.d.ts.map +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/copilot-sdk-wrapper/model-registry.js +10 -0
- package/node_modules/@plusplusoneplusplus/forge/dist/copilot-sdk-wrapper/model-registry.js.map +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/copilot-sdk-wrapper/sdk-loader.d.ts +25 -28
- package/node_modules/@plusplusoneplusplus/forge/dist/copilot-sdk-wrapper/sdk-loader.d.ts.map +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/copilot-sdk-wrapper/sdk-loader.js +59 -40
- package/node_modules/@plusplusoneplusplus/forge/dist/copilot-sdk-wrapper/sdk-loader.js.map +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/file-process-store.d.ts +11 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/file-process-store.d.ts.map +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/file-process-store.js +125 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/file-process-store.js.map +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/git/branch-service.d.ts +28 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/git/branch-service.d.ts.map +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/git/branch-service.js +183 -0
- package/node_modules/@plusplusoneplusplus/forge/dist/git/branch-service.js.map +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/git/git-ops-store.d.ts +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/git/git-ops-store.d.ts.map +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/git/index.d.ts +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/git/index.d.ts.map +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/git/index.js.map +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/git/types.d.ts +8 -0
- package/node_modules/@plusplusoneplusplus/forge/dist/git/types.d.ts.map +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/index.d.ts +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/index.d.ts.map +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/index.js.map +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/memory/memory-store.d.ts +14 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/memory/memory-store.d.ts.map +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/memory/memory-store.js +44 -15
- package/node_modules/@plusplusoneplusplus/forge/dist/memory/memory-store.js.map +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/memory/tool-call-cache-store.d.ts +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/memory/tool-call-cache-store.d.ts.map +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/memory/tool-call-cache-store.js +10 -2
- package/node_modules/@plusplusoneplusplus/forge/dist/memory/tool-call-cache-store.js.map +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/memory/tool-call-cache-types.d.ts +6 -0
- package/node_modules/@plusplusoneplusplus/forge/dist/memory/tool-call-cache-types.d.ts.map +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/memory/types.d.ts +6 -0
- package/node_modules/@plusplusoneplusplus/forge/dist/memory/types.d.ts.map +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/memory/with-memory.d.ts +2 -0
- package/node_modules/@plusplusoneplusplus/forge/dist/memory/with-memory.d.ts.map +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/memory/with-memory.js.map +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/memory/write-memory-tool.d.ts +3 -0
- package/node_modules/@plusplusoneplusplus/forge/dist/memory/write-memory-tool.d.ts.map +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/memory/write-memory-tool.js.map +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/process-store.d.ts +34 -3
- package/node_modules/@plusplusoneplusplus/forge/dist/process-store.d.ts.map +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/skills/bundled-skills-provider.d.ts.map +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/skills/bundled-skills-provider.js +10 -0
- package/node_modules/@plusplusoneplusplus/forge/dist/skills/bundled-skills-provider.js.map +1 -1
- package/node_modules/@plusplusoneplusplus/forge/dist/tasks/task-prompt-builder.js +3 -3
- package/node_modules/@plusplusoneplusplus/forge/dist/tasks/task-prompt-builder.js.map +1 -1
- package/package.json +6 -2
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExecutorRegistry = void 0;
|
|
4
|
+
const task_types_1 = require("../task-types");
|
|
5
|
+
const task_strategies_1 = require("../task-strategies");
|
|
6
|
+
const replicate_template_strategy_1 = require("../task-strategies/replicate-template-strategy");
|
|
7
|
+
const shell_executor_1 = require("./shell-executor");
|
|
8
|
+
const workflow_executor_1 = require("./workflow-executor");
|
|
9
|
+
const follow_up_executor_1 = require("./follow-up-executor");
|
|
10
|
+
const chat_executor_1 = require("./chat-executor");
|
|
11
|
+
const plan_executor_1 = require("./plan-executor");
|
|
12
|
+
const autopilot_executor_1 = require("./autopilot-executor");
|
|
13
|
+
const task_generation_executor_1 = require("./task-generation-executor");
|
|
14
|
+
const resolve_comments_executor_1 = require("./resolve-comments-executor");
|
|
15
|
+
const memory_aggregate_executor_1 = require("../memory/memory-aggregate-executor");
|
|
16
|
+
const process_lifecycle_runner_1 = require("./process-lifecycle-runner");
|
|
17
|
+
const wrapped_task_executor_1 = require("./wrapped-task-executor");
|
|
18
|
+
/**
|
|
19
|
+
* Central registry that owns all executor instances and provides
|
|
20
|
+
* task dispatch logic. Replaces the 9-way constructor fan-out
|
|
21
|
+
* previously in CLITaskExecutor.
|
|
22
|
+
*/
|
|
23
|
+
class ExecutorRegistry {
|
|
24
|
+
constructor(store, options) {
|
|
25
|
+
this.store = store;
|
|
26
|
+
this.approvePermissions = options.approvePermissions;
|
|
27
|
+
this.defaultWorkingDirectory = options.defaultWorkingDirectory;
|
|
28
|
+
this.dataDir = options.dataDir;
|
|
29
|
+
const chatOpts = {
|
|
30
|
+
workingDirectory: options.defaultWorkingDirectory,
|
|
31
|
+
approvePermissions: options.approvePermissions,
|
|
32
|
+
aiService: options.aiService,
|
|
33
|
+
defaultTimeoutMs: options.defaultTimeoutMs,
|
|
34
|
+
followUpSuggestions: options.followUpSuggestions,
|
|
35
|
+
toolCallCacheStore: options.toolCallCacheStore,
|
|
36
|
+
resolveSkillConfig: options.resolveSkillConfig,
|
|
37
|
+
resolveWorkspaceIdForPath: options.resolveWorkspaceIdForPath,
|
|
38
|
+
};
|
|
39
|
+
this.strategyRegistry = new task_strategies_1.TaskStrategyRegistry();
|
|
40
|
+
this.strategyRegistry.register('replicate-template', new replicate_template_strategy_1.ReplicateTemplateStrategy());
|
|
41
|
+
this.workflowExecutor = new workflow_executor_1.WorkflowExecutor(store, { approvePermissions: options.approvePermissions, workingDirectory: options.defaultWorkingDirectory }, options.dataDir);
|
|
42
|
+
this.followUpExecutor = new follow_up_executor_1.FollowUpExecutor(store, { workingDirectory: options.defaultWorkingDirectory, approvePermissions: options.approvePermissions, aiService: options.aiService, followUpSuggestions: options.followUpSuggestions, resolveWorkspaceIdForPath: options.resolveWorkspaceIdForPath, resolveSkillConfig: options.resolveSkillConfig, onTitleNeeded: options.onTitleNeeded }, options.dataDir);
|
|
43
|
+
this.chatExecutor = new chat_executor_1.ChatExecutor(store, chatOpts, options.dataDir);
|
|
44
|
+
this.planExecutor = new plan_executor_1.PlanExecutor(store, chatOpts, options.dataDir);
|
|
45
|
+
this.autopilotExecutor = new autopilot_executor_1.AutopilotExecutor(store, chatOpts, options.dataDir);
|
|
46
|
+
this.taskGenerationExecutor = new task_generation_executor_1.TaskGenerationExecutor(store, chatOpts, options.dataDir);
|
|
47
|
+
this.resolveCommentsExecutor = new resolve_comments_executor_1.ResolveCommentsExecutor(store, chatOpts, options.getWsServer, options.dataDir);
|
|
48
|
+
this.memoryAggregateExecutor = new memory_aggregate_executor_1.MemoryAggregateExecutor(store, options.dataDir ?? '');
|
|
49
|
+
this.runner = new process_lifecycle_runner_1.ProcessLifecycleRunner(store, options.dataDir, options.onTitleNeeded);
|
|
50
|
+
}
|
|
51
|
+
/** Dispatch a task to the appropriate executor based on its type and payload. */
|
|
52
|
+
async dispatch(task, prompt) {
|
|
53
|
+
if ((0, task_types_1.isRunWorkflowPayload)(task.payload))
|
|
54
|
+
return this.workflowExecutor.execute(task);
|
|
55
|
+
if ((0, task_types_1.isRunScriptPayload)(task.payload))
|
|
56
|
+
return new shell_executor_1.ShellExecutor(this.store, this.dataDir, this.defaultWorkingDirectory).execute(task);
|
|
57
|
+
if ((0, task_types_1.isChatPayload)(task.payload) && !(0, task_types_1.isChatFollowUp)(task.payload)) {
|
|
58
|
+
const payload = task.payload;
|
|
59
|
+
const executor = this.resolveChatExecutor(task, payload);
|
|
60
|
+
if (payload.beforeScript || payload.afterScript) {
|
|
61
|
+
return new wrapped_task_executor_1.WrappedTaskExecutor(executor, this.store).execute(task, prompt);
|
|
62
|
+
}
|
|
63
|
+
return executor.execute(task, prompt);
|
|
64
|
+
}
|
|
65
|
+
return { status: 'completed', message: `Task type '${task.type}' executed (no-op in CLI mode)` };
|
|
66
|
+
}
|
|
67
|
+
/** Resolve the working directory for a task. */
|
|
68
|
+
getWorkingDirectory(task) {
|
|
69
|
+
if ((0, task_types_1.isRunWorkflowPayload)(task.payload))
|
|
70
|
+
return task.payload.workingDirectory || this.defaultWorkingDirectory;
|
|
71
|
+
if ((0, task_types_1.isRunScriptPayload)(task.payload))
|
|
72
|
+
return task.payload.workingDirectory || this.defaultWorkingDirectory;
|
|
73
|
+
if ((0, task_types_1.isChatPayload)(task.payload))
|
|
74
|
+
return task.payload.workingDirectory || task.payload.folderPath || this.defaultWorkingDirectory;
|
|
75
|
+
return this.defaultWorkingDirectory;
|
|
76
|
+
}
|
|
77
|
+
/** Build execution context for strategy-based execution. */
|
|
78
|
+
buildExecutionContext(task) {
|
|
79
|
+
return { processId: `queue_${task.id}`, store: this.store, approvePermissions: this.approvePermissions, workingDirectory: this.getWorkingDirectory(task) };
|
|
80
|
+
}
|
|
81
|
+
/** Resolve the chat-mode executor based on payload context and mode. */
|
|
82
|
+
resolveChatExecutor(task, payload) {
|
|
83
|
+
if ((0, task_types_1.hasTaskGenerationContext)(task.payload))
|
|
84
|
+
return this.taskGenerationExecutor;
|
|
85
|
+
if ((0, task_types_1.hasReplicationContext)(task.payload))
|
|
86
|
+
return { execute: (t) => this.strategyRegistry.get('replicate-template').execute(t, this.buildExecutionContext(t)) };
|
|
87
|
+
if ((0, task_types_1.hasResolveCommentsContext)(task.payload) || (0, task_types_1.hasResolveDiffCommentsContext)(task.payload) || payload.tools?.includes('resolve-comments'))
|
|
88
|
+
return { execute: (t) => this.resolveCommentsExecutor.executeTask(t) };
|
|
89
|
+
const mode = payload.mode;
|
|
90
|
+
if (mode === 'plan')
|
|
91
|
+
return this.planExecutor;
|
|
92
|
+
if (mode === 'autopilot')
|
|
93
|
+
return this.autopilotExecutor;
|
|
94
|
+
return this.chatExecutor;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.ExecutorRegistry = ExecutorRegistry;
|
|
98
|
+
//# sourceMappingURL=executor-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor-registry.js","sourceRoot":"","sources":["../../../src/server/executors/executor-registry.ts"],"names":[],"mappings":";;;AAEA,8CAAmN;AAEnN,wDAA0D;AAC1D,gGAA2F;AAC3F,qDAAiD;AACjD,2D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AE,OAAO,IAAI,CAAC,YAAY,CAAC;QAC9C,IAAI,IAAI,KAAK,WAAW;YAAE,OAAO,IAAI,CAAC,iBAAiB,CAAC;QACxD,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;CACJ;AAxFD,4CAwFC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { QueuedTask } from '@plusplusoneplusplus/forge';
|
|
2
|
+
/** Normalized executor interface for all task execution strategies. */
|
|
3
|
+
export interface ITaskExecutor {
|
|
4
|
+
execute(task: QueuedTask, prompt: string): Promise<unknown>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=executor-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor-types.d.ts","sourceRoot":"","sources":["../../../src/server/executors/executor-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE7D,uEAAuE;AACvE,MAAM,WAAW,aAAa;IAC1B,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC/D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor-types.js","sourceRoot":"","sources":["../../../src/server/executors/executor-types.ts"],"names":[],"mappings":""}
|
|
@@ -53,6 +53,6 @@ export declare class FollowUpExecutor extends BaseExecutor {
|
|
|
53
53
|
* 4. On completion, append assistant turn to conversationTurns
|
|
54
54
|
* 5. Update process status back to 'completed'
|
|
55
55
|
*/
|
|
56
|
-
executeFollowUp(processId: string, message: string, attachments?: Attachment[], mode?: ChatMode, deliveryMode?: string): Promise<void>;
|
|
56
|
+
executeFollowUp(processId: string, message: string, attachments?: Attachment[], mode?: ChatMode, deliveryMode?: string, images?: string[]): Promise<void>;
|
|
57
57
|
}
|
|
58
58
|
//# sourceMappingURL=follow-up-executor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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C;IAC3C,yBAAyB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACjE,kDAAkD;IAClD,kBAAkB,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;IACzF,2DAA2D;IAC3D,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;CAC1E;AAMD,qBAAa,gBAAiB,SAAQ,YAAY;IAC9C,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAU;IAC7C,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAS;IAClD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAoB;IAC9C,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAsC;IAC1E,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAAwC;IACnF,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAuE;IAC3G,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAyD;gBAE5E,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,uBAAuB,EAAE,OAAO,CAAC,EAAE,MAAM;IAWnF;;;;;;;;;OASG;IACG,eAAe,CACjB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,UAAU,EAAE,EAC1B,IAAI,CAAC,EAAE,QAAQ,EACf,YAAY,CAAC,EAAE,MAAM,EACrB,MAAM,CAAC,EAAE,MAAM,EAAE,GAClB,OAAO,CAAC,IAAI,CAAC;CA8NnB"}
|
|
@@ -88,7 +88,7 @@ class FollowUpExecutor extends base_executor_1.BaseExecutor {
|
|
|
88
88
|
* 4. On completion, append assistant turn to conversationTurns
|
|
89
89
|
* 5. Update process status back to 'completed'
|
|
90
90
|
*/
|
|
91
|
-
async executeFollowUp(processId, message, attachments, mode, deliveryMode) {
|
|
91
|
+
async executeFollowUp(processId, message, attachments, mode, deliveryMode, images) {
|
|
92
92
|
const logger = (0, forge_1.getLogger)();
|
|
93
93
|
const startTime = Date.now();
|
|
94
94
|
logger.debug(forge_1.LogCategory.AI, `[FollowUp] Starting follow-up for process ${processId}`);
|
|
@@ -126,8 +126,17 @@ class FollowUpExecutor extends base_executor_1.BaseExecutor {
|
|
|
126
126
|
this.getOrCreateSession(processId).outputBuffer = '';
|
|
127
127
|
this.store.registerFlushHandler?.(processId, () => this.flushConversationTurn(processId, true));
|
|
128
128
|
try {
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
// Save user turn before the AI call so it is always serialized
|
|
130
|
+
// ahead of the assistant turn in the write-queue.
|
|
131
|
+
await this.store.appendConversationTurn(processId, (turnIndex) => ({
|
|
132
|
+
role: 'user',
|
|
133
|
+
content: message,
|
|
134
|
+
timestamp: new Date(),
|
|
135
|
+
turnIndex,
|
|
136
|
+
timeline: [],
|
|
137
|
+
images,
|
|
138
|
+
}), { additionalUpdates: { status: 'running' } });
|
|
139
|
+
const { tools: suggestTools, suffix: followUpSuffix } = (0, prompt_builder_1.buildFollowUpSuggestionsAddon)(this.followUpSuggestions.enabled, this.followUpSuggestions.count);
|
|
131
140
|
const followUpMessage = followUpSuffix ? `${message}${followUpSuffix}` : message;
|
|
132
141
|
const agentMode = toAgentMode(currentMode);
|
|
133
142
|
const historySystemMessage = historyContext
|
|
@@ -176,92 +185,47 @@ class FollowUpExecutor extends base_executor_1.BaseExecutor {
|
|
|
176
185
|
const pendingSuggestions = this.sessions.get(processId)?.pendingSuggestions;
|
|
177
186
|
let assistantTurn;
|
|
178
187
|
let allTurns;
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
cost
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
duration
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
allTurns = appendResult.allTurns;
|
|
221
|
-
}
|
|
222
|
-
else {
|
|
223
|
-
// Fallback: non-atomic read-modify-write for stores without appendConversationTurn
|
|
224
|
-
const refreshed = await this.store.getProcess(processId, process.metadata?.workspaceId);
|
|
225
|
-
const turns = refreshed?.conversationTurns || [];
|
|
226
|
-
const cleanTurns = turns.filter(t => !(t.role === 'assistant' && t.streaming));
|
|
227
|
-
assistantTurn = {
|
|
228
|
-
role: 'assistant',
|
|
229
|
-
content: result.response || '(No text response)',
|
|
230
|
-
timestamp: new Date(),
|
|
231
|
-
turnIndex: cleanTurns.length,
|
|
232
|
-
toolCalls: result.toolCalls || undefined,
|
|
233
|
-
timeline: followUpTimeline,
|
|
234
|
-
suggestions: pendingSuggestions,
|
|
235
|
-
tokenUsage: result.tokenUsage,
|
|
236
|
-
};
|
|
237
|
-
const tokenLimit = result.tokenUsage?.tokenLimit ?? refreshed?.tokenLimit;
|
|
238
|
-
const currentTokens = result.tokenUsage?.currentTokens ?? refreshed?.currentTokens;
|
|
239
|
-
const prevCumulative = refreshed?.cumulativeTokenUsage;
|
|
240
|
-
const cumulativeTokenUsage = result.tokenUsage ? {
|
|
241
|
-
inputTokens: (prevCumulative?.inputTokens ?? 0) + result.tokenUsage.inputTokens,
|
|
242
|
-
outputTokens: (prevCumulative?.outputTokens ?? 0) + result.tokenUsage.outputTokens,
|
|
243
|
-
cacheReadTokens: (prevCumulative?.cacheReadTokens ?? 0) + result.tokenUsage.cacheReadTokens,
|
|
244
|
-
cacheWriteTokens: (prevCumulative?.cacheWriteTokens ?? 0) + result.tokenUsage.cacheWriteTokens,
|
|
245
|
-
totalTokens: (prevCumulative?.totalTokens ?? 0) + result.tokenUsage.totalTokens,
|
|
246
|
-
turnCount: (prevCumulative?.turnCount ?? 0) + result.tokenUsage.turnCount,
|
|
247
|
-
cost: result.tokenUsage.cost !== undefined
|
|
248
|
-
? (prevCumulative?.cost ?? 0) + result.tokenUsage.cost
|
|
249
|
-
: prevCumulative?.cost,
|
|
250
|
-
duration: result.tokenUsage.duration !== undefined
|
|
251
|
-
? (prevCumulative?.duration ?? 0) + result.tokenUsage.duration
|
|
252
|
-
: prevCumulative?.duration,
|
|
253
|
-
} : prevCumulative;
|
|
254
|
-
allTurns = [...cleanTurns, assistantTurn];
|
|
255
|
-
await this.store.updateProcess(processId, {
|
|
256
|
-
conversationTurns: allTurns,
|
|
257
|
-
status: 'completed',
|
|
258
|
-
endTime: new Date(),
|
|
259
|
-
result: result.response || undefined,
|
|
260
|
-
...(tokenLimit !== undefined ? { tokenLimit } : {}),
|
|
261
|
-
...(currentTokens !== undefined ? { currentTokens } : {}),
|
|
262
|
-
...(cumulativeTokenUsage ? { cumulativeTokenUsage } : {}),
|
|
263
|
-
});
|
|
264
|
-
}
|
|
188
|
+
const appendResult = await this.store.appendConversationTurn(processId, (turnIndex) => ({
|
|
189
|
+
role: 'assistant',
|
|
190
|
+
content: result.response || '(No text response)',
|
|
191
|
+
timestamp: new Date(),
|
|
192
|
+
turnIndex,
|
|
193
|
+
toolCalls: result.toolCalls || undefined,
|
|
194
|
+
timeline: followUpTimeline,
|
|
195
|
+
suggestions: pendingSuggestions,
|
|
196
|
+
tokenUsage: result.tokenUsage,
|
|
197
|
+
}), {
|
|
198
|
+
filterStreaming: true,
|
|
199
|
+
additionalUpdates: (current) => {
|
|
200
|
+
const tokenLimit = result.tokenUsage?.tokenLimit ?? current.tokenLimit;
|
|
201
|
+
const currentTokens = result.tokenUsage?.currentTokens ?? current.currentTokens;
|
|
202
|
+
const prevCumulative = current.cumulativeTokenUsage;
|
|
203
|
+
const cumulativeTokenUsage = result.tokenUsage ? {
|
|
204
|
+
inputTokens: (prevCumulative?.inputTokens ?? 0) + result.tokenUsage.inputTokens,
|
|
205
|
+
outputTokens: (prevCumulative?.outputTokens ?? 0) + result.tokenUsage.outputTokens,
|
|
206
|
+
cacheReadTokens: (prevCumulative?.cacheReadTokens ?? 0) + result.tokenUsage.cacheReadTokens,
|
|
207
|
+
cacheWriteTokens: (prevCumulative?.cacheWriteTokens ?? 0) + result.tokenUsage.cacheWriteTokens,
|
|
208
|
+
totalTokens: (prevCumulative?.totalTokens ?? 0) + result.tokenUsage.totalTokens,
|
|
209
|
+
turnCount: (prevCumulative?.turnCount ?? 0) + result.tokenUsage.turnCount,
|
|
210
|
+
cost: result.tokenUsage.cost !== undefined
|
|
211
|
+
? (prevCumulative?.cost ?? 0) + result.tokenUsage.cost
|
|
212
|
+
: prevCumulative?.cost,
|
|
213
|
+
duration: result.tokenUsage.duration !== undefined
|
|
214
|
+
? (prevCumulative?.duration ?? 0) + result.tokenUsage.duration
|
|
215
|
+
: prevCumulative?.duration,
|
|
216
|
+
} : prevCumulative;
|
|
217
|
+
return {
|
|
218
|
+
status: 'completed',
|
|
219
|
+
endTime: new Date(),
|
|
220
|
+
result: result.response || undefined,
|
|
221
|
+
...(tokenLimit !== undefined ? { tokenLimit } : {}),
|
|
222
|
+
...(currentTokens !== undefined ? { currentTokens } : {}),
|
|
223
|
+
...(cumulativeTokenUsage ? { cumulativeTokenUsage } : {}),
|
|
224
|
+
};
|
|
225
|
+
},
|
|
226
|
+
});
|
|
227
|
+
assistantTurn = appendResult.turn;
|
|
228
|
+
allTurns = appendResult.allTurns;
|
|
265
229
|
if (result.tokenUsage) {
|
|
266
230
|
try {
|
|
267
231
|
this.store.emitProcessEvent(processId, {
|
|
@@ -283,41 +247,20 @@ class FollowUpExecutor extends base_executor_1.BaseExecutor {
|
|
|
283
247
|
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
284
248
|
const duration = Date.now() - startTime;
|
|
285
249
|
logger.debug(forge_1.LogCategory.AI, `[FollowUp] Failed for ${processId} in ${duration}ms: ${errorMsg}`);
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
additionalUpdates: {
|
|
296
|
-
status: 'failed',
|
|
297
|
-
endTime: new Date(),
|
|
298
|
-
error: errorMsg,
|
|
299
|
-
},
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
else {
|
|
303
|
-
// Fallback for stores without appendConversationTurn
|
|
304
|
-
const refreshed = await this.store.getProcess(processId, process.metadata?.workspaceId);
|
|
305
|
-
const turns = refreshed?.conversationTurns || [];
|
|
306
|
-
const cleanTurns = turns.filter(t => !(t.role === 'assistant' && t.streaming));
|
|
307
|
-
const errorTurn = {
|
|
308
|
-
role: 'assistant',
|
|
309
|
-
content: `Error: ${errorMsg}`,
|
|
310
|
-
timestamp: new Date(),
|
|
311
|
-
turnIndex: cleanTurns.length,
|
|
312
|
-
timeline: [],
|
|
313
|
-
};
|
|
314
|
-
await this.store.updateProcess(processId, {
|
|
315
|
-
conversationTurns: [...cleanTurns, errorTurn],
|
|
250
|
+
await this.store.appendConversationTurn(processId, (turnIndex) => ({
|
|
251
|
+
role: 'assistant',
|
|
252
|
+
content: `Error: ${errorMsg}`,
|
|
253
|
+
timestamp: new Date(),
|
|
254
|
+
turnIndex,
|
|
255
|
+
timeline: [],
|
|
256
|
+
}), {
|
|
257
|
+
filterStreaming: true,
|
|
258
|
+
additionalUpdates: {
|
|
316
259
|
status: 'failed',
|
|
317
260
|
endTime: new Date(),
|
|
318
261
|
error: errorMsg,
|
|
319
|
-
}
|
|
320
|
-
}
|
|
262
|
+
},
|
|
263
|
+
});
|
|
321
264
|
this.store.emitProcessComplete(processId, 'failed', `${duration}ms`);
|
|
322
265
|
}
|
|
323
266
|
finally {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"follow-up-executor.js","sourceRoot":"","sources":["../../../src/server/executors/follow-up-executor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,uCAAyB;AACzB,2CAA6B;AAY7B,sDAKoC;AACpC,qDAK0B;AAC1B,gDAAqD;AACrD,8DAAwD;AACxD,mDAA+C;AAE/C,+EAA+E;AAC/E,QAAQ;AACR,+EAA+E;AAE/E,wEAAwE;AACxE,MAAM,uBAAuB,GAAgC;IACzD,GAAG,EAAE,aAAa;IAClB,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,WAAW;CACzB,CAAC;AAEF,SAAS,WAAW,CAAC,QAA8B;IAC/C,OAAO,QAAQ,CAAC,CAAC,CAAC,uBAAuB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACpE,CAAC;AAwBD,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;AAE/E,MAAa,gBAAiB,SAAQ,4BAAY;IAS9C,YAAY,KAAmB,EAAE,OAAgC,EAAE,OAAgB;QAC/E,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACtB,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,KAAK,KAAK,CAAC;QAC/D,IAAI,CAAC,uBAAuB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QACxD,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACnC,IAAI,CAAC,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC;QACvD,IAAI,CAAC,0BAA0B,GAAG,OAAO,CAAC,yBAAyB,CAAC;QACpE,IAAI,CAAC,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC;QACtD,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAA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|
|
30
30
|
/** Delegate follow-up execution to the FollowUpExecutor. */
|
|
31
|
-
executeFollowUpFn: (processId: string, message: string, attachments?: Attachment[], mode?: string, deliveryMode?: string) => Promise<void>;
|
|
31
|
+
executeFollowUpFn: (processId: string, message: string, attachments?: Attachment[], mode?: string, deliveryMode?: string, images?: string[]) => Promise<void>;
|
|
32
32
|
/** Dispatch execution by task type (chat/workflow/script). */
|
|
33
33
|
executeByTypeFn: (task: QueuedTask, prompt: string) => Promise<unknown>;
|
|
34
34
|
/** Resolve the working directory for a given task. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-lifecycle-runner.d.ts","sourceRoot":"","sources":["../../../src/server/executors/process-lifecycle-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,KAAK,EAER,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,mBAAmB,EACtB,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"process-lifecycle-runner.d.ts","sourceRoot":"","sources":["../../../src/server/executors/process-lifecycle-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,KAAK,EAER,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,mBAAmB,EACtB,MAAM,4BAA4B,CAAC;AAmBpC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAM/C,2EAA2E;AAC3E,QAAA,MAAM,iBAAiB,aAAgD,CAAC;AAExE,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAM7B,MAAM,WAAW,sBAAsB;IACnC,yEAAyE;IACzE,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B,4DAA4D;IAC5D,iBAAiB,EAAE,CACf,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,UAAU,EAAE,EAC1B,IAAI,CAAC,EAAE,MAAM,EACb,YAAY,CAAC,EAAE,MAAM,EACrB,MAAM,CAAC,EAAE,MAAM,EAAE,KAChB,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,8DAA8D;IAC9D,eAAe,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACxE,sDAAsD;IACtD,qBAAqB,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,MAAM,GAAG,SAAS,CAAC;CACnE;AAMD,qBAAa,sBAAuB,SAAQ,YAAY;IACpD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAyD;gBAGrF,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,eAAe,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,IAAI;IAM3E;;;;;;OAMG;IACG,GAAG,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAuO1F"}
|
|
@@ -60,6 +60,7 @@ const forge_1 = require("@plusplusoneplusplus/forge");
|
|
|
60
60
|
const prompt_builder_1 = require("./prompt-builder");
|
|
61
61
|
const image_store_1 = require("./image-store");
|
|
62
62
|
const task_types_1 = require("../task-types");
|
|
63
|
+
const conversation_recorder_1 = require("../memory/conversation-recorder");
|
|
63
64
|
const base_executor_1 = require("./base-executor");
|
|
64
65
|
// ============================================================================
|
|
65
66
|
// Constants
|
|
@@ -112,7 +113,7 @@ class ProcessLifecycleRunner extends base_executor_1.BaseExecutor {
|
|
|
112
113
|
const imageTempDir = followUpPayload.imageTempDir;
|
|
113
114
|
await (0, image_store_1.rehydrateImagesIfNeeded)(task.payload);
|
|
114
115
|
try {
|
|
115
|
-
await opts.executeFollowUpFn(followUpPayload.processId, followUpPayload.prompt, followUpPayload.attachments, followUpPayload.mode, followUpPayload.deliveryMode);
|
|
116
|
+
await opts.executeFollowUpFn(followUpPayload.processId, followUpPayload.prompt, followUpPayload.attachments, followUpPayload.mode, followUpPayload.deliveryMode, followUpPayload.images);
|
|
116
117
|
const duration = Date.now() - startTime;
|
|
117
118
|
logger.debug(forge_1.LogCategory.AI, `[QueueExecutor] Follow-up task ${task.id} completed in ${duration}ms`);
|
|
118
119
|
return { success: true, durationMs: duration };
|
|
@@ -172,7 +173,46 @@ class ProcessLifecycleRunner extends base_executor_1.BaseExecutor {
|
|
|
172
173
|
images: payloadImages?.length > 0 ? payloadImages : undefined,
|
|
173
174
|
},
|
|
174
175
|
];
|
|
175
|
-
|
|
176
|
+
// Cold resume: prepend historical turns before creating the process
|
|
177
|
+
const resumedFrom = task.payload?.resumedFrom;
|
|
178
|
+
if (resumedFrom && typeof resumedFrom === 'string') {
|
|
179
|
+
try {
|
|
180
|
+
const oldProcess = await this.store.getProcess(resumedFrom, task.payload?.workspaceId);
|
|
181
|
+
if (oldProcess?.conversationTurns?.length) {
|
|
182
|
+
const historicalTurns = oldProcess.conversationTurns.map((t, i) => ({
|
|
183
|
+
...t,
|
|
184
|
+
historical: true,
|
|
185
|
+
turnIndex: i,
|
|
186
|
+
}));
|
|
187
|
+
const offset = historicalTurns.length;
|
|
188
|
+
process.conversationTurns = [
|
|
189
|
+
...historicalTurns,
|
|
190
|
+
...initialTurns.map((t, i) => ({ ...t, turnIndex: offset + i })),
|
|
191
|
+
];
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
process.conversationTurns = initialTurns;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
catch {
|
|
198
|
+
// Non-fatal: old process may be gone
|
|
199
|
+
process.conversationTurns = initialTurns;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
process.conversationTurns = initialTurns;
|
|
204
|
+
}
|
|
205
|
+
// Record initial prompt to memory (skip scheduled/template-generated runs)
|
|
206
|
+
const isScheduledRun = (0, task_types_1.isChatPayload)(task.payload) && !!task.payload.context?.scheduleId;
|
|
207
|
+
if (this.dataDir && task.type === 'chat' && !isScheduledRun) {
|
|
208
|
+
const wsId = process.metadata?.workspaceId ?? '';
|
|
209
|
+
if (wsId) {
|
|
210
|
+
try {
|
|
211
|
+
(0, conversation_recorder_1.recordUserMessage)(this.dataDir, wsId, prompt);
|
|
212
|
+
}
|
|
213
|
+
catch { /* never block */ }
|
|
214
|
+
}
|
|
215
|
+
}
|
|
176
216
|
try {
|
|
177
217
|
await this.store.addProcess(process);
|
|
178
218
|
}
|
|
@@ -188,64 +228,38 @@ class ProcessLifecycleRunner extends base_executor_1.BaseExecutor {
|
|
|
188
228
|
const responseText = result?.response ?? '';
|
|
189
229
|
const finalTimeline = result?.timeline
|
|
190
230
|
?? (0, forge_1.mergeConsecutiveContentItems)(this.sessions.get(processId)?.timelineBuffer || []);
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
? currentProcess.conversationTurns
|
|
194
|
-
: initialTurns;
|
|
195
|
-
const finalTurns = [
|
|
196
|
-
existingTurns[0],
|
|
197
|
-
{
|
|
231
|
+
try {
|
|
232
|
+
const appendResult = await this.store.appendConversationTurn(processId, (turnIndex) => ({
|
|
198
233
|
role: 'assistant',
|
|
199
234
|
content: responseText,
|
|
200
235
|
timestamp: new Date(),
|
|
201
|
-
turnIndex
|
|
236
|
+
turnIndex,
|
|
202
237
|
toolCalls: result?.toolCalls || undefined,
|
|
203
238
|
timeline: finalTimeline,
|
|
204
239
|
suggestions: result?.pendingSuggestions ?? this.sessions.get(processId)?.pendingSuggestions,
|
|
205
|
-
},
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
const offset = historicalTurns.length;
|
|
220
|
-
combinedTurns = [
|
|
221
|
-
...historicalTurns,
|
|
222
|
-
...finalTurns.map((t, i) => ({ ...t, turnIndex: offset + i })),
|
|
223
|
-
];
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
catch {
|
|
227
|
-
// Non-fatal: old process may be gone
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
try {
|
|
240
|
+
}), {
|
|
241
|
+
filterStreaming: true,
|
|
242
|
+
additionalUpdates: (current) => {
|
|
243
|
+
if (TERMINAL_STATUSES.has(current.status))
|
|
244
|
+
return {};
|
|
245
|
+
return {
|
|
246
|
+
status: 'completed',
|
|
247
|
+
endTime: new Date(),
|
|
248
|
+
result: typeof result === 'string' ? result : JSON.stringify(result),
|
|
249
|
+
...(sessionId ? { sdkSessionId: sessionId } : {}),
|
|
250
|
+
};
|
|
251
|
+
},
|
|
252
|
+
});
|
|
253
|
+
const combinedTurns = appendResult?.allTurns ?? process.conversationTurns ?? initialTurns;
|
|
231
254
|
const currentProc = await this.store.getProcess(processId, task.payload?.workspaceId);
|
|
232
255
|
if (!TERMINAL_STATUSES.has(currentProc?.status ?? '')) {
|
|
233
|
-
await this.store.updateProcess(processId, {
|
|
234
|
-
status: 'completed',
|
|
235
|
-
endTime: new Date(),
|
|
236
|
-
result: typeof result === 'string' ? result : JSON.stringify(result),
|
|
237
|
-
...(sessionId ? { sdkSessionId: sessionId } : {}),
|
|
238
|
-
conversationTurns: combinedTurns,
|
|
239
|
-
});
|
|
240
256
|
this.store.emitProcessComplete(processId, 'completed', `${duration}ms`);
|
|
241
257
|
}
|
|
258
|
+
setTimeout(() => this.onGenerateTitle(processId, combinedTurns), 0);
|
|
242
259
|
}
|
|
243
260
|
catch {
|
|
244
261
|
// Non-fatal
|
|
245
262
|
}
|
|
246
|
-
// Schedule title generation as a macrotask so it runs AFTER the queue
|
|
247
|
-
// executor fires taskCompleted and after the caller's synchronous code.
|
|
248
|
-
setTimeout(() => this.onGenerateTitle(processId, combinedTurns), 0);
|
|
249
263
|
return { success: true, result, durationMs: Date.now() - startTime };
|
|
250
264
|
}
|
|
251
265
|
catch (error) {
|
|
@@ -254,13 +268,11 @@ class ProcessLifecycleRunner extends base_executor_1.BaseExecutor {
|
|
|
254
268
|
logger.debug(forge_1.LogCategory.AI, `[QueueExecutor] Task ${task.id} failed in ${duration}ms: ${errorMsg}`);
|
|
255
269
|
try {
|
|
256
270
|
const currentProcess = await this.store.getProcess(processId, task.payload?.workspaceId);
|
|
257
|
-
const existingTurns = currentProcess?.conversationTurns || initialTurns;
|
|
258
271
|
if (!TERMINAL_STATUSES.has(currentProcess?.status ?? '')) {
|
|
259
272
|
await this.store.updateProcess(processId, {
|
|
260
273
|
status: 'failed',
|
|
261
274
|
endTime: new Date(),
|
|
262
275
|
error: errorMsg,
|
|
263
|
-
conversationTurns: existingTurns,
|
|
264
276
|
});
|
|
265
277
|
this.store.emitProcessComplete(processId, 'failed', `${duration}ms`);
|
|
266
278
|
}
|