@outbuild-company/schedule-core 1.14.2 → 1.15.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/index.d.cts CHANGED
@@ -493,6 +493,7 @@ declare const DISPATCH_ACTION_KIND: {
493
493
  readonly ACTIVITY_MOVE: "activity-move";
494
494
  readonly ACTIVITY_INDENT: "activity-indent";
495
495
  readonly ACTIVITY_OUTDENT: "activity-outdent";
496
+ readonly ACTIVITY_TYPE_SET: "activity-type-set";
496
497
  readonly ACTIVITY_SET_PROGRESS: "activity-set-progress";
497
498
  readonly ACTIVITY_LOOKAHEAD_CONVERT: "activity-lookahead-convert";
498
499
  readonly SELECTION_TOGGLE: "selection-toggle";
@@ -502,6 +503,7 @@ declare const DISPATCH_ACTION_KIND: {
502
503
  readonly SORT_SET: "sort-set";
503
504
  readonly SIR_SYNC: "sir-sync";
504
505
  readonly ACTIVITY_LOOKAHEAD_SYNC: "activity-lookahead-sync";
506
+ readonly SCHEDULE_AUTO_SCHEDULE: "schedule-auto-schedule";
505
507
  };
506
508
  /** Discriminator accepted by {@link ScheduleCore.applyActivityBatch}. */
507
509
  declare const ACTIVITY_BATCH_ACTION_KIND: "activity-batch";
@@ -685,6 +687,8 @@ type LinksBatchOperation = {
685
687
  } | {
686
688
  kind: typeof DISPATCH_LINK_OPERATION_KIND.UPDATE;
687
689
  linkId: LinkId;
690
+ source?: ActivityId;
691
+ target?: ActivityId;
688
692
  type?: LinkType;
689
693
  /** Replacement lag in working days; dispatch converts it to stored hours. */
690
694
  lag?: number;
@@ -784,6 +788,21 @@ interface ActivityBatchAction {
784
788
  readonly links: ReadonlyArray<ActivityBatchLinkInput$1>;
785
789
  readonly eventSource?: string;
786
790
  }
791
+ /** In-place dependency update preserving the existing link identity. */
792
+ interface LinkUpdateAction {
793
+ readonly kind: typeof DISPATCH_ACTION_KIND.LINK_UPDATE;
794
+ readonly linkId: LinkId;
795
+ readonly source?: ActivityId;
796
+ readonly target?: ActivityId;
797
+ readonly type?: LinkType;
798
+ /** Replacement lag in working days; dispatch converts it to stored hours. */
799
+ readonly lag?: number;
800
+ }
801
+ /** Explicit request to run canonical schedule finalization. */
802
+ interface ScheduleAutoScheduleAction {
803
+ readonly kind: typeof DISPATCH_ACTION_KIND.SCHEDULE_AUTO_SCHEDULE;
804
+ readonly activityId?: ActivityId;
805
+ }
787
806
  /**
788
807
  * Complete union of public commands accepted by {@link ScheduleCore.dispatch}.
789
808
  *
@@ -846,13 +865,7 @@ type DispatchAction = {
846
865
  /** Dependency lag in working days; omitted lag defaults to zero. */
847
866
  lag?: number;
848
867
  linkId?: LinkId;
849
- } | {
850
- kind: typeof DISPATCH_ACTION_KIND.LINK_UPDATE;
851
- linkId: LinkId;
852
- type?: LinkType;
853
- /** Replacement lag in working days; dispatch converts it to stored hours. */
854
- lag?: number;
855
- } | {
868
+ } | LinkUpdateAction | {
856
869
  kind: typeof DISPATCH_ACTION_KIND.LINK_DELETE;
857
870
  linkId: LinkId;
858
871
  } | {
@@ -885,6 +898,10 @@ type DispatchAction = {
885
898
  kind: typeof DISPATCH_ACTION_KIND.ACTIVITY_OUTDENT;
886
899
  activityIds: ReadonlyArray<ActivityId>;
887
900
  eventSource?: string;
901
+ } | {
902
+ kind: typeof DISPATCH_ACTION_KIND.ACTIVITY_TYPE_SET;
903
+ activityId: ActivityId;
904
+ type: ActivityType;
888
905
  } | {
889
906
  kind: typeof DISPATCH_ACTION_KIND.ACTIVITY_SET_PROGRESS;
890
907
  activityId: ActivityId;
@@ -931,7 +948,7 @@ type DispatchAction = {
931
948
  persistedProgress?: number;
932
949
  acknowledgePersistedLookahead?: boolean;
933
950
  eventSource?: string;
934
- };
951
+ } | ScheduleAutoScheduleAction;
935
952
  /**
936
953
  * Supported creation fields with duration expressed in working days.
937
954
  *
@@ -940,7 +957,9 @@ type DispatchAction = {
940
957
  type ActivityCreationOverrides = Omit<CreationOverrides, 'durationHours'> & {
941
958
  readonly durationDays?: number;
942
959
  };
943
- type InternalDispatchAction = DispatchAction | ActivityBatchAction;
960
+ /** One ordered input accepted by {@link ScheduleCore.dispatchMany}. */
961
+ type DispatchManyAction = DispatchAction | ActivityBatchAction;
962
+ type InternalDispatchAction = DispatchManyAction;
944
963
  /** Per-operation derived-work controls; both default to `false`. */
945
964
  interface DispatchOptions {
946
965
  /** Skips autoscheduling for this operation when `true`. */
@@ -966,6 +985,13 @@ type DispatchResult = {
966
985
  reason: string;
967
986
  alertKey?: string | undefined;
968
987
  };
988
+ /** Ordered per-command results plus the single deferred finalization payload. */
989
+ interface DispatchManyResult {
990
+ readonly results: readonly DispatchResult[];
991
+ readonly changeSet: ChangeSet | null;
992
+ /** Whether this batch's deferred autoschedule pass actually ran. */
993
+ readonly autoScheduled: boolean;
994
+ }
969
995
  /** Accepted conversion result always carries the snapshots planned in-queue. */
970
996
  type LookaheadConversionResult = (Extract<DispatchResult, {
971
997
  ok: true;
@@ -1042,15 +1068,21 @@ interface ViewStateChange {
1042
1068
  readonly checked?: ViewStatePropChange;
1043
1069
  readonly visible?: ViewStatePropChange;
1044
1070
  }
1045
- /** Lifecycle sources used when no public dispatch command initiated a change set. */
1071
+ /** Aggregate and lifecycle change-set source kinds. */
1046
1072
  declare const CHANGE_SET_SOURCE_KIND: {
1073
+ readonly DISPATCH_MANY: "dispatch-many";
1047
1074
  readonly INIT: "init";
1048
1075
  readonly UNDO: "undo";
1049
1076
  readonly REDO: "redo";
1050
1077
  };
1078
+ /** Truthful source for one partial ordered public dispatch batch. */
1079
+ interface DispatchManyChangeSetSource {
1080
+ readonly kind: typeof CHANGE_SET_SOURCE_KIND.DISPATCH_MANY;
1081
+ readonly actions: readonly DispatchManyAction[];
1082
+ }
1051
1083
  /** Public command, activity batch, or lifecycle operation that produced changes. */
1052
- type ChangeSetSource = InternalDispatchAction | {
1053
- kind: (typeof CHANGE_SET_SOURCE_KIND)[keyof typeof CHANGE_SET_SOURCE_KIND];
1084
+ type ChangeSetSource = InternalDispatchAction | DispatchManyChangeSetSource | {
1085
+ kind: typeof CHANGE_SET_SOURCE_KIND.INIT | typeof CHANGE_SET_SOURCE_KIND.UNDO | typeof CHANGE_SET_SOURCE_KIND.REDO;
1054
1086
  };
1055
1087
  /**
1056
1088
  * Complete ordered projection payload produced by an accepted operation.
@@ -1059,7 +1091,7 @@ type ChangeSetSource = InternalDispatchAction | {
1059
1091
  * set updates external projection only; persistence remains consumer-owned.
1060
1092
  */
1061
1093
  interface ChangeSet {
1062
- /** Command or lifecycle operation that produced the payload. */
1094
+ /** Command, ordered dispatch batch, or lifecycle operation that produced it. */
1063
1095
  source: ChangeSetSource;
1064
1096
  /** Activity create, update, and delete records. */
1065
1097
  activities: ReadonlyArray<EntityChange<CoreActivity>>;
@@ -1270,6 +1302,8 @@ interface LinkCreateRequest {
1270
1302
  }
1271
1303
  /** Optional dependency fields to replace. */
1272
1304
  interface LinkPatchRequest {
1305
+ readonly sourceId?: ActivityId;
1306
+ readonly targetId?: ActivityId;
1273
1307
  readonly relationship?: LinkRelationship;
1274
1308
  /** Replacement lag in working days. */
1275
1309
  readonly lagDays?: number;
@@ -1288,6 +1322,8 @@ type LinkBatchRequest = ({
1288
1322
  } & LinkCreateRequest) | {
1289
1323
  readonly kind: typeof LINK_BATCH_OPERATION_KIND.UPDATE;
1290
1324
  readonly linkId: LinkId;
1325
+ readonly sourceId?: ActivityId;
1326
+ readonly targetId?: ActivityId;
1291
1327
  readonly relationship?: LinkRelationship;
1292
1328
  readonly lagDays?: number;
1293
1329
  } | {
@@ -1459,6 +1495,8 @@ interface ScheduleActivitiesApi {
1459
1495
  * @returns The complete dispatch result.
1460
1496
  */
1461
1497
  setProgress(activityId: ActivityId, progress: typeof COMPLETED_PROGRESS | typeof NOT_STARTED_PROGRESS, context?: MutationContext): Promise<DispatchResult>;
1498
+ /** Sets the canonical activity shape when compatible with its hierarchy. */
1499
+ setType(activityId: ActivityId, type: ActivityType, options?: DispatchOptions): Promise<DispatchResult>;
1462
1500
  /** @returns The complete result of copying the current selection to core-owned clipboard state. */
1463
1501
  copy(context?: MutationContext): Promise<DispatchResult>;
1464
1502
  /**
@@ -1482,6 +1520,8 @@ interface ScheduleActivitiesApi {
1482
1520
  * @returns The complete dispatch result.
1483
1521
  */
1484
1522
  lookaheadSync(input: ActivityLookaheadSyncInput): Promise<DispatchResult>;
1523
+ /** Runs canonical autoscheduling for one activity or the whole schedule. */
1524
+ autoSchedule(activityId?: ActivityId, options?: DispatchOptions): Promise<DispatchResult>;
1485
1525
  /**
1486
1526
  * Creates a read-only date prediction bound to the current schedule revision.
1487
1527
  *
@@ -2254,6 +2294,7 @@ declare class ScheduleCore {
2254
2294
  * @returns A complete consumer projection change set.
2255
2295
  */
2256
2296
  createProjectionChangeSetFrom(source: ScheduleCore): ChangeSet;
2297
+ private _snapshotProjection;
2257
2298
  /** @returns Deleted persisted activity identities since the last save. */
2258
2299
  getDeletedActivitiesSinceLastSave(): ReadonlyArray<Readonly<DeletedActivitySnapshot>>;
2259
2300
  /** @returns Deleted persisted link identities since the last save. */
@@ -2272,6 +2313,12 @@ declare class ScheduleCore {
2272
2313
  * verdicts, effects, tracking events, and warnings when present.
2273
2314
  */
2274
2315
  dispatch(action: DispatchAction, options?: DispatchOptions): Promise<DispatchResult>;
2316
+ /**
2317
+ * Applies commands in order and runs deferred scheduling finalization once.
2318
+ *
2319
+ * Rejected commands do not roll back earlier accepted commands.
2320
+ */
2321
+ dispatchMany(actions: readonly DispatchManyAction[], options?: DispatchOptions): Promise<DispatchManyResult>;
2275
2322
  /**
2276
2323
  * Serializes and applies an activity creation batch.
2277
2324
  *
@@ -2286,6 +2333,8 @@ declare class ScheduleCore {
2286
2333
  /** Applies one revision-guarded conversion through the serialized dispatcher. */
2287
2334
  applyLookaheadConversion(input: ApplyLookaheadConversionInput): Promise<LookaheadConversionResult>;
2288
2335
  private _dispatchInner;
2336
+ private _dispatchManyInner;
2337
+ private _aggregateDispatchManyChangeSets;
2289
2338
  private _runDispatch;
2290
2339
  /**
2291
2340
  * Queues critical-path calculation for the current revision.
@@ -2570,4 +2619,4 @@ declare const DISPATCH_TRACK_EVENT: {
2570
2619
  /** Consumer analytics event name emitted by a schedule mutation. */
2571
2620
  type DispatchTrackEvent = (typeof DISPATCH_TRACK_EVENT)[keyof typeof DISPATCH_TRACK_EVENT];
2572
2621
 
2573
- export { ACTIVITY_BATCH_ACTION_KIND, ACTIVITY_BATCH_MODE, ACTIVITY_DATE_EDGE, ACTIVITY_FIELD, ACTIVITY_PONDERATOR_CRITERION, ACTIVITY_PROGRESS_ORIGIN, ACTIVITY_TYPE, type ActivityBaselineSnapshot, type ActivityBatchAction, type ActivityBatchInput, type ActivityBatchItem, type ActivityBatchItemInput, type ActivityBatchLinkInput$1 as ActivityBatchLinkInput, type ActivityBatchMode, type ActivityBatchParentReference, type ActivityBatchReference, type ActivityBulkEdit, type ActivityCreateInput, type ActivityCreationOverrides, type ActivityCreter, type ActivityDateEdge, type ActivityDateEdit, type ActivityField, type ActivityFieldEdit, type ActivityFieldValue, type ActivityId, type ActivityLookaheadSyncInput, type ActivityMoveInput, type ActivityStatus, type ActivityType, type ApplyLookaheadConversionInput, type BackendActivityInput, type BackendCalendarExceptionInput, type BackendCalendarInput, type BackendLinkInput, type BackendScheduleInput, type BackendSectorInput, type BackendShiftInput, type BaselinePoint, type BaselineVersion, type BranchOrderChange, CALENDAR_UNIT, CHANGE_SET_SOURCE_KIND, COLUMN, COMPLETED_PROGRESS, CONSTRAINT_TYPE, CONSTRAINT_TYPE_TO_LABEL, CONSTRAINT_WARNING_KIND, CREATION_KIND, type Calendar, type CalendarId, type CalendarLike, type CalendarUnit, type CalendarWorktime, type ChangeSet, type ChangeSetSource, type ColumnName, type ConstraintType, type ConstraintWarning, type CoreActivity, type CoreBaselinePoint, type CreationKind, type CriticalPathResult, DATE_GESTURE_KIND, DEFAULT_HOURS_PER_DAY, DISPATCH_ACTION_KIND, DISPATCH_ACTION_KINDS, DISPATCH_LINK_OPERATION_KIND, DISPATCH_TRACK_EVENT, type DateGesture, type DateGestureKind, type DateGesturePreview, type DatesBatchVerdict, type DeletedActivitySnapshot, type DeletedLinkSnapshot, type DispatchAction, type DispatchActionKind, type DispatchOptions, type DispatchRejectReason, type DispatchResult, type DispatchTrackEvent, EDIT_ALERT_KEY, EDIT_DENIAL_REASON, ENTITY_CHANGE_KIND, type EditAlertKey, type EditDenialReason, type EditResult, type EditableColumnName, type EffectiveGraphAudit, type EntityChange, type ActivityBatchLinkInput as ErgonomicActivityBatchLinkInput, type ExpectedProgressAdapter, FILTER_FIELD, FILTER_LOGIC, FILTER_OPERATOR, FILTER_REJECTION_REASON, FILTER_VALUE_KIND, type FilterCriterion, type FilterCriterionValue, type FilterDateRange, type FilterField, type FilterLogic, type FilterOperator, type FilterRejection, type FilterState, type FilterValueKind, type ImpactRequestSyncInput, LINK_BATCH_OPERATION_KIND, LINK_CODE, LINK_CODE_TO_TYPE, LINK_REJECTION_REASON, LINK_RELATIONSHIP, LINK_TYPE, LINK_TYPE_CODE, type Link, type LinkBatchOperationKind, type LinkBatchRequest, type LinkBatchVerdict, type LinkCreateRequest, type LinkId, type LinkPatchRequest, type LinkRejection, type LinkRelationship, type LinkType, type LinkTypeCode, type LinksBatchOperation, type LoadDiagnostic, type LoadDiagnosticCode, type LookaheadConversionFormerParent, type LookaheadConversionGroup, type LookaheadConversionInput, type LookaheadConversionMilestoneMove, type LookaheadConversionPlan, type LookaheadConversionResult, type MutationContext, NEW_ACTIVITY_DEFAULTS, NOT_STARTED_PROGRESS, ORDER_DIRECTION, type OrderDirection, type OrderRule, type OrderState, type ParsedInput, type PendingRequest, type PersistableActivityField, type PersistedEntityIdentity, type PersistenceCheckpoint, type PipelineColumnName, type ProjectWorkHours, REJECTION_REASON, ROOT_PARENT_ID, SCHEDULE_CORE_STATUS, SCHEDULE_EFFECT_KIND, SIR_AUTO_REJECT_REASON, STATUS, STATUS_CRITERIA, type ScheduleActivitiesApi, type ScheduleApiNamespaces, type ScheduleBaselinesApi, type ScheduleCalendarsApi, ScheduleCore, type ScheduleCoreInput, type ScheduleCoreReporter, type ScheduleCoreStatus, type ScheduleCriticalPathApi, type ScheduleDiagnosticsApi, type ScheduleEffect, type ScheduleHistoryApi, type ScheduleImpactRequestsApi, type ScheduleLinksApi, type SchedulePersistenceApi, type ScheduleProjectionApi, type ScheduleSelectionApi, type ScheduleViewApi, type SectorMetadata, type SelectionToggleInput, type StaticActivityDefaults, type StatusCriteria, type TrackingEvent, type UndoOptions, type ViewFilterInput, type ViewStateChange, type ViewStatePropChange, WORK_TIME_DIRECTION, type WithProplannerId, type WorkTimeDirection, checkNoUpdatedLinks, computeExpectedProgress, createSchedule, expectedProgressFromBaseline, getActiveBaseline, getUnsavedActivities, isRootParent, normalizeParentKey, parseFromBackend, willRunCriticalPath, yieldToBrowser };
2622
+ export { ACTIVITY_BATCH_ACTION_KIND, ACTIVITY_BATCH_MODE, ACTIVITY_DATE_EDGE, ACTIVITY_FIELD, ACTIVITY_PONDERATOR_CRITERION, ACTIVITY_PROGRESS_ORIGIN, ACTIVITY_TYPE, type ActivityBaselineSnapshot, type ActivityBatchAction, type ActivityBatchInput, type ActivityBatchItem, type ActivityBatchItemInput, type ActivityBatchLinkInput$1 as ActivityBatchLinkInput, type ActivityBatchMode, type ActivityBatchParentReference, type ActivityBatchReference, type ActivityBulkEdit, type ActivityCreateInput, type ActivityCreationOverrides, type ActivityCreter, type ActivityDateEdge, type ActivityDateEdit, type ActivityField, type ActivityFieldEdit, type ActivityFieldValue, type ActivityId, type ActivityLookaheadSyncInput, type ActivityMoveInput, type ActivityStatus, type ActivityType, type ApplyLookaheadConversionInput, type BackendActivityInput, type BackendCalendarExceptionInput, type BackendCalendarInput, type BackendLinkInput, type BackendScheduleInput, type BackendSectorInput, type BackendShiftInput, type BaselinePoint, type BaselineVersion, type BranchOrderChange, CALENDAR_UNIT, CHANGE_SET_SOURCE_KIND, COLUMN, COMPLETED_PROGRESS, CONSTRAINT_TYPE, CONSTRAINT_TYPE_TO_LABEL, CONSTRAINT_WARNING_KIND, CREATION_KIND, type Calendar, type CalendarId, type CalendarLike, type CalendarUnit, type CalendarWorktime, type ChangeSet, type ChangeSetSource, type ColumnName, type ConstraintType, type ConstraintWarning, type CoreActivity, type CoreBaselinePoint, type CreationKind, type CriticalPathResult, DATE_GESTURE_KIND, DEFAULT_HOURS_PER_DAY, DISPATCH_ACTION_KIND, DISPATCH_ACTION_KINDS, DISPATCH_LINK_OPERATION_KIND, DISPATCH_TRACK_EVENT, type DateGesture, type DateGestureKind, type DateGesturePreview, type DatesBatchVerdict, type DeletedActivitySnapshot, type DeletedLinkSnapshot, type DispatchAction, type DispatchActionKind, type DispatchManyAction, type DispatchManyChangeSetSource, type DispatchManyResult, type DispatchOptions, type DispatchRejectReason, type DispatchResult, type DispatchTrackEvent, EDIT_ALERT_KEY, EDIT_DENIAL_REASON, ENTITY_CHANGE_KIND, type EditAlertKey, type EditDenialReason, type EditResult, type EditableColumnName, type EffectiveGraphAudit, type EntityChange, type ActivityBatchLinkInput as ErgonomicActivityBatchLinkInput, type ExpectedProgressAdapter, FILTER_FIELD, FILTER_LOGIC, FILTER_OPERATOR, FILTER_REJECTION_REASON, FILTER_VALUE_KIND, type FilterCriterion, type FilterCriterionValue, type FilterDateRange, type FilterField, type FilterLogic, type FilterOperator, type FilterRejection, type FilterState, type FilterValueKind, type ImpactRequestSyncInput, LINK_BATCH_OPERATION_KIND, LINK_CODE, LINK_CODE_TO_TYPE, LINK_REJECTION_REASON, LINK_RELATIONSHIP, LINK_TYPE, LINK_TYPE_CODE, type Link, type LinkBatchOperationKind, type LinkBatchRequest, type LinkBatchVerdict, type LinkCreateRequest, type LinkId, type LinkPatchRequest, type LinkRejection, type LinkRelationship, type LinkType, type LinkTypeCode, type LinkUpdateAction, type LinksBatchOperation, type LoadDiagnostic, type LoadDiagnosticCode, type LookaheadConversionFormerParent, type LookaheadConversionGroup, type LookaheadConversionInput, type LookaheadConversionMilestoneMove, type LookaheadConversionPlan, type LookaheadConversionResult, type MutationContext, NEW_ACTIVITY_DEFAULTS, NOT_STARTED_PROGRESS, ORDER_DIRECTION, type OrderDirection, type OrderRule, type OrderState, type ParsedInput, type PendingRequest, type PersistableActivityField, type PersistedEntityIdentity, type PersistenceCheckpoint, type PipelineColumnName, type ProjectWorkHours, REJECTION_REASON, ROOT_PARENT_ID, SCHEDULE_CORE_STATUS, SCHEDULE_EFFECT_KIND, SIR_AUTO_REJECT_REASON, STATUS, STATUS_CRITERIA, type ScheduleActivitiesApi, type ScheduleApiNamespaces, type ScheduleAutoScheduleAction, type ScheduleBaselinesApi, type ScheduleCalendarsApi, ScheduleCore, type ScheduleCoreInput, type ScheduleCoreReporter, type ScheduleCoreStatus, type ScheduleCriticalPathApi, type ScheduleDiagnosticsApi, type ScheduleEffect, type ScheduleHistoryApi, type ScheduleImpactRequestsApi, type ScheduleLinksApi, type SchedulePersistenceApi, type ScheduleProjectionApi, type ScheduleSelectionApi, type ScheduleViewApi, type SectorMetadata, type SelectionToggleInput, type StaticActivityDefaults, type StatusCriteria, type TrackingEvent, type UndoOptions, type ViewFilterInput, type ViewStateChange, type ViewStatePropChange, WORK_TIME_DIRECTION, type WithProplannerId, type WorkTimeDirection, checkNoUpdatedLinks, computeExpectedProgress, createSchedule, expectedProgressFromBaseline, getActiveBaseline, getUnsavedActivities, isRootParent, normalizeParentKey, parseFromBackend, willRunCriticalPath, yieldToBrowser };
package/dist/index.d.ts CHANGED
@@ -493,6 +493,7 @@ declare const DISPATCH_ACTION_KIND: {
493
493
  readonly ACTIVITY_MOVE: "activity-move";
494
494
  readonly ACTIVITY_INDENT: "activity-indent";
495
495
  readonly ACTIVITY_OUTDENT: "activity-outdent";
496
+ readonly ACTIVITY_TYPE_SET: "activity-type-set";
496
497
  readonly ACTIVITY_SET_PROGRESS: "activity-set-progress";
497
498
  readonly ACTIVITY_LOOKAHEAD_CONVERT: "activity-lookahead-convert";
498
499
  readonly SELECTION_TOGGLE: "selection-toggle";
@@ -502,6 +503,7 @@ declare const DISPATCH_ACTION_KIND: {
502
503
  readonly SORT_SET: "sort-set";
503
504
  readonly SIR_SYNC: "sir-sync";
504
505
  readonly ACTIVITY_LOOKAHEAD_SYNC: "activity-lookahead-sync";
506
+ readonly SCHEDULE_AUTO_SCHEDULE: "schedule-auto-schedule";
505
507
  };
506
508
  /** Discriminator accepted by {@link ScheduleCore.applyActivityBatch}. */
507
509
  declare const ACTIVITY_BATCH_ACTION_KIND: "activity-batch";
@@ -685,6 +687,8 @@ type LinksBatchOperation = {
685
687
  } | {
686
688
  kind: typeof DISPATCH_LINK_OPERATION_KIND.UPDATE;
687
689
  linkId: LinkId;
690
+ source?: ActivityId;
691
+ target?: ActivityId;
688
692
  type?: LinkType;
689
693
  /** Replacement lag in working days; dispatch converts it to stored hours. */
690
694
  lag?: number;
@@ -784,6 +788,21 @@ interface ActivityBatchAction {
784
788
  readonly links: ReadonlyArray<ActivityBatchLinkInput$1>;
785
789
  readonly eventSource?: string;
786
790
  }
791
+ /** In-place dependency update preserving the existing link identity. */
792
+ interface LinkUpdateAction {
793
+ readonly kind: typeof DISPATCH_ACTION_KIND.LINK_UPDATE;
794
+ readonly linkId: LinkId;
795
+ readonly source?: ActivityId;
796
+ readonly target?: ActivityId;
797
+ readonly type?: LinkType;
798
+ /** Replacement lag in working days; dispatch converts it to stored hours. */
799
+ readonly lag?: number;
800
+ }
801
+ /** Explicit request to run canonical schedule finalization. */
802
+ interface ScheduleAutoScheduleAction {
803
+ readonly kind: typeof DISPATCH_ACTION_KIND.SCHEDULE_AUTO_SCHEDULE;
804
+ readonly activityId?: ActivityId;
805
+ }
787
806
  /**
788
807
  * Complete union of public commands accepted by {@link ScheduleCore.dispatch}.
789
808
  *
@@ -846,13 +865,7 @@ type DispatchAction = {
846
865
  /** Dependency lag in working days; omitted lag defaults to zero. */
847
866
  lag?: number;
848
867
  linkId?: LinkId;
849
- } | {
850
- kind: typeof DISPATCH_ACTION_KIND.LINK_UPDATE;
851
- linkId: LinkId;
852
- type?: LinkType;
853
- /** Replacement lag in working days; dispatch converts it to stored hours. */
854
- lag?: number;
855
- } | {
868
+ } | LinkUpdateAction | {
856
869
  kind: typeof DISPATCH_ACTION_KIND.LINK_DELETE;
857
870
  linkId: LinkId;
858
871
  } | {
@@ -885,6 +898,10 @@ type DispatchAction = {
885
898
  kind: typeof DISPATCH_ACTION_KIND.ACTIVITY_OUTDENT;
886
899
  activityIds: ReadonlyArray<ActivityId>;
887
900
  eventSource?: string;
901
+ } | {
902
+ kind: typeof DISPATCH_ACTION_KIND.ACTIVITY_TYPE_SET;
903
+ activityId: ActivityId;
904
+ type: ActivityType;
888
905
  } | {
889
906
  kind: typeof DISPATCH_ACTION_KIND.ACTIVITY_SET_PROGRESS;
890
907
  activityId: ActivityId;
@@ -931,7 +948,7 @@ type DispatchAction = {
931
948
  persistedProgress?: number;
932
949
  acknowledgePersistedLookahead?: boolean;
933
950
  eventSource?: string;
934
- };
951
+ } | ScheduleAutoScheduleAction;
935
952
  /**
936
953
  * Supported creation fields with duration expressed in working days.
937
954
  *
@@ -940,7 +957,9 @@ type DispatchAction = {
940
957
  type ActivityCreationOverrides = Omit<CreationOverrides, 'durationHours'> & {
941
958
  readonly durationDays?: number;
942
959
  };
943
- type InternalDispatchAction = DispatchAction | ActivityBatchAction;
960
+ /** One ordered input accepted by {@link ScheduleCore.dispatchMany}. */
961
+ type DispatchManyAction = DispatchAction | ActivityBatchAction;
962
+ type InternalDispatchAction = DispatchManyAction;
944
963
  /** Per-operation derived-work controls; both default to `false`. */
945
964
  interface DispatchOptions {
946
965
  /** Skips autoscheduling for this operation when `true`. */
@@ -966,6 +985,13 @@ type DispatchResult = {
966
985
  reason: string;
967
986
  alertKey?: string | undefined;
968
987
  };
988
+ /** Ordered per-command results plus the single deferred finalization payload. */
989
+ interface DispatchManyResult {
990
+ readonly results: readonly DispatchResult[];
991
+ readonly changeSet: ChangeSet | null;
992
+ /** Whether this batch's deferred autoschedule pass actually ran. */
993
+ readonly autoScheduled: boolean;
994
+ }
969
995
  /** Accepted conversion result always carries the snapshots planned in-queue. */
970
996
  type LookaheadConversionResult = (Extract<DispatchResult, {
971
997
  ok: true;
@@ -1042,15 +1068,21 @@ interface ViewStateChange {
1042
1068
  readonly checked?: ViewStatePropChange;
1043
1069
  readonly visible?: ViewStatePropChange;
1044
1070
  }
1045
- /** Lifecycle sources used when no public dispatch command initiated a change set. */
1071
+ /** Aggregate and lifecycle change-set source kinds. */
1046
1072
  declare const CHANGE_SET_SOURCE_KIND: {
1073
+ readonly DISPATCH_MANY: "dispatch-many";
1047
1074
  readonly INIT: "init";
1048
1075
  readonly UNDO: "undo";
1049
1076
  readonly REDO: "redo";
1050
1077
  };
1078
+ /** Truthful source for one partial ordered public dispatch batch. */
1079
+ interface DispatchManyChangeSetSource {
1080
+ readonly kind: typeof CHANGE_SET_SOURCE_KIND.DISPATCH_MANY;
1081
+ readonly actions: readonly DispatchManyAction[];
1082
+ }
1051
1083
  /** Public command, activity batch, or lifecycle operation that produced changes. */
1052
- type ChangeSetSource = InternalDispatchAction | {
1053
- kind: (typeof CHANGE_SET_SOURCE_KIND)[keyof typeof CHANGE_SET_SOURCE_KIND];
1084
+ type ChangeSetSource = InternalDispatchAction | DispatchManyChangeSetSource | {
1085
+ kind: typeof CHANGE_SET_SOURCE_KIND.INIT | typeof CHANGE_SET_SOURCE_KIND.UNDO | typeof CHANGE_SET_SOURCE_KIND.REDO;
1054
1086
  };
1055
1087
  /**
1056
1088
  * Complete ordered projection payload produced by an accepted operation.
@@ -1059,7 +1091,7 @@ type ChangeSetSource = InternalDispatchAction | {
1059
1091
  * set updates external projection only; persistence remains consumer-owned.
1060
1092
  */
1061
1093
  interface ChangeSet {
1062
- /** Command or lifecycle operation that produced the payload. */
1094
+ /** Command, ordered dispatch batch, or lifecycle operation that produced it. */
1063
1095
  source: ChangeSetSource;
1064
1096
  /** Activity create, update, and delete records. */
1065
1097
  activities: ReadonlyArray<EntityChange<CoreActivity>>;
@@ -1270,6 +1302,8 @@ interface LinkCreateRequest {
1270
1302
  }
1271
1303
  /** Optional dependency fields to replace. */
1272
1304
  interface LinkPatchRequest {
1305
+ readonly sourceId?: ActivityId;
1306
+ readonly targetId?: ActivityId;
1273
1307
  readonly relationship?: LinkRelationship;
1274
1308
  /** Replacement lag in working days. */
1275
1309
  readonly lagDays?: number;
@@ -1288,6 +1322,8 @@ type LinkBatchRequest = ({
1288
1322
  } & LinkCreateRequest) | {
1289
1323
  readonly kind: typeof LINK_BATCH_OPERATION_KIND.UPDATE;
1290
1324
  readonly linkId: LinkId;
1325
+ readonly sourceId?: ActivityId;
1326
+ readonly targetId?: ActivityId;
1291
1327
  readonly relationship?: LinkRelationship;
1292
1328
  readonly lagDays?: number;
1293
1329
  } | {
@@ -1459,6 +1495,8 @@ interface ScheduleActivitiesApi {
1459
1495
  * @returns The complete dispatch result.
1460
1496
  */
1461
1497
  setProgress(activityId: ActivityId, progress: typeof COMPLETED_PROGRESS | typeof NOT_STARTED_PROGRESS, context?: MutationContext): Promise<DispatchResult>;
1498
+ /** Sets the canonical activity shape when compatible with its hierarchy. */
1499
+ setType(activityId: ActivityId, type: ActivityType, options?: DispatchOptions): Promise<DispatchResult>;
1462
1500
  /** @returns The complete result of copying the current selection to core-owned clipboard state. */
1463
1501
  copy(context?: MutationContext): Promise<DispatchResult>;
1464
1502
  /**
@@ -1482,6 +1520,8 @@ interface ScheduleActivitiesApi {
1482
1520
  * @returns The complete dispatch result.
1483
1521
  */
1484
1522
  lookaheadSync(input: ActivityLookaheadSyncInput): Promise<DispatchResult>;
1523
+ /** Runs canonical autoscheduling for one activity or the whole schedule. */
1524
+ autoSchedule(activityId?: ActivityId, options?: DispatchOptions): Promise<DispatchResult>;
1485
1525
  /**
1486
1526
  * Creates a read-only date prediction bound to the current schedule revision.
1487
1527
  *
@@ -2254,6 +2294,7 @@ declare class ScheduleCore {
2254
2294
  * @returns A complete consumer projection change set.
2255
2295
  */
2256
2296
  createProjectionChangeSetFrom(source: ScheduleCore): ChangeSet;
2297
+ private _snapshotProjection;
2257
2298
  /** @returns Deleted persisted activity identities since the last save. */
2258
2299
  getDeletedActivitiesSinceLastSave(): ReadonlyArray<Readonly<DeletedActivitySnapshot>>;
2259
2300
  /** @returns Deleted persisted link identities since the last save. */
@@ -2272,6 +2313,12 @@ declare class ScheduleCore {
2272
2313
  * verdicts, effects, tracking events, and warnings when present.
2273
2314
  */
2274
2315
  dispatch(action: DispatchAction, options?: DispatchOptions): Promise<DispatchResult>;
2316
+ /**
2317
+ * Applies commands in order and runs deferred scheduling finalization once.
2318
+ *
2319
+ * Rejected commands do not roll back earlier accepted commands.
2320
+ */
2321
+ dispatchMany(actions: readonly DispatchManyAction[], options?: DispatchOptions): Promise<DispatchManyResult>;
2275
2322
  /**
2276
2323
  * Serializes and applies an activity creation batch.
2277
2324
  *
@@ -2286,6 +2333,8 @@ declare class ScheduleCore {
2286
2333
  /** Applies one revision-guarded conversion through the serialized dispatcher. */
2287
2334
  applyLookaheadConversion(input: ApplyLookaheadConversionInput): Promise<LookaheadConversionResult>;
2288
2335
  private _dispatchInner;
2336
+ private _dispatchManyInner;
2337
+ private _aggregateDispatchManyChangeSets;
2289
2338
  private _runDispatch;
2290
2339
  /**
2291
2340
  * Queues critical-path calculation for the current revision.
@@ -2570,4 +2619,4 @@ declare const DISPATCH_TRACK_EVENT: {
2570
2619
  /** Consumer analytics event name emitted by a schedule mutation. */
2571
2620
  type DispatchTrackEvent = (typeof DISPATCH_TRACK_EVENT)[keyof typeof DISPATCH_TRACK_EVENT];
2572
2621
 
2573
- export { ACTIVITY_BATCH_ACTION_KIND, ACTIVITY_BATCH_MODE, ACTIVITY_DATE_EDGE, ACTIVITY_FIELD, ACTIVITY_PONDERATOR_CRITERION, ACTIVITY_PROGRESS_ORIGIN, ACTIVITY_TYPE, type ActivityBaselineSnapshot, type ActivityBatchAction, type ActivityBatchInput, type ActivityBatchItem, type ActivityBatchItemInput, type ActivityBatchLinkInput$1 as ActivityBatchLinkInput, type ActivityBatchMode, type ActivityBatchParentReference, type ActivityBatchReference, type ActivityBulkEdit, type ActivityCreateInput, type ActivityCreationOverrides, type ActivityCreter, type ActivityDateEdge, type ActivityDateEdit, type ActivityField, type ActivityFieldEdit, type ActivityFieldValue, type ActivityId, type ActivityLookaheadSyncInput, type ActivityMoveInput, type ActivityStatus, type ActivityType, type ApplyLookaheadConversionInput, type BackendActivityInput, type BackendCalendarExceptionInput, type BackendCalendarInput, type BackendLinkInput, type BackendScheduleInput, type BackendSectorInput, type BackendShiftInput, type BaselinePoint, type BaselineVersion, type BranchOrderChange, CALENDAR_UNIT, CHANGE_SET_SOURCE_KIND, COLUMN, COMPLETED_PROGRESS, CONSTRAINT_TYPE, CONSTRAINT_TYPE_TO_LABEL, CONSTRAINT_WARNING_KIND, CREATION_KIND, type Calendar, type CalendarId, type CalendarLike, type CalendarUnit, type CalendarWorktime, type ChangeSet, type ChangeSetSource, type ColumnName, type ConstraintType, type ConstraintWarning, type CoreActivity, type CoreBaselinePoint, type CreationKind, type CriticalPathResult, DATE_GESTURE_KIND, DEFAULT_HOURS_PER_DAY, DISPATCH_ACTION_KIND, DISPATCH_ACTION_KINDS, DISPATCH_LINK_OPERATION_KIND, DISPATCH_TRACK_EVENT, type DateGesture, type DateGestureKind, type DateGesturePreview, type DatesBatchVerdict, type DeletedActivitySnapshot, type DeletedLinkSnapshot, type DispatchAction, type DispatchActionKind, type DispatchOptions, type DispatchRejectReason, type DispatchResult, type DispatchTrackEvent, EDIT_ALERT_KEY, EDIT_DENIAL_REASON, ENTITY_CHANGE_KIND, type EditAlertKey, type EditDenialReason, type EditResult, type EditableColumnName, type EffectiveGraphAudit, type EntityChange, type ActivityBatchLinkInput as ErgonomicActivityBatchLinkInput, type ExpectedProgressAdapter, FILTER_FIELD, FILTER_LOGIC, FILTER_OPERATOR, FILTER_REJECTION_REASON, FILTER_VALUE_KIND, type FilterCriterion, type FilterCriterionValue, type FilterDateRange, type FilterField, type FilterLogic, type FilterOperator, type FilterRejection, type FilterState, type FilterValueKind, type ImpactRequestSyncInput, LINK_BATCH_OPERATION_KIND, LINK_CODE, LINK_CODE_TO_TYPE, LINK_REJECTION_REASON, LINK_RELATIONSHIP, LINK_TYPE, LINK_TYPE_CODE, type Link, type LinkBatchOperationKind, type LinkBatchRequest, type LinkBatchVerdict, type LinkCreateRequest, type LinkId, type LinkPatchRequest, type LinkRejection, type LinkRelationship, type LinkType, type LinkTypeCode, type LinksBatchOperation, type LoadDiagnostic, type LoadDiagnosticCode, type LookaheadConversionFormerParent, type LookaheadConversionGroup, type LookaheadConversionInput, type LookaheadConversionMilestoneMove, type LookaheadConversionPlan, type LookaheadConversionResult, type MutationContext, NEW_ACTIVITY_DEFAULTS, NOT_STARTED_PROGRESS, ORDER_DIRECTION, type OrderDirection, type OrderRule, type OrderState, type ParsedInput, type PendingRequest, type PersistableActivityField, type PersistedEntityIdentity, type PersistenceCheckpoint, type PipelineColumnName, type ProjectWorkHours, REJECTION_REASON, ROOT_PARENT_ID, SCHEDULE_CORE_STATUS, SCHEDULE_EFFECT_KIND, SIR_AUTO_REJECT_REASON, STATUS, STATUS_CRITERIA, type ScheduleActivitiesApi, type ScheduleApiNamespaces, type ScheduleBaselinesApi, type ScheduleCalendarsApi, ScheduleCore, type ScheduleCoreInput, type ScheduleCoreReporter, type ScheduleCoreStatus, type ScheduleCriticalPathApi, type ScheduleDiagnosticsApi, type ScheduleEffect, type ScheduleHistoryApi, type ScheduleImpactRequestsApi, type ScheduleLinksApi, type SchedulePersistenceApi, type ScheduleProjectionApi, type ScheduleSelectionApi, type ScheduleViewApi, type SectorMetadata, type SelectionToggleInput, type StaticActivityDefaults, type StatusCriteria, type TrackingEvent, type UndoOptions, type ViewFilterInput, type ViewStateChange, type ViewStatePropChange, WORK_TIME_DIRECTION, type WithProplannerId, type WorkTimeDirection, checkNoUpdatedLinks, computeExpectedProgress, createSchedule, expectedProgressFromBaseline, getActiveBaseline, getUnsavedActivities, isRootParent, normalizeParentKey, parseFromBackend, willRunCriticalPath, yieldToBrowser };
2622
+ export { ACTIVITY_BATCH_ACTION_KIND, ACTIVITY_BATCH_MODE, ACTIVITY_DATE_EDGE, ACTIVITY_FIELD, ACTIVITY_PONDERATOR_CRITERION, ACTIVITY_PROGRESS_ORIGIN, ACTIVITY_TYPE, type ActivityBaselineSnapshot, type ActivityBatchAction, type ActivityBatchInput, type ActivityBatchItem, type ActivityBatchItemInput, type ActivityBatchLinkInput$1 as ActivityBatchLinkInput, type ActivityBatchMode, type ActivityBatchParentReference, type ActivityBatchReference, type ActivityBulkEdit, type ActivityCreateInput, type ActivityCreationOverrides, type ActivityCreter, type ActivityDateEdge, type ActivityDateEdit, type ActivityField, type ActivityFieldEdit, type ActivityFieldValue, type ActivityId, type ActivityLookaheadSyncInput, type ActivityMoveInput, type ActivityStatus, type ActivityType, type ApplyLookaheadConversionInput, type BackendActivityInput, type BackendCalendarExceptionInput, type BackendCalendarInput, type BackendLinkInput, type BackendScheduleInput, type BackendSectorInput, type BackendShiftInput, type BaselinePoint, type BaselineVersion, type BranchOrderChange, CALENDAR_UNIT, CHANGE_SET_SOURCE_KIND, COLUMN, COMPLETED_PROGRESS, CONSTRAINT_TYPE, CONSTRAINT_TYPE_TO_LABEL, CONSTRAINT_WARNING_KIND, CREATION_KIND, type Calendar, type CalendarId, type CalendarLike, type CalendarUnit, type CalendarWorktime, type ChangeSet, type ChangeSetSource, type ColumnName, type ConstraintType, type ConstraintWarning, type CoreActivity, type CoreBaselinePoint, type CreationKind, type CriticalPathResult, DATE_GESTURE_KIND, DEFAULT_HOURS_PER_DAY, DISPATCH_ACTION_KIND, DISPATCH_ACTION_KINDS, DISPATCH_LINK_OPERATION_KIND, DISPATCH_TRACK_EVENT, type DateGesture, type DateGestureKind, type DateGesturePreview, type DatesBatchVerdict, type DeletedActivitySnapshot, type DeletedLinkSnapshot, type DispatchAction, type DispatchActionKind, type DispatchManyAction, type DispatchManyChangeSetSource, type DispatchManyResult, type DispatchOptions, type DispatchRejectReason, type DispatchResult, type DispatchTrackEvent, EDIT_ALERT_KEY, EDIT_DENIAL_REASON, ENTITY_CHANGE_KIND, type EditAlertKey, type EditDenialReason, type EditResult, type EditableColumnName, type EffectiveGraphAudit, type EntityChange, type ActivityBatchLinkInput as ErgonomicActivityBatchLinkInput, type ExpectedProgressAdapter, FILTER_FIELD, FILTER_LOGIC, FILTER_OPERATOR, FILTER_REJECTION_REASON, FILTER_VALUE_KIND, type FilterCriterion, type FilterCriterionValue, type FilterDateRange, type FilterField, type FilterLogic, type FilterOperator, type FilterRejection, type FilterState, type FilterValueKind, type ImpactRequestSyncInput, LINK_BATCH_OPERATION_KIND, LINK_CODE, LINK_CODE_TO_TYPE, LINK_REJECTION_REASON, LINK_RELATIONSHIP, LINK_TYPE, LINK_TYPE_CODE, type Link, type LinkBatchOperationKind, type LinkBatchRequest, type LinkBatchVerdict, type LinkCreateRequest, type LinkId, type LinkPatchRequest, type LinkRejection, type LinkRelationship, type LinkType, type LinkTypeCode, type LinkUpdateAction, type LinksBatchOperation, type LoadDiagnostic, type LoadDiagnosticCode, type LookaheadConversionFormerParent, type LookaheadConversionGroup, type LookaheadConversionInput, type LookaheadConversionMilestoneMove, type LookaheadConversionPlan, type LookaheadConversionResult, type MutationContext, NEW_ACTIVITY_DEFAULTS, NOT_STARTED_PROGRESS, ORDER_DIRECTION, type OrderDirection, type OrderRule, type OrderState, type ParsedInput, type PendingRequest, type PersistableActivityField, type PersistedEntityIdentity, type PersistenceCheckpoint, type PipelineColumnName, type ProjectWorkHours, REJECTION_REASON, ROOT_PARENT_ID, SCHEDULE_CORE_STATUS, SCHEDULE_EFFECT_KIND, SIR_AUTO_REJECT_REASON, STATUS, STATUS_CRITERIA, type ScheduleActivitiesApi, type ScheduleApiNamespaces, type ScheduleAutoScheduleAction, type ScheduleBaselinesApi, type ScheduleCalendarsApi, ScheduleCore, type ScheduleCoreInput, type ScheduleCoreReporter, type ScheduleCoreStatus, type ScheduleCriticalPathApi, type ScheduleDiagnosticsApi, type ScheduleEffect, type ScheduleHistoryApi, type ScheduleImpactRequestsApi, type ScheduleLinksApi, type SchedulePersistenceApi, type ScheduleProjectionApi, type ScheduleSelectionApi, type ScheduleViewApi, type SectorMetadata, type SelectionToggleInput, type StaticActivityDefaults, type StatusCriteria, type TrackingEvent, type UndoOptions, type ViewFilterInput, type ViewStateChange, type ViewStatePropChange, WORK_TIME_DIRECTION, type WithProplannerId, type WorkTimeDirection, checkNoUpdatedLinks, computeExpectedProgress, createSchedule, expectedProgressFromBaseline, getActiveBaseline, getUnsavedActivities, isRootParent, normalizeParentKey, parseFromBackend, willRunCriticalPath, yieldToBrowser };