@bpmsoftwaresolutions/ai-engine-client 1.1.50 → 1.1.51

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +234 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpmsoftwaresolutions/ai-engine-client",
3
- "version": "1.1.50",
3
+ "version": "1.1.51",
4
4
  "description": "Thin npm client for the AI Engine operator and retrieval APIs",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
package/src/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  const DEFAULT_TIMEOUT_MS = 30000;
2
- export const AI_ENGINE_CLIENT_VERSION = '1.1.50';
2
+ export const AI_ENGINE_CLIENT_VERSION = '1.1.51';
3
3
  export const GOVERNED_MUTATION_REQUIRED_CAPABILITIES = [
4
4
  'executeVerifiedMutation',
5
5
  'post_mutation_verification',
@@ -439,6 +439,13 @@ export class AIEngineClient {
439
439
  createHandoff: (request) => this.createCommunicationHandoff(request),
440
440
  acceptHandoff: (request) => this.acceptCommunicationHandoff(request),
441
441
  };
442
+ this.collaboration = {
443
+ reviewProposal: (request) => this.reviewCollaborationProposal(request),
444
+ reviseProposal: (request) => this.reviseCollaborationProposal(request),
445
+ raiseBlocker: (request) => this.raiseCollaborationBlocker(request),
446
+ beginImplementation: (request) => this.beginCollaborationImplementation(request),
447
+ requestClosure: (request) => this.requestCollaborationClosure(request),
448
+ };
442
449
  }
443
450
 
