@ram_28/kf-ai-sdk 2.0.15 → 2.0.16

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.
Files changed (83) hide show
  1. package/README.md +8 -8
  2. package/dist/bdo/core/BaseBdo.d.ts +1 -1
  3. package/dist/bdo.mjs +2 -2
  4. package/dist/components/hooks/useActivityForm/createActivityItemProxy.d.ts +1 -1
  5. package/dist/components/hooks/useActivityForm/createActivityItemProxy.d.ts.map +1 -1
  6. package/dist/components/hooks/useActivityForm/types.d.ts +2 -2
  7. package/dist/components/hooks/useActivityForm/types.d.ts.map +1 -1
  8. package/dist/components/hooks/useActivityForm/useActivityForm.d.ts.map +1 -1
  9. package/dist/components/hooks/useActivityTable/types.d.ts +4 -4
  10. package/dist/components/hooks/useActivityTable/types.d.ts.map +1 -1
  11. package/dist/components/hooks/useActivityTable/useActivityTable.d.ts +1 -1
  12. package/dist/components/hooks/useActivityTable/useActivityTable.d.ts.map +1 -1
  13. package/dist/components/hooks/useBDOForm/createItemProxy.d.ts.map +1 -0
  14. package/dist/components/hooks/useBDOForm/createResolver.d.ts.map +1 -0
  15. package/dist/components/hooks/useBDOForm/index.d.ts +6 -0
  16. package/dist/components/hooks/useBDOForm/index.d.ts.map +1 -0
  17. package/dist/components/hooks/useBDOForm/shared.d.ts +50 -0
  18. package/dist/components/hooks/useBDOForm/shared.d.ts.map +1 -0
  19. package/dist/components/hooks/{useForm → useBDOForm}/types.d.ts +6 -6
  20. package/dist/components/hooks/useBDOForm/types.d.ts.map +1 -0
  21. package/dist/components/hooks/{useForm/useForm.d.ts → useBDOForm/useBDOForm.d.ts} +4 -4
  22. package/dist/components/hooks/useBDOForm/useBDOForm.d.ts.map +1 -0
  23. package/dist/components/hooks/useBDOTable/types.d.ts +1 -3
  24. package/dist/components/hooks/useBDOTable/types.d.ts.map +1 -1
  25. package/dist/components/hooks/useBDOTable/useBDOTable.d.ts.map +1 -1
  26. package/dist/form.cjs +1 -1
  27. package/dist/form.d.ts +1 -1
  28. package/dist/form.d.ts.map +1 -1
  29. package/dist/form.mjs +250 -253
  30. package/dist/form.types.d.ts +1 -1
  31. package/dist/form.types.d.ts.map +1 -1
  32. package/dist/shared-5a7UkED1.js +1180 -0
  33. package/dist/shared-nnmlRVs7.cjs +1 -0
  34. package/dist/table.cjs +1 -1
  35. package/dist/table.mjs +12 -11
  36. package/dist/types/constants.d.ts +3 -3
  37. package/dist/workflow/Activity.d.ts +15 -3
  38. package/dist/workflow/Activity.d.ts.map +1 -1
  39. package/dist/workflow/client.d.ts +2 -2
  40. package/dist/workflow/client.d.ts.map +1 -1
  41. package/dist/workflow/types.d.ts +7 -3
  42. package/dist/workflow/types.d.ts.map +1 -1
  43. package/dist/workflow.cjs +1 -1
  44. package/dist/workflow.mjs +503 -546
  45. package/docs/bdo.md +1 -1
  46. package/docs/gaps.md +14 -64
  47. package/docs/useActivityForm.md +393 -0
  48. package/docs/useActivityTable.md +42 -105
  49. package/docs/{useForm.md → useBDOForm.md} +24 -24
  50. package/docs/useBDOTable.md +6 -39
  51. package/docs/workflow.md +43 -301
  52. package/package.json +2 -2
  53. package/sdk/bdo/core/BaseBdo.ts +2 -2
  54. package/sdk/components/hooks/useActivityForm/createActivityItemProxy.ts +1 -1
  55. package/sdk/components/hooks/useActivityForm/createActivityResolver.ts +1 -1
  56. package/sdk/components/hooks/useActivityForm/types.ts +4 -4
  57. package/sdk/components/hooks/useActivityForm/useActivityForm.ts +44 -194
  58. package/sdk/components/hooks/useActivityTable/types.ts +4 -2
  59. package/sdk/components/hooks/useActivityTable/useActivityTable.ts +8 -39
  60. package/sdk/components/hooks/{useForm → useBDOForm}/index.ts +4 -3
  61. package/sdk/components/hooks/useBDOForm/shared.ts +250 -0
  62. package/sdk/components/hooks/{useForm → useBDOForm}/types.ts +9 -9
  63. package/sdk/components/hooks/{useForm/useForm.ts → useBDOForm/useBDOForm.ts} +70 -96
  64. package/sdk/components/hooks/useBDOTable/types.ts +1 -3
  65. package/sdk/components/hooks/useBDOTable/useBDOTable.ts +3 -2
  66. package/sdk/form.ts +2 -2
  67. package/sdk/form.types.ts +4 -4
  68. package/sdk/types/constants.ts +3 -3
  69. package/sdk/workflow/Activity.ts +29 -6
  70. package/sdk/workflow/client.ts +65 -25
  71. package/sdk/workflow/types.ts +10 -2
  72. package/dist/components/hooks/useForm/createItemProxy.d.ts.map +0 -1
  73. package/dist/components/hooks/useForm/createResolver.d.ts.map +0 -1
  74. package/dist/components/hooks/useForm/index.d.ts +0 -5
  75. package/dist/components/hooks/useForm/index.d.ts.map +0 -1
  76. package/dist/components/hooks/useForm/types.d.ts.map +0 -1
  77. package/dist/components/hooks/useForm/useForm.d.ts.map +0 -1
  78. package/dist/createResolver-AIgUwoS6.cjs +0 -1
  79. package/dist/createResolver-ZHXQ7QMa.js +0 -1078
  80. /package/dist/components/hooks/{useForm → useBDOForm}/createItemProxy.d.ts +0 -0
  81. /package/dist/components/hooks/{useForm → useBDOForm}/createResolver.d.ts +0 -0
  82. /package/sdk/components/hooks/{useForm → useBDOForm}/createItemProxy.ts +0 -0
  83. /package/sdk/components/hooks/{useForm → useBDOForm}/createResolver.ts +0 -0
