@guanlin4924/devflow-pi 0.1.56 → 0.1.57

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guanlin4924/devflow-pi",
3
- "version": "0.1.56",
3
+ "version": "0.1.57",
4
4
  "type": "module",
5
5
  "description": "Devflow 专项研发 Pi,基于固定版本 OMP Runtime 组装研发状态机、代码智能、设计、实现与质量门禁。",
6
6
  "license": "UNLICENSED",
package/src/constants.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export const PRODUCT_NAME = "Devflow Pi";
2
- export const PRODUCT_VERSION = "0.1.56";
2
+ export const PRODUCT_VERSION = "0.1.57";
3
3
  export const PROJECT_SCHEMA_VERSION = 1;
4
4
  export const OMP_RUNTIME_VERSION = "17.2.7";
5
5
 
package/src/runtime.ts CHANGED
@@ -278,6 +278,29 @@ export async function runInteractiveRuntime(project: ProjectContext, options: Ru
278
278
  void consumeControlledRollover();
279
279
  }, delay);
280
280
  };
281
+ const waitForControlledRollover = async (): Promise<void> => {
282
+ const requestPath = path.join(project.root, ".planning", "rollover-request.json");
283
+ let requestObserved = false;
284
+ // The input hook may finish its async state transition just after
285
+ // submitInteractiveInput resolves. Wait briefly for that durable request
286
+ // so approval starts the fresh session without requiring another input.
287
+ for (let attempt = 0; attempt < 50; attempt += 1) {
288
+ try {
289
+ await readFile(requestPath, "utf8");
290
+ requestObserved = true;
291
+ } catch {
292
+ if (requestObserved) return;
293
+ }
294
+ await consumeControlledRollover();
295
+ try {
296
+ await readFile(requestPath, "utf8");
297
+ } catch {
298
+ if (requestObserved) return;
299
+ }
300
+ await new Promise(resolve => setTimeout(resolve, 100));
301
+ }
302
+ scheduleControlledRolloverRetry();
303
+ };
281
304
  // A control-plane request may be created by an extension input handler that
282
305
  // marks the message handled, so it is not guaranteed to pass through the
283
306
  // normal submitInteractiveInput return path. Keep a small runtime-owned
@@ -298,11 +321,16 @@ export async function runInteractiveRuntime(project: ProjectContext, options: Ru
298
321
  } finally {
299
322
  interactiveSubmissionInFlight = false;
300
323
  }
301
- await consumeControlledRollover();
324
+ // Only an explicit approval can create a user-driven rollover after this
325
+ // input. Ordinary chat messages must return to the prompt immediately.
326
+ if (/^(?:批准|确认|同意|通过)(?:\s*(?:(?:full|完整|全量)?\s*初始化|执行|完成|继续|推进|当前(?:方案|步骤|计划)))?[。!!]?$/i.test(input.trim())) {
327
+ await waitForControlledRollover();
328
+ } else {
329
+ await consumeControlledRollover();
330
+ scheduleControlledRolloverRetry();
331
+ }
302
332
  // The submitted turn may create a durable rollover request after the
303
- // immediate check above returns. Poll once while the UI is waiting for the
304
- // next user input so a successful step does not require a dummy message to
305
- // trigger the fresh-session handoff.
306
- scheduleControlledRolloverRetry();
333
+ // input hook settles; the bounded wait above handles the normal path and
334
+ // the poller remains as a recovery path for a slow or interrupted hook.
307
335
  }
308
336
  }