@opengeni/contracts 0.32.0 → 0.36.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.
@@ -4,6 +4,7 @@ export declare const WORKSPACE_INSTRUCTION_POLICY_PROMPT_MAX_UTF8_BYTES = 131072
4
4
  export declare const WORKSPACE_INSTRUCTION_POLICY_REASON_MAX_CHARS = 4096;
5
5
  export declare const WORKSPACE_INSTRUCTION_POLICY_ROLE_KEY_MAX_CHARS = 64;
6
6
  export declare const WORKSPACE_INSTRUCTION_POLICY_SOURCE_ID_MAX_CHARS = 512;
7
+ export declare const WORKSPACE_INSTRUCTION_POLICY_ONBOARDING_SOURCE_VERSION_MAX_CHARS = 256;
7
8
  export declare const WorkspaceInstructionPolicyKind: z.ZodEnum<{
8
9
  charter: "charter";
9
10
  policy: "policy";
@@ -89,6 +90,7 @@ export declare const WorkspaceInstructionPolicyRevision: z.ZodObject<{
89
90
  id: z.ZodString;
90
91
  revision: z.ZodNumber;
91
92
  contentHash: z.ZodString;
93
+ operationId: z.ZodString;
92
94
  accountId: z.ZodString;
93
95
  workspaceId: z.ZodString;
94
96
  content: z.ZodString;
@@ -285,6 +287,7 @@ export declare const WorkspaceInstructionPolicyActivationEvent: z.ZodObject<{
285
287
  }>;
286
288
  roleKey: z.ZodNullable<z.ZodString>;
287
289
  id: z.ZodString;
290
+ operationId: z.ZodString;
288
291
  accountId: z.ZodString;
289
292
  workspaceId: z.ZodString;
290
293
  type: z.ZodEnum<{
@@ -308,6 +311,7 @@ export declare const WorkspaceInstructionPolicyActivationEvent: z.ZodObject<{
308
311
  }, z.core.$strip>;
309
312
  export type WorkspaceInstructionPolicyActivationEvent = z.infer<typeof WorkspaceInstructionPolicyActivationEvent>;
310
313
  export declare const CreateWorkspaceInstructionPolicyDraftRequest: z.ZodObject<{
314
+ operationId: z.ZodOptional<z.ZodString>;
311
315
  kind: z.ZodEnum<{
312
316
  charter: "charter";
313
317
  policy: "policy";
@@ -328,6 +332,7 @@ export declare const CreateWorkspaceInstructionPolicyDraftRequest: z.ZodObject<{
328
332
  }, z.core.$strip>;
329
333
  export type CreateWorkspaceInstructionPolicyDraftRequest = z.infer<typeof CreateWorkspaceInstructionPolicyDraftRequest>;
330
334
  export declare const ImportLegacyWorkspaceInstructionPolicyDraftRequest: z.ZodObject<{
335
+ operationId: z.ZodOptional<z.ZodString>;
331
336
  supersedesRevisionId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
332
337
  }, z.core.$strict>;
333
338
  export type ImportLegacyWorkspaceInstructionPolicyDraftRequest = z.infer<typeof ImportLegacyWorkspaceInstructionPolicyDraftRequest>;
@@ -359,6 +364,7 @@ export declare const WorkspaceInstructionPolicyListResponse: z.ZodObject<{
359
364
  id: z.ZodString;
360
365
  revision: z.ZodNumber;
361
366
  contentHash: z.ZodString;
367
+ operationId: z.ZodString;
362
368
  accountId: z.ZodString;
363
369
  workspaceId: z.ZodString;
364
370
  content: z.ZodString;
@@ -403,6 +409,7 @@ export declare const WorkspaceInstructionPolicyListResponse: z.ZodObject<{
403
409
  }>;
404
410
  roleKey: z.ZodNullable<z.ZodString>;
405
411
  id: z.ZodString;
412
+ operationId: z.ZodString;
406
413
  accountId: z.ZodString;
407
414
  workspaceId: z.ZodString;
408
415
  type: z.ZodEnum<{
@@ -446,6 +453,7 @@ export declare const WorkspaceInstructionPolicyDiffResponse: z.ZodObject<{
446
453
  id: z.ZodString;
447
454
  revision: z.ZodNumber;
448
455
  contentHash: z.ZodString;
456
+ operationId: z.ZodString;
449
457
  accountId: z.ZodString;
450
458
  workspaceId: z.ZodString;
451
459
  content: z.ZodString;
@@ -475,6 +483,7 @@ export declare const WorkspaceInstructionPolicyDiffResponse: z.ZodObject<{
475
483
  id: z.ZodString;
476
484
  revision: z.ZodNumber;
477
485
  contentHash: z.ZodString;
486
+ operationId: z.ZodString;
478
487
  accountId: z.ZodString;
479
488
  workspaceId: z.ZodString;
480
489
  content: z.ZodString;
@@ -496,13 +505,17 @@ export declare const WorkspaceInstructionPolicyDiffResponse: z.ZodObject<{
496
505
  }, z.core.$strip>;
497
506
  export type WorkspaceInstructionPolicyDiffResponse = z.infer<typeof WorkspaceInstructionPolicyDiffResponse>;
498
507
  export declare const ActivateWorkspaceInstructionPolicyRequest: z.ZodObject<{
508
+ operationId: z.ZodOptional<z.ZodString>;
499
509
  expectedCurrentRevisionId: z.ZodNullable<z.ZodString>;
510
+ expectedActivationVersion: z.ZodOptional<z.ZodNumber>;
500
511
  reason: z.ZodString;
501
512
  }, z.core.$strip>;
502
513
  export type ActivateWorkspaceInstructionPolicyRequest = z.infer<typeof ActivateWorkspaceInstructionPolicyRequest>;
503
514
  export declare const RollbackWorkspaceInstructionPolicyRequest: z.ZodObject<{
515
+ operationId: z.ZodOptional<z.ZodString>;
504
516
  targetRevisionId: z.ZodString;
505
517
  expectedCurrentRevisionId: z.ZodString;
518
+ expectedActivationVersion: z.ZodOptional<z.ZodNumber>;
506
519
  reason: z.ZodString;
507
520
  }, z.core.$strip>;
508
521
  export type RollbackWorkspaceInstructionPolicyRequest = z.infer<typeof RollbackWorkspaceInstructionPolicyRequest>;
@@ -535,6 +548,7 @@ export declare const WorkspaceInstructionPolicyActivationResponse: z.ZodObject<{
535
548
  }>;
536
549
  roleKey: z.ZodNullable<z.ZodString>;
537
550
  id: z.ZodString;
551
+ operationId: z.ZodString;
538
552
  accountId: z.ZodString;
539
553
  workspaceId: z.ZodString;
540
554
  type: z.ZodEnum<{
@@ -580,3 +594,220 @@ export declare const WorkspaceInstructionPolicyConflictResponse: z.ZodObject<{
580
594
  }, z.core.$strip>>;
581
595
  }, z.core.$strip>;
582
596
  export type WorkspaceInstructionPolicyConflictResponse = z.infer<typeof WorkspaceInstructionPolicyConflictResponse>;
597
+ export declare const WorkspaceInstructionPolicyOperationReuseResponse: z.ZodObject<{
598
+ code: z.ZodLiteral<"WORKSPACE_INSTRUCTION_POLICY_OPERATION_REUSED">;
599
+ message: z.ZodString;
600
+ }, z.core.$strip>;
601
+ export type WorkspaceInstructionPolicyOperationReuseResponse = z.infer<typeof WorkspaceInstructionPolicyOperationReuseResponse>;
602
+ export declare const WorkspaceInstructionPolicyOnboardingProposalSource: z.ZodObject<{
603
+ id: z.ZodString;
604
+ version: z.ZodString;
605
+ confidenceBps: z.ZodNumber;
606
+ }, z.core.$strip>;
607
+ export type WorkspaceInstructionPolicyOnboardingProposalSource = z.infer<typeof WorkspaceInstructionPolicyOnboardingProposalSource>;
608
+ export declare const CreateWorkspaceInstructionPolicyOnboardingProposalRequest: z.ZodObject<{
609
+ operationId: z.ZodOptional<z.ZodString>;
610
+ kind: z.ZodEnum<{
611
+ charter: "charter";
612
+ policy: "policy";
613
+ }>;
614
+ scope: z.ZodEnum<{
615
+ global: "global";
616
+ role: "role";
617
+ }>;
618
+ roleKey: z.ZodDefault<z.ZodNullable<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>>>;
619
+ content: z.ZodString;
620
+ sourceId: z.ZodString;
621
+ sourceVersion: z.ZodString;
622
+ confidenceBps: z.ZodNumber;
623
+ expectedCurrentRevisionId: z.ZodNullable<z.ZodString>;
624
+ expectedActivationVersion: z.ZodNumber;
625
+ }, z.core.$strip>;
626
+ export type CreateWorkspaceInstructionPolicyOnboardingProposalRequest = z.infer<typeof CreateWorkspaceInstructionPolicyOnboardingProposalRequest>;
627
+ export declare const WorkspaceInstructionPolicyOnboardingProposal: z.ZodObject<{
628
+ kind: z.ZodEnum<{
629
+ charter: "charter";
630
+ policy: "policy";
631
+ }>;
632
+ scope: z.ZodEnum<{
633
+ global: "global";
634
+ role: "role";
635
+ }>;
636
+ roleKey: z.ZodNullable<z.ZodString>;
637
+ id: z.ZodString;
638
+ operationId: z.ZodString;
639
+ accountId: z.ZodString;
640
+ workspaceId: z.ZodString;
641
+ source: z.ZodObject<{
642
+ id: z.ZodString;
643
+ version: z.ZodString;
644
+ confidenceBps: z.ZodNumber;
645
+ }, z.core.$strip>;
646
+ baseline: z.ZodNullable<z.ZodObject<{
647
+ kind: z.ZodEnum<{
648
+ charter: "charter";
649
+ policy: "policy";
650
+ }>;
651
+ scope: z.ZodEnum<{
652
+ global: "global";
653
+ role: "role";
654
+ }>;
655
+ roleKey: z.ZodNullable<z.ZodString>;
656
+ workspaceId: z.ZodString;
657
+ revisionId: z.ZodString;
658
+ revision: z.ZodNumber;
659
+ contentHash: z.ZodString;
660
+ activationVersion: z.ZodNumber;
661
+ activatedAt: z.ZodString;
662
+ }, z.core.$strip>>;
663
+ draft: z.ZodObject<{
664
+ kind: z.ZodEnum<{
665
+ charter: "charter";
666
+ policy: "policy";
667
+ }>;
668
+ scope: z.ZodEnum<{
669
+ global: "global";
670
+ role: "role";
671
+ }>;
672
+ roleKey: z.ZodNullable<z.ZodString>;
673
+ id: z.ZodString;
674
+ revision: z.ZodNumber;
675
+ contentHash: z.ZodString;
676
+ operationId: z.ZodString;
677
+ accountId: z.ZodString;
678
+ workspaceId: z.ZodString;
679
+ content: z.ZodString;
680
+ provenance: z.ZodObject<{
681
+ source: z.ZodEnum<{
682
+ human: "human";
683
+ knowledge_proposal: "knowledge_proposal";
684
+ legacy_import: "legacy_import";
685
+ onboarding: "onboarding";
686
+ }>;
687
+ sourceId: z.ZodNullable<z.ZodString>;
688
+ }, z.core.$strip>;
689
+ supersedesRevisionId: z.ZodNullable<z.ZodString>;
690
+ createdBySubjectId: z.ZodString;
691
+ createdAt: z.ZodString;
692
+ }, z.core.$strip>;
693
+ status: z.ZodLiteral<"proposed">;
694
+ createdBySubjectId: z.ZodString;
695
+ createdAt: z.ZodString;
696
+ }, z.core.$strip>;
697
+ export type WorkspaceInstructionPolicyOnboardingProposal = z.infer<typeof WorkspaceInstructionPolicyOnboardingProposal>;
698
+ export declare const WorkspaceInstructionPolicyOnboardingProposalListQuery: z.ZodObject<{
699
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
700
+ }, z.core.$strip>;
701
+ export type WorkspaceInstructionPolicyOnboardingProposalListQuery = z.infer<typeof WorkspaceInstructionPolicyOnboardingProposalListQuery>;
702
+ export declare const WorkspaceInstructionPolicyOnboardingProposalListResponse: z.ZodObject<{
703
+ proposals: z.ZodArray<z.ZodObject<{
704
+ kind: z.ZodEnum<{
705
+ charter: "charter";
706
+ policy: "policy";
707
+ }>;
708
+ scope: z.ZodEnum<{
709
+ global: "global";
710
+ role: "role";
711
+ }>;
712
+ roleKey: z.ZodNullable<z.ZodString>;
713
+ id: z.ZodString;
714
+ operationId: z.ZodString;
715
+ accountId: z.ZodString;
716
+ workspaceId: z.ZodString;
717
+ source: z.ZodObject<{
718
+ id: z.ZodString;
719
+ version: z.ZodString;
720
+ confidenceBps: z.ZodNumber;
721
+ }, z.core.$strip>;
722
+ baseline: z.ZodNullable<z.ZodObject<{
723
+ kind: z.ZodEnum<{
724
+ charter: "charter";
725
+ policy: "policy";
726
+ }>;
727
+ scope: z.ZodEnum<{
728
+ global: "global";
729
+ role: "role";
730
+ }>;
731
+ roleKey: z.ZodNullable<z.ZodString>;
732
+ workspaceId: z.ZodString;
733
+ revisionId: z.ZodString;
734
+ revision: z.ZodNumber;
735
+ contentHash: z.ZodString;
736
+ activationVersion: z.ZodNumber;
737
+ activatedAt: z.ZodString;
738
+ }, z.core.$strip>>;
739
+ draft: z.ZodObject<{
740
+ kind: z.ZodEnum<{
741
+ charter: "charter";
742
+ policy: "policy";
743
+ }>;
744
+ scope: z.ZodEnum<{
745
+ global: "global";
746
+ role: "role";
747
+ }>;
748
+ roleKey: z.ZodNullable<z.ZodString>;
749
+ id: z.ZodString;
750
+ revision: z.ZodNumber;
751
+ contentHash: z.ZodString;
752
+ operationId: z.ZodString;
753
+ accountId: z.ZodString;
754
+ workspaceId: z.ZodString;
755
+ content: z.ZodString;
756
+ provenance: z.ZodObject<{
757
+ source: z.ZodEnum<{
758
+ human: "human";
759
+ knowledge_proposal: "knowledge_proposal";
760
+ legacy_import: "legacy_import";
761
+ onboarding: "onboarding";
762
+ }>;
763
+ sourceId: z.ZodNullable<z.ZodString>;
764
+ }, z.core.$strip>;
765
+ supersedesRevisionId: z.ZodNullable<z.ZodString>;
766
+ createdBySubjectId: z.ZodString;
767
+ createdAt: z.ZodString;
768
+ }, z.core.$strip>;
769
+ status: z.ZodLiteral<"proposed">;
770
+ createdBySubjectId: z.ZodString;
771
+ createdAt: z.ZodString;
772
+ }, z.core.$strip>>;
773
+ truncated: z.ZodBoolean;
774
+ }, z.core.$strip>;
775
+ export type WorkspaceInstructionPolicyOnboardingProposalListResponse = z.infer<typeof WorkspaceInstructionPolicyOnboardingProposalListResponse>;
776
+ export declare const WorkspaceInstructionPolicyOnboardingProposalContentErrorResponse: z.ZodObject<{
777
+ code: z.ZodEnum<{
778
+ WORKSPACE_INSTRUCTION_POLICY_ONBOARDING_PROPOSAL_EMPTY: "WORKSPACE_INSTRUCTION_POLICY_ONBOARDING_PROPOSAL_EMPTY";
779
+ WORKSPACE_INSTRUCTION_POLICY_ONBOARDING_PROPOSAL_OVERSIZED: "WORKSPACE_INSTRUCTION_POLICY_ONBOARDING_PROPOSAL_OVERSIZED";
780
+ }>;
781
+ message: z.ZodString;
782
+ maxChars: z.ZodNumber;
783
+ }, z.core.$strip>;
784
+ export type WorkspaceInstructionPolicyOnboardingProposalContentErrorResponse = z.infer<typeof WorkspaceInstructionPolicyOnboardingProposalContentErrorResponse>;
785
+ export declare const WorkspaceInstructionPolicyOnboardingProposalStaleResponse: z.ZodObject<{
786
+ code: z.ZodLiteral<"WORKSPACE_INSTRUCTION_POLICY_ONBOARDING_PROPOSAL_STALE">;
787
+ message: z.ZodString;
788
+ currentHead: z.ZodNullable<z.ZodObject<{
789
+ kind: z.ZodEnum<{
790
+ charter: "charter";
791
+ policy: "policy";
792
+ }>;
793
+ scope: z.ZodEnum<{
794
+ global: "global";
795
+ role: "role";
796
+ }>;
797
+ roleKey: z.ZodNullable<z.ZodString>;
798
+ workspaceId: z.ZodString;
799
+ revisionId: z.ZodString;
800
+ revision: z.ZodNumber;
801
+ contentHash: z.ZodString;
802
+ activationVersion: z.ZodNumber;
803
+ activatedAt: z.ZodString;
804
+ }, z.core.$strip>>;
805
+ }, z.core.$strip>;
806
+ export type WorkspaceInstructionPolicyOnboardingProposalStaleResponse = z.infer<typeof WorkspaceInstructionPolicyOnboardingProposalStaleResponse>;
807
+ export declare const WorkspaceInstructionPolicyOnboardingProposalConflictResponse: z.ZodObject<{
808
+ code: z.ZodLiteral<"WORKSPACE_INSTRUCTION_POLICY_ONBOARDING_PROPOSAL_CONFLICT">;
809
+ message: z.ZodString;
810
+ existingProposalId: z.ZodString;
811
+ existingDraftRevisionId: z.ZodString;
812
+ }, z.core.$strip>;
813
+ export type WorkspaceInstructionPolicyOnboardingProposalConflictResponse = z.infer<typeof WorkspaceInstructionPolicyOnboardingProposalConflictResponse>;
@@ -6,6 +6,10 @@ export declare const WORKSPACE_STATE_MAX_GAPS = 16;
6
6
  export declare const WORKSPACE_STATE_BASE_NAME_MAX_CHARS = 160;
7
7
  export declare const WORKSPACE_STATE_TOPIC_MAX_CHARS = 96;
8
8
  export declare const WORKSPACE_STATE_MEMORY_SAMPLE_LIMIT = 100;
9
+ export declare const WorkspaceStateQuery: z.ZodObject<{
10
+ attemptId: z.ZodOptional<z.ZodString>;
11
+ }, z.core.$strict>;
12
+ export type WorkspaceStateQuery = z.infer<typeof WorkspaceStateQuery>;
9
13
  export declare const WorkspaceStateDocumentStatusCounts: z.ZodObject<{
10
14
  queued: z.ZodNumber;
11
15
  indexing: z.ZodNumber;
@@ -364,6 +368,118 @@ export declare const WorkspaceStateKnowledge: z.ZodDiscriminatedUnion<[z.ZodObje
364
368
  requiredPermission: z.ZodLiteral<"documents:search">;
365
369
  }, z.core.$strict>], "availability">;
366
370
  export type WorkspaceStateKnowledge = z.infer<typeof WorkspaceStateKnowledge>;
371
+ export declare const WorkspaceStateGovernanceDriftStatus: z.ZodEnum<{
372
+ changed: "changed";
373
+ identical: "identical";
374
+ missing: "missing";
375
+ superseded: "superseded";
376
+ truncated: "truncated";
377
+ unavailable: "unavailable";
378
+ }>;
379
+ export type WorkspaceStateGovernanceDriftStatus = z.infer<typeof WorkspaceStateGovernanceDriftStatus>;
380
+ export declare const WorkspaceStateAttemptGovernance: z.ZodDiscriminatedUnion<[z.ZodObject<{
381
+ status: z.ZodLiteral<"not_requested">;
382
+ }, z.core.$strict>, z.ZodObject<{
383
+ status: z.ZodLiteral<"unavailable">;
384
+ reason: z.ZodLiteral<"attempt_not_found_or_not_authorized">;
385
+ driftStatus: z.ZodLiteral<"unavailable">;
386
+ }, z.core.$strict>, z.ZodObject<{
387
+ status: z.ZodLiteral<"available">;
388
+ attemptId: z.ZodString;
389
+ executionGeneration: z.ZodNumber;
390
+ acceptedAt: z.ZodString;
391
+ policySnapshot: z.ZodDiscriminatedUnion<[z.ZodObject<{
392
+ status: z.ZodLiteral<"available">;
393
+ id: z.ZodString;
394
+ createdAt: z.ZodString;
395
+ entryHash: z.ZodString;
396
+ policyRole: z.ZodNullable<z.ZodString>;
397
+ roleSource: z.ZodEnum<{
398
+ invalid_metadata_fallback: "invalid_metadata_fallback";
399
+ metadata_fallback: "metadata_fallback";
400
+ none: "none";
401
+ session_binding: "session_binding";
402
+ }>;
403
+ entries: z.ZodArray<z.ZodObject<{
404
+ kind: z.ZodEnum<{
405
+ charter: "charter";
406
+ policy: "policy";
407
+ }>;
408
+ scope: z.ZodEnum<{
409
+ global: "global";
410
+ role: "role";
411
+ }>;
412
+ roleKey: z.ZodNullable<z.ZodString>;
413
+ revisionId: z.ZodString;
414
+ revision: z.ZodNumber;
415
+ contentHash: z.ZodString;
416
+ activationVersion: z.ZodNumber;
417
+ activatedAt: z.ZodString;
418
+ provenance: z.ZodObject<{
419
+ source: z.ZodEnum<{
420
+ human: "human";
421
+ knowledge_proposal: "knowledge_proposal";
422
+ legacy_import: "legacy_import";
423
+ onboarding: "onboarding";
424
+ }>;
425
+ sourceIdHash: z.ZodNullable<z.ZodString>;
426
+ }, z.core.$strip>;
427
+ }, z.core.$strip>>;
428
+ }, z.core.$strict>, z.ZodObject<{
429
+ status: z.ZodLiteral<"missing">;
430
+ }, z.core.$strict>], "status">;
431
+ preferenceSnapshot: z.ZodDiscriminatedUnion<[z.ZodObject<{
432
+ status: z.ZodLiteral<"available">;
433
+ id: z.ZodString;
434
+ createdAt: z.ZodString;
435
+ descriptorHash: z.ZodString;
436
+ descriptorCount: z.ZodNumber;
437
+ truncated: z.ZodBoolean;
438
+ }, z.core.$strict>, z.ZodObject<{
439
+ status: z.ZodLiteral<"missing">;
440
+ }, z.core.$strict>], "status">;
441
+ drift: z.ZodObject<{
442
+ overall: z.ZodEnum<{
443
+ changed: "changed";
444
+ identical: "identical";
445
+ missing: "missing";
446
+ superseded: "superseded";
447
+ truncated: "truncated";
448
+ unavailable: "unavailable";
449
+ }>;
450
+ policy: z.ZodObject<{
451
+ status: z.ZodEnum<{
452
+ changed: "changed";
453
+ identical: "identical";
454
+ missing: "missing";
455
+ superseded: "superseded";
456
+ truncated: "truncated";
457
+ unavailable: "unavailable";
458
+ }>;
459
+ snapshotHash: z.ZodNullable<z.ZodString>;
460
+ currentHash: z.ZodNullable<z.ZodString>;
461
+ snapshotTargetCount: z.ZodNumber;
462
+ currentTargetCount: z.ZodNumber;
463
+ }, z.core.$strict>;
464
+ preferences: z.ZodObject<{
465
+ status: z.ZodEnum<{
466
+ changed: "changed";
467
+ identical: "identical";
468
+ missing: "missing";
469
+ superseded: "superseded";
470
+ truncated: "truncated";
471
+ unavailable: "unavailable";
472
+ }>;
473
+ snapshotHash: z.ZodNullable<z.ZodString>;
474
+ currentHash: z.ZodNullable<z.ZodString>;
475
+ snapshotDescriptorCount: z.ZodNumber;
476
+ currentDescriptorCount: z.ZodNumber;
477
+ snapshotTruncated: z.ZodBoolean;
478
+ currentTruncated: z.ZodBoolean;
479
+ }, z.core.$strict>;
480
+ }, z.core.$strict>;
481
+ }, z.core.$strict>], "status">;
482
+ export type WorkspaceStateAttemptGovernance = z.infer<typeof WorkspaceStateAttemptGovernance>;
367
483
  export declare const WorkspaceStateResponse: z.ZodObject<{
368
484
  workspaceId: z.ZodString;
369
485
  generatedAt: z.ZodString;
@@ -372,10 +488,108 @@ export declare const WorkspaceStateResponse: z.ZodObject<{
372
488
  source: z.ZodLiteral<"read_time_projection">;
373
489
  capturedAt: z.ZodString;
374
490
  }, z.core.$strict>;
375
- policySnapshot: z.ZodObject<{
376
- status: z.ZodLiteral<"not_captured">;
377
- reason: z.ZodLiteral<"workspace_instruction_policy_snapshot_not_implemented">;
378
- }, z.core.$strict>;
491
+ attemptGovernance: z.ZodDiscriminatedUnion<[z.ZodObject<{
492
+ status: z.ZodLiteral<"not_requested">;
493
+ }, z.core.$strict>, z.ZodObject<{
494
+ status: z.ZodLiteral<"unavailable">;
495
+ reason: z.ZodLiteral<"attempt_not_found_or_not_authorized">;
496
+ driftStatus: z.ZodLiteral<"unavailable">;
497
+ }, z.core.$strict>, z.ZodObject<{
498
+ status: z.ZodLiteral<"available">;
499
+ attemptId: z.ZodString;
500
+ executionGeneration: z.ZodNumber;
501
+ acceptedAt: z.ZodString;
502
+ policySnapshot: z.ZodDiscriminatedUnion<[z.ZodObject<{
503
+ status: z.ZodLiteral<"available">;
504
+ id: z.ZodString;
505
+ createdAt: z.ZodString;
506
+ entryHash: z.ZodString;
507
+ policyRole: z.ZodNullable<z.ZodString>;
508
+ roleSource: z.ZodEnum<{
509
+ invalid_metadata_fallback: "invalid_metadata_fallback";
510
+ metadata_fallback: "metadata_fallback";
511
+ none: "none";
512
+ session_binding: "session_binding";
513
+ }>;
514
+ entries: z.ZodArray<z.ZodObject<{
515
+ kind: z.ZodEnum<{
516
+ charter: "charter";
517
+ policy: "policy";
518
+ }>;
519
+ scope: z.ZodEnum<{
520
+ global: "global";
521
+ role: "role";
522
+ }>;
523
+ roleKey: z.ZodNullable<z.ZodString>;
524
+ revisionId: z.ZodString;
525
+ revision: z.ZodNumber;
526
+ contentHash: z.ZodString;
527
+ activationVersion: z.ZodNumber;
528
+ activatedAt: z.ZodString;
529
+ provenance: z.ZodObject<{
530
+ source: z.ZodEnum<{
531
+ human: "human";
532
+ knowledge_proposal: "knowledge_proposal";
533
+ legacy_import: "legacy_import";
534
+ onboarding: "onboarding";
535
+ }>;
536
+ sourceIdHash: z.ZodNullable<z.ZodString>;
537
+ }, z.core.$strip>;
538
+ }, z.core.$strip>>;
539
+ }, z.core.$strict>, z.ZodObject<{
540
+ status: z.ZodLiteral<"missing">;
541
+ }, z.core.$strict>], "status">;
542
+ preferenceSnapshot: z.ZodDiscriminatedUnion<[z.ZodObject<{
543
+ status: z.ZodLiteral<"available">;
544
+ id: z.ZodString;
545
+ createdAt: z.ZodString;
546
+ descriptorHash: z.ZodString;
547
+ descriptorCount: z.ZodNumber;
548
+ truncated: z.ZodBoolean;
549
+ }, z.core.$strict>, z.ZodObject<{
550
+ status: z.ZodLiteral<"missing">;
551
+ }, z.core.$strict>], "status">;
552
+ drift: z.ZodObject<{
553
+ overall: z.ZodEnum<{
554
+ changed: "changed";
555
+ identical: "identical";
556
+ missing: "missing";
557
+ superseded: "superseded";
558
+ truncated: "truncated";
559
+ unavailable: "unavailable";
560
+ }>;
561
+ policy: z.ZodObject<{
562
+ status: z.ZodEnum<{
563
+ changed: "changed";
564
+ identical: "identical";
565
+ missing: "missing";
566
+ superseded: "superseded";
567
+ truncated: "truncated";
568
+ unavailable: "unavailable";
569
+ }>;
570
+ snapshotHash: z.ZodNullable<z.ZodString>;
571
+ currentHash: z.ZodNullable<z.ZodString>;
572
+ snapshotTargetCount: z.ZodNumber;
573
+ currentTargetCount: z.ZodNumber;
574
+ }, z.core.$strict>;
575
+ preferences: z.ZodObject<{
576
+ status: z.ZodEnum<{
577
+ changed: "changed";
578
+ identical: "identical";
579
+ missing: "missing";
580
+ superseded: "superseded";
581
+ truncated: "truncated";
582
+ unavailable: "unavailable";
583
+ }>;
584
+ snapshotHash: z.ZodNullable<z.ZodString>;
585
+ currentHash: z.ZodNullable<z.ZodString>;
586
+ snapshotDescriptorCount: z.ZodNumber;
587
+ currentDescriptorCount: z.ZodNumber;
588
+ snapshotTruncated: z.ZodBoolean;
589
+ currentTruncated: z.ZodBoolean;
590
+ }, z.core.$strict>;
591
+ }, z.core.$strict>;
592
+ }, z.core.$strict>], "status">;
379
593
  }, z.core.$strict>;
380
594
  policy: z.ZodObject<{
381
595
  authority: z.ZodLiteral<"workspace_instruction_policy_heads">;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeni/contracts",
3
- "version": "0.32.0",
3
+ "version": "0.36.0",
4
4
  "description": "Shared zod schemas and wire-contract types for the OpenGeni API.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -72,6 +72,59 @@ export type GoogleDriveSyncCadence = z.infer<typeof GoogleDriveSyncCadence>;
72
72
  export const GoogleDriveReadPolicy = z.enum(["allow", "ask", "block"]);
73
73
  export type GoogleDriveReadPolicy = z.infer<typeof GoogleDriveReadPolicy>;
74
74
 
75
+ export const GoogleDriveConnectionLifecycleState = z.enum([
76
+ "active",
77
+ "paused",
78
+ "token_revoked",
79
+ "app_removed",
80
+ "disconnected",
81
+ "reconnect_required",
82
+ "reconsent_required",
83
+ ]);
84
+ export type GoogleDriveConnectionLifecycleState = z.infer<
85
+ typeof GoogleDriveConnectionLifecycleState
86
+ >;
87
+
88
+ const GoogleDriveLifecycleObservedAt = z.string().datetime({ offset: true });
89
+ export const GoogleDriveConnectionLifecycle = z.discriminatedUnion("state", [
90
+ z.object({
91
+ state: z.literal("active"),
92
+ recoverable: z.literal(true),
93
+ observedAt: GoogleDriveLifecycleObservedAt,
94
+ }),
95
+ z.object({
96
+ state: z.literal("paused"),
97
+ recoverable: z.literal(true),
98
+ observedAt: GoogleDriveLifecycleObservedAt,
99
+ }),
100
+ z.object({
101
+ state: z.literal("token_revoked"),
102
+ recoverable: z.literal(true),
103
+ observedAt: GoogleDriveLifecycleObservedAt,
104
+ }),
105
+ z.object({
106
+ state: z.literal("app_removed"),
107
+ recoverable: z.literal(false),
108
+ observedAt: GoogleDriveLifecycleObservedAt,
109
+ }),
110
+ z.object({
111
+ state: z.literal("disconnected"),
112
+ recoverable: z.literal(true),
113
+ observedAt: GoogleDriveLifecycleObservedAt,
114
+ }),
115
+ z.object({
116
+ state: z.literal("reconnect_required"),
117
+ recoverable: z.literal(true),
118
+ observedAt: GoogleDriveLifecycleObservedAt,
119
+ }),
120
+ z.object({
121
+ state: z.literal("reconsent_required"),
122
+ recoverable: z.literal(true),
123
+ observedAt: GoogleDriveLifecycleObservedAt,
124
+ }),
125
+ ]);
126
+ export type GoogleDriveConnectionLifecycle = z.infer<typeof GoogleDriveConnectionLifecycle>;
127
+
75
128
  export const GoogleDriveSelectedSource = z.object({
76
129
  id: z.string().min(1).max(256),
77
130
  name: z.string().min(1).max(1024),
@@ -93,6 +146,7 @@ export const GoogleDriveConnectionMetadata = z
93
146
  googleDisplayName: z.string().min(1).max(512).nullable(),
94
147
  verifiedAt: z.string().datetime({ offset: true }),
95
148
  accessMode: z.enum(["metadata_readonly", "readonly"]),
149
+ lifecycle: GoogleDriveConnectionLifecycle.optional(),
96
150
  selectedSources: z.array(GoogleDriveSelectedSource).max(100).optional(),
97
151
  /** @deprecated Read `selectedSources`; retained while existing connections migrate. */
98
152
  selectedSource: GoogleDriveSelectedSource.nullable().optional(),
@@ -111,6 +165,18 @@ export const GoogleDriveOAuthStartResponse = z.object({
111
165
  });
112
166
  export type GoogleDriveOAuthStartResponse = z.infer<typeof GoogleDriveOAuthStartResponse>;
113
167
 
168
+ export const GoogleDriveLifecycleActionRequest = z.object({
169
+ action: z.enum(["pause", "resume"]),
170
+ expectedVersion: z.number().int().positive(),
171
+ });
172
+ export type GoogleDriveLifecycleActionRequest = z.infer<typeof GoogleDriveLifecycleActionRequest>;
173
+
174
+ export const GoogleDriveDisconnectRequest = z.object({
175
+ expectedVersion: z.number().int().positive(),
176
+ idempotencyKey: z.string().trim().min(1).max(200),
177
+ });
178
+ export type GoogleDriveDisconnectRequest = z.infer<typeof GoogleDriveDisconnectRequest>;
179
+
114
180
  export const GoogleDriveBrowseItem = z.object({
115
181
  id: z.string().min(1).max(256),
116
182
  name: z.string().min(1).max(1024),