@yeaft/webchat-agent 0.1.236 → 0.1.237

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.
@@ -110,6 +110,8 @@ message: <要转发的内容>
110
110
  - 每条用户消息只需要一种响应:创建任务 / 转发 / 直接回答
111
111
  - 创建任务时只给标题,不要描述实现步骤
112
112
  - 创建任务时必须指定 workDir(用户提到的项目路径)和 scenario(场景类型)
113
+ - 当消息包含 [工作路径: xxx] 时,直接使用该路径作为 workDir 创建 CREATE_TASK,不要再询问 workDir
114
+ - 当消息包含 [工作路径: xxx] 时,这是用户明确的意图——立刻创建任务,不要做任何分析
113
115
  - 如果用户没指定 workDir 或 scenario,先询问
114
116
  - 如果用户问"进度怎样",直接汇总上面的任务列表状态
115
117
  - 保持回复简洁
@@ -176,18 +178,24 @@ export async function createConductorClaude(conductor) {
176
178
  /**
177
179
  * Send message to Conductor Claude
178
180
  */
179
- export async function sendToConductor(conductor, content) {
181
+ export async function sendToConductor(conductor, content, workDir) {
180
182
  let state = conductor.conductorState;
181
183
 
182
184
  if (!state || !state.query || !state.inputStream) {
183
185
  state = await createConductorClaude(conductor);
184
186
  }
185
187
 
188
+ // Inject workDir prefix so Conductor knows the project path
189
+ let fullContent = content;
190
+ if (workDir) {
191
+ fullContent = `[工作路径: ${workDir}]\n${content}`;
192
+ }
193
+
186
194
  // Inject task context before user message
187
195
  const taskContext = buildTaskContext(conductor);
188
- const fullContent = taskContext
189
- ? `${content}\n\n---\n<conductor-context>\n${taskContext}\n</conductor-context>`
190
- : content;
196
+ if (taskContext) {
197
+ fullContent = `${fullContent}\n\n---\n<conductor-context>\n${taskContext}\n</conductor-context>`;
198
+ }
191
199
 
192
200
  state.turnActive = true;
193
201
  state.accumulatedText = '';
@@ -138,7 +138,7 @@ export async function initConductor(msg) {
138
138
  * Handle user input to Conductor
139
139
  */
140
140
  export async function handleConductorUserInput(msg) {
141
- const { content } = msg;
141
+ const { content, workDir } = msg;
142
142
  if (!conductor) {
143
143
  console.warn('[Conductor] Not initialized, ignoring input');
144
144
  return;
@@ -154,7 +154,7 @@ export async function handleConductorUserInput(msg) {
154
154
 
155
155
  recordUserMessage(conductor, content);
156
156
  conductor.status = 'running';
157
- await sendToConductor(conductor, content);
157
+ await sendToConductor(conductor, content, workDir);
158
158
  }
159
159
 
160
160
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeaft/webchat-agent",
3
- "version": "0.1.236",
3
+ "version": "0.1.237",
4
4
  "description": "Remote agent for Yeaft WebChat — connects worker machines to the central server",
5
5
  "main": "index.js",
6
6
  "type": "module",