444
451
  static fromEnv(options = {}) {
@@ -628,6 +635,232 @@ export class AIEngineClient {
628
635
  return this._request('/api/agent-communications/deployment-capabilities');
629
636
  }
630
637
 
638
+ async reviewCollaborationProposal({
639
+ transferChannelId,
640
+ transfer_channel_id,
641
+ channelId,
642
+ collaborationProposalId,
643
+ collaboration_proposal_id,
644
+ proposalId,
645
+ proposal_id,
646
+ decision = 'accept',
647
+ nextOwner,
648
+ next_owner,
649
+ phase,
650
+ currentPhase,
651
+ current_phase,
652
+ decisionReason,
653
+ decision_reason,
654
+ evidenceRefs = [],
655
+ evidence_refs = [],
656
+ reviewerRole,
657
+ reviewer_role,
658
+ reviewerAgentSessionId,
659
+ reviewer_agent_session_id,
660
+ reviewerActorSessionId,
661
+ reviewer_actor_session_id,
662
+ reviewedByClaimId,
663
+ reviewed_by_claim_id,
664
+ metadata = {},
665
+ } = {}) {
666
+ const normalizedTransferChannelId = cleanText(transfer_channel_id) || cleanText(transferChannelId) || cleanText(channelId);
667
+ if (!normalizedTransferChannelId) throw new Error('transfer_channel_id is required.');
668
+ const normalizedProposalId = cleanText(collaboration_proposal_id) || cleanText(collaborationProposalId) || cleanText(proposal_id) || cleanText(proposalId);
669
+ if (!normalizedProposalId) throw new Error('collaboration_proposal_id is required.');
670
+ return this._request(`/api/agent-communications/transfer-channels/${encodeURIComponent(normalizedTransferChannelId)}/collaboration/review-proposal`, {
671
+ method: 'POST',
672
+ body: {
673
+ collaboration_proposal_id: normalizedProposalId,
674
+ decision: cleanText(decision) || 'accept',
675
+ next_owner: cleanText(next_owner) || cleanText(nextOwner),
676
+ phase: cleanText(current_phase) || cleanText(currentPhase) || cleanText(phase),
677
+ decision_reason: cleanText(decision_reason) || cleanText(decisionReason),
678
+ evidence_refs: Array.isArray(evidence_refs) ? evidence_refs : evidenceRefs,
679
+ reviewer_role: cleanText(reviewer_role) || cleanText(reviewerRole),
680
+ reviewer_agent_session_id: cleanText(reviewer_agent_session_id) || cleanText(reviewerAgentSessionId),
681
+ reviewer_actor_session_id: cleanText(reviewer_actor_session_id) || cleanText(reviewerActorSessionId),
682
+ reviewed_by_claim_id: cleanText(reviewed_by_claim_id) || cleanText(reviewedByClaimId),
683
+ metadata: isPlainObject(metadata) ? metadata : {},
684
+ },
685
+ });
686
+ }
687
+
688
+ async reviseCollaborationProposal({
689
+ transferChannelId,
690
+ transfer_channel_id,
691
+ channelId,
692
+ collaborationProposalId,
693
+ collaboration_proposal_id,
694
+ proposalId,
695
+ proposal_id,
696
+ proposalSummary,
697
+ proposal_summary,
698
+ nextOwner,
699
+ next_owner,
700
+ phase,
701
+ currentPhase,
702
+ current_phase,
703
+ revisionReason,
704
+ revision_reason,
705
+ evidenceRefs = [],
706
+ evidence_refs = [],
707
+ reviewerRole,
708
+ reviewer_role,
709
+ reviewerAgentSessionId,
710
+ reviewer_agent_session_id,
711
+ reviewerActorSessionId,
712
+ reviewer_actor_session_id,
713
+ metadata = {},
714
+ } = {}) {
715
+ const normalizedTransferChannelId = cleanText(transfer_channel_id) || cleanText(transferChannelId) || cleanText(channelId);
716
+ if (!normalizedTransferChannelId) throw new Error('transfer_channel_id is required.');
717
+ const normalizedProposalId = cleanText(collaboration_proposal_id) || cleanText(collaborationProposalId) || cleanText(proposal_id) || cleanText(proposalId);
718
+ if (!normalizedProposalId) throw new Error('collaboration_proposal_id is required.');
719
+ return this._request(`/api/agent-communications/transfer-channels/${encodeURIComponent(normalizedTransferChannelId)}/collaboration/revise-proposal`, {
720
+ method: 'POST',
721
+ body: {
722
+ collaboration_proposal_id: normalizedProposalId,
723
+ proposal_summary: cleanText(proposal_summary) || cleanText(proposalSummary),
724
+ next_owner: cleanText(next_owner) || cleanText(nextOwner),
725
+ phase: cleanText(current_phase) || cleanText(currentPhase) || cleanText(phase),
726
+ revision_reason: cleanText(revision_reason) || cleanText(revisionReason),
727
+ evidence_refs: Array.isArray(evidence_refs) ? evidence_refs : evidenceRefs,
728
+ reviewer_role: cleanText(reviewer_role) || cleanText(reviewerRole),
729
+ reviewer_agent_session_id: cleanText(reviewer_agent_session_id) || cleanText(reviewerAgentSessionId),
730
+ reviewer_actor_session_id: cleanText(reviewer_actor_session_id) || cleanText(reviewerActorSessionId),
731
+ metadata: isPlainObject(metadata) ? metadata : {},
732
+ },
733
+ });
734
+ }
735
+
736
+ async raiseCollaborationBlocker({
737
+ transferChannelId,
738
+ transfer_channel_id,
739
+ channelId,
740
+ blockerKind,
741
+ blocker_kind,
742
+ blockerSummary,
743
+ blocker_summary,
744
+ blockedSide,
745
+ blocked_side,
746
+ blockerDetails,
747
+ blocker_details,
748
+ expectedNextUpdate,
749
+ expected_next_update,
750
+ participantRole,
751
+ participant_role,
752
+ nextOwner,
753
+ next_owner,
754
+ phase,
755
+ currentPhase,
756
+ current_phase,
757
+ reviewerAgentSessionId,
758
+ reviewer_agent_session_id,
759
+ reviewerActorSessionId,
760
+ reviewer_actor_session_id,
761
+ metadata = {},
762
+ } = {}) {
763
+ const normalizedTransferChannelId = cleanText(transfer_channel_id) || cleanText(transferChannelId) || cleanText(channelId);
764
+ if (!normalizedTransferChannelId) throw new Error('transfer_channel_id is required.');
765
+ return this._request(`/api/agent-communications/transfer-channels/${encodeURIComponent(normalizedTransferChannelId)}/collaboration/raise-blocker`, {
766
+ method: 'POST',
767
+ body: {
768
+ blocker_kind: cleanText(blocker_kind) || cleanText(blockerKind),
769
+ blocker_summary: cleanText(blocker_summary) || cleanText(blockerSummary),
770
+ blocked_side: cleanText(blocked_side) || cleanText(blockedSide),
771
+ blocker_details: cleanText(blocker_details) || cleanText(blockerDetails),
772
+ expected_next_update: cleanText(expected_next_update) || cleanText(expectedNextUpdate),
773
+ participant_role: cleanText(participant_role) || cleanText(participantRole),
774
+ next_owner: cleanText(next_owner) || cleanText(nextOwner),
775
+ phase: cleanText(current_phase) || cleanText(currentPhase) || cleanText(phase),
776
+ reviewer_agent_session_id: cleanText(reviewer_agent_session_id) || cleanText(reviewerAgentSessionId),
777
+ reviewer_actor_session_id: cleanText(reviewer_actor_session_id) || cleanText(reviewerActorSessionId),
778
+ metadata: isPlainObject(metadata) ? metadata : {},
779
+ },
780
+ });
781
+ }
782
+
783
+ async beginCollaborationImplementation({
784
+ transferChannelId,
785
+ transfer_channel_id,
786
+ channelId,
787
+ participantRole,
788
+ participant_role,
789
+ ownerLabel,
790
+ owner_label,
791
+ ownerRoleKey,
792
+ owner_role_key,
793
+ expectedUpdateCadence,
794
+ expected_update_cadence,
795
+ phase,
796
+ currentPhase,
797
+ current_phase,
798
+ currentTaskSummary,
799
+ current_task_summary,
800
+ ownerAgentSessionId,
801
+ owner_agent_session_id,
802
+ ownerActorSessionId,
803
+ owner_actor_session_id,
804
+ assignedByAgentSessionId,
805
+ assigned_by_agent_session_id,
806
+ assignedByActorSessionId,
807
+ assigned_by_actor_session_id,
808
+ metadata = {},
809
+ } = {}) {
810
+ const normalizedTransferChannelId = cleanText(transfer_channel_id) || cleanText(transferChannelId) || cleanText(channelId);
811
+ if (!normalizedTransferChannelId) throw new Error('transfer_channel_id is required.');
812
+ return this._request(`/api/agent-communications/transfer-channels/${encodeURIComponent(normalizedTransferChannelId)}/collaboration/begin-implementation`, {
813
+ method: 'POST',
814
+ body: {
815
+ participant_role: cleanText(participant_role) || cleanText(participantRole) || cleanText(owner_role_key) || cleanText(ownerRoleKey),
816
+ owner_label: cleanText(owner_label) || cleanText(ownerLabel) || cleanText(owner_role_key) || cleanText(ownerRoleKey),
817
+ expected_update_cadence: cleanText(expected_update_cadence) || cleanText(expectedUpdateCadence),
818
+ phase: cleanText(current_phase) || cleanText(currentPhase) || cleanText(phase),
819
+ current_task_summary: cleanText(current_task_summary) || cleanText(currentTaskSummary),
820
+ owner_agent_session_id: cleanText(owner_agent_session_id) || cleanText(ownerAgentSessionId),
821
+ owner_actor_session_id: cleanText(owner_actor_session_id) || cleanText(ownerActorSessionId),
822
+ assigned_by_agent_session_id: cleanText(assigned_by_agent_session_id) || cleanText(assignedByAgentSessionId),
823
+ assigned_by_actor_session_id: cleanText(assigned_by_actor_session_id) || cleanText(assignedByActorSessionId),
824
+ metadata: isPlainObject(metadata) ? metadata : {},
825
+ },
826
+ });
827
+ }
828
+
829
+ async requestCollaborationClosure({
830
+ transferChannelId,
831
+ transfer_channel_id,
832
+ channelId,
833
+ senderAgentSessionId,
834
+ sender_agent_session_id,
835
+ senderActorSessionId,
836
+ sender_actor_session_id,
837
+ closureReason,
838
+ closure_reason,
839
+ evidenceRefs = [],
840
+ evidence_refs = [],
841
+ failureReason,
842
+ failure_reason,
843
+ phase,
844
+ currentPhase,
845
+ current_phase,
846
+ metadata = {},
847
+ } = {}) {
848
+ const normalizedTransferChannelId = cleanText(transfer_channel_id) || cleanText(transferChannelId) || cleanText(channelId);
849
+ if (!normalizedTransferChannelId) throw new Error('transfer_channel_id is required.');
850
+ return this._request(`/api/agent-communications/transfer-channels/${encodeURIComponent(normalizedTransferChannelId)}/collaboration/request-closure`, {
851
+ method: 'POST',
852
+ body: {
853
+ sender_agent_session_id: cleanText(sender_agent_session_id) || cleanText(senderAgentSessionId),
854
+ sender_actor_session_id: cleanText(sender_actor_session_id) || cleanText(senderActorSessionId),
855
+ closure_reason: cleanText(closure_reason) || cleanText(closureReason),
856
+ evidence_refs: Array.isArray(evidence_refs) ? evidence_refs : evidenceRefs,
857
+ failure_reason: cleanText(failure_reason) || cleanText(failureReason),
858
+ phase: cleanText(current_phase) || cleanText(currentPhase) || cleanText(phase),
859
+ metadata: isPlainObject(metadata) ? metadata : {},
860
+ },
861
+ });
862
+ }
863
+
631
864
  async bootstrapCommunication() {
632
865
  return this._request('/api/agent-communications/bootstrap');
633
866
  }