@outbuild-company/schedule-core 1.10.4 → 1.12.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
@@ -1,40 +1,44 @@
1
- declare const LINK_TYPE: {
2
- readonly FINISH_TO_START: "0";
3
- readonly START_TO_START: "1";
4
- readonly FINISH_TO_FINISH: "2";
5
- readonly START_TO_FINISH: "3";
6
- };
7
-
8
- type ConstraintType = 'asap' | 'alap' | 'snet' | 'snlt' | 'fnet' | 'fnlt' | 'mso' | 'mfo';
9
- declare const CONSTRAINT_TYPE: {
10
- readonly ASAP: "asap";
11
- readonly ALAP: "alap";
12
- readonly SNET: "snet";
13
- readonly SNLT: "snlt";
14
- readonly FNET: "fnet";
15
- readonly FNLT: "fnlt";
16
- readonly MSO: "mso";
17
- readonly MFO: "mfo";
18
- };
19
-
1
+ /** Canonical activity identifier inside a schedule. */
20
2
  type ActivityId = string;
3
+ /** Canonical dependency-link identifier inside a schedule. */
21
4
  type LinkId = string;
5
+ /** Canonical calendar identifier inside a schedule. */
22
6
  type CalendarId = string;
7
+ /** Normalized activity shape category. */
23
8
  type ActivityType = 'project' | 'task' | 'milestone';
24
9
 
10
+ /** Stored dependency relationship code. */
25
11
  type LinkType = '0' | '1' | '2' | '3';
12
+ /** Direction used for calendar-aware work-time traversal. */
26
13
  type WorkTimeDirection = 'future' | 'past';
14
+ /** Named work-time traversal directions. */
27
15
  declare const WORK_TIME_DIRECTION: {
28
16
  readonly FUTURE: "future";
29
17
  readonly PAST: "past";
30
18
  };
19
+ /** Unit accepted by calendar duration operations. */
31
20
  type CalendarUnit = 'hour' | 'day';
21
+ /** Named units accepted by calendar duration operations. */
32
22
  declare const CALENDAR_UNIT: {
33
23
  readonly HOUR: "hour";
34
24
  readonly DAY: "day";
35
25
  };