package/docs/workflow.md CHANGED
@@ -97,62 +97,12 @@ type ActivityInstanceFieldsType = {
97
97
 
98
98
  See the dedicated [useActivityTable documentation](./useActivityTable.md) for `ActivityTableStatus`, `ActivityRowType`, `UseActivityTableOptionsType`, and `UseActivityTableReturnType`.
99
99
 
100
- **Key change:** Entity fields are now nested under `ADO` instead of being flattened at the top level. Access entity fields as `row.ADO.FieldName`.
100
+ Entity fields and system fields are flat at the top level, same as BDO tables. Access entity fields as `row.FieldName`.
101
101
 
102
102
 
103
- ### UseActivityFormOptions\<A\>
103
+ ### UseActivityFormOptions\<A\> / UseActivityFormReturn\<A\>
104
104
 
105
- ```typescript
106
- interface UseActivityFormOptions<A extends Activity<any, any, any>> {
107
- /** Activity instance identifier (from wf.start() or getInProgressList()) */
108
- activity_instance_id: string;
109
-
110
- /** Default form values */
111
- defaultValues?: Partial<ExtractActivityEditable<A>>;
112
-
113
- /** Validation mode (default: "onBlur") */
114
- mode?: "onBlur" | "onChange" | "onSubmit" | "onTouched" | "all";
115
-
116
- /** Whether to load activity data on mount (default: true) */
117
- enabled?: boolean;
118
- }
119
- ```
120
-
121
- ### UseActivityFormReturn\<A\>
122
-
123
- ```typescript
124
- interface UseActivityFormReturn<A extends Activity<any, any, any>> {
125
- // Core
126
- item: FormItemType<EditableFields, ReadonlyFields>;
127
- activity: A;
128
- register: FormRegisterType<EditableFields, ReadonlyFields>;
129
- handleSubmit: HandleSubmitType; // Save the activity form
130
- handleComplete: HandleSubmitType; // Complete the activity
131
-
132
- // RHF methods
133
- watch: UseFormWatch;
134
- setValue: UseFormSetValue;
135
- getValues: UseFormGetValues;
136
- reset: UseFormReset;
137
- trigger: UseFormTrigger;
138
- control: Control;
139
-
140
- // Form state
141
- errors: FieldErrors;
142
- isValid: boolean;
143
- isDirty: boolean;
144
- isSubmitting: boolean;
145
- isSubmitSuccessful: boolean;
146
-
147
- // Loading
148
- isLoading: boolean;
149
- loadError: Error | null;
150
- hasError: boolean;
151
-
152
- // Operations
153
- clearErrors: () => void;
154
- }
155
- ```
105
+ See the dedicated [useActivityForm documentation](./useActivityForm.md) for the full type definitions.
156
106
 
157
107
  ### File & Image Types
158
108
 
@@ -303,22 +253,46 @@ for (const item of result.Data) {
303
253
  }
304
254
  ```
305
255
 
306
- ### inProgressMetrics(options?)
256
+ ### inProgressCount(options?)
307
257
 
308
- Get count of in-progress activity instances. Returns `CountResponseType` (`{ Count: number }`).
258
+ Get count of in-progress activity instances. Returns `number`.
309
259
 
310
260
  ```typescript
311
- const { Count } = await activity.inProgressMetrics();
312
- console.log('In-progress count:', Count);
261
+ const count = await activity.inProgressCount();
262
+ console.log('In-progress count:', count);
313
263
  ```
314
264
 
315
- ### completedMetrics(options?)
265
+ ### completedCount(options?)
316
266
 
317
- Get count of completed activity instances. Returns `CountResponseType` (`{ Count: number }`).
267
+ Get count of completed activity instances. Returns `number`.
318
268
 
319
269
  ```typescript
320
- const { Count } = await activity.completedMetrics();
321
- console.log('Completed count:', Count);
270
+ const count = await activity.completedCount();
271
+ console.log('Completed count:', count);
272
+ ```
273
+
274
+ ### inProgressMetric(options)
275
+
276
+ Get aggregated metrics for in-progress activity instances. Accepts `Omit<MetricOptionsType, 'Type'>` for custom aggregations (Sum, Avg, Count, etc.). Returns `MetricResponseType` (`{ Data: Record<string, any>[] }`).
277
+
278
+ ```typescript
279
+ const result = await activity.inProgressMetric({
280
+ GroupBy: ['Status'],
281
+ Metric: [{ Field: '_id', Type: 'Count' }],
282
+ });
283
+ console.log(result.Data);
284
+ ```
285
+
286
+ ### completedMetric(options)
287
+
288
+ Get aggregated metrics for completed activity instances. Same signature as `inProgressMetric`.
289
+
290
+ ```typescript
291
+ const result = await activity.completedMetric({
292
+ GroupBy: [],
293
+ Metric: [{ Field: 'LeaveDays', Type: 'Sum' }],
294
+ });
295
+ console.log('Total leave days:', result.Data[0]?.sum_LeaveDays);
322
296
  ```
323
297
 
324
298
  ### getInstance(instanceId)
@@ -351,65 +325,7 @@ const progress = await instance.progress(); // get progress (ActivityP
351
325
 
352
326
  ## useActivityForm Hook
353
327
 
354
- React hook for building forms bound to workflow activity input fields. Integrates with `react-hook-form`.
355
-
356
- ### Options
357
-
358
- | Property | Type | Default | Description |
359
- |----------|------|---------|-------------|
360
- | `activity_instance_id` | `string` | *required* | Activity instance ID (from `wf.start()` or `getInProgressList()`) |
361
- | `defaultValues` | `Partial<Editable>` | `{}` | Initial form values |
362
- | `mode` | `"onBlur" \| "onChange" \| "onSubmit" \| "onTouched" \| "all"` | `"onBlur"` | Validation timing |
363
- | `enabled` | `boolean` | `true` | Whether to load activity data on mount |
364
-
365
- ### Lifecycle
366
-
367
- ```
368
- Mount
369
- |
370
- |-> Load activity instance data -> populate form
371
- |
372
- v
373
- User edits field -> blurs
374
- |
375
- |-> Field validation (BaseField.validate)
376
- |-> If valid + readonly fields exist -> update computed fields
377
- |
378
- v
379
- User clicks Save
380
- |
381
- |-> handleSubmit -> save activity data
382
- |
383
- v
384
- User clicks Complete
385
- |
386
- |-> handleComplete -> complete activity
387
- ```
388
-
389
- ### Return Value
390
-
391
- | Property | Type | Description |
392
- |----------|------|-------------|
393
- | `item` | `FormItemType` | Proxy with typed field accessors (`.get()`, `.set()`, `.meta`) |
394
- | `activity` | `A` | The Activity instance |
395
- | `register` | `FormRegisterType` | Smart register (auto-disables readonly fields) |
396
- | `handleSubmit` | `HandleSubmitType` | Save activity data |
397
- | `handleComplete` | `HandleSubmitType` | Complete the activity |
398
- | `watch` | `UseFormWatch` | Watch field values |
399
- | `setValue` | `UseFormSetValue` | Set field value programmatically |
400
- | `getValues` | `UseFormGetValues` | Get current field values |
401
- | `reset` | `UseFormReset` | Reset form to default values |
402
- | `trigger` | `UseFormTrigger` | Trigger validation |
403
- | `control` | `Control` | RHF control (for Controller components) |
404
- | `errors` | `FieldErrors` | Validation errors |
405
- | `isValid` | `boolean` | Form is valid |
406
- | `isDirty` | `boolean` | Form has been modified |
407
- | `isSubmitting` | `boolean` | Currently submitting |
408
- | `isSubmitSuccessful` | `boolean` | Last submission succeeded |
409
- | `isLoading` | `boolean` | Loading activity data |
410
- | `loadError` | `Error \| null` | Load error |
411
- | `hasError` | `boolean` | Any error active |
412
- | `clearErrors` | `() => void` | Clear all form errors |
328
+ See the dedicated [useActivityForm documentation](./useActivityForm.md) for the full API reference, type definitions, and examples.
413
329
 
414
330
  ---
415
331
 
@@ -417,7 +333,7 @@ User clicks Complete
417
333
 
418
334
  See the dedicated [useActivityTable documentation](./useActivityTable.md) for the full API reference, type definitions, and examples.
419
335
 
420
- `useActivityTable` now wraps the base `useTable` hook, providing the same search, sort, filter, and pagination capabilities as BDO tables. Entity fields are accessed via `row.ADO.FieldName`.
336
+ `useActivityTable` provides search, sort, filter, and pagination capabilities, same as `useBDOTable`. Entity fields are accessed at the top level (e.g., `row.FieldName`).
421
337
 
422
338
  ---
423
339
 
@@ -439,115 +355,7 @@ const progress = await wf.progress(BPInstanceId);
439
355
 
440
356
  ### Step 2 — React component with useActivityForm
441
357
 
442
- ```tsx
443
- import { useMemo } from "react";
444
- import { useActivityForm } from "@ram_28/kf-ai-sdk/workflow";
445
- import type { UseActivityFormOptions } from "@ram_28/kf-ai-sdk/workflow";
446
- import type { FieldErrors } from "react-hook-form";
447
- import { SimpleLeaveProcess, EmployeeInputActivity } from "@/bdo/workflows/SimpleLeaveProcess";
448
-
449
- interface LeaveRequestFormProps {
450
- activityInstanceId: string;
451
- onComplete: () => void;
452
- }
453
-
454
- function LeaveRequestForm({ activityInstanceId, onComplete }: LeaveRequestFormProps) {
455
- // 1. Get the typed activity from the workflow
456
- const activity = useMemo(() => new SimpleLeaveProcess().employeeInputActivity(), []);
457
-
458
- // 2. Hook options
459
- const options: UseActivityFormOptions<EmployeeInputActivity> = {
460
- activity_instance_id: activityInstanceId,
461
- defaultValues: {
462
- StartDate: undefined,
463
- EndDate: undefined,
464
- LeaveType: undefined,
465
- },
466
- mode: "onBlur",
467
- };
468
-
469
- // 3. Initialize hook
470
- const {
471
- register,
472
- handleSubmit,
473
- handleComplete,
474
- item,
475
- errors,
476
- isLoading,
477
- isSubmitting,
478
- loadError,
479
- } = useActivityForm(activity, options);
480
-
481
- if (isLoading) return <div>Loading...</div>;
482
- if (loadError) return <div>Error: {loadError.message}</div>;
483
-
484
- // 4. Handlers
485
- const onSaveSuccess = (): void => {
486
- console.log("Saved!");
487
- };
488
-
489
- const onCompleteSuccess = (): void => {
490
- console.log("Leave request submitted!");
491
- onComplete();
492
- };
493
-
494
- const onError = (error: FieldErrors | Error): void => {
495
- if (error instanceof Error) {
496
- console.error("API Error:", error.message);
497
- } else {
498
- console.error("Validation errors:", error);
499
- }
500
- };
501
-
502
- return (
503
- <form>
504
- <h2>Leave Request</h2>
505
-
506
- {/* Start Date */}
507
- <div>
508
- <label>{activity.StartDate.label}</label>
509
- <input type="date" {...register(activity.StartDate.id)} />
510
- {errors.StartDate && <span>{errors.StartDate.message}</span>}
511
- </div>
512
-
513
- {/* End Date */}
514
- <div>
515
- <label>{activity.EndDate.label}</label>
516
- <input type="date" {...register(activity.EndDate.id)} />
517
- {errors.EndDate && <span>{errors.EndDate.message}</span>}
518
- </div>
519
-
520
- {/* Leave Type */}
521
- <div>
522
- <label>{activity.LeaveType.label}</label>
523
- <select {...register(activity.LeaveType.id)}>
524
- <option value="">Select type</option>
525
- <option value="PTO">PTO</option>
526
- <option value="Sick">Sick</option>
527
- <option value="Parental">Parental</option>
528
- </select>
529
- {errors.LeaveType && <span>{errors.LeaveType.message}</span>}
530
- </div>
531
-
532
- {/* Leave Days (readonly — auto-disabled, computed by server) */}
533
- <div>
534
- <label>{activity.LeaveDays.label}</label>
535
- <input type="number" {...register(activity.LeaveDays.id)} />
536
- </div>
537
-
538
- {/* Actions */}
539
- <div>
540
- <button type="button" onClick={handleSubmit(onSaveSuccess, onError)}>
541
- {isSubmitting ? "Saving..." : "Save Draft"}
542
- </button>
543
- <button type="button" onClick={handleComplete(onCompleteSuccess, onError)}>
544
- {isSubmitting ? "Submitting..." : "Submit Leave Request"}
545
- </button>
546
- </div>
547
- </form>
548
- );
549
- }
550
- ```
358
+ See [useActivityForm](./useActivityForm.md) for the full form component example.
551
359
 
552
360
  ### Full flow orchestration
553
361
 
@@ -592,7 +400,8 @@ import { SimpleLeaveProcess, ManagerApprovalActivity } from "@/bdo/workflows/Sim
592
400
  const wf = new SimpleLeaveProcess();
593
401
  const activity = wf.managerApprovalActivity();
594
402
 
595
- const { rows, totalItems, isLoading, error, pagination, refetch } = useActivityTable(activity, {
403
+ const { rows, totalItems, isLoading, error, pagination, refetch } = useActivityTable({
404
+ activity,
596
405
  status: ActivityTableStatus.InProgress,
597
406
  initialState: {
598
407
  pagination: { pageNo: 1, pageSize: 10 },
@@ -634,8 +443,8 @@ const activity = wf.managerApprovalActivity();
634
443
  <td>{row._id}</td>
635
444
  <td>{row.Status}</td>
636
445
  <td>{row.AssignedTo.map((u) => u._name).join(", ")}</td>
637
- <td>{row.ADO.ManagerApproved ? "Yes" : "No"}</td>
638
- <td>{row.ADO.ManagerReason}</td>
446
+ <td>{row.ManagerApproved ? "Yes" : "No"}</td>
447
+ <td>{row.ManagerReason}</td>
639
448
  <td>
640
449
  <button onClick={() => setSelectedId(row._id)}>Review</button>
641
450
  </td>
@@ -655,74 +464,7 @@ const activity = wf.managerApprovalActivity();
655
464
 
656
465
  ### Step 2 — Approval form component
657
466
 
658
- ```tsx
659
- import { useMemo } from "react";
660
- import { useActivityForm } from "@ram_28/kf-ai-sdk/workflow";
661
- import type { UseActivityFormOptions } from "@ram_28/kf-ai-sdk/workflow";
662
- import type { FieldErrors } from "react-hook-form";
663
- import { SimpleLeaveProcess, ManagerApprovalActivity } from "@/bdo/workflows/SimpleLeaveProcess";
664
-
665
- interface ApprovalFormProps {
666
- activityInstanceId: string;
667
- onComplete: () => void;
668
- }
669
-
670
- function ApprovalForm({ activityInstanceId, onComplete }: ApprovalFormProps) {
671
- const activity = useMemo(() => new SimpleLeaveProcess().managerApprovalActivity(), []);
672
-
673
- const options: UseActivityFormOptions<ManagerApprovalActivity> = {
674
- activity_instance_id: activityInstanceId,
675
- defaultValues: {
676
- ManagerApproved: false,
677
- ManagerReason: "",
678
- },
679
- mode: "onBlur",
680
- };
681
-
682
- const {
683
- register,
684
- handleComplete,
685
- errors,
686
- isLoading,
687
- isSubmitting,
688
- loadError,
689
- } = useActivityForm(activity, options);
690
-
691
- if (isLoading) return <div>Loading...</div>;
692
- if (loadError) return <div>Error: {loadError.message}</div>;
693
-
694
- const onSuccess = (): void => {
695
- console.log("Approval submitted!");
696
- onComplete();
697
- };
698
-
699
- const onError = (error: FieldErrors | Error): void => {
700
- if (error instanceof Error) console.error("API Error:", error.message);
701
- };
702
-
703
- return (
704
- <form>
705
- <h2>Leave Approval</h2>
706
-
707
- <div>
708
- <label>
709
- <input type="checkbox" {...register(activity.ManagerApproved.id)} />
710
- {activity.ManagerApproved.label}
711
- </label>
712
- </div>
713
-
714
- <div>
715
- <label>{activity.ManagerReason.label}</label>
716
- <textarea {...register(activity.ManagerReason.id)} rows={4} />
717
- </div>
718
-
719
- <button type="button" onClick={handleComplete(onSuccess, onError)}>
720
- {isSubmitting ? "Submitting..." : "Submit Decision"}
721
- </button>
722
- </form>
723
- );
724
- }
725
- ```
467
+ See [useActivityForm](./useActivityForm.md) for the full approval form component example.
726
468
 
727
469
  ---
728
470
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ram_28/kf-ai-sdk",
3
- "version": "2.0.15",
3
+ "version": "2.0.16",
4
4
  "description": "Type-safe, AI-driven SDK for building modern web applications with role-based access control",
5
5
  "author": "Ramprasad",
6
6
  "license": "MIT",
@@ -189,7 +189,7 @@
189
189
  "react",
190
190
  "hooks",
191
191
  "typescript",
192
- "useForm",
192
+ "useBDOForm",
193
193
  "useTable",
194
194
  "useFilter",
195
195
  "bdo",
@@ -127,7 +127,7 @@ export abstract class BaseBdo<
127
127
  /**
128
128
  * Load backend metadata for expression-based validation
129
129
  *
130
- * Called by useForm after fetching schema from the backend.
130
+ * Called by useBDOForm after fetching schema from the backend.
131
131
  * This enables expression-based validation rules to be used
132
132
  * in addition to type validation.
133
133
  *
@@ -241,7 +241,7 @@ export abstract class BaseBdo<
241
241
  }
242
242
 
243
243
  // ============================================================
244
- // DRAFT OPERATIONS (for useForm integration)
244
+ // DRAFT OPERATIONS (for useBDOForm integration)
245
245
  // ============================================================
246
246
 
247
247
  /**
@@ -18,7 +18,7 @@ import type {
18
18
  FormItemType,
19
19
  EditableFormFieldAccessorType,
20
20
  ReadonlyFormFieldAccessorType,
21
- } from '../useForm/types';
21
+ } from '../useBDOForm/types';
22
22
  import type { Activity } from '../../../workflow/Activity';
23
23
  import type {
24
24
  ExtractActivityEditable,
@@ -10,7 +10,7 @@ import type { FieldValues } from 'react-hook-form';
10
10
  import type { Activity } from '../../../workflow/Activity';
11
11
  import type { BaseField } from '../../../bdo/fields/BaseField';
12
12
  import type { ValidationResultType } from '../../../bdo/core/types';
13
- import { validateConstraints } from '../useForm/createResolver';
13
+ import { validateConstraints } from '../useBDOForm/createResolver';
14
14
 
15
15
  /**
16
16
  * Creates a React Hook Form resolver for Activity field validation.
@@ -2,7 +2,7 @@
2
2
  // TYPE DEFINITIONS FOR useActivityForm HOOK
3
3
  // ============================================================
4
4
  // BDO-aligned types for the Activity pattern.
5
- // Reuses shared types from useForm where identical.
5
+ // Reuses shared types from useBDOForm where identical.
6
6
 
7
7
  import type {
8
8
  UseFormWatch,
@@ -16,14 +16,14 @@ import type {
16
16
 
17
17
  import type { Activity } from '../../../workflow/Activity';
18
18
 
19
- // Reuse shared types from useForm — identical interfaces, no duplication
19
+ // Reuse shared types from useBDOForm — identical interfaces, no duplication
20
20
  import type {
21
21
  HandleSubmitType,
22
22
  FormItemType,
23
23
  FormRegisterType,
24
24
  EditableFormFieldAccessorType,
25
25
  ReadonlyFormFieldAccessorType,
26
- } from '../useForm/types';
26
+ } from '../useBDOForm/types';
27
27
 
28
28
  // Re-export for consumers who import from this module
29
29
  export type {
@@ -89,7 +89,7 @@ export interface UseActivityFormOptions<A extends Activity<any, any, any>> {
89
89
  // ============================================================
90
90
 
91
91
  /**
92
- * useActivityForm hook return type — mirrors useForm return structure
92
+ * useActivityForm hook return type — mirrors useBDOForm return structure
93
93
  */
94
94
  export interface UseActivityFormReturn<A extends Activity<any, any, any>> {
95
95
  /** Item proxy with typed field accessors */