@outbuild-company/schedule-core 1.1.0 → 1.1.1

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/index.d.cts CHANGED
@@ -1252,8 +1252,9 @@ declare class ScheduleCore {
1252
1252
  private readonly coreRuntime;
1253
1253
  private readonly _undo;
1254
1254
  private _opQueue;
1255
- private _mutationEpoch;
1256
- private _cpComputedEpoch;
1255
+ private _scheduleRevision;
1256
+ private _criticalPathRevision;
1257
+ private _activeCriticalPath;
1257
1258
  constructor(input: ScheduleCoreInput);
1258
1259
  get ready(): Promise<void>;
1259
1260
  get criticalPathReady(): Promise<{
@@ -1335,21 +1336,19 @@ declare class ScheduleCore {
1335
1336
  dispatch(action: DispatchAction, options?: DispatchOptions): Promise<DispatchResult>;
1336
1337
  private _dispatchInner;
1337
1338
  /**
1338
- * Recompute the critical path OUT of band and return a repaintable ChangeSet
1339
- * of the 7 CP fields, or null when the CP is already fresh for the current
1340
- * state (coalesced). Enqueued on `_opQueue` so it runs serialized against
1341
- * dispatches — it reads/writes the live tree only when no mutation is in
1342
- * flight.
1343
- *
1344
- * Deferred-CP flow: dispatch with `{ skipCriticalPath: true }` (paints
1345
- * without the heavy CP pass), then call this after the paint. Bursts
1346
- * coalesce: only the first enqueued recompute after the last mutation does
1347
- * the work; later ones see `_cpComputedEpoch === _mutationEpoch` and no-op.
1339
+ * Starts or joins the Critical Path calculation for the current schedule
1340
+ * revision. Snapshot capture and the final commit are serialized with user
1341
+ * mutations, but the expensive calculation runs outside `_opQueue` against
1342
+ * an isolated state. A newer revision aborts this job and makes its result
1343
+ * ineligible to commit.
1348
1344
  */
1349
1345
  recomputeCriticalPath(): Promise<{
1350
1346
  changes: ChangeSet;
1351
1347
  } | null>;
1352
- private _recomputeCriticalPathIfStale;
1348
+ isCriticalPathSettled(): boolean;
1349
+ whenCriticalPathSettled(): Promise<void>;
1350
+ private _recordScheduleMutation;
1351
+ private _startCriticalPathForCurrentRevision;
1353
1352
  private _runCriticalPathAndCapture;
1354
1353
  undo(): Promise<ChangeSet | null>;
1355
1354
  redo(): Promise<ChangeSet | null>;
package/dist/index.d.ts CHANGED
@@ -1252,8 +1252,9 @@ declare class ScheduleCore {
1252
1252
  private readonly coreRuntime;
1253
1253
  private readonly _undo;
1254
1254
  private _opQueue;
1255
- private _mutationEpoch;
1256
- private _cpComputedEpoch;
1255
+ private _scheduleRevision;
1256
+ private _criticalPathRevision;
1257
+ private _activeCriticalPath;
1257
1258
  constructor(input: ScheduleCoreInput);
1258
1259
  get ready(): Promise<void>;
1259
1260
  get criticalPathReady(): Promise<{
@@ -1335,21 +1336,19 @@ declare class ScheduleCore {
1335
1336
  dispatch(action: DispatchAction, options?: DispatchOptions): Promise<DispatchResult>;
1336
1337
  private _dispatchInner;
1337
1338
  /**
1338
- * Recompute the critical path OUT of band and return a repaintable ChangeSet
1339
- * of the 7 CP fields, or null when the CP is already fresh for the current
1340
- * state (coalesced). Enqueued on `_opQueue` so it runs serialized against
1341
- * dispatches — it reads/writes the live tree only when no mutation is in
1342
- * flight.
1343
- *
1344
- * Deferred-CP flow: dispatch with `{ skipCriticalPath: true }` (paints
1345
- * without the heavy CP pass), then call this after the paint. Bursts
1346
- * coalesce: only the first enqueued recompute after the last mutation does
1347
- * the work; later ones see `_cpComputedEpoch === _mutationEpoch` and no-op.
1339
+ * Starts or joins the Critical Path calculation for the current schedule
1340
+ * revision. Snapshot capture and the final commit are serialized with user
1341
+ * mutations, but the expensive calculation runs outside `_opQueue` against
1342
+ * an isolated state. A newer revision aborts this job and makes its result
1343
+ * ineligible to commit.
1348
1344
  */
1349
1345
  recomputeCriticalPath(): Promise<{
1350
1346
  changes: ChangeSet;
1351
1347
  } | null>;
1352
- private _recomputeCriticalPathIfStale;
1348
+ isCriticalPathSettled(): boolean;
1349
+ whenCriticalPathSettled(): Promise<void>;
1350
+ private _recordScheduleMutation;
1351
+ private _startCriticalPathForCurrentRevision;
1353
1352
  private _runCriticalPathAndCapture;
1354
1353
  undo(): Promise<ChangeSet | null>;
1355
1354
  redo(): Promise<ChangeSet | null>;