36
- type ActivityCreter = 'DURATION' | 'COST' | 'HH';
37
- type StatusCriteria = 'Baseline' | 'Actual';
26
+ /** Criteria available for schedule-wide activity weighting. */
27
+ declare const ACTIVITY_PONDERATOR_CRITERION: {
28
+ readonly DURATION: "DURATION";
29
+ readonly COST: "COST";
30
+ readonly WORK_HOURS: "HH";
31
+ };
32
+ /** Schedule-wide activity weighting criterion. */
33
+ type ActivityCreter = (typeof ACTIVITY_PONDERATOR_CRITERION)[keyof typeof ACTIVITY_PONDERATOR_CRITERION];
34
+ /** Modes used to derive activity status from actual or baseline progress. */
35
+ declare const STATUS_CRITERIA: {
36
+ readonly BASELINE: "Baseline";
37
+ readonly ACTUAL: "Actual";
38
+ };
39
+ /** Mode used to derive activity status. */
40
+ type StatusCriteria = (typeof STATUS_CRITERIA)[keyof typeof STATUS_CRITERIA];
41
+ /** Backend baseline-version metadata retained during normalization. */
38
42
  interface BaselineVersion {
39
43
  id?: number;
40
44
  name?: string | null;
@@ -42,11 +46,14 @@ interface BaselineVersion {
42
46
  visible?: boolean;
43
47
  [key: string]: unknown;
44
48
  }
49
+ /** Backend baseline point accepted at the package boundary. */
45
50
  interface BaselinePoint {
46
51
  start_date: string;
47
52
  end_date: string;
53
+ /** Baseline duration in working days. */
48
54
  duration: number;
49
55
  cost: number | string;
56
+ /** Baseline work in hours. */
50
57
  hh_work: number | string;
51
58
  sectorbaselineversion?: BaselineVersion;
52
59
  sectorbaselineversionId?: number;
@@ -55,9 +62,11 @@ interface BaselinePoint {
55
62
  hoursPerWeek?: number;
56
63
  [key: string]: unknown;
57
64
  }
65
+ /** Minimal pending impact-request identity consumed by schedule effects. */
58
66
  interface PendingRequest {
59
67
  id: string;
60
68
  }
69
+ /** Derived activity statuses exposed to consumers. */
61
70
  declare const STATUS: {
62
71
  readonly DONE: "Done";
63
72
  readonly OVERDUE: "Overdue";
@@ -65,24 +74,40 @@ declare const STATUS: {
65
74
  readonly WAITING: "Waiting";
66
75
  readonly DOING: "Doing";
67
76
  };
77
+ /** Derived activity status exposed on normalized activities. */
68
78
  type ActivityStatus = (typeof STATUS)[keyof typeof STATUS];
79
+ /** Critical-path dates and slack for one activity. */
69
80
  interface CriticalPathResult {
81
+ /** Earliest feasible start, or `null` when not calculated. */
70
82
  earlyStart: Date | null;
83
+ /** Earliest feasible finish, or `null` when not calculated. */
71
84
  earlyFinish: Date | null;
85
+ /** Latest feasible start, or `null` when not calculated. */
72
86
  lateStart: Date | null;
87
+ /** Latest feasible finish, or `null` when not calculated. */
73
88
  lateFinish: Date | null;
89
+ /** Total working-hour slack, or `null` when not calculated. */
74
90
  totalSlackHours: number | null;
75
91
  }
92
+ /** Active baseline values copied onto an activity for projection. */
76
93
  interface ActivityBaselineSnapshot {
94
+ /** Baseline start, or `null` when unavailable. */
77
95
  startDate: Date | null;
96
+ /** Baseline end, or `null` when unavailable. */
78
97
  endDate: Date | null;
98
+ /** Baseline duration in working days. */
79
99
  durationDays: number;
80
100
  cost: number;
101
+ /** Baseline work in hours. */
81
102
  workHours: number;
82
103
  }
104
+ /** Normalized baseline point retained on a core activity. */
83
105
  interface CoreBaselinePoint {
106
+ /** Baseline start, or `null` when the wire value is unavailable. */
84
107
  startDate: Date | null;
108
+ /** Baseline end, or `null` when the wire value is unavailable. */
85
109
  endDate: Date | null;
110
+ /** Duration in working days. */
86
111
  durationDays: number;
87
112
  cost: number;
88
113
  workHours: number;
@@ -90,9 +115,17 @@ interface CoreBaselinePoint {
90
115
  isActiveVersion: boolean;
91
116
  isVisibleVersion: boolean;
92
117
  baseCalendarId: CalendarId | null;
118
+ /** Calendar hours per working day, or `null` when unspecified. */
93
119
  hoursPerDay: number | null;
120
+ /** Calendar hours per working week, or `null` when unspecified. */
94
121
  hoursPerWeek: number | null;
95
122
  }
123
+ /**
124
+ * Complete normalized activity snapshot owned by Schedule Core.
125
+ *
126
+ * Read APIs return defensive copies. Stored duration and slack fields use
127
+ * working hours; façade inputs use working days where documented.
128
+ */
96
129
  interface CoreActivity {
97
130
  id: ActivityId;
98
131
  proplannerId: number | null;
@@ -102,12 +135,17 @@ interface CoreActivity {
102
135
  type: ActivityType;
103
136
  startDate: Date;
104
137
  endDate: Date;
138
+ /** Stored duration in working hours. */
105
139
  durationHours: number;
140
+ /** Scheduling constraint, or `null` when unconstrained. */
106
141
  constraintType: ConstraintType | null;
142
+ /** Constraint date, or `null` when the constraint has no date. */
107
143
  constraintDate: Date | null;
108
144
  autoScheduling: boolean;
145
+ /** Assigned calendar ID, or `null` when no known source/default calendar resolves. */
109
146
  calendarId: CalendarId | null;
110
147
  assignedDefaultCalendar: boolean;
148
+ /** Consumer-origin date, or `null` when absent. */
111
149
  dateOrigin: Date | null;
112
150
  progress: number;
113
151
  cost: number;
@@ -131,47 +169,60 @@ interface CoreActivity {
131
169
  tagIds: string[];
132
170
  baselinePoints: CoreBaselinePoint[];
133
171
  baselineSnapshot: ActivityBaselineSnapshot | null;
172
+ /** Summary roll-up duration in working hours. */
134
173
  recursiveDurationHours: number;
135
174
  isCritical: boolean;
175
+ /** Free slack in working hours, or `null` when not calculated. */
136
176
  freeSlackHours: number | null;
177
+ /** Inclusive calendar-day span, or `null` when unavailable. */
137
178
  calendarDuration?: number | null;
179
+ /** Expected progress percentage, or `null` when unavailable. */
138
180
  expectedProgress: number | null;
181
+ /** Baseline expected progress percentage, or `null` when unavailable. */
139
182
  expectedProgressBaseline: number | null;
140
183
  status: ActivityStatus | null;
141
184
  criticalPath: CriticalPathResult | null;
142
185
  }
186
+ /** Normalized dependency-link snapshot. */
143
187
  interface Link {
144
188
  id: LinkId;
145
189
  source: ActivityId;
146
190
  target: ActivityId;
147
191
  type: LinkType;
192
+ /** Stored dependency lag in working hours. */
148
193
  lag: number;
194
+ /** Free slack in working hours, or `null` when not calculated. */
149
195
  freeSlackHours: number | null;
150
196
  isCritical: boolean;
151
197
  ganttId?: number;
152
198
  sectorId?: number;
153
199
  proplannerId?: number;
154
200
  }
201
+ /** Persisted identity retained after an activity is deleted. */
155
202
  interface DeletedActivitySnapshot {
156
203
  readonly id: ActivityId;
157
204
  readonly proplannerId: number;
158
205
  readonly parentId: ActivityId | null;
159
206
  readonly hadBaseline: boolean;
160
207
  }
208
+ /** Persisted link identity and endpoints retained after deletion. */
161
209
  interface DeletedLinkSnapshot {
162
210
  readonly id: LinkId;
163
211
  readonly proplannerId: number;
164
212
  readonly source: ActivityId;
165
213
  readonly target: ActivityId;
166
214
  readonly type: LinkType;
215
+ /** Stored lag in working hours. */
167
216
  readonly lag: number;
168
217
  }
218
+ /** Normalized calendar work-week, exception, and custom-week rules. */
169
219
  interface CalendarWorktime {
170
220
  days: Array<false | string[]>;
171
221
  hours: string[];
172
222
  dates?: Record<string, false | string[]>;
173
223
  customWeeks?: Record<string, unknown>;
174
224
  }
225
+ /** Normalized schedule or base calendar snapshot. */
175
226
  interface Calendar {
176
227
  id: CalendarId;
177
228
  name: string;
@@ -183,10 +234,13 @@ interface Calendar {
183
234
  hours?: string[];
184
235
  }>;
185
236
  }
237
+ /** Normalized schedule metadata derived from the backend `sector` field. */
186
238
  interface SectorMetadata {
187
239
  id: string;
188
240
  name: string;
241
+ /** Working hours per day used for day/hour conversion. */
189
242
  hoursPerDay: number;
243
+ /** Working hours per week. */
190
244
  hoursPerWeek: number;
191
245
  dateFormat: string;
192
246
  projectId: number;
@@ -198,6 +252,7 @@ interface SectorMetadata {
198
252
  statusCriteria: StatusCriteria;
199
253
  ganttId: number | null;
200
254
  }
255
+ /** One created, updated, or deleted entity in a consumer projection. */
201
256
  interface EntityChange<T> {
202
257
  id: string;
203
258
  kind: 'created' | 'updated' | 'deleted';
@@ -205,9 +260,94 @@ interface EntityChange<T> {
205
260
  before: unknown;
206
261
  after: unknown;
207
262
  }> | undefined;
263
+ /** Complete post-change snapshot, or `null` for deletion. */
208
264
  after: Readonly<T> | null;
209
265
  }
210
266
 
267
+ /** Normalized activity scheduling constraint. */
268
+ type ConstraintType = 'asap' | 'alap' | 'snet' | 'snlt' | 'fnet' | 'fnlt' | 'mso' | 'mfo';
269
+ /** Named normalized activity scheduling constraints. */
270
+ declare const CONSTRAINT_TYPE: {
271
+ readonly ASAP: "asap";
272
+ readonly ALAP: "alap";
273
+ readonly SNET: "snet";
274
+ readonly SNLT: "snlt";
275
+ readonly FNET: "fnet";
276
+ readonly FNLT: "fnlt";
277
+ readonly MSO: "mso";
278
+ readonly MFO: "mfo";
279
+ };
280
+
281
+ /** Stored dependency relationship codes used by normalized links. */
282
+ declare const LINK_TYPE: {
283
+ readonly FINISH_TO_START: "0";
284
+ readonly START_TO_START: "1";
285
+ readonly FINISH_TO_FINISH: "2";
286
+ readonly START_TO_FINISH: "3";
287
+ };
288
+
289
+ declare const ACTIVITY_SAVE_FIELD_POLICY: {
290
+ readonly id: "ignored";
291
+ readonly proplannerId: "ignored";
292
+ readonly parentId: "tracked";
293
+ readonly name: "tracked";
294
+ readonly description: "tracked";
295
+ readonly type: "tracked";
296
+ readonly startDate: "tracked";
297
+ readonly endDate: "tracked";
298
+ readonly durationHours: "tracked";
299
+ readonly constraintType: "tracked";
300
+ readonly constraintDate: "tracked";
301
+ readonly autoScheduling: "tracked";
302
+ readonly calendarId: "tracked";
303
+ readonly assignedDefaultCalendar: "ignored";
304
+ readonly dateOrigin: "tracked";
305
+ readonly progress: "tracked";
306
+ readonly cost: "tracked";
307
+ readonly usedCost: "tracked";
308
+ readonly realCost: "tracked";
309
+ readonly workHours: "tracked";
310
+ readonly realWorkHours: "tracked";
311
+ readonly ponderator: "tracked";
312
+ readonly hasCustomPonderator: "tracked";
313
+ readonly correlativeId: "tracked";
314
+ readonly uniqueCorrelativeId: "tracked";
315
+ readonly customId: "tracked";
316
+ readonly subcontractId: "tracked";
317
+ readonly isLookahead: "tracked";
318
+ readonly hasLookaheadTasks: "ignored";
319
+ readonly newActivityIds: "tracked";
320
+ readonly hasNewActivities: "tracked";
321
+ readonly isNewActivity: "ignored";
322
+ readonly pendingRequestIds: "ignored";
323
+ readonly responsableIds: "tracked";
324
+ readonly tagIds: "tracked";
325
+ readonly baselinePoints: "ignored";
326
+ readonly baselineSnapshot: "ignored";
327
+ readonly recursiveDurationHours: "ignored";
328
+ readonly isCritical: "ignored";
329
+ readonly freeSlackHours: "ignored";
330
+ readonly calendarDuration: "ignored";
331
+ readonly expectedProgress: "ignored";
332
+ readonly expectedProgressBaseline: "ignored";
333
+ readonly status: "ignored";
334
+ readonly criticalPath: "ignored";
335
+ };
336
+ /**
337
+ * Activity field included in consumer persistence comparisons.
338
+ *
339
+ * Derived scheduling, baseline, selection, and backend identity fields are
340
+ * intentionally excluded.
341
+ */
342
+ type PersistableActivityField = {
343
+ [Field in keyof typeof ACTIVITY_SAVE_FIELD_POLICY]: (typeof ACTIVITY_SAVE_FIELD_POLICY)[Field] extends 'tracked' ? Field : never;
344
+ }[keyof typeof ACTIVITY_SAVE_FIELD_POLICY];
345
+
346
+ /** Progress percentage representing a not-started activity. */
347
+ declare const NOT_STARTED_PROGRESS = 0;
348
+ /** Progress percentage representing a completed activity. */
349
+ declare const COMPLETED_PROGRESS = 100;
350
+
211
351
  declare const EDITABLE: {
212
352
  readonly TEXT: "text";
213
353
  readonly DESCRIPTION: "description";
@@ -228,6 +368,7 @@ declare const EDITABLE: {
228
368
  readonly CUSTOM_PREDECESSORS: "custom_predecessors";
229
369
  readonly CUSTOM_SUCESSORS: "custom_sucessors";
230
370
  };
371
+ /** Canonical editable and read-only column names at dispatch boundaries. */
231
372
  declare const COLUMN: {
232
373
  readonly REAL_WORK: "real_work";
233
374
  readonly REAL_COST: "real_cost";
@@ -269,29 +410,149 @@ declare const COLUMN: {
269
410
  readonly CUSTOM_PREDECESSORS: "custom_predecessors";
270
411
  readonly CUSTOM_SUCESSORS: "custom_sucessors";
271
412
  };
413
+ /** Canonical column handled by an edit pipeline or dependency display. */
272
414
  type EditableColumnName = (typeof EDITABLE)[keyof typeof EDITABLE];
415
+ /** Canonical editable or read-only column name. */
273
416
  type ColumnName = (typeof COLUMN)[keyof typeof COLUMN];
274
417
 
418
+ /** Editable column handled by the canonical field-mutation pipeline. */
275
419
  type PipelineColumnName = Exclude<(typeof EDITABLE)[keyof typeof EDITABLE], typeof COLUMN.CUSTOM_PREDECESSORS | typeof COLUMN.CUSTOM_SUCESSORS>;
276
420
 
277
421
  declare const CREATION_OVERRIDE_FIELD_LIST: readonly ["name", "description", "type", "startDate", "durationHours", "constraintType", "constraintDate", "calendarId", "assignedDefaultCalendar", "autoScheduling", "progress", "cost", "usedCost", "realCost", "workHours", "realWorkHours", "ponderator", "hasCustomPonderator", "customId", "subcontractId", "responsableIds", "tagIds", "isLookahead"];
278
422
  type CreationOverrideField = (typeof CREATION_OVERRIDE_FIELD_LIST)[number];
279
423
  type CreationOverrides = Partial<Pick<CoreActivity, CreationOverrideField>>;
280
424
 
281
- type StringOperator = 'includes' | 'notIncludes' | 'is' | 'isNot';
282
- type NumberOperator = 'equals' | 'notEquals' | 'greaterThan' | 'lessThan' | 'greaterOrEqual' | 'lessOrEqual';
283
- type DateOperator = 'after' | 'before';
284
- type MembershipOperator = 'someOf' | 'notSomeOf';
285
- type FilterOperator = StringOperator | NumberOperator | DateOperator | 'between' | MembershipOperator;
286
- type StringFilterField = 'name' | 'description' | 'customId';
287
- type NumberFilterField = 'correlativeId' | 'uniqueCorrelativeId' | 'progress' | 'durationDays' | 'calendarDuration' | 'cost' | 'usedCost' | 'realCost' | 'workHours' | 'realWorkHours' | 'ponderator' | 'freeSlackDays' | 'totalSlackDays' | 'expectedProgressBaseline' | 'baselineDurationDays' | 'baselineCost' | 'baselineWorkHours' | 'expectedProgress';
288
- type DateFilterField = 'startDate' | 'endDate' | 'constraintDate' | 'baselineStartDate' | 'baselineEndDate' | 'earlyStart' | 'earlyFinish' | 'lateStart' | 'lateFinish';
289
- type IdArrayFilterField = 'responsableIds' | 'tagIds';
290
- type EnumFilterField = 'status' | 'constraintType';
291
- type ReferenceFilterField = 'calendarId' | 'subcontractId';
292
- type BooleanFilterField = 'isCritical';
425
+ /** Discriminators for commands accepted by {@link ScheduleCore.dispatch}. */
426
+ declare const DISPATCH_ACTION_KIND: {
427
+ readonly ACTIVITY_CLIPBOARD_CLEAR: "activity-clipboard-clear";
428
+ readonly ACTIVITY_COPY: "activity-copy";
429
+ readonly CALENDAR_RECONCILE: "calendar-reconcile";
430
+ readonly ACTIVITY_PASTE_COPIED: "activity-paste-copied";
431
+ readonly PERSISTENCE_ACKNOWLEDGE: "persistence-acknowledge";
432
+ readonly BASELINE_APPLY: "baseline-apply";
433
+ readonly PONDERATOR_CRITERION_SET: "ponderator-criterion-set";
434
+ readonly STATUS_CRITERIA_SET: "status-criteria-set";
435
+ readonly INLINE_EDIT: "inline-edit";
436
+ readonly DATES_BATCH: "dates-batch";
437
+ readonly BULK_EDIT: "bulk-edit";
438
+ readonly LINK_CREATE: "link-create";
439
+ readonly LINK_UPDATE: "link-update";
440
+ readonly LINK_DELETE: "link-delete";
441
+ readonly LINKS_BATCH: "links-batch";
442
+ readonly ACTIVITY_CREATE: "activity-create";
443
+ readonly ACTIVITY_DELETE: "activity-delete";
444
+ readonly ACTIVITY_MOVE: "activity-move";
445
+ readonly ACTIVITY_INDENT: "activity-indent";
446
+ readonly ACTIVITY_OUTDENT: "activity-outdent";
447
+ readonly ACTIVITY_SET_PROGRESS: "activity-set-progress";
448
+ readonly SELECTION_TOGGLE: "selection-toggle";
449
+ readonly SELECTION_REPLACE: "selection-replace";
450
+ readonly VISIBILITY_SET: "visibility-set";
451
+ readonly FILTER_SET: "filter-set";
452
+ readonly SORT_SET: "sort-set";
453
+ readonly SIR_SYNC: "sir-sync";
454
+ readonly ACTIVITY_LOOKAHEAD_SYNC: "activity-lookahead-sync";
455
+ };
456
+ /** Discriminator accepted by {@link ScheduleCore.applyActivityBatch}. */
457
+ declare const ACTIVITY_BATCH_ACTION_KIND: "activity-batch";
458
+ /** Low-level create, update, and delete dependency operation kinds. */
459
+ declare const DISPATCH_LINK_OPERATION_KIND: {
460
+ readonly CREATE: "create";
461
+ readonly UPDATE: "update";
462
+ readonly DELETE: "delete";
463
+ };
464
+ /** Discriminator of a public dispatch command. */
465
+ type DispatchActionKind = (typeof DISPATCH_ACTION_KIND)[keyof typeof DISPATCH_ACTION_KIND];
466
+ /** Read-only catalog of every public dispatch command discriminator. */
467
+ declare const DISPATCH_ACTION_KINDS: ReadonlyArray<DispatchActionKind>;
468
+
469
+ /** Runtime value categories used to validate filter criteria. */
470
+ declare const FILTER_VALUE_KIND: {
471
+ readonly STRING: "string";
472
+ readonly NUMBER: "number";
473
+ readonly DATE: "date";
474
+ readonly ID_ARRAY: "id-array";
475
+ readonly ENUM: "enum";
476
+ readonly BOOLEAN: "boolean";
477
+ readonly REFERENCE: "reference";
478
+ };
479
+ /** Runtime value category associated with a filter field. */
480
+ type FilterValueKind = (typeof FILTER_VALUE_KIND)[keyof typeof FILTER_VALUE_KIND];
481
+ /** Public filterable activity fields, including derived day-based values. */
482
+ declare const FILTER_FIELD: {
483
+ readonly NAME: "name";
484
+ readonly DESCRIPTION: "description";
485
+ readonly CUSTOM_ID: "customId";
486
+ readonly CORRELATIVE_ID: "correlativeId";
487
+ readonly UNIQUE_CORRELATIVE_ID: "uniqueCorrelativeId";
488
+ readonly PROGRESS: "progress";
489
+ readonly DURATION_DAYS: "durationDays";
490
+ readonly CALENDAR_DURATION: "calendarDuration";
491
+ readonly COST: "cost";
492
+ readonly USED_COST: "usedCost";
493
+ readonly REAL_COST: "realCost";
494
+ readonly WORK_HOURS: "workHours";
495
+ readonly REAL_WORK_HOURS: "realWorkHours";
496
+ readonly PONDERATOR: "ponderator";
497
+ readonly FREE_SLACK_DAYS: "freeSlackDays";
498
+ readonly TOTAL_SLACK_DAYS: "totalSlackDays";
499
+ readonly EXPECTED_PROGRESS_BASELINE: "expectedProgressBaseline";
500
+ readonly BASELINE_DURATION_DAYS: "baselineDurationDays";
501
+ readonly BASELINE_COST: "baselineCost";
502
+ readonly BASELINE_WORK_HOURS: "baselineWorkHours";
503
+ readonly EXPECTED_PROGRESS: "expectedProgress";
504
+ readonly START_DATE: "startDate";
505
+ readonly END_DATE: "endDate";
506
+ readonly CONSTRAINT_DATE: "constraintDate";
507
+ readonly BASELINE_START_DATE: "baselineStartDate";
508
+ readonly BASELINE_END_DATE: "baselineEndDate";
509
+ readonly EARLY_START: "earlyStart";
510
+ readonly EARLY_FINISH: "earlyFinish";
511
+ readonly LATE_START: "lateStart";
512
+ readonly LATE_FINISH: "lateFinish";
513
+ readonly RESPONSABLE_IDS: "responsableIds";
514
+ readonly TAG_IDS: "tagIds";
515
+ readonly STATUS: "status";
516
+ readonly CONSTRAINT_TYPE: "constraintType";
517
+ readonly CALENDAR_ID: "calendarId";
518
+ readonly SUBCONTRACT_ID: "subcontractId";
519
+ readonly IS_CRITICAL: "isCritical";
520
+ };
521
+ /** Operators accepted by typed filter criteria. */
522
+ declare const FILTER_OPERATOR: {
523
+ readonly INCLUDES: "includes";
524
+ readonly NOT_INCLUDES: "notIncludes";
525
+ readonly IS: "is";
526
+ readonly IS_NOT: "isNot";
527
+ readonly EQUALS: "equals";
528
+ readonly NOT_EQUALS: "notEquals";
529
+ readonly GREATER_THAN: "greaterThan";
530
+ readonly LESS_THAN: "lessThan";
531
+ readonly GREATER_OR_EQUAL: "greaterOrEqual";
532
+ readonly LESS_OR_EQUAL: "lessOrEqual";
533
+ readonly AFTER: "after";
534
+ readonly BEFORE: "before";
535
+ readonly BETWEEN: "between";
536
+ readonly SOME_OF: "someOf";
537
+ readonly NOT_SOME_OF: "notSomeOf";
538
+ };
539
+ type StringOperator = typeof FILTER_OPERATOR.INCLUDES | typeof FILTER_OPERATOR.NOT_INCLUDES | typeof FILTER_OPERATOR.IS | typeof FILTER_OPERATOR.IS_NOT;
540
+ type NumberOperator = typeof FILTER_OPERATOR.EQUALS | typeof FILTER_OPERATOR.NOT_EQUALS | typeof FILTER_OPERATOR.GREATER_THAN | typeof FILTER_OPERATOR.LESS_THAN | typeof FILTER_OPERATOR.GREATER_OR_EQUAL | typeof FILTER_OPERATOR.LESS_OR_EQUAL;
541
+ type DateOperator = typeof FILTER_OPERATOR.AFTER | typeof FILTER_OPERATOR.BEFORE;
542
+ type MembershipOperator = typeof FILTER_OPERATOR.SOME_OF | typeof FILTER_OPERATOR.NOT_SOME_OF;
543
+ /** Operator accepted by at least one public filter field. */
544
+ type FilterOperator = StringOperator | NumberOperator | DateOperator | typeof FILTER_OPERATOR.BETWEEN | MembershipOperator;
545
+ type StringFilterField = typeof FILTER_FIELD.NAME | typeof FILTER_FIELD.DESCRIPTION | typeof FILTER_FIELD.CUSTOM_ID;
546
+ type NumberFilterField = typeof FILTER_FIELD.CORRELATIVE_ID | typeof FILTER_FIELD.UNIQUE_CORRELATIVE_ID | typeof FILTER_FIELD.PROGRESS | typeof FILTER_FIELD.DURATION_DAYS | typeof FILTER_FIELD.CALENDAR_DURATION | typeof FILTER_FIELD.COST | typeof FILTER_FIELD.USED_COST | typeof FILTER_FIELD.REAL_COST | typeof FILTER_FIELD.WORK_HOURS | typeof FILTER_FIELD.REAL_WORK_HOURS | typeof FILTER_FIELD.PONDERATOR | typeof FILTER_FIELD.FREE_SLACK_DAYS | typeof FILTER_FIELD.TOTAL_SLACK_DAYS | typeof FILTER_FIELD.EXPECTED_PROGRESS_BASELINE | typeof FILTER_FIELD.BASELINE_DURATION_DAYS | typeof FILTER_FIELD.BASELINE_COST | typeof FILTER_FIELD.BASELINE_WORK_HOURS | typeof FILTER_FIELD.EXPECTED_PROGRESS;
547
+ type DateFilterField = typeof FILTER_FIELD.START_DATE | typeof FILTER_FIELD.END_DATE | typeof FILTER_FIELD.CONSTRAINT_DATE | typeof FILTER_FIELD.BASELINE_START_DATE | typeof FILTER_FIELD.BASELINE_END_DATE | typeof FILTER_FIELD.EARLY_START | typeof FILTER_FIELD.EARLY_FINISH | typeof FILTER_FIELD.LATE_START | typeof FILTER_FIELD.LATE_FINISH;
548
+ type IdArrayFilterField = typeof FILTER_FIELD.RESPONSABLE_IDS | typeof FILTER_FIELD.TAG_IDS;
549
+ type EnumFilterField = typeof FILTER_FIELD.STATUS | typeof FILTER_FIELD.CONSTRAINT_TYPE;
550
+ type ReferenceFilterField = typeof FILTER_FIELD.CALENDAR_ID | typeof FILTER_FIELD.SUBCONTRACT_ID;
551
+ type BooleanFilterField = typeof FILTER_FIELD.IS_CRITICAL;
552
+ /** Activity field accepted by the filter pipeline. */
293
553
  type FilterField = StringFilterField | NumberFilterField | DateFilterField | IdArrayFilterField | EnumFilterField | ReferenceFilterField | BooleanFilterField;
294
554
  type FilterScalarValue = string | number | Date;
555
+ /** Scalar or membership-array value accepted by a filter criterion. */
295
556
  type FilterCriterionValue = FilterScalarValue | ReadonlyArray<string | number | boolean>;
296
557
  interface Criterion<Field extends FilterField, Operator, Value> {
297
558
  readonly field: Field;
@@ -300,63 +561,117 @@ interface Criterion<Field extends FilterField, Operator, Value> {
300
561
  }
301
562
  interface BetweenCriterion<Field extends FilterField, Value> {
302
563
  readonly field: Field;
303
- readonly operator: 'between';
564
+ readonly operator: typeof FILTER_OPERATOR.BETWEEN;
304
565
  readonly value: Value;
305
566
  readonly valueTo: Value;
306
567
  }
568
+ /**
569
+ * Field-aware criterion that restricts operators and values by field kind.
570
+ *
571
+ * Duration and slack fields whose names end in `Days` use working days.
572
+ */
307
573
  type FilterCriterion = Criterion<StringFilterField, StringOperator, string> | Criterion<NumberFilterField, NumberOperator, string | number> | BetweenCriterion<NumberFilterField, string | number> | Criterion<DateFilterField, DateOperator, string | number | Date> | BetweenCriterion<DateFilterField, string | number | Date> | Criterion<IdArrayFilterField, MembershipOperator, ReadonlyArray<string | number>> | Criterion<EnumFilterField, MembershipOperator, ReadonlyArray<string>> | Criterion<ReferenceFilterField, MembershipOperator, ReadonlyArray<string | number>> | Criterion<BooleanFilterField, MembershipOperator, ReadonlyArray<boolean>>;
574
+ /** Inclusive date range used to constrain filter projection. */
308
575
  interface FilterDateRange {
309
576
  readonly start: Date;
310
577
  readonly end: Date;
311
578
  }
579
+ /** Logical modes for combining multiple filter criteria. */
580
+ declare const FILTER_LOGIC: {
581
+ readonly AND: "and";
582
+ readonly OR: "or";
583
+ };
584
+ /** Logical mode used to combine filter criteria. */
585
+ type FilterLogic = (typeof FILTER_LOGIC)[keyof typeof FILTER_LOGIC];
586
+ /** Immutable active filter projection state. */
312
587
  interface FilterState {
313
588
  readonly criteria: ReadonlyArray<FilterCriterion>;
314
- readonly logic: 'and' | 'or';
589
+ readonly logic: FilterLogic;
315
590
  readonly dateRange?: FilterDateRange;
316
591
  }
317
592
 
593
+ /** Canonical parent ID used for root-level activities. */
594
+ declare const ROOT_PARENT_ID: "0";
595
+ /** @returns Whether a value is a nullish, numeric, or string root parent. */
596
+ declare function isRootParent(parent: unknown): boolean;
597
+ /**
598
+ * Converts root sentinels to {@link ROOT_PARENT_ID} and stringifies other IDs.
599
+ *
600
+ * @param parent - Backend or domain parent value.
601
+ */
602
+ declare function normalizeParentKey(parent: unknown): string;
603
+
604
+ /** Sort directions accepted by visual-order rules. */
605
+ declare const ORDER_DIRECTION: {
606
+ readonly ASCENDING: "asc";
607
+ readonly DESCENDING: "desc";
608
+ };
609
+ /** Ascending or descending visual sort direction. */
610
+ type OrderDirection = (typeof ORDER_DIRECTION)[keyof typeof ORDER_DIRECTION];
611
+ /** One filter-field and direction used for visual ordering. */
318
612
  interface OrderRule {
319
613
  readonly field: FilterField;
320
- readonly direction: 'asc' | 'desc';
614
+ readonly direction: OrderDirection;
321
615
  }
616
+ /** Immutable ordered rule set active on a schedule. */
322
617
  interface OrderState {
323
618
  readonly rules: ReadonlyArray<OrderRule>;
324
619
  }
620
+ /** Complete child-ID order projected for one hierarchy branch. */
325
621
  interface BranchOrderChange {
326
622
  readonly parentId: string;
327
623
  readonly childIds: ReadonlyArray<string>;
328
624
  }
329
625
 
626
+ /** Low-level dependency operation accepted by the canonical dispatcher. */
330
627
  type LinksBatchOperation = {
331
- kind: 'create';
628
+ kind: typeof DISPATCH_LINK_OPERATION_KIND.CREATE;
332
629
  source: ActivityId;
333
630
  target: ActivityId;
334
631
  type: LinkType;
632
+ /** Lag in working days; dispatch converts it to stored working hours. */
335
633
  lag?: number;
336
634
  linkId?: LinkId;
337
635
  } | {
338
- kind: 'update';
636
+ kind: typeof DISPATCH_LINK_OPERATION_KIND.UPDATE;
339
637
  linkId: LinkId;
340
638
  type?: LinkType;
639
+ /** Replacement lag in working days; dispatch converts it to stored hours. */
341
640
  lag?: number;
342
641
  } | {
343
- kind: 'delete';
642
+ kind: typeof DISPATCH_LINK_OPERATION_KIND.DELETE;
344
643
  linkId: LinkId;
345
644
  };
645
+ /** Backend identity used to acknowledge an entity as persisted. */
346
646
  interface PersistedEntityIdentity {
347
647
  readonly id: string;
348
648
  readonly proplannerId: number;
349
649
  }
650
+ /**
651
+ * Defensive schedule snapshot captured for consumer-owned persistence.
652
+ *
653
+ * The package does not write this data; acknowledge the exact checkpoint only
654
+ * after external storage succeeds.
655
+ */
350
656
  interface PersistenceCheckpoint {
351
657
  readonly activities: ReadonlyArray<Readonly<CoreActivity>>;
352
658
  readonly links: ReadonlyArray<Readonly<Link>>;
353
659
  readonly historyBoundary: number;
354
660
  }
355
- type ActivityBatchMode = 'append' | 'replace';
661
+ /** Available activity-batch replacement policies. */
662
+ declare const ACTIVITY_BATCH_MODE: {
663
+ readonly APPEND: "append";
664
+ readonly REPLACE: "replace";
665
+ };
666
+ /** Activity-batch append or replace policy. */
667
+ type ActivityBatchMode = (typeof ACTIVITY_BATCH_MODE)[keyof typeof ACTIVITY_BATCH_MODE];
668
+ /** Existing activity ID or local batch-item reference. */
356
669
  type ActivityBatchReference = ActivityId | {
357
670
  readonly batchId: string;
358
671
  };
359
- type ActivityBatchParentReference = '0' | ActivityBatchReference;
672
+ /** Root, existing activity, or local batch-item parent reference. */
673
+ type ActivityBatchParentReference = typeof ROOT_PARENT_ID | ActivityBatchReference;
674
+ /** One activity to create during a low-level activity batch. */
360
675
  interface ActivityBatchItem {
361
676
  readonly batchId: string;
362
677
  readonly parent: ActivityBatchParentReference;
@@ -364,61 +679,71 @@ interface ActivityBatchItem {
364
679
  readonly activityId?: ActivityId;
365
680
  readonly overrides?: ActivityCreationOverrides;
366
681
  }
367
- interface ActivityBatchLinkInput {
682
+ /** One dependency to create between activity-batch references. */
683
+ interface ActivityBatchLinkInput$1 {
368
684
  readonly source: ActivityBatchReference;
369
685
  readonly target: ActivityBatchReference;
370
686
  readonly type: LinkType;
371
- readonly lag: number;
687
+ /** Lag in working days; omitted lag defaults to zero. */
688
+ readonly lag?: number;
372
689
  readonly linkId?: LinkId;
373
690
  }
691
+ /** Low-level activity creation batch handled separately from {@link DispatchAction}. */
374
692
  interface ActivityBatchAction {
375
- readonly kind: 'activity-batch';
693
+ readonly kind: typeof ACTIVITY_BATCH_ACTION_KIND;
376
694
  readonly mode: ActivityBatchMode;
377
695
  readonly items: ReadonlyArray<ActivityBatchItem>;
378
- readonly links: ReadonlyArray<ActivityBatchLinkInput>;
696
+ readonly links: ReadonlyArray<ActivityBatchLinkInput$1>;
379
697
  readonly eventSource?: string;
380
698
  }
381
-
699
+ /**
700
+ * Complete union of public commands accepted by {@link ScheduleCore.dispatch}.
701
+ *
702
+ * Link `lag` inputs are working days and are converted to stored working hours.
703
+ * Consumer analytics context is carried by optional `eventSource` fields.
704
+ */
382
705
  type DispatchAction = {
383
- kind: 'activity-copy';
706
+ kind: typeof DISPATCH_ACTION_KIND.ACTIVITY_COPY;
384
707
  eventSource?: string;
385
708
  } | {
386
- kind: 'activity-clipboard-clear';
709
+ kind: typeof DISPATCH_ACTION_KIND.CALENDAR_RECONCILE;
710
+ } | {
711
+ kind: typeof DISPATCH_ACTION_KIND.ACTIVITY_CLIPBOARD_CLEAR;
387
712
  eventSource?: string;
388
713
  } | {
389
- kind: 'activity-paste-copied';
714
+ kind: typeof DISPATCH_ACTION_KIND.ACTIVITY_PASTE_COPIED;
390
715
  destination: {
391
716
  afterSiblingId: ActivityId;
392
717
  };
393
718
  eventSource?: string;
394
719
  } | {
395
- kind: 'persistence-acknowledge';
720
+ kind: typeof DISPATCH_ACTION_KIND.PERSISTENCE_ACKNOWLEDGE;
396
721
  activities?: ReadonlyArray<PersistedEntityIdentity>;
397
722
  links?: ReadonlyArray<PersistedEntityIdentity>;
398
723
  checkpoint?: PersistenceCheckpoint;
399
724
  } | {
400
- kind: 'baseline-apply';
725
+ kind: typeof DISPATCH_ACTION_KIND.BASELINE_APPLY;
401
726
  points: ReadonlyArray<BaselinePoint>;
402
727
  } | {
403
- kind: 'ponderator-criterion-set';
728
+ kind: typeof DISPATCH_ACTION_KIND.PONDERATOR_CRITERION_SET;
404
729
  criterion: ActivityCreter;
405
730
  } | {
406
- kind: 'status-criteria-set';
731
+ kind: typeof DISPATCH_ACTION_KIND.STATUS_CRITERIA_SET;
407
732
  criteria: StatusCriteria;
408
733
  } | {
409
- kind: 'inline-edit';
734
+ kind: typeof DISPATCH_ACTION_KIND.INLINE_EDIT;
410
735
  activityId: ActivityId;
411
736
  column: EditableColumnName;
412
737
  newValue: unknown;
413
738
  } | {
414
- kind: 'dates-batch';
739
+ kind: typeof DISPATCH_ACTION_KIND.DATES_BATCH;
415
740
  edits: ReadonlyArray<{
416
741
  activityId: ActivityId;
417
- column: 'start_date' | 'end_date';
742
+ column: typeof COLUMN.START_DATE | typeof COLUMN.END_DATE;
418
743
  newValue: unknown;
419
744
  }>;
420
745
  } | {
421
- kind: 'bulk-edit';
746
+ kind: typeof DISPATCH_ACTION_KIND.BULK_EDIT;
422
747
  edits: ReadonlyArray<{
423
748
  activityId: ActivityId;
424
749
  column: PipelineColumnName;
@@ -426,88 +751,90 @@ type DispatchAction = {
426
751
  }>;
427
752
  eventSource?: string;
428
753
  } | {
429
- kind: 'link-create';
754
+ kind: typeof DISPATCH_ACTION_KIND.LINK_CREATE;
430
755
  source: ActivityId;
431
756
  target: ActivityId;
432
757
  type: LinkType;
433
- lag: number;
758
+ /** Dependency lag in working days; omitted lag defaults to zero. */
759
+ lag?: number;
434
760
  linkId?: LinkId;
435
761
  } | {
436
- kind: 'link-update';
762
+ kind: typeof DISPATCH_ACTION_KIND.LINK_UPDATE;
437
763
  linkId: LinkId;
438
764
  type?: LinkType;
765
+ /** Replacement lag in working days; dispatch converts it to stored hours. */
439
766
  lag?: number;
440
767
  } | {
441
- kind: 'link-delete';
768
+ kind: typeof DISPATCH_ACTION_KIND.LINK_DELETE;
442
769
  linkId: LinkId;
443
770
  } | {
444
- kind: 'links-batch';
771
+ kind: typeof DISPATCH_ACTION_KIND.LINKS_BATCH;
445
772
  operations: ReadonlyArray<LinksBatchOperation>;
446
773
  } | {
447
- kind: 'activity-create';
448
- parentId: ActivityId | '0';
774
+ kind: typeof DISPATCH_ACTION_KIND.ACTIVITY_CREATE;
775
+ parentId: ActivityId | typeof ROOT_PARENT_ID;
449
776
  afterSiblingId?: ActivityId | undefined;
450
777
  beforeSiblingId?: ActivityId | undefined;
451
778
  overrides?: ActivityCreationOverrides;
452
779
  activityId?: ActivityId;
453
780
  eventSource?: string | undefined;
454
781
  } | {
455
- kind: 'activity-delete';
782
+ kind: typeof DISPATCH_ACTION_KIND.ACTIVITY_DELETE;
456
783
  activityIds: ReadonlyArray<ActivityId>;
457
784
  eventSource?: string;
458
785
  } | {
459
- kind: 'activity-move';
786
+ kind: typeof DISPATCH_ACTION_KIND.ACTIVITY_MOVE;
460
787
  activityId: ActivityId;
461
- parentId: ActivityId | '0';
788
+ parentId: ActivityId | typeof ROOT_PARENT_ID;
462
789
  afterSiblingId?: ActivityId;
463
790
  beforeSiblingId?: ActivityId;
464
791
  eventSource?: string;
465
792
  } | {
466
- kind: 'activity-indent';
793
+ kind: typeof DISPATCH_ACTION_KIND.ACTIVITY_INDENT;
467
794
  activityIds: ReadonlyArray<ActivityId>;
468
795
  eventSource?: string;
469
796
  } | {
470
- kind: 'activity-outdent';
797
+ kind: typeof DISPATCH_ACTION_KIND.ACTIVITY_OUTDENT;
471
798
  activityIds: ReadonlyArray<ActivityId>;
472
799
  eventSource?: string;
473
800
  } | {
474
- kind: 'activity-set-progress';
801
+ kind: typeof DISPATCH_ACTION_KIND.ACTIVITY_SET_PROGRESS;
475
802
  activityId: ActivityId;
476
- newValue: 0 | 100;
803
+ newValue: typeof NOT_STARTED_PROGRESS | typeof COMPLETED_PROGRESS;
477
804
  origin?: 'action-button';
478
805
  eventSource?: string;
479
806
  } | {
480
- kind: 'selection-toggle';
807
+ kind: typeof DISPATCH_ACTION_KIND.SELECTION_TOGGLE;
481
808
  activityId: ActivityId;
482
809
  isChecked: boolean;
483
810
  frozenIds?: ReadonlyArray<ActivityId>;
484
811
  autoCheckParents?: boolean;
485
812
  eventSource?: string;
486
813
  } | {
487
- kind: 'selection-replace';
814
+ kind: typeof DISPATCH_ACTION_KIND.SELECTION_REPLACE;
488
815
  activityIds: ReadonlyArray<ActivityId>;
489
816
  eventSource?: string;
490
817
  } | {
491
- kind: 'visibility-set';
818
+ kind: typeof DISPATCH_ACTION_KIND.VISIBILITY_SET;
492
819
  visibleIds: ReadonlyArray<ActivityId>;
493
820
  eventSource?: string;
494
821
  } | {
495
- kind: 'filter-set';
822
+ kind: typeof DISPATCH_ACTION_KIND.FILTER_SET;
496
823
  criteria: ReadonlyArray<FilterCriterion>;
497
- logic: 'and' | 'or';
824
+ logic: FilterLogic;
498
825
  dateRange?: FilterDateRange;
499
826
  eventSource?: string;
500
827
  } | {
501
- kind: 'sort-set';
828
+ kind: typeof DISPATCH_ACTION_KIND.SORT_SET;
502
829
  rules: ReadonlyArray<OrderRule>;
503
830
  eventSource?: string;
504
831
  } | {
505
- kind: 'sir-sync';
832
+ kind: typeof DISPATCH_ACTION_KIND.SIR_SYNC;
506
833
  activityId: ActivityId;
507
834
  pendingRequests: ReadonlyArray<PendingRequest>;
508
835
  eventSource?: string;
509
836
  } | {
510
- kind: 'activity-lookahead-sync';
837
+ kind: typeof DISPATCH_ACTION_KIND.ACTIVITY_LOOKAHEAD_SYNC;
511
838
  activityIds: ReadonlyArray<ActivityId>;
512
839
  isLookahead: boolean;
513
840
  hasLookaheadTasks: boolean;
@@ -515,14 +842,28 @@ type DispatchAction = {
515
842
  acknowledgePersistedLookahead?: boolean;
516
843
  eventSource?: string;
517
844
  };
845
+ /**
846
+ * Supported creation fields with duration expressed in working days.
847
+ *
848
+ * Omitted fields retain core-owned creation defaults.
849
+ */
518
850
  type ActivityCreationOverrides = Omit<CreationOverrides, 'durationHours'> & {
519
851
  readonly durationDays?: number;
520
852
  };
521
853
  type InternalDispatchAction = DispatchAction | ActivityBatchAction;
854
+ /** Per-operation derived-work controls; both default to `false`. */
522
855
  interface DispatchOptions {
856
+ /** Skips autoscheduling for this operation when `true`. */
523
857
  skipAutoSchedule?: boolean;
858
+ /** Skips critical-path work for this operation when `true`. */
524
859
  skipCriticalPath?: boolean;
525
860
  }
861
+ /**
862
+ * Complete accepted or rejected command result returned unchanged by public APIs.
863
+ *
864
+ * Accepted results always include the consumer projection {@link ChangeSet} and
865
+ * may include per-item verdicts. Rejected results leave state unchanged.
866
+ */
526
867
  type DispatchResult = {
527
868
  ok: true;
528
869
  changes: ChangeSet;
@@ -534,6 +875,7 @@ type DispatchResult = {
534
875
  reason: string;
535
876
  alertKey?: string | undefined;
536
877
  };
878
+ /** Per-activity acceptance result for a dates batch. */
537
879
  type DatesBatchVerdict = {
538
880
  activityId: string;
539
881
  ok: true;
@@ -543,6 +885,7 @@ type DatesBatchVerdict = {
543
885
  reason: string;
544
886
  alertKey?: string | undefined;
545
887
  };
888
+ /** Per-operation acceptance result for a dependency batch. */
546
889
  type LinkBatchVerdict = {
547
890
  operationIndex: number;
548
891
  kind: LinksBatchOperation['kind'];
@@ -555,117 +898,815 @@ type LinkBatchVerdict = {
555
898
  reason: string;
556
899
  };
557
900
 
901
+ /** Consumer-owned analytics event emitted by an accepted command. */
558
902
  interface TrackingEvent {
559
903
  name: string;
560
904
  properties: Record<string, unknown>;
561
905
  }
906
+ /** Integration effects that consumers must handle outside the core. */
907
+ declare const SCHEDULE_EFFECT_KIND: {
908
+ readonly SIR_AUTO_REJECT: "sir-auto-reject";
909
+ };
910
+ /** Reasons a schedule mutation automatically rejects an impact request. */
911
+ declare const SIR_AUTO_REJECT_REASON: {
912
+ readonly DATE_CHANGED: "date_changed";
913
+ readonly ACTIVITY_DELETED: "activity_deleted";
914
+ };
915
+ /** Consumer integration effect included in a change set. */
562
916
  type ScheduleEffect = {
563
- kind: 'sir-auto-reject';
917
+ kind: typeof SCHEDULE_EFFECT_KIND.SIR_AUTO_REJECT;
564
918
  activityId: ActivityId;
565
919
  sirId: string;
566
- reason: 'date_changed' | 'activity_deleted';
920
+ reason: (typeof SIR_AUTO_REJECT_REASON)[keyof typeof SIR_AUTO_REJECT_REASON];
921
+ };
922
+ /** Non-fatal schedule warning kinds. */
923
+ declare const CONSTRAINT_WARNING_KIND: {
924
+ readonly VIOLATION: "constraint_violation";
567
925
  };
926
+ /** Non-fatal constraint violation produced by projected scheduling dates. */
568
927
  interface ConstraintWarning {
569
- kind: 'constraint_violation';
928
+ kind: typeof CONSTRAINT_WARNING_KIND.VIOLATION;
570
929
  activityId: ActivityId;
571
930
  constraintType: ConstraintType;
572
931
  constraintDate: Date;
573
932
  projectedDate: Date;
574
933
  messageKey: string;
575
934
  }
935
+ /** Boolean value before and after a view-state mutation. */
576
936
  interface ViewStatePropChange {
577
937
  readonly before: boolean;
578
938
  readonly after: boolean;
579
939
  }
940
+ /** Selection and/or visibility projection change for one activity. */
580
941
  interface ViewStateChange {
581
942
  readonly activityId: ActivityId;
582
943
  readonly checked?: ViewStatePropChange;
583
944
  readonly visible?: ViewStatePropChange;
584
945
  }
946
+ /** Lifecycle sources used when no public dispatch command initiated a change set. */
947
+ declare const CHANGE_SET_SOURCE_KIND: {
948
+ readonly INIT: "init";
949
+ readonly UNDO: "undo";
950
+ readonly REDO: "redo";
951
+ };
952
+ /** Public command, activity batch, or lifecycle operation that produced changes. */
585
953
  type ChangeSetSource = InternalDispatchAction | {
586
- kind: 'init';
587
- } | {
588
- kind: 'undo';
589
- } | {
590
- kind: 'redo';
954
+ kind: (typeof CHANGE_SET_SOURCE_KIND)[keyof typeof CHANGE_SET_SOURCE_KIND];
591
955
  };
956
+ /**
957
+ * Complete ordered projection payload produced by an accepted operation.
958
+ *
959
+ * Consumers apply every populated collection in result order. Applying a change
960
+ * set updates external projection only; persistence remains consumer-owned.
961
+ */
592
962
  interface ChangeSet {
963
+ /** Command or lifecycle operation that produced the payload. */
593
964
  source: ChangeSetSource;
965
+ /** Activity create, update, and delete records. */
594
966
  activities: ReadonlyArray<EntityChange<CoreActivity>>;
967
+ /** Link create, update, and delete records; lag fields use stored hours. */
595
968
  links: ReadonlyArray<EntityChange<Link>>;
969
+ /** Calendar create, update, and delete records. */
596
970
  calendars: ReadonlyArray<EntityChange<Calendar>>;
971
+ /** Consumer-owned analytics events. */
597
972
  trackingEvents: ReadonlyArray<TrackingEvent>;
973
+ /** Optional checked/visible projection updates. */
598
974
  viewState?: ReadonlyArray<ViewStateChange>;
975
+ /** Optional visual child order grouped by parent. */
599
976
  order?: ReadonlyArray<BranchOrderChange>;
977
+ /** Optional integration effects for consumer handling. */
600
978
  effects?: ReadonlyArray<ScheduleEffect>;
979
+ /** Optional non-fatal warnings for consumer presentation. */
601
980
  warnings?: ReadonlyArray<ConstraintWarning>;
602
981
  }
603
982
 
983
+ /** Earliest start and latest end from the default calendar's work ranges. */
604
984
  interface ProjectWorkHours {
605
985
  startHour: string;
606
986
  endHour: string;
607
987
  }
608
988
 
609
- declare const ACTIVITY_SAVE_FIELD_POLICY: {
610
- readonly id: "ignored";
611
- readonly proplannerId: "ignored";
612
- readonly parentId: "tracked";
613
- readonly name: "tracked";
614
- readonly description: "tracked";
615
- readonly type: "tracked";
616
- readonly startDate: "tracked";
617
- readonly endDate: "tracked";
618
- readonly durationHours: "tracked";
619
- readonly constraintType: "tracked";
620
- readonly constraintDate: "tracked";
621
- readonly autoScheduling: "tracked";
622
- readonly calendarId: "tracked";
623
- readonly assignedDefaultCalendar: "ignored";
624
- readonly dateOrigin: "tracked";
625
- readonly progress: "tracked";
626
- readonly cost: "tracked";
627
- readonly usedCost: "tracked";
628
- readonly realCost: "tracked";
629
- readonly workHours: "tracked";
630
- readonly realWorkHours: "tracked";
631
- readonly ponderator: "tracked";
632
- readonly hasCustomPonderator: "tracked";
633
- readonly correlativeId: "tracked";
634
- readonly uniqueCorrelativeId: "tracked";
635
- readonly customId: "tracked";
636
- readonly subcontractId: "tracked";
637
- readonly isLookahead: "tracked";
638
- readonly hasLookaheadTasks: "ignored";
639
- readonly newActivityIds: "tracked";
640
- readonly hasNewActivities: "tracked";
641
- readonly isNewActivity: "ignored";
642
- readonly pendingRequestIds: "ignored";
643
- readonly responsableIds: "tracked";
644
- readonly tagIds: "tracked";
645
- readonly baselinePoints: "ignored";
646
- readonly baselineSnapshot: "ignored";
647
- readonly recursiveDurationHours: "ignored";
648
- readonly isCritical: "ignored";
649
- readonly freeSlackHours: "ignored";
650
- readonly calendarDuration: "ignored";
651
- readonly expectedProgress: "ignored";
652
- readonly expectedProgressBaseline: "ignored";
653
- readonly status: "ignored";
654
- readonly criticalPath: "ignored";
989
+ /** Move and resize gestures supported by date prediction. */
990
+ declare const DATE_GESTURE_KIND: {
991
+ readonly MOVE: "move";
992
+ readonly RESIZE_START: "resize-start";
993
+ readonly RESIZE_END: "resize-end";
655
994
  };
656
- type PersistableActivityField = {
657
- [Field in keyof typeof ACTIVITY_SAVE_FIELD_POLICY]: (typeof ACTIVITY_SAVE_FIELD_POLICY)[Field] extends 'tracked' ? Field : never;
658
- }[keyof typeof ACTIVITY_SAVE_FIELD_POLICY];
995
+ /** Move or edge-resize date gesture kind. */
996
+ type DateGestureKind = (typeof DATE_GESTURE_KIND)[keyof typeof DATE_GESTURE_KIND];
997
+ /**
998
+ * Revision-bound move or resize request used to build a date preview.
999
+ *
1000
+ * Move gestures require a non-empty participant list containing the anchor.
1001
+ */
1002
+ type DateGesture = {
1003
+ readonly kind: typeof DATE_GESTURE_KIND.MOVE;
1004
+ readonly activityIds: readonly ActivityId[];
1005
+ readonly anchorActivityId: ActivityId;
1006
+ } | {
1007
+ readonly kind: typeof DATE_GESTURE_KIND.RESIZE_START | typeof DATE_GESTURE_KIND.RESIZE_END;
1008
+ readonly activityId: ActivityId;
1009
+ };
1010
+ /** Read-only date prediction captured for one schedule revision. */
1011
+ interface DateGesturePreview {
1012
+ /**
1013
+ * Predicts one participant or affected ancestor's dates.
1014
+ *
1015
+ * @param activityId - Participant or ancestor activity ID.
1016
+ * @param proposedEdgeTimeMs - Proposed moved/resized edge as Unix milliseconds.
1017
+ * @returns Predicted start/end Unix milliseconds, or `null` when unaffected.
1018
+ * @throws When the time is invalid, bounds are incomplete, or the preview is stale.
1019
+ */
1020
+ getDates(activityId: ActivityId, proposedEdgeTimeMs: number): {
1021
+ startTimeMs: number;
1022
+ endTimeMs: number;
1023
+ } | null;
1024
+ }
1025
+
1026
+ /** Canonical fields accepted by typed activity-edit APIs. */
1027
+ declare const ACTIVITY_FIELD: {
1028
+ readonly NAME: "name";
1029
+ readonly DESCRIPTION: "description";
1030
+ readonly DURATION_DAYS: "durationDays";
1031
+ readonly PROGRESS: "progress";
1032
+ readonly COST: "cost";
1033
+ readonly USED_COST: "usedCost";
1034
+ readonly WORK_HOURS: "workHours";
1035
+ readonly START_DATE: "startDate";
1036
+ readonly END_DATE: "endDate";
1037
+ readonly CONSTRAINT_TYPE: "constraintType";
1038
+ readonly CONSTRAINT_DATE: "constraintDate";
1039
+ readonly CALENDAR_ID: "calendarId";
1040
+ readonly CUSTOM_ID: "customId";
1041
+ readonly SUBCONTRACT_ID: "subcontractId";
1042
+ readonly RESPONSABLE_IDS: "responsableIds";
1043
+ readonly TAG_IDS: "tagIds";
1044
+ };
1045
+ /** Value type associated with each canonical activity-edit field. */
1046
+ interface ActivityFieldValue {
1047
+ readonly name: string;
1048
+ readonly description: string;
1049
+ /** Duration in working days. */
1050
+ readonly durationDays: number;
1051
+ readonly progress: number;
1052
+ readonly cost: number;
1053
+ readonly usedCost: number;
1054
+ readonly workHours: number;
1055
+ readonly startDate: Date;
1056
+ readonly endDate: Date;
1057
+ /** Constraint type, or `null` to remove the constraint. */
1058
+ readonly constraintType: ConstraintType | null;
1059
+ /** Constraint date, or `null` to clear it. */
1060
+ readonly constraintDate: Date | null;
1061
+ /** Calendar ID, or `null` to use default resolution. */
1062
+ readonly calendarId: CalendarId | null;
1063
+ /** Consumer custom ID, or `null` to clear it. */
1064
+ readonly customId: string | null;
1065
+ /** Subcontract identifier, or `null` to clear it. */
1066
+ readonly subcontractId: number | null;
1067
+ readonly responsableIds: readonly string[];
1068
+ readonly tagIds: readonly string[];
1069
+ }
1070
+ /** Canonical activity field accepted by typed edits. */
1071
+ type ActivityField = (typeof ACTIVITY_FIELD)[keyof typeof ACTIVITY_FIELD];
1072
+ /** Discriminated field/value edit that preserves value type by field. */
1073
+ type ActivityFieldEdit = {
1074
+ readonly [Field in ActivityField]: {
1075
+ readonly field: Field;
1076
+ readonly value: ActivityFieldValue[Field];
1077
+ };
1078
+ }[ActivityField];
1079
+ /** Typed field edit paired with its target activity. */
1080
+ type ActivityBulkEdit = ActivityFieldEdit & {
1081
+ readonly activityId: ActivityId;
1082
+ };
1083
+ /** Activity edges accepted by date-gesture and drag APIs. */
1084
+ declare const ACTIVITY_DATE_EDGE: {
1085
+ readonly START: "start";
1086
+ readonly END: "end";
1087
+ };
1088
+ /** Start or end edge of an activity date range. */
1089
+ type ActivityDateEdge = (typeof ACTIVITY_DATE_EDGE)[keyof typeof ACTIVITY_DATE_EDGE];
1090
+ /** One activity edge and proposed date in a drag batch. */
1091
+ interface ActivityDateEdit {
1092
+ readonly activityId: ActivityId;
1093
+ readonly edge: ActivityDateEdge;
1094
+ readonly value: Date;
1095
+ }
1096
+ /** Optional consumer context copied into tracking metadata. */
1097
+ interface MutationContext {
1098
+ readonly eventSource?: string;
1099
+ }
1100
+ /** Ergonomic input for creating one activity. */
1101
+ interface ActivityCreateInput extends MutationContext {
1102
+ readonly parentId: ActivityId | typeof ROOT_PARENT_ID;
1103
+ readonly afterSiblingId?: ActivityId;
1104
+ readonly beforeSiblingId?: ActivityId;
1105
+ readonly overrides?: ActivityCreationOverrides;
1106
+ readonly activityId?: ActivityId;
1107
+ }
1108
+ /** Ergonomic input for moving one activity in the hierarchy. */
1109
+ interface ActivityMoveInput extends MutationContext {
1110
+ readonly activityId: ActivityId;
1111
+ readonly parentId: ActivityId | typeof ROOT_PARENT_ID;
1112
+ readonly afterSiblingId?: ActivityId;
1113
+ readonly beforeSiblingId?: ActivityId;
1114
+ }
1115
+ /** One activity item in an ergonomic creation batch. */
1116
+ interface ActivityBatchItemInput {
1117
+ readonly batchId: string;
1118
+ readonly parent: ActivityBatchParentReference;
1119
+ readonly index?: number;
1120
+ readonly activityId?: ActivityId;
1121
+ readonly overrides?: ActivityCreationOverrides;
1122
+ }
1123
+ /** One named dependency in an ergonomic activity batch. */
1124
+ interface ActivityBatchLinkInput {
1125
+ readonly source: ActivityBatchReference;
1126
+ readonly target: ActivityBatchReference;
1127
+ readonly relationship: LinkRelationship;
1128
+ /** Dependency lag in working days; omitted lag defaults to zero. */
1129
+ readonly lagDays?: number;
1130
+ readonly linkId?: LinkId;
1131
+ }
1132
+ /** Ergonomic append/replace activity and dependency batch. */
1133
+ interface ActivityBatchInput extends MutationContext {
1134
+ readonly mode: ActivityBatchMode;
1135
+ readonly items: ReadonlyArray<ActivityBatchItemInput>;
1136
+ readonly links: ReadonlyArray<ActivityBatchLinkInput>;
1137
+ }
1138
+ /** Consumer lookahead state synchronized into core-owned activity state. */
1139
+ interface ActivityLookaheadSyncInput extends MutationContext {
1140
+ readonly activityIds: ReadonlyArray<ActivityId>;
1141
+ readonly isLookahead: boolean;
1142
+ readonly hasLookaheadTasks: boolean;
1143
+ /**
1144
+ * Externally persisted progress. When supplied with acknowledgement enabled,
1145
+ * a successful synchronization clears all undo and redo history.
1146
+ */
1147
+ readonly persistedProgress?: number;
1148
+ /**
1149
+ * Acknowledges lookahead persistence. Combined with `persistedProgress`, a
1150
+ * successful synchronization clears all undo and redo history.
1151
+ */
1152
+ readonly acknowledgePersistedLookahead?: boolean;
1153
+ }
1154
+ /** Named dependency relationships accepted by the façade. */
1155
+ declare const LINK_RELATIONSHIP: {
1156
+ readonly FINISH_TO_START: "finish-to-start";
1157
+ readonly START_TO_START: "start-to-start";
1158
+ readonly FINISH_TO_FINISH: "finish-to-finish";
1159
+ readonly START_TO_FINISH: "start-to-finish";
1160
+ };
1161
+ /** Named dependency relationship accepted by the façade. */
1162
+ type LinkRelationship = (typeof LINK_RELATIONSHIP)[keyof typeof LINK_RELATIONSHIP];
1163
+ /** Ergonomic dependency creation request. */
1164
+ interface LinkCreateRequest {
1165
+ readonly sourceId: ActivityId;
1166
+ readonly targetId: ActivityId;
1167
+ readonly relationship: LinkRelationship;
1168
+ /** Dependency lag in working days; omitted lag defaults to zero. */
1169
+ readonly lagDays?: number;
1170
+ readonly linkId?: LinkId;
1171
+ }
1172
+ /** Optional dependency fields to replace. */
1173
+ interface LinkPatchRequest {
1174
+ readonly relationship?: LinkRelationship;
1175
+ /** Replacement lag in working days. */
1176
+ readonly lagDays?: number;
1177
+ }
1178
+ /** Dependency operations accepted by the ergonomic batch façade. */
1179
+ declare const LINK_BATCH_OPERATION_KIND: {
1180
+ readonly CREATE: "create";
1181
+ readonly UPDATE: "update";
1182
+ readonly REMOVE: "remove";
1183
+ };
1184
+ /** Dependency operation kind accepted by the ergonomic batch façade. */
1185
+ type LinkBatchOperationKind = (typeof LINK_BATCH_OPERATION_KIND)[keyof typeof LINK_BATCH_OPERATION_KIND];
1186
+ /** Ergonomic dependency create, update, or remove request. */
1187
+ type LinkBatchRequest = ({
1188
+ readonly kind: typeof LINK_BATCH_OPERATION_KIND.CREATE;
1189
+ } & LinkCreateRequest) | {
1190
+ readonly kind: typeof LINK_BATCH_OPERATION_KIND.UPDATE;
1191
+ readonly linkId: LinkId;
1192
+ readonly relationship?: LinkRelationship;
1193
+ readonly lagDays?: number;
1194
+ } | {
1195
+ readonly kind: typeof LINK_BATCH_OPERATION_KIND.REMOVE;
1196
+ readonly linkId: LinkId;
1197
+ };
1198
+ /** Input for toggling one activity's checked state. */
1199
+ interface SelectionToggleInput extends MutationContext {
1200
+ readonly activityId: ActivityId;
1201
+ readonly checked: boolean;
1202
+ readonly frozenIds?: ReadonlyArray<ActivityId>;
1203
+ readonly autoCheckParents?: boolean;
1204
+ }
1205
+ /** Input for replacing the active filter projection. */
1206
+ interface ViewFilterInput extends MutationContext {
1207
+ readonly criteria: ReadonlyArray<FilterCriterion>;
1208
+ readonly logic: FilterLogic;
1209
+ readonly dateRange?: FilterDateRange;
1210
+ }
1211
+ /** Input for replacing an activity's pending impact requests. */
1212
+ interface ImpactRequestSyncInput extends MutationContext {
1213
+ readonly activityId: ActivityId;
1214
+ readonly pendingRequests: ReadonlyArray<PendingRequest>;
1215
+ }
1216
+
1217
+ /** Activity reads and canonical activity mutations for a ready schedule. */
1218
+ interface ScheduleActivitiesApi {
1219
+ /**
1220
+ * Reads a defensive activity snapshot.
1221
+ *
1222
+ * @param id - Canonical activity ID.
1223
+ * @returns The activity, or `null` when the ID is absent.
1224
+ */
1225
+ get(id: ActivityId): Readonly<CoreActivity> | null;
1226
+ /** @returns Defensive snapshots of every current activity. */
1227
+ list(): ReadonlyArray<Readonly<CoreActivity>>;
1228
+ /** @returns A read-only snapshot of all current activity IDs. */
1229
+ ids(): readonly string[];
1230
+ /**
1231
+ * Visits each current activity ID without exposing mutable state.
1232
+ *
1233
+ * @param visit - Callback invoked once per current ID.
1234
+ */
1235
+ forEachId(visit: (id: string) => void): void;
1236
+ /**
1237
+ * Reads one cloned activity property.
1238
+ *
1239
+ * @param id - Canonical activity ID.
1240
+ * @param property - Property to read.
1241
+ * @returns The cloned value, or `null` when the activity is absent.
1242
+ */
1243
+ property<Property extends keyof CoreActivity>(id: ActivityId, property: Property): CoreActivity[Property] | null;
1244
+ /**
1245
+ * Reads direct children in correlative order.
1246
+ *
1247
+ * @param parentId - Parent activity ID, or the root ID.
1248
+ * @returns Defensive child snapshots.
1249
+ */
1250
+ children(parentId: ActivityId | typeof ROOT_PARENT_ID): ReadonlyArray<Readonly<CoreActivity>>;
1251
+ /**
1252
+ * Reads direct child IDs in visual order.
1253
+ *
1254
+ * @param parentId - Parent activity ID, or the root ID.
1255
+ */
1256
+ childIds(parentId: ActivityId | typeof ROOT_PARENT_ID): ReadonlyArray<ActivityId>;
1257
+ /** @returns Whether the parent currently has at least one direct child. */
1258
+ hasChildren(parentId: ActivityId | typeof ROOT_PARENT_ID): boolean;
1259
+ /**
1260
+ * Computes the parent IDs available to an indent operation.
1261
+ *
1262
+ * @param ids - Activities being considered for indentation.
1263
+ */
1264
+ indentTargetParentIds(ids: ReadonlyArray<ActivityId | string>): readonly string[];
1265
+ /**
1266
+ * Checks custom-ID uniqueness while optionally excluding the current value.
1267
+ *
1268
+ * @param customId - Candidate custom ID.
1269
+ * @param currentCustomId - Existing value to ignore, or `null`.
1270
+ */
1271
+ isCustomIdInUse(customId: string, currentCustomId?: string | null): boolean;
1272
+ /**
1273
+ * Creates one activity through the canonical dispatch pipeline.
1274
+ *
1275
+ * Creation durations use working days; accepted commands mutate core state.
1276
+ * @param input - Parent, placement, optional ID, and creation overrides.
1277
+ * @param options - Per-operation autoschedule and critical-path controls.
1278
+ * @returns The complete dispatch result, including changes and metadata.
1279
+ */
1280
+ create(input: ActivityCreateInput, options?: DispatchOptions): Promise<DispatchResult>;
1281
+ /**
1282
+ * Creates a related activity/link batch atomically through the batch pipeline.
1283
+ *
1284
+ * Durations and link lags at this façade are working days.
1285
+ * @param input - Append/replace batch with local or existing references.
1286
+ * @param options - Per-operation autoschedule and critical-path controls.
1287
+ * @returns The complete dispatch result.
1288
+ */
1289
+ applyBatch(input: ActivityBatchInput, options?: DispatchOptions): Promise<DispatchResult>;
1290
+ /**
1291
+ * Applies one inline field edit through the canonical dispatch pipeline.
1292
+ *
1293
+ * @param activityId - Canonical activity ID.
1294
+ * @param edit - A field/value pair derived from {@link ACTIVITY_FIELD}.
1295
+ * @param options - Per-operation autoschedule and critical-path controls.
1296
+ * @returns The complete dispatch result, including changes and verdict metadata.
1297
+ */
1298
+ editInline(activityId: ActivityId, edit: ActivityFieldEdit, options?: DispatchOptions): Promise<DispatchResult>;
1299
+ /**
1300
+ * Applies start/end drag edits as one dates-batch command.
1301
+ *
1302
+ * Accepted edits mutate schedule dates and may trigger derived scheduling.
1303
+ * @param edits - Activity edges and proposed `Date` values.
1304
+ * @param options - Per-operation autoschedule and critical-path controls.
1305
+ * @returns The complete dispatch result with per-activity verdicts when present.
1306
+ */
1307
+ applyDragBatch(edits: ReadonlyArray<ActivityDateEdit>, options?: DispatchOptions): Promise<DispatchResult>;
1308
+ /**
1309
+ * Applies typed field edits as one bulk command.
1310
+ *
1311
+ * Duration values are working days at this boundary.
1312
+ * @param edits - Activity IDs paired with typed field edits.
1313
+ * @param options - Per-operation autoschedule and critical-path controls.
1314
+ * @returns The complete dispatch result.
1315
+ */
1316
+ editFields(edits: ReadonlyArray<ActivityBulkEdit>, options?: DispatchOptions): Promise<DispatchResult>;
1317
+ /**
1318
+ * Deletes activities through the canonical dispatch pipeline.
1319
+ *
1320
+ * @param activityIds - IDs to delete.
1321
+ * @param context - Optional consumer event source.
1322
+ * @returns The complete dispatch result.
1323
+ */
1324
+ remove(activityIds: ReadonlyArray<ActivityId>, context?: MutationContext): Promise<DispatchResult>;
1325
+ /**
1326
+ * Moves an activity within the hierarchy.
1327
+ *
1328
+ * @param input - Activity, destination parent, and optional sibling anchor.
1329
+ * @param options - Per-operation autoschedule and critical-path controls.
1330
+ * @returns The complete dispatch result.
1331
+ */
1332
+ move(input: ActivityMoveInput, options?: DispatchOptions): Promise<DispatchResult>;
1333
+ /**
1334
+ * Indents activities beneath the nearest eligible sibling.
1335
+ *
1336
+ * @param activityIds - IDs to indent.
1337
+ * @param context - Optional consumer event source.
1338
+ * @returns The complete dispatch result.
1339
+ */
1340
+ indent(activityIds: ReadonlyArray<ActivityId>, context?: MutationContext): Promise<DispatchResult>;
1341
+ /**
1342
+ * Outdents activities one hierarchy level.
1343
+ *
1344
+ * @param activityIds - IDs to outdent.
1345
+ * @param context - Optional consumer event source.
1346
+ * @returns The complete dispatch result.
1347
+ */
1348
+ outdent(activityIds: ReadonlyArray<ActivityId>, context?: MutationContext): Promise<DispatchResult>;
1349
+ /**
1350
+ * Sets an activity to the public not-started or completed progress sentinel.
1351
+ *
1352
+ * @param activityId - Activity to update.
1353
+ * @param progress - Either {@link NOT_STARTED_PROGRESS} or
1354
+ * {@link COMPLETED_PROGRESS}.
1355
+ * @param context - Optional consumer event source.
1356
+ * @returns The complete dispatch result.
1357
+ */
1358
+ setProgress(activityId: ActivityId, progress: typeof COMPLETED_PROGRESS | typeof NOT_STARTED_PROGRESS, context?: MutationContext): Promise<DispatchResult>;
1359
+ /** @returns The complete result of copying the current selection to core-owned clipboard state. */
1360
+ copy(context?: MutationContext): Promise<DispatchResult>;
1361
+ /**
1362
+ * Pastes copied activities after a sibling.
1363
+ *
1364
+ * @param afterSiblingId - Placement anchor.
1365
+ * @param context - Optional consumer event source.
1366
+ * @returns The complete dispatch result.
1367
+ */
1368
+ paste(afterSiblingId: ActivityId, context?: MutationContext): Promise<DispatchResult>;
1369
+ /** @returns The complete result of clearing core-owned clipboard state. */
1370
+ clearClipboard(context?: MutationContext): Promise<DispatchResult>;
1371
+ /**
1372
+ * Synchronizes consumer-owned lookahead metadata into core state.
1373
+ *
1374
+ * Persisted-progress acknowledgement changes persistence tracking when
1375
+ * requested. When `acknowledgePersistedLookahead` is `true` and
1376
+ * `persistedProgress` is supplied, a successful command clears all undo and
1377
+ * redo history.
1378
+ * @param input - Lookahead flags, IDs, and optional persisted progress.
1379
+ * @returns The complete dispatch result.
1380
+ */
1381
+ lookaheadSync(input: ActivityLookaheadSyncInput): Promise<DispatchResult>;
1382
+ /**
1383
+ * Creates a read-only date prediction bound to the current schedule revision.
1384
+ *
1385
+ * @param gesture - Move or resize gesture to preview.
1386
+ * @returns A preview that throws after the schedule revision changes.
1387
+ */
1388
+ createDateGesturePreview(gesture: DateGesture): DateGesturePreview;
1389
+ }
1390
+ /** Dependency-link reads and mutations for a ready schedule. */
1391
+ interface ScheduleLinksApi {
1392
+ /** @returns A defensive link snapshot, or `null` when the ID is absent. */
1393
+ get(id: LinkId): Readonly<Link> | null;
1394
+ /** @returns Defensive snapshots of every current link. */
1395
+ list(): ReadonlyArray<Readonly<Link>>;
1396
+ /** @returns Unique incoming and outgoing links for the activity. */
1397
+ forActivity(activityId: ActivityId): ReadonlyArray<Readonly<Link>>;
1398
+ /**
1399
+ * Creates a dependency through the canonical dispatch pipeline.
1400
+ *
1401
+ * @param input - Endpoints, named relationship, and lag in working days.
1402
+ * @param options - Per-operation autoschedule and critical-path controls.
1403
+ * @returns The complete dispatch result.
1404
+ */
1405
+ create(input: LinkCreateRequest, options?: DispatchOptions): Promise<DispatchResult>;
1406
+ /**
1407
+ * Updates a dependency relationship and/or lag.
1408
+ *
1409
+ * @param linkId - Link to update.
1410
+ * @param patch - Optional relationship and lag in working days.
1411
+ * @param options - Per-operation autoschedule and critical-path controls.
1412
+ * @returns The complete dispatch result.
1413
+ */
1414
+ update(linkId: LinkId, patch: LinkPatchRequest, options?: DispatchOptions): Promise<DispatchResult>;
1415
+ /** @returns The complete result of deleting the identified link. */
1416
+ remove(linkId: LinkId, options?: DispatchOptions): Promise<DispatchResult>;
1417
+ /**
1418
+ * Applies dependency operations as one command.
1419
+ *
1420
+ * Link lag inputs are working days; stored link snapshots expose hours.
1421
+ * @param operations - Ordered create, update, or remove requests.
1422
+ * @param options - Per-operation autoschedule and critical-path controls.
1423
+ * @returns The complete result with per-operation verdicts when present.
1424
+ */
1425
+ batch(operations: ReadonlyArray<LinkBatchRequest>, options?: DispatchOptions): Promise<DispatchResult>;
1426
+ }
1427
+ /** Calendar snapshots, project hours, and reconciliation. */
1428
+ interface ScheduleCalendarsApi {
1429
+ /** @returns A defensive calendar snapshot, or `null` when absent. */
1430
+ get(id: CalendarId): Readonly<Calendar> | null;
1431
+ /** @returns Defensive snapshots of schedule calendars. */
1432
+ list(): ReadonlyArray<Readonly<Calendar>>;
1433
+ /** @returns Defensive snapshots of base calendars. */
1434
+ listBase(): ReadonlyArray<Readonly<Calendar>>;
1435
+ /** @returns The default calendar's earliest start/latest end, or `null`. */
1436
+ projectWorkHours(): ProjectWorkHours | null;
1437
+ /**
1438
+ * Reconciles activities against the current calendars.
1439
+ *
1440
+ * @param options - Per-operation autoschedule and critical-path controls.
1441
+ * @returns The complete dispatch result.
1442
+ */
1443
+ reconcile(options?: DispatchOptions): Promise<DispatchResult>;
1444
+ }
1445
+ /** Core-owned activity selection state. */
1446
+ interface ScheduleSelectionApi {
1447
+ /** @returns A snapshot of selected activity IDs. */
1448
+ ids(): readonly string[];
1449
+ /**
1450
+ * Toggles one activity and optionally propagates selection to parents.
1451
+ *
1452
+ * @param input - Activity, checked state, and optional frozen IDs/context.
1453
+ * @returns The complete dispatch result including view-state changes.
1454
+ */
1455
+ toggle(input: SelectionToggleInput): Promise<DispatchResult>;
1456
+ /**
1457
+ * Replaces the selected ID set.
1458
+ *
1459
+ * @param activityIds - New selected IDs.
1460
+ * @param context - Optional consumer event source.
1461
+ * @returns The complete dispatch result including view-state changes.
1462
+ */
1463
+ replace(activityIds: ReadonlyArray<ActivityId>, context?: MutationContext): Promise<DispatchResult>;
1464
+ }
1465
+ /** Filtering, visibility, and visual-order state. */
1466
+ interface ScheduleViewApi {
1467
+ /** @returns A snapshot of explicitly hidden activity IDs. */
1468
+ hiddenActivityIds(): readonly string[];
1469
+ /** @returns A snapshot of activity IDs not currently hidden. */
1470
+ visibleActivityIds(): readonly string[];
1471
+ /** @returns Activity IDs in the current projected traversal order. */
1472
+ visualOrderIds(): ReadonlyArray<ActivityId>;
1473
+ /** @returns A defensive active-filter snapshot, or `null`. */
1474
+ filter(): Readonly<FilterState> | null;
1475
+ /**
1476
+ * Replaces the active filter and rebuilds visibility projection.
1477
+ *
1478
+ * @param input - Criteria, logical operator, optional date range and context.
1479
+ * @returns The complete dispatch result including view-state changes.
1480
+ */
1481
+ setFilter(input: ViewFilterInput): Promise<DispatchResult>;
1482
+ /** @returns A defensive active-order snapshot, or `null`. */
1483
+ order(): Readonly<OrderState> | null;
1484
+ /**
1485
+ * Replaces visual sort rules.
1486
+ *
1487
+ * @param rules - Ordered field/direction rules.
1488
+ * @param context - Optional consumer event source.
1489
+ * @returns The complete dispatch result including branch order changes.
1490
+ */
1491
+ setOrder(rules: ReadonlyArray<OrderRule>, context?: MutationContext): Promise<DispatchResult>;
1492
+ /**
1493
+ * Replaces the visible activity ID set.
1494
+ *
1495
+ * @param activityIds - IDs that should remain visible.
1496
+ * @param context - Optional consumer event source.
1497
+ * @returns The complete dispatch result including view-state changes.
1498
+ */
1499
+ setVisibility(activityIds: ReadonlyArray<ActivityId>, context?: MutationContext): Promise<DispatchResult>;
1500
+ /**
1501
+ * Changes the criterion used for derived activity status.
1502
+ *
1503
+ * @param criteria - Baseline- or actual-based status mode.
1504
+ * @param options - Per-operation autoschedule and critical-path controls.
1505
+ * @returns The complete dispatch result.
1506
+ */
1507
+ setStatusCriteria(criteria: StatusCriteria, options?: DispatchOptions): Promise<DispatchResult>;
1508
+ }
1509
+ /** Baseline overlays and baseline-aware reads. */
1510
+ interface ScheduleBaselinesApi {
1511
+ /**
1512
+ * Replaces normalized baseline overlays.
1513
+ *
1514
+ * @param points - Backend baseline points to normalize and apply.
1515
+ * @param options - Per-operation autoschedule and critical-path controls.
1516
+ * @returns The complete dispatch result.
1517
+ */
1518
+ refresh(points: ReadonlyArray<BaselinePoint>, options?: DispatchOptions): Promise<DispatchResult>;
1519
+ /**
1520
+ * Applies baseline visibility metadata from backend points.
1521
+ *
1522
+ * @param points - Baseline points carrying version visibility.
1523
+ * @param options - Per-operation autoschedule and critical-path controls.
1524
+ * @returns The complete dispatch result.
1525
+ */
1526
+ setVisibility(points: ReadonlyArray<BaselinePoint>, options?: DispatchOptions): Promise<DispatchResult>;
1527
+ /**
1528
+ * Changes the schedule-wide ponderator criterion.
1529
+ *
1530
+ * @param criterion - Duration, cost, or work-hours criterion.
1531
+ * @param options - Per-operation autoschedule and critical-path controls.
1532
+ * @returns The complete dispatch result.
1533
+ */
1534
+ setPonderatorCriterion(criterion: ActivityCreter, options?: DispatchOptions): Promise<DispatchResult>;
1535
+ /**
1536
+ * Selects the active normalized baseline for display.
1537
+ *
1538
+ * @param activity - Activity snapshot to inspect.
1539
+ * @returns The active point, or `null` when none is active.
1540
+ */
1541
+ activeFor(activity: Readonly<CoreActivity>): Readonly<CoreBaselinePoint> | null;
1542
+ }
1543
+ /** Pending impact-request synchronization. */
1544
+ interface ScheduleImpactRequestsApi {
1545
+ /**
1546
+ * Replaces pending requests for an activity.
1547
+ *
1548
+ * @param input - Activity, request snapshots, and optional event source.
1549
+ * @returns The complete dispatch result, including integration effects.
1550
+ */
1551
+ sync(input: ImpactRequestSyncInput): Promise<DispatchResult>;
1552
+ }
1553
+ /**
1554
+ * Read-only persistence tracking plus external-save acknowledgement.
1555
+ *
1556
+ * This namespace never performs storage I/O. Forks disable dirty tracking, so
1557
+ * `hasChanges()` is always false and modified/new/deleted collections are empty;
1558
+ * persistence acknowledgement is rejected.
1559
+ */
1560
+ interface SchedulePersistenceApi {
1561
+ /** @returns Whether tracked state differs from the acknowledged save baseline. */
1562
+ hasChanges(): boolean;
1563
+ /** @returns Defensive snapshots of modified persisted activities. */
1564
+ modifiedActivities(): ReadonlyArray<Readonly<CoreActivity>>;
1565
+ /** @returns Modified persisted fields grouped by activity ID. */
1566
+ modifiedActivityFields(): ReadonlyMap<string, ReadonlyArray<PersistableActivityField>>;
1567
+ /** @returns Defensive snapshots of not-yet-persisted activities. */
1568
+ newActivities(): ReadonlyArray<Readonly<CoreActivity>>;
1569
+ /** @returns Deleted persisted activity identities since the last save. */
1570
+ deletedActivities(): ReadonlyArray<Readonly<DeletedActivitySnapshot>>;
1571
+ /** @returns Defensive snapshots of modified persisted links. */
1572
+ modifiedLinks(): ReadonlyArray<Readonly<Link>>;
1573
+ /** @returns Defensive snapshots of not-yet-persisted links. */
1574
+ newLinks(): ReadonlyArray<Readonly<Link>>;
1575
+ /** @returns Deleted persisted link identities since the last save. */
1576
+ deletedLinks(): ReadonlyArray<Readonly<DeletedLinkSnapshot>>;
1577
+ /** @returns The undo-history boundary for an external save checkpoint. */
1578
+ captureHistoryBoundary(): number;
1579
+ /**
1580
+ * Captures the current activity/link snapshots and matching history boundary.
1581
+ *
1582
+ * @returns A defensive checkpoint; no storage I/O occurs.
1583
+ */
1584
+ readSnapshot(): PersistenceCheckpoint;
1585
+ /**
1586
+ * Acknowledges an exact checkpoint after consumer-owned storage succeeds.
1587
+ *
1588
+ * This updates save tracking and discards history through the checkpoint. A
1589
+ * fork returns a rejected dispatch result.
1590
+ * @param checkpoint - The exact externally persisted snapshot.
1591
+ * @returns The complete dispatch result.
1592
+ */
1593
+ acknowledge(checkpoint: PersistenceCheckpoint): Promise<DispatchResult>;
1594
+ }
1595
+ /** Serialized undo/redo history for the schedule instance. */
1596
+ interface ScheduleHistoryApi {
1597
+ /**
1598
+ * Applies the latest inverse operation.
1599
+ *
1600
+ * @param options - Optional depth guard and critical-path suppression.
1601
+ * @returns The complete projection change set, or `null` when unavailable or
1602
+ * when the expected depth does not match.
1603
+ */
1604
+ undo(options?: UndoOptions): Promise<ChangeSet | null>;
1605
+ /**
1606
+ * Reapplies the latest undone operation.
1607
+ *
1608
+ * @param options - Optional critical-path suppression.
1609
+ * @returns The complete projection change set, or `null` when unavailable.
1610
+ */
1611
+ redo(options?: {
1612
+ readonly skipCriticalPath?: boolean;
1613
+ }): Promise<ChangeSet | null>;
1614
+ /** @returns Whether an undo entry is available; readiness is not required. */
1615
+ canUndo(): boolean;
1616
+ /** @returns Whether a redo entry is available; readiness is not required. */
1617
+ canRedo(): boolean;
1618
+ /** Clears undo and redo history without changing schedule state. */
1619
+ clear(): void;
1620
+ /** @returns Current undo depth; readiness is not required. */
1621
+ depth(): number;
1622
+ }
1623
+ /** Change-set projection between isolated schedule owners. */
1624
+ interface ScheduleProjectionApi {
1625
+ /**
1626
+ * Produces changes that transform a projection of `source` into this schedule.
1627
+ *
1628
+ * Both schedules must be ready. Neither instance is mutated or merged.
1629
+ * @param source - Schedule currently represented by the consumer projection.
1630
+ * @returns A complete consumer projection change set.
1631
+ */
1632
+ changeSetFrom(source: ScheduleCore): ChangeSet;
1633
+ }
1634
+ /** Critical-path job lifecycle for the current schedule revision. */
1635
+ interface ScheduleCriticalPathApi {
1636
+ /**
1637
+ * Tracks the critical-path job current when this property is read.
1638
+ *
1639
+ * Later automatic work, including undo or redo recomputation, can replace
1640
+ * what subsequent reads return. Use {@link ScheduleCriticalPathApi.whenSettled}
1641
+ * to wait for the current schedule revision.
1642
+ * A non-null result contains a complete consumer projection update.
1643
+ */
1644
+ readonly ready: Promise<{
1645
+ changes: ChangeSet;
1646
+ } | null>;
1647
+ /**
1648
+ * Queues critical-path calculation for the current revision.
1649
+ *
1650
+ * @returns A complete projection update, or `null` when already current,
1651
+ * destroyed, or superseded.
1652
+ */
1653
+ recompute(): Promise<{
1654
+ changes: ChangeSet;
1655
+ } | null>;
1656
+ /** @returns Whether no mutation or calculation remains for the current revision. */
1657
+ isSettled(): boolean;
1658
+ /** Resolves after repeatedly recomputing until the current revision is settled. */
1659
+ whenSettled(): Promise<void>;
1660
+ }
1661
+ /** Read-only diagnostics for integration checks and deterministic comparison. */
1662
+ interface ScheduleDiagnosticsApi {
1663
+ /** @returns Counts and circular components from the effective dependency graph. */
1664
+ auditEffectiveGraph(): EffectiveGraphAudit;
1665
+ /** @returns The monotonic scheduling revision; readiness is not required. */
1666
+ revision(): number;
1667
+ /** @returns A deterministic serialization digest of canonical schedule state. */
1668
+ canonicalDigest(): string;
1669
+ }
1670
+ /** Namespaced façade attached to each {@link ScheduleCore} instance. */
1671
+ interface ScheduleApiNamespaces {
1672
+ /** Activity reads and mutations. */
1673
+ readonly activities: ScheduleActivitiesApi;
1674
+ /** Dependency-link reads and mutations. */
1675
+ readonly links: ScheduleLinksApi;
1676
+ /** Calendar reads and reconciliation. */
1677
+ readonly calendars: ScheduleCalendarsApi;
1678
+ /** Core-owned activity selection. */
1679
+ readonly selection: ScheduleSelectionApi;
1680
+ /** Visibility, filtering, and order projection. */
1681
+ readonly view: ScheduleViewApi;
1682
+ /** Baseline overlays and selection. */
1683
+ readonly baselines: ScheduleBaselinesApi;
1684
+ /** Pending impact-request synchronization. */
1685
+ readonly impactRequests: ScheduleImpactRequestsApi;
1686
+ /** External persistence tracking without I/O. */
1687
+ readonly persistence: SchedulePersistenceApi;
1688
+ /** Undo and redo history. */
1689
+ readonly history: ScheduleHistoryApi;
1690
+ /** Cross-instance projection change sets. */
1691
+ readonly projection: ScheduleProjectionApi;
1692
+ /** Critical-path job lifecycle. */
1693
+ readonly criticalPath: ScheduleCriticalPathApi;
1694
+ /** Effective-graph, revision, and digest diagnostics. */
1695
+ readonly diagnostics: ScheduleDiagnosticsApi;
1696
+ }
659
1697
 
1698
+ /** Backend-encoded work shift consumed during calendar normalization. */
660
1699
  interface BackendShiftInput {
661
1700
  shift_string: string;
662
1701
  }
1702
+ /** Backend calendar exception range and optional replacement shifts. */
663
1703
  interface BackendCalendarExceptionInput {
664
1704
  from_date: string;
665
1705
  to_date: string;
666
1706
  workable: boolean;
667
1707
  shifts?: BackendShiftInput[];
668
1708
  }
1709
+ /** Calendar payload accepted at the backend normalization boundary. */
669
1710
  interface BackendCalendarInput {
670
1711
  id: number;
671
1712
  name: string;
@@ -678,6 +1719,12 @@ interface BackendCalendarInput {
678
1719
  exceptiondays: BackendCalendarExceptionInput[];
679
1720
  baseexceptiondays?: BackendCalendarExceptionInput[];
680
1721
  }
1722
+ /**
1723
+ * Activity payload accepted at the backend normalization boundary.
1724
+ *
1725
+ * Date fields are backend strings, `duration` is in working days, and nullable
1726
+ * wire values are normalized into the stricter {@link CoreActivity} shape.
1727
+ */
681
1728
  interface BackendActivityInput {
682
1729
  id: number | null;
683
1730
  unique_id: string;
@@ -689,6 +1736,7 @@ interface BackendActivityInput {
689
1736
  type: 'project' | 'task' | 'milestone';
690
1737
  start_date: string;
691
1738
  end_date: string;
1739
+ /** Duration in working days. */
692
1740
  duration: number;
693
1741
  constraint: string | null;
694
1742
  constraint_date?: string | null;
@@ -727,6 +1775,7 @@ interface BackendActivityInput {
727
1775
  createdAt: string;
728
1776
  updatedAt: string;
729
1777
  }
1778
+ /** Dependency payload accepted at the backend normalization boundary. */
730
1779
  interface BackendLinkInput {
731
1780
  id: number | string;
732
1781
  unique_id?: string | null;
@@ -735,14 +1784,18 @@ interface BackendLinkInput {
735
1784
  source?: number | string;
736
1785
  target?: number | string;
737
1786
  type?: unknown;
1787
+ /** Dependency lag in working days, or `null` for zero. */
738
1788
  lag: number | null;
739
1789
  ganttId?: number;
740
1790
  sectorId?: number;
741
1791
  }
1792
+ /** Schedule metadata accepted from the backend's legacy `sector` field. */
742
1793
  interface BackendSectorInput {
743
1794
  id: number;
744
1795
  name: string;
1796
+ /** Working hours per day used for input day/hour conversion. */
745
1797
  hoursPerDay: number;
1798
+ /** Working hours per week. */
746
1799
  hoursPerWeek: number;
747
1800
  dateFormat: string;
748
1801
  projectId: number;
@@ -753,6 +1806,11 @@ interface BackendSectorInput {
753
1806
  custom_id_increment?: string | number | null;
754
1807
  calendars?: BackendCalendarInput[];
755
1808
  }
1809
+ /**
1810
+ * Complete consumer-owned backend payload normalized during construction.
1811
+ *
1812
+ * Calendars are optional; omitted collections normalize to package defaults.
1813
+ */
756
1814
  interface BackendScheduleInput {
757
1815
  sector: BackendSectorInput;
758
1816
  activities: BackendActivityInput[];
@@ -761,55 +1819,117 @@ interface BackendScheduleInput {
761
1819
  baseCalendars?: BackendCalendarInput[] | undefined;
762
1820
  }
763
1821
 
1822
+ /** Consumer diagnostics sink for normalization and background failures. */
764
1823
  interface ScheduleCoreReporter {
1824
+ /** Reports a recoverable warning with optional safe context. */
765
1825
  warn(message: string, context?: unknown): void;
1826
+ /** Reports an unexpected failure with its optional cause. */
766
1827
  error(message: string, cause?: unknown): void;
767
1828
  }
768
1829
 
1830
+ /** Stable validation reasons for rejected dependency operations. */
1831
+ declare const LINK_REJECTION_REASON: {
1832
+ readonly SELF_LINK: "self-link";
1833
+ readonly CYCLE: "cycle";
1834
+ readonly DUPLICATE: "duplicate";
1835
+ readonly ACTIVITY_MISSING: "activity-missing";
1836
+ readonly LINK_MISSING: "link-missing";
1837
+ readonly HIERARCHY_LINK: "hierarchy-link";
1838
+ };
1839
+ /** Stable validation reason for a rejected dependency operation. */
1840
+ type LinkRejection = (typeof LINK_REJECTION_REASON)[keyof typeof LINK_REJECTION_REASON];
1841
+
1842
+ /**
1843
+ * Lifecycle health states observable without awaiting initialization.
1844
+ * `ready` means alive, not initialized; await {@link ScheduleCore.ready} before
1845
+ * normal reads or commands.
1846
+ */
769
1847
  type ScheduleCoreStatus = 'ready' | 'destroyed' | 'poisoned';
1848
+ /** Named lifecycle states for integration checks. */
770
1849
  declare const SCHEDULE_CORE_STATUS: {
771
1850
  readonly READY: "ready";
772
1851
  readonly DESTROYED: "destroyed";
773
1852
  readonly POISONED: "poisoned";
774
1853
  };
1854
+ /**
1855
+ * Backend payload plus options used to construct a {@link ScheduleCore}.
1856
+ *
1857
+ * Construction parses the backend fields and begins initialization immediately.
1858
+ */
775
1859
  interface ScheduleCoreInput extends BackendScheduleInput {
1860
+ /** Skips the initial autoschedule pass when `true`; defaults to `false`. */
776
1861
  skipInitialAutoSchedule?: boolean;
1862
+ /** Optional baseline overlay applied before initial passes. */
777
1863
  baselinePoints?: readonly BaselinePoint[];
1864
+ /**
1865
+ * Supplies deterministic current dates. When omitted, clock-dependent
1866
+ * recomputations are skipped rather than reading the system clock.
1867
+ */
778
1868
  clock?: () => Date;
1869
+ /** Makes `ready` wait for initial critical-path calculation when `true`. */
779
1870
  criticalPathOnLoad?: boolean;
1871
+ /** Initial baseline- or actual-based status mode. */
780
1872
  statusCriteria?: StatusCriteria;
1873
+ /** Optional consumer schedule identifier retained in sector metadata. */
781
1874
  ganttId?: number;
1875
+ /** Optional normalization and background-error diagnostics sink. */
782
1876
  reporter?: ScheduleCoreReporter;
783
1877
  }
784
1878
 
785
- type DateGesture = {
786
- readonly kind: 'move';
787
- readonly activityIds: readonly ActivityId[];
788
- readonly anchorActivityId: ActivityId;
789
- } | {
790
- readonly kind: 'resize-start' | 'resize-end';
791
- readonly activityId: ActivityId;
792
- };
793
- interface DateGesturePreview {
794
- getDates(activityId: ActivityId, proposedEdgeTimeMs: number): {
795
- startTimeMs: number;
796
- endTimeMs: number;
797
- } | null;
798
- }
799
-
1879
+ /** Summary of logical links and projected effective dependency edges. */
800
1880
  interface EffectiveGraphAudit {
1881
+ /** Number of current activities. */
801
1882
  readonly activityCount: number;
1883
+ /** Number of stored logical links. */
802
1884
  readonly logicalLinkCount: number;
1885
+ /** Number of effective edges after summary-link projection. */
803
1886
  readonly effectiveEdgeCount: number;
1887
+ /** Strongly connected activity-ID components that are circular. */
804
1888
  readonly circularComponents: ReadonlyArray<ReadonlyArray<string>>;
1889
+ /** Number of activities in the largest circular component. */
805
1890
  readonly largestComponentSize: number;
806
1891
  }
1892
+ /** Controls an undo operation without changing the recorded entry. */
807
1893
  interface UndoOptions {
1894
+ /** Suppresses automatic critical-path recomputation for this undo. */
808
1895
  readonly skipCriticalPath?: boolean;
1896
+ /** Causes undo to return `null` unless the current depth matches. */
809
1897
  readonly expectedUndoDepth?: number;
810
1898
  }
811
1899
 
1900
+ /**
1901
+ * Owns one normalized schedule, its serialized mutation queue, derived
1902
+ * scheduling state, persistence tracking, and history.
1903
+ *
1904
+ * Construction parses backend input and starts initialization immediately.
1905
+ * Await {@link ScheduleCore.ready} before normal reads or commands. Consumers
1906
+ * own backend I/O and projection of returned change sets.
1907
+ */
812
1908
  declare class ScheduleCore {
1909
+ /** Activity reads and mutations. */
1910
+ readonly activities: ScheduleApiNamespaces['activities'];
1911
+ /** Dependency-link reads and mutations. */
1912
+ readonly links: ScheduleApiNamespaces['links'];
1913
+ /** Calendar reads and reconciliation. */
1914
+ readonly calendars: ScheduleApiNamespaces['calendars'];
1915
+ /** Core-owned activity selection. */
1916
+ readonly selection: ScheduleApiNamespaces['selection'];
1917
+ /** Visibility, filtering, and order projection. */
1918
+ readonly view: ScheduleApiNamespaces['view'];
1919
+ /** Baseline overlays and selection. */
1920
+ readonly baselines: ScheduleApiNamespaces['baselines'];
1921
+ /** Pending impact-request synchronization. */
1922
+ readonly impactRequests: ScheduleApiNamespaces['impactRequests'];
1923
+ /** External persistence tracking; no storage I/O is performed. */
1924
+ readonly persistence: ScheduleApiNamespaces['persistence'];
1925
+ /** Undo and redo history. */
1926
+ readonly history: ScheduleApiNamespaces['history'];
1927
+ /** Cross-instance projection change sets. */
1928
+ readonly projection: ScheduleApiNamespaces['projection'];
1929
+ /** Critical-path job lifecycle. */
1930
+ readonly criticalPath: ScheduleApiNamespaces['criticalPath'];
1931
+ /** Effective-graph, revision, and digest diagnostics. */
1932
+ readonly diagnostics: ScheduleApiNamespaces['diagnostics'];
813
1933
  private readonly _activityClipboard;
814
1934
  private _status;
815
1935
  private readonly coreRuntime;
@@ -820,63 +1940,216 @@ declare class ScheduleCore {
820
1940
  private _pendingScheduleRevision;
821
1941
  private _criticalPathRevision;
822
1942
  private _activeCriticalPath;
1943
+ /**
1944
+ * Creates one state owner and starts backend normalization and initial passes.
1945
+ *
1946
+ * @param input - Backend schedule data plus initialization options.
1947
+ */
823
1948
  constructor(input: ScheduleCoreInput);
1949
+ /**
1950
+ * Resolves after initialization, and after initial critical path when
1951
+ * `criticalPathOnLoad` is enabled.
1952
+ */
824
1953
  get ready(): Promise<void>;
1954
+ /**
1955
+ * Creates an isolated schedule with copied state, history, and generators.
1956
+ *
1957
+ * The fork runs the same mutation logic but disables dirty tracking:
1958
+ * `persistence.hasChanges()` stays false and all dirty collections stay
1959
+ * empty. It cannot acknowledge persistence and is never merged automatically.
1960
+ * @returns A ready isolated schedule.
1961
+ */
825
1962
  fork(): Promise<ScheduleCore>;
1963
+ /**
1964
+ * Tracks the critical-path job current when this property is read.
1965
+ *
1966
+ * Later automatic work, including undo or redo recomputation, can replace
1967
+ * the promise returned by subsequent reads. Use `whenSettled()` to wait for
1968
+ * the current schedule revision.
1969
+ * Apply a non-null `changes` value to the consumer-owned projection.
1970
+ */
826
1971
  get criticalPathReady(): Promise<{
827
1972
  changes: ChangeSet;
828
1973
  } | null>;
1974
+ /**
1975
+ * Current lifecycle health; `ready` can be observed before initialization
1976
+ * finishes, so await {@link ScheduleCore.ready} before normal use.
1977
+ */
829
1978
  get status(): ScheduleCoreStatus;
1979
+ /**
1980
+ * Reads a defensive sector metadata snapshot without a readiness guard.
1981
+ *
1982
+ * @returns Cloned metadata, including values available after destruction.
1983
+ */
830
1984
  getSector(): Readonly<SectorMetadata>;
1985
+ /**
1986
+ * Reads a defensive activity snapshot from a ready schedule.
1987
+ *
1988
+ * @param id - Canonical activity ID.
1989
+ * @returns The activity, or `null` when absent.
1990
+ */
831
1991
  getActivityView(id: ActivityId): Readonly<CoreActivity> | null;
1992
+ /**
1993
+ * Creates a read-only date prediction bound to the current revision.
1994
+ *
1995
+ * @param gesture - Move or resize gesture to preview.
1996
+ * @returns A preview that throws after schedule state changes.
1997
+ */
832
1998
  createDateGesturePreview(gesture: DateGesture): DateGesturePreview;
1999
+ /** @returns Defensive snapshots of every activity in the ready schedule. */
833
2000
  getAllActivitiesView(): ReadonlyArray<Readonly<CoreActivity>>;
2001
+ /**
2002
+ * Computes the unique parent IDs allowed by the current indent plan.
2003
+ *
2004
+ * @param activityIds - Activities considered for indentation.
2005
+ */
834
2006
  getIndentTargetParentIds(activityIds: ReadonlyArray<ActivityId | string>): readonly string[];
835
- getChildrenView(parentId: ActivityId | '0'): ReadonlyArray<Readonly<CoreActivity>>;
2007
+ /**
2008
+ * Reads defensive direct-child snapshots in correlative order.
2009
+ *
2010
+ * @param parentId - Parent activity ID, or the root ID.
2011
+ */
2012
+ getChildrenView(parentId: ActivityId | typeof ROOT_PARENT_ID): ReadonlyArray<Readonly<CoreActivity>>;
2013
+ /**
2014
+ * Reads a defensive link snapshot.
2015
+ *
2016
+ * @param id - Canonical link ID.
2017
+ * @returns The link, or `null` when absent. Stored lag is in working hours.
2018
+ */
836
2019
  getLinkView(id: LinkId): Readonly<Link> | null;
2020
+ /**
2021
+ * Reads unique incoming and outgoing link snapshots for an activity.
2022
+ *
2023
+ * @param activityId - Activity whose links should be read.
2024
+ */
837
2025
  getLinksForActivityView(activityId: ActivityId): ReadonlyArray<Readonly<Link>>;
2026
+ /** @returns Defensive snapshots of every link; stored lag is in working hours. */
838
2027
  getAllLinksView(): ReadonlyArray<Readonly<Link>>;
2028
+ /** @returns Counts and circular components from the effective dependency graph. */
839
2029
  auditEffectiveGraph(): EffectiveGraphAudit;
2030
+ /**
2031
+ * Reads and clones one activity property.
2032
+ *
2033
+ * @param activityId - Canonical activity ID.
2034
+ * @param property - Property to read.
2035
+ * @returns The cloned value, or `null` when the activity is absent.
2036
+ */
840
2037
  getProperty<Property extends keyof CoreActivity>(activityId: ActivityId, property: Property): CoreActivity[Property] | null;
2038
+ /** @returns A read-only snapshot of all current activity IDs. */
841
2039
  getAllIds(): readonly string[];
2040
+ /**
2041
+ * Visits each current activity ID without exposing mutable state.
2042
+ *
2043
+ * @param visit - Callback invoked once per current ID.
2044
+ */
842
2045
  forEachActivityId(visit: (id: string) => void): void;
843
- getChildrenIds(parentId: ActivityId | '0'): ReadonlyArray<ActivityId>;
2046
+ /**
2047
+ * Reads direct child IDs in visual order.
2048
+ *
2049
+ * @param parentId - Parent activity ID, or the root ID.
2050
+ */
2051
+ getChildrenIds(parentId: ActivityId | typeof ROOT_PARENT_ID): ReadonlyArray<ActivityId>;
2052
+ /** @returns A defensive snapshot of selected activity IDs. */
844
2053
  getSelectedActivityIds(): string[];
2054
+ /** @returns A defensive snapshot of explicitly hidden activity IDs. */
845
2055
  getHiddenActivityIds(): string[];
2056
+ /** @returns A defensive snapshot of activity IDs not currently hidden. */
846
2057
  getVisibleActivityIds(): string[];
2058
+ /** @returns A defensive active-filter snapshot, or `null`. */
847
2059
  getActiveFilter(): Readonly<FilterState> | null;
2060
+ /** @returns A defensive active-order snapshot, or `null`. */
848
2061
  getActiveOrder(): Readonly<OrderState> | null;
2062
+ /** @returns Activity IDs in the current projected traversal order. */
849
2063
  getVisualOrderIds(): ReadonlyArray<ActivityId>;
850
- hasChild(parentId: ActivityId | '0'): boolean;
2064
+ /** @returns Whether the parent currently has a direct child. */
2065
+ hasChild(parentId: ActivityId | typeof ROOT_PARENT_ID): boolean;
2066
+ /**
2067
+ * Reads a defensive schedule-calendar snapshot.
2068
+ *
2069
+ * @param id - Canonical calendar ID.
2070
+ * @returns The calendar, or `null` when absent.
2071
+ */
851
2072
  getCalendar(id: CalendarId): Readonly<Calendar> | null;
2073
+ /** @returns Defensive snapshots of every schedule calendar. */
852
2074
  getAllCalendars(): ReadonlyArray<Readonly<Calendar>>;
2075
+ /** @returns Defensive snapshots of every base calendar. */
853
2076
  getBaseCalendars(): ReadonlyArray<Readonly<Calendar>>;
2077
+ /**
2078
+ * Checks custom-ID uniqueness while optionally excluding the current value.
2079
+ *
2080
+ * @param customId - Candidate custom ID.
2081
+ * @param currentCustomId - Existing value to ignore, or `null`.
2082
+ */
854
2083
  isCustomIdInUse(customId: string, currentCustomId?: string | null): boolean;
2084
+ /** @returns The default calendar's earliest start/latest end, or `null`. */
855
2085
  getProjectWorkHours(): ProjectWorkHours | null;
2086
+ /** @returns Defensive snapshots of modified persisted links; no I/O occurs. */
856
2087
  getModifiedLinks(): ReadonlyArray<Readonly<Link>>;
2088
+ /** @returns Defensive snapshots of not-yet-persisted links; no I/O occurs. */
857
2089
  getNewLinks(): ReadonlyArray<Readonly<Link>>;
2090
+ /** @returns Defensive snapshots of modified persisted activities; no I/O occurs. */
858
2091
  getModifiedActivities(): ReadonlyArray<Readonly<CoreActivity>>;
2092
+ /** @returns Modified persisted fields grouped by activity ID; no I/O occurs. */
859
2093
  getModifiedActivityFields(): ReadonlyMap<string, ReadonlyArray<PersistableActivityField>>;
2094
+ /** @returns Defensive snapshots of not-yet-persisted activities; no I/O occurs. */
860
2095
  getNewActivities(): ReadonlyArray<Readonly<CoreActivity>>;
2096
+ /** @returns Whether tracked state differs from the acknowledged save baseline. */
861
2097
  hasUnsavedChanges(): boolean;
2098
+ /** @returns The monotonic scheduling revision without a readiness guard. */
862
2099
  getScheduleRevision(): number;
2100
+ /** @returns The undo-history boundary for an external save checkpoint. */
863
2101
  capturePersistenceHistoryBoundary(): number;
2102
+ /** @returns A deterministic serialization digest of canonical schedule state. */
864
2103
  getCanonicalDigest(): string;
2104
+ /**
2105
+ * Produces changes that transform a projection of `source` into this schedule.
2106
+ *
2107
+ * Both schedules must be ready. Neither instance is mutated or merged.
2108
+ * @param source - Schedule currently represented by the consumer projection.
2109
+ * @returns A complete consumer projection change set.
2110
+ */
865
2111
  createProjectionChangeSetFrom(source: ScheduleCore): ChangeSet;
2112
+ /** @returns Deleted persisted activity identities since the last save. */
866
2113
  getDeletedActivitiesSinceLastSave(): ReadonlyArray<Readonly<DeletedActivitySnapshot>>;
2114
+ /** @returns Deleted persisted link identities since the last save. */
867
2115
  getDeletedLinksSinceLastSave(): ReadonlyArray<Readonly<DeletedLinkSnapshot>>;
868
2116
  private _enqueue;
869
2117
  private _beginScheduleMutation;
870
2118
  private _admitScheduleMutation;
871
2119
  private _settleScheduleMutation;
2120
+ /**
2121
+ * Serializes and applies one public command to core-owned state.
2122
+ *
2123
+ * @param action - Public command. Activity-batch commands use
2124
+ * {@link ScheduleCore.applyActivityBatch} instead.
2125
+ * @param options - Per-operation autoschedule and critical-path controls.
2126
+ * @returns The complete dispatch result unchanged, including change sets,
2127
+ * verdicts, effects, tracking events, and warnings when present.
2128
+ */
872
2129
  dispatch(action: DispatchAction, options?: DispatchOptions): Promise<DispatchResult>;
2130
+ /**
2131
+ * Serializes and applies an activity creation batch.
2132
+ *
2133
+ * @param action - Append/replace batch using working-day link lags and
2134
+ * activity-creation overrides. Dispatch converts lags to stored hours.
2135
+ * @param options - Per-operation autoschedule and critical-path controls.
2136
+ * @returns The complete dispatch result unchanged.
2137
+ */
873
2138
  applyActivityBatch(action: ActivityBatchAction, options?: DispatchOptions): Promise<DispatchResult>;
874
2139
  private _dispatchInner;
875
2140
  private _runDispatch;
2141
+ /**
2142
+ * Queues critical-path calculation for the current revision.
2143
+ *
2144
+ * @returns A complete projection update, or `null` when already current,
2145
+ * destroyed, or superseded.
2146
+ */
876
2147
  recomputeCriticalPath(): Promise<{
877
2148
  changes: ChangeSet;
878
2149
  } | null>;
2150
+ /** @returns Whether no mutation or calculation remains for the current revision. */
879
2151
  isCriticalPathSettled(): boolean;
2152
+ /** Resolves after repeatedly recomputing until the current revision is settled. */
880
2153
  whenCriticalPathSettled(): Promise<void>;
881
2154
  private _withReappliedViewState;
882
2155
  private _reapplyViewState;
@@ -885,17 +2158,38 @@ declare class ScheduleCore {
885
2158
  private _reapplyActiveFilter;
886
2159
  private _recordScheduleMutation;
887
2160
  private _startCriticalPathForCurrentRevision;
2161
+ /**
2162
+ * Applies the latest inverse operation through the serialized queue.
2163
+ *
2164
+ * @param options - Optional depth guard and critical-path suppression.
2165
+ * @returns The complete projection change set, or `null` when unavailable or
2166
+ * when the expected depth does not match.
2167
+ */
888
2168
  undo(options?: UndoOptions): Promise<ChangeSet | null>;
889
2169
  private _runUndo;
2170
+ /**
2171
+ * Reapplies the latest undone operation through the serialized queue.
2172
+ *
2173
+ * @param options - Optional critical-path suppression.
2174
+ * @returns The complete projection change set, or `null` when unavailable.
2175
+ */
890
2176
  redo(options?: {
891
2177
  skipCriticalPath?: boolean;
892
2178
  }): Promise<ChangeSet | null>;
893
2179
  private _runRedo;
2180
+ /** @returns Whether an undo entry is available; readiness is not required. */
894
2181
  canUndo(): boolean;
2182
+ /** @returns Whether a redo entry is available; readiness is not required. */
895
2183
  canRedo(): boolean;
2184
+ /** Clears undo and redo history without changing schedule state. */
896
2185
  clearHistory(): void;
2186
+ /** @returns Current undo depth; readiness is not required. */
897
2187
  undoDepth(): number;
898
2188
  private _resyncCustomIdTrackerFromModel;
2189
+ /**
2190
+ * Cancels active critical-path work, clears caches, and permanently destroys
2191
+ * this instance. Guarded reads and operations throw afterward.
2192
+ */
899
2193
  destroy(): void;
900
2194
  private readonly _initPromise;
901
2195
  private _criticalPathReady;
@@ -905,6 +2199,17 @@ declare class ScheduleCore {
905
2199
  private _rollback;
906
2200
  }
907
2201
 
2202
+ /**
2203
+ * Constructs a schedule from backend input and waits for its configured
2204
+ * initialization passes.
2205
+ *
2206
+ * @param input - Backend schedule data plus initialization options.
2207
+ * @returns The ready {@link ScheduleCore} instance; no wrapper or second state
2208
+ * owner is created.
2209
+ */
2210
+ declare function createSchedule(input: ScheduleCoreInput): Promise<ScheduleCore>;
2211
+
2212
+ /** Fully normalized data returned by the backend parsing boundary. */
908
2213
  interface ParsedInput {
909
2214
  sector: SectorMetadata;
910
2215
  activities: CoreActivity[];
@@ -915,57 +2220,141 @@ interface ParsedInput {
915
2220
  readonly hiddenIds: readonly ActivityId[];
916
2221
  };
917
2222
  }
2223
+ /**
2224
+ * Normalizes backend wire data without constructing a schedule owner.
2225
+ *
2226
+ * Construction calls this automatically. Invalid or inconsistent input may
2227
+ * throw; diagnostics are reported through the optional reporter.
2228
+ * @param input - Backend schedule metadata, activities, links, and calendars.
2229
+ * @param reporter - Optional normalization diagnostics sink.
2230
+ * @returns Normalized domain data and initial hidden-ID view state.
2231
+ */
918
2232
  declare function parseFromBackend(input: BackendScheduleInput, reporter?: ScheduleCoreReporter): ParsedInput;
919
2233
 
2234
+ /**
2235
+ * Selects the normalized baseline point marked as active.
2236
+ *
2237
+ * @param activity - Baseline-bearing activity, or a nullish value.
2238
+ * @returns The active point, or `null` when none is available.
2239
+ */
920
2240
  declare function getActiveBaseline(activity: {
921
2241
  baselinePoints?: readonly CoreBaselinePoint[];
922
2242
  } | null | undefined): CoreBaselinePoint | null;
923
2243
 
2244
+ /** Calendar duration boundary used by expected-progress calculation. */
924
2245
  interface CalendarLike {
2246
+ /** @returns Working duration between two dates in a consistent calendar unit. */
925
2247
  calculateDuration(start: Date, end: Date): number;
926
2248
  }
2249
+ /**
2250
+ * Calculates elapsed calendar duration as a percentage of baseline duration.
2251
+ *
2252
+ * @param start - Baseline start.
2253
+ * @param end - Baseline end.
2254
+ * @param now - Calculation date.
2255
+ * @param calendar - Working-duration boundary.
2256
+ * @returns A percentage from 0 through 100.
2257
+ */
927
2258
  declare function expectedProgressFromBaseline(start: Date, end: Date, now: Date, calendar: CalendarLike): number;
928
2259
 
2260
+ /** Consumer-compatible adapter used by baseline expected-progress calculation. */
929
2261
  interface ExpectedProgressAdapter {
2262
+ /** @returns Direct child IDs for a parent or root. */
930
2263
  getChildrenIds(parentId: string | 0): readonly string[];
2264
+ /** @returns The activity record, or `null` when absent. */
931
2265
  getActivity(id: string): Record<string, unknown> | null;
2266
+ /** Writes one calculated field to adapter-owned state. */
932
2267
  setActivityField(id: string, field: string, value: unknown): void;
2268
+ /** @returns A base calendar calculation boundary, or `null` when absent. */
933
2269
  getBaseCalendar(engineId: string): CalendarLike | null;
934
2270
  }
2271
+ /**
2272
+ * Calculates baseline expected progress and writes changed values through an adapter.
2273
+ *
2274
+ * @param rootIds - Root activities to traverse recursively.
2275
+ * @param now - Calculation date.
2276
+ * @param adapter - Consumer-owned read/write and calendar boundary.
2277
+ * @param defaultBaseCalendarId - Fallback base calendar ID, or `null`.
2278
+ * @returns IDs whose `expectedProgressBaseline` percentage changed.
2279
+ */
935
2280
  declare function computeExpectedProgress(rootIds: readonly string[], now: Date, adapter: ExpectedProgressAdapter, defaultBaseCalendarId?: string | null): string[];
936
2281
 
2282
+ /**
2283
+ * Activity fields safe to prefill before identity, placement, dates, duration,
2284
+ * calendar, and unique correlative ID are chosen.
2285
+ */
937
2286
  type StaticActivityDefaults = Omit<CoreActivity, 'id' | 'parentId' | 'name' | 'startDate' | 'endDate' | 'durationHours' | 'calendarId' | 'uniqueCorrelativeId'>;
2287
+ /**
2288
+ * Frozen defaults for consumer creation UI.
2289
+ *
2290
+ * These values do not replace the authoritative `activity-create` pipeline.
2291
+ */
938
2292
  declare const NEW_ACTIVITY_DEFAULTS: Readonly<StaticActivityDefaults>;
939
2293
 
2294
+ /**
2295
+ * Finds persisted links whose endpoints, type, or stored-hour lag changed.
2296
+ *
2297
+ * @param baseline - Previously saved link snapshots.
2298
+ * @param current - Current link snapshots.
2299
+ * @returns Current snapshots for links changed since the baseline.
2300
+ */
940
2301
  declare function checkNoUpdatedLinks(baseline: readonly Link[], current: readonly Link[]): Link[];
941
2302
 
2303
+ /** Entity that may not yet have a backend persistence identifier. */
942
2304
  interface WithProplannerId {
943
2305
  proplannerId?: number | null;
944
2306
  [key: string]: unknown;
945
2307
  }
2308
+ /**
2309
+ * Selects activities without a truthy backend persistence identifier.
2310
+ *
2311
+ * @param activities - Optional activity collection; defaults to empty.
2312
+ * @returns Matching items without cloning them.
2313
+ */
946
2314
  declare const getUnsavedActivities: <T extends WithProplannerId>(activities?: readonly T[]) => T[];
947
2315
 
2316
+ /**
2317
+ * Yields one browser message-channel turn without introducing a timer.
2318
+ *
2319
+ * @returns An already-resolved promise outside a browser or without
2320
+ * `MessageChannel` support.
2321
+ */
948
2322
  declare function yieldToBrowser(): Promise<void>;
949
2323
 
2324
+ /**
2325
+ * Predicts whether an action's normal derived-work policy runs critical path.
2326
+ *
2327
+ * Per-dispatch skip options are not represented by this action-only prediction.
2328
+ * @param action - Public dispatch command.
2329
+ */
950
2330
  declare function willRunCriticalPath(action: DispatchAction): boolean;
951
2331
 
2332
+ /** Stable reasons returned when filter input cannot be normalized. */
2333
+ declare const FILTER_REJECTION_REASON: {
2334
+ readonly UNKNOWN_FIELD: "unknown_field";
2335
+ readonly UNKNOWN_OPERATOR: "unknown_operator";
2336
+ readonly INVALID_VALUE: "invalid_value";
2337
+ };
2338
+ /** Stable reason returned for rejected filter input. */
2339
+ type FilterRejection = (typeof FILTER_REJECTION_REASON)[keyof typeof FILTER_REJECTION_REASON];
2340
+
2341
+ /** Named normalized activity shape categories. */
952
2342
  declare const ACTIVITY_TYPE: {
953
2343
  readonly TASK: "task";
954
2344
  readonly PROJECT: "project";
955
2345
  readonly MILESTONE: "milestone";
956
2346
  };
957
2347
 
958
- declare const ROOT_PARENT_ID: "0";
959
- declare function isRootParent(parent: unknown): boolean;
960
- declare function normalizeParentKey(parent: unknown): string;
961
-
2348
+ /** Compact dependency relationship code used by consumer text formats. */
962
2349
  type LinkTypeCode = 'fs' | 'ss' | 'ff' | 'sf';
2350
+ /** Maps stored link types to compact consumer relationship codes. */
963
2351
  declare const LINK_TYPE_CODE: {
964
2352
  readonly "0": "fs";
965
2353
  readonly "1": "ss";
966
2354
  readonly "2": "ff";
967
2355
  readonly "3": "sf";
968
2356
  };
2357
+ /** Maps compact consumer relationship codes to stored link types. */
969
2358
  declare const LINK_CODE_TO_TYPE: {
970
2359
  readonly fs: "0";
971
2360
  readonly ss: "1";
@@ -973,50 +2362,23 @@ declare const LINK_CODE_TO_TYPE: {
973
2362
  readonly sf: "3";
974
2363
  };
975
2364
 
2365
+ /** Maps normalized constraint types to backend-compatible display labels. */
976
2366
  declare const CONSTRAINT_TYPE_TO_LABEL: Record<ConstraintType, string>;
977
2367
 
2368
+ /** Fallback working hours per day when schedule metadata is unavailable. */
978
2369
  declare const DEFAULT_HOURS_PER_DAY = 8;
979
2370
 
980
- type DispatchActionKind = DispatchAction['kind'];
981
- declare const DISPATCH_ACTION_KIND: {
982
- readonly ACTIVITY_CLIPBOARD_CLEAR: "activity-clipboard-clear";
983
- readonly ACTIVITY_COPY: "activity-copy";
984
- readonly ACTIVITY_PASTE_COPIED: "activity-paste-copied";
985
- readonly PERSISTENCE_ACKNOWLEDGE: "persistence-acknowledge";
986
- readonly BASELINE_APPLY: "baseline-apply";
987
- readonly PONDERATOR_CRITERION_SET: "ponderator-criterion-set";
988
- readonly STATUS_CRITERIA_SET: "status-criteria-set";
989
- readonly INLINE_EDIT: "inline-edit";
990
- readonly DATES_BATCH: "dates-batch";
991
- readonly BULK_EDIT: "bulk-edit";
992
- readonly LINK_CREATE: "link-create";
993
- readonly LINK_UPDATE: "link-update";
994
- readonly LINK_DELETE: "link-delete";
995
- readonly LINKS_BATCH: "links-batch";
996
- readonly ACTIVITY_CREATE: "activity-create";
997
- readonly ACTIVITY_DELETE: "activity-delete";
998
- readonly ACTIVITY_MOVE: "activity-move";
999
- readonly ACTIVITY_INDENT: "activity-indent";
1000
- readonly ACTIVITY_OUTDENT: "activity-outdent";
1001
- readonly ACTIVITY_SET_PROGRESS: "activity-set-progress";
1002
- readonly SELECTION_TOGGLE: "selection-toggle";
1003
- readonly SELECTION_REPLACE: "selection-replace";
1004
- readonly VISIBILITY_SET: "visibility-set";
1005
- readonly FILTER_SET: "filter-set";
1006
- readonly SORT_SET: "sort-set";
1007
- readonly SIR_SYNC: "sir-sync";
1008
- readonly ACTIVITY_LOOKAHEAD_SYNC: "activity-lookahead-sync";
1009
- };
1010
- declare const DISPATCH_ACTION_KINDS: ReadonlyArray<DispatchActionKind>;
1011
-
2371
+ /** Consumer creation contexts recognized by schedule integrations. */
1012
2372
  declare const CREATION_KIND: {
1013
2373
  readonly CHILD: "child";
1014
2374
  readonly CHILD_CONFIRMED: "child-confirmed";
1015
2375
  readonly LINE: "line";
1016
2376
  readonly ROOT: "root";
1017
2377
  };
2378
+ /** Consumer creation context recognized by schedule integrations. */
1018
2379
  type CreationKind = (typeof CREATION_KIND)[keyof typeof CREATION_KIND];
1019
2380
 
2381
+ /** Stable expected-rejection reasons returned by public dispatch commands. */
1020
2382
  declare const REJECTION_REASON: {
1021
2383
  readonly CANNOT_EDIT: "cannot_edit";
1022
2384
  readonly PARSE_ERROR: "parse_error";
@@ -1043,8 +2405,10 @@ declare const REJECTION_REASON: {
1043
2405
  readonly SANDBOX_PERSISTENCE_FORBIDDEN: "sandbox_persistence_forbidden";
1044
2406
  readonly INVALID_PROGRESS_VALUE: "invalid_progress_value_must_be_0_or_100";
1045
2407
  };
2408
+ /** Stable expected-rejection reason returned by a public command. */
1046
2409
  type DispatchRejectReason = (typeof REJECTION_REASON)[keyof typeof REJECTION_REASON];
1047
2410
 
2411
+ /** Consumer analytics event names emitted by schedule mutations. */
1048
2412
  declare const DISPATCH_TRACK_EVENT: {
1049
2413
  readonly ACTIVITY_CREATION: "schedule_activity_creation";
1050
2414
  readonly ACTIVITY_DELETION: "schedule_activity_deletion";
@@ -1052,6 +2416,7 @@ declare const DISPATCH_TRACK_EVENT: {
1052
2416
  readonly ACTIVITY_INDENT: "schedule_activity_indent";
1053
2417
  readonly ACTIVITY_OUTDENT: "schedule_activity_outdent";
1054
2418
  };
2419
+ /** Consumer analytics event name emitted by a schedule mutation. */
1055
2420
  type DispatchTrackEvent = (typeof DISPATCH_TRACK_EVENT)[keyof typeof DISPATCH_TRACK_EVENT];
1056
2421
 
1057
- export { ACTIVITY_TYPE, type ActivityBaselineSnapshot, type ActivityBatchAction, type ActivityBatchItem, type ActivityBatchLinkInput, type ActivityBatchMode, type ActivityBatchParentReference, type ActivityBatchReference, type ActivityCreationOverrides, type ActivityCreter, type ActivityId, type ActivityStatus, type ActivityType, type BackendActivityInput, type BackendCalendarExceptionInput, type BackendCalendarInput, type BackendLinkInput, type BackendScheduleInput, type BackendSectorInput, type BackendShiftInput, type BaselinePoint, type BaselineVersion, type BranchOrderChange, CALENDAR_UNIT, COLUMN, CONSTRAINT_TYPE, CONSTRAINT_TYPE_TO_LABEL, 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, DEFAULT_HOURS_PER_DAY, DISPATCH_ACTION_KIND, DISPATCH_ACTION_KINDS, DISPATCH_TRACK_EVENT, type DateGesture, type DateGesturePreview, type DatesBatchVerdict, type DeletedActivitySnapshot, type DeletedLinkSnapshot, type DispatchAction, type DispatchActionKind, type DispatchOptions, type DispatchRejectReason, type DispatchResult, type DispatchTrackEvent, type EditableColumnName, type EffectiveGraphAudit, type EntityChange, type ExpectedProgressAdapter, type FilterCriterion, type FilterCriterionValue, type FilterDateRange, type FilterField, type FilterOperator, type FilterState, LINK_CODE_TO_TYPE, LINK_TYPE, LINK_TYPE_CODE, type Link, type LinkBatchVerdict, type LinkId, type LinkType, type LinkTypeCode, type LinksBatchOperation, NEW_ACTIVITY_DEFAULTS, 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, STATUS, ScheduleCore, type ScheduleCoreInput, type ScheduleCoreReporter, type ScheduleCoreStatus, type ScheduleEffect, type SectorMetadata, type StaticActivityDefaults, type StatusCriteria, type TrackingEvent, type UndoOptions, type ViewStateChange, type ViewStatePropChange, WORK_TIME_DIRECTION, type WithProplannerId, type WorkTimeDirection, checkNoUpdatedLinks, computeExpectedProgress, expectedProgressFromBaseline, getActiveBaseline, getUnsavedActivities, isRootParent, normalizeParentKey, parseFromBackend, willRunCriticalPath, yieldToBrowser };
2422
+ export { ACTIVITY_BATCH_ACTION_KIND, ACTIVITY_BATCH_MODE, ACTIVITY_DATE_EDGE, ACTIVITY_FIELD, ACTIVITY_PONDERATOR_CRITERION, 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 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, 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_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 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 };