@bpmsoftwaresolutions/ai-engine-client 1.1.50 → 1.1.52
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/package.json +1 -1
- package/src/index.js +313 -1
package/package.json
CHANGED
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.
|
|
2
|
+
export const AI_ENGINE_CLIENT_VERSION = '1.1.52';
|
|
3
3
|
export const GOVERNED_MUTATION_REQUIRED_CAPABILITIES = [
|
|
4
4
|
'executeVerifiedMutation',
|
|
5
5
|
'post_mutation_verification',
|
|
@@ -438,6 +438,15 @@ export class AIEngineClient {
|
|
|
438
438
|
attachEvidence: (request) => this.attachCommunicationMessageEvidence(request),
|
|
439
439
|
createHandoff: (request) => this.createCommunicationHandoff(request),
|
|
440
440
|
acceptHandoff: (request) => this.acceptCommunicationHandoff(request),
|
|
441
|
+
connectToTransferChannel: (request) => this.connectToTransferChannel(request),
|
|
442
|
+
};
|
|
443
|
+
this.collaboration = {
|
|
444
|
+
connectToTransferChannel: (request) => this.connectToTransferChannel(request),
|
|
445
|
+
reviewProposal: (request) => this.reviewCollaborationProposal(request),
|
|
446
|
+
reviseProposal: (request) => this.reviseCollaborationProposal(request),
|
|
447
|
+
raiseBlocker: (request) => this.raiseCollaborationBlocker(request),
|
|
448
|
+
beginImplementation: (request) => this.beginCollaborationImplementation(request),
|
|
449
|
+
requestClosure: (request) => this.requestCollaborationClosure(request),
|
|
441
450
|
};
|
|
442
451
|
}
|
|
443
452
|
|
|
@@ -628,6 +637,309 @@ export class AIEngineClient {
|
|
|
628
637
|
return this._request('/api/agent-communications/deployment-capabilities');
|
|
629
638
|
}
|
|
630
639
|
|
|
640
|
+
async reviewCollaborationProposal({
|
|
641
|
+
transferChannelId,
|
|
642
|
+
transfer_channel_id,
|
|
643
|
+
channelId,
|
|
644
|
+
collaborationProposalId,
|
|
645
|
+
collaboration_proposal_id,
|
|
646
|
+
proposalId,
|
|
647
|
+
proposal_id,
|
|
648
|
+
decision = 'accept',
|
|
649
|
+
nextOwner,
|
|
650
|
+
next_owner,
|
|
651
|
+
phase,
|
|
652
|
+
currentPhase,
|
|
653
|
+
current_phase,
|
|
654
|
+
decisionReason,
|
|
655
|
+
decision_reason,
|
|
656
|
+
evidenceRefs = [],
|
|
657
|
+
evidence_refs = [],
|
|
658
|
+
reviewerRole,
|
|
659
|
+
reviewer_role,
|
|
660
|
+
reviewerAgentSessionId,
|
|
661
|
+
reviewer_agent_session_id,
|
|
662
|
+
reviewerActorSessionId,
|
|
663
|
+
reviewer_actor_session_id,
|
|
664
|
+
reviewedByClaimId,
|
|
665
|
+
reviewed_by_claim_id,
|
|
666
|
+
metadata = {},
|
|
667
|
+
} = {}) {
|
|
668
|
+
const normalizedTransferChannelId = cleanText(transfer_channel_id) || cleanText(transferChannelId) || cleanText(channelId);
|
|
669
|
+
if (!normalizedTransferChannelId) throw new Error('transfer_channel_id is required.');
|
|
670
|
+
const normalizedProposalId = cleanText(collaboration_proposal_id) || cleanText(collaborationProposalId) || cleanText(proposal_id) || cleanText(proposalId);
|
|
671
|
+
if (!normalizedProposalId) throw new Error('collaboration_proposal_id is required.');
|
|
672
|
+
return this._request(`/api/agent-communications/transfer-channels/${encodeURIComponent(normalizedTransferChannelId)}/collaboration/review-proposal`, {
|
|
673
|
+
method: 'POST',
|
|
674
|
+
body: {
|
|
675
|
+
collaboration_proposal_id: normalizedProposalId,
|
|
676
|
+
decision: cleanText(decision) || 'accept',
|
|
677
|
+
next_owner: cleanText(next_owner) || cleanText(nextOwner),
|
|
678
|
+
phase: cleanText(current_phase) || cleanText(currentPhase) || cleanText(phase),
|
|
679
|
+
decision_reason: cleanText(decision_reason) || cleanText(decisionReason),
|
|
680
|
+
evidence_refs: Array.isArray(evidence_refs) ? evidence_refs : evidenceRefs,
|
|
681
|
+
reviewer_role: cleanText(reviewer_role) || cleanText(reviewerRole),
|
|
682
|
+
reviewer_agent_session_id: cleanText(reviewer_agent_session_id) || cleanText(reviewerAgentSessionId),
|
|
683
|
+
reviewer_actor_session_id: cleanText(reviewer_actor_session_id) || cleanText(reviewerActorSessionId),
|
|
684
|
+
reviewed_by_claim_id: cleanText(reviewed_by_claim_id) || cleanText(reviewedByClaimId),
|
|
685
|
+
metadata: isPlainObject(metadata) ? metadata : {},
|
|
686
|
+
},
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
async connectToTransferChannel({
|
|
691
|
+
transferChannelId,
|
|
692
|
+
transfer_channel_id,
|
|
693
|
+
channelId,
|
|
694
|
+
channel_id,
|
|
695
|
+
workTransferPacketId,
|
|
696
|
+
work_transfer_packet_id,
|
|
697
|
+
packetId,
|
|
698
|
+
packet_id,
|
|
699
|
+
workflowRunId,
|
|
700
|
+
workflow_run_id,
|
|
701
|
+
participantRole,
|
|
702
|
+
participant_role,
|
|
703
|
+
expectedPeerRole,
|
|
704
|
+
expected_peer_role,
|
|
705
|
+
expectedMessageKind,
|
|
706
|
+
expected_message_kind,
|
|
707
|
+
proposalId,
|
|
708
|
+
proposal_id,
|
|
709
|
+
collaborationProposalId,
|
|
710
|
+
collaboration_proposal_id,
|
|
711
|
+
mode = 'communication_participant',
|
|
712
|
+
participantLabel,
|
|
713
|
+
participant_label,
|
|
714
|
+
participantRoleKey,
|
|
715
|
+
participant_role_key,
|
|
716
|
+
agentSessionId,
|
|
717
|
+
agent_session_id,
|
|
718
|
+
actorSessionId,
|
|
719
|
+
actor_session_id,
|
|
720
|
+
phase,
|
|
721
|
+
currentPhase,
|
|
722
|
+
current_phase,
|
|
723
|
+
currentTaskSummary,
|
|
724
|
+
current_task_summary,
|
|
725
|
+
expectedPayload = {},
|
|
726
|
+
expected_payload = {},
|
|
727
|
+
lastSeenMessageId,
|
|
728
|
+
last_seen_message_id,
|
|
729
|
+
lastCheckedAt,
|
|
730
|
+
last_checked_at,
|
|
731
|
+
staleAfterSeconds = 60,
|
|
732
|
+
stale_after_seconds,
|
|
733
|
+
operatorNudge,
|
|
734
|
+
operator_nudge,
|
|
735
|
+
observedAt,
|
|
736
|
+
observed_at,
|
|
737
|
+
metadata = {},
|
|
738
|
+
} = {}) {
|
|
739
|
+
const normalizedTransferChannelId = cleanText(transfer_channel_id) || cleanText(transferChannelId) || cleanText(channel_id) || cleanText(channelId);
|
|
740
|
+
if (!normalizedTransferChannelId) throw new Error('transfer_channel_id is required.');
|
|
741
|
+
return this._request(`/api/agent-communications/transfer-channels/${encodeURIComponent(normalizedTransferChannelId)}/collaboration/connect`, {
|
|
742
|
+
method: 'POST',
|
|
743
|
+
body: {
|
|
744
|
+
work_transfer_packet_id: cleanText(work_transfer_packet_id) || cleanText(workTransferPacketId) || cleanText(packet_id) || cleanText(packetId),
|
|
745
|
+
workflow_run_id: cleanText(workflow_run_id) || cleanText(workflowRunId),
|
|
746
|
+
participant_role: cleanText(participant_role) || cleanText(participantRole),
|
|
747
|
+
expected_peer_role: cleanText(expected_peer_role) || cleanText(expectedPeerRole),
|
|
748
|
+
expected_message_kind: cleanText(expected_message_kind) || cleanText(expectedMessageKind),
|
|
749
|
+
proposal_id: cleanText(proposal_id) || cleanText(proposalId) || cleanText(collaboration_proposal_id) || cleanText(collaborationProposalId),
|
|
750
|
+
mode: cleanText(mode) || 'communication_participant',
|
|
751
|
+
participant_label: cleanText(participant_label) || cleanText(participantLabel) || cleanText(participant_role_key) || cleanText(participantRoleKey),
|
|
752
|
+
agent_session_id: cleanText(agent_session_id) || cleanText(agentSessionId),
|
|
753
|
+
actor_session_id: cleanText(actor_session_id) || cleanText(actorSessionId),
|
|
754
|
+
phase: cleanText(current_phase) || cleanText(currentPhase) || cleanText(phase),
|
|
755
|
+
current_task_summary: cleanText(current_task_summary) || cleanText(currentTaskSummary),
|
|
756
|
+
expected_payload: isPlainObject(expected_payload) ? expected_payload : isPlainObject(expectedPayload) ? expectedPayload : {},
|
|
757
|
+
last_seen_message_id: cleanText(last_seen_message_id) || cleanText(lastSeenMessageId),
|
|
758
|
+
last_checked_at: last_checked_at || lastCheckedAt,
|
|
759
|
+
stale_after_seconds: stale_after_seconds || staleAfterSeconds,
|
|
760
|
+
operator_nudge: cleanText(operator_nudge) || cleanText(operatorNudge),
|
|
761
|
+
observed_at: observed_at || observedAt,
|
|
762
|
+
metadata: isPlainObject(metadata) ? metadata : {},
|
|
763
|
+
},
|
|
764
|
+
});
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
async reviseCollaborationProposal({
|
|
768
|
+
transferChannelId,
|
|
769
|
+
transfer_channel_id,
|
|
770
|
+
channelId,
|
|
771
|
+
collaborationProposalId,
|
|
772
|
+
collaboration_proposal_id,
|
|
773
|
+
proposalId,
|
|
774
|
+
proposal_id,
|
|
775
|
+
proposalSummary,
|
|
776
|
+
proposal_summary,
|
|
777
|
+
nextOwner,
|
|
778
|
+
next_owner,
|
|
779
|
+
phase,
|
|
780
|
+
currentPhase,
|
|
781
|
+
current_phase,
|
|
782
|
+
revisionReason,
|
|
783
|
+
revision_reason,
|
|
784
|
+
evidenceRefs = [],
|
|
785
|
+
evidence_refs = [],
|
|
786
|
+
reviewerRole,
|
|
787
|
+
reviewer_role,
|
|
788
|
+
reviewerAgentSessionId,
|
|
789
|
+
reviewer_agent_session_id,
|
|
790
|
+
reviewerActorSessionId,
|
|
791
|
+
reviewer_actor_session_id,
|
|
792
|
+
metadata = {},
|
|
793
|
+
} = {}) {
|
|
794
|
+
const normalizedTransferChannelId = cleanText(transfer_channel_id) || cleanText(transferChannelId) || cleanText(channelId);
|
|
795
|
+
if (!normalizedTransferChannelId) throw new Error('transfer_channel_id is required.');
|
|
796
|
+
const normalizedProposalId = cleanText(collaboration_proposal_id) || cleanText(collaborationProposalId) || cleanText(proposal_id) || cleanText(proposalId);
|
|
797
|
+
if (!normalizedProposalId) throw new Error('collaboration_proposal_id is required.');
|
|
798
|
+
return this._request(`/api/agent-communications/transfer-channels/${encodeURIComponent(normalizedTransferChannelId)}/collaboration/revise-proposal`, {
|
|
799
|
+
method: 'POST',
|
|
800
|
+
body: {
|
|
801
|
+
collaboration_proposal_id: normalizedProposalId,
|
|
802
|
+
proposal_summary: cleanText(proposal_summary) || cleanText(proposalSummary),
|
|
803
|
+
next_owner: cleanText(next_owner) || cleanText(nextOwner),
|
|
804
|
+
phase: cleanText(current_phase) || cleanText(currentPhase) || cleanText(phase),
|
|
805
|
+
revision_reason: cleanText(revision_reason) || cleanText(revisionReason),
|
|
806
|
+
evidence_refs: Array.isArray(evidence_refs) ? evidence_refs : evidenceRefs,
|
|
807
|
+
reviewer_role: cleanText(reviewer_role) || cleanText(reviewerRole),
|
|
808
|
+
reviewer_agent_session_id: cleanText(reviewer_agent_session_id) || cleanText(reviewerAgentSessionId),
|
|
809
|
+
reviewer_actor_session_id: cleanText(reviewer_actor_session_id) || cleanText(reviewerActorSessionId),
|
|
810
|
+
metadata: isPlainObject(metadata) ? metadata : {},
|
|
811
|
+
},
|
|
812
|
+
});
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
async raiseCollaborationBlocker({
|
|
816
|
+
transferChannelId,
|
|
817
|
+
transfer_channel_id,
|
|
818
|
+
channelId,
|
|
819
|
+
blockerKind,
|
|
820
|
+
blocker_kind,
|
|
821
|
+
blockerSummary,
|
|
822
|
+
blocker_summary,
|
|
823
|
+
blockedSide,
|
|
824
|
+
blocked_side,
|
|
825
|
+
blockerDetails,
|
|
826
|
+
blocker_details,
|
|
827
|
+
expectedNextUpdate,
|
|
828
|
+
expected_next_update,
|
|
829
|
+
participantRole,
|
|
830
|
+
participant_role,
|
|
831
|
+
nextOwner,
|
|
832
|
+
next_owner,
|
|
833
|
+
phase,
|
|
834
|
+
currentPhase,
|
|
835
|
+
current_phase,
|
|
836
|
+
reviewerAgentSessionId,
|
|
837
|
+
reviewer_agent_session_id,
|
|
838
|
+
reviewerActorSessionId,
|
|
839
|
+
reviewer_actor_session_id,
|
|
840
|
+
metadata = {},
|
|
841
|
+
} = {}) {
|
|
842
|
+
const normalizedTransferChannelId = cleanText(transfer_channel_id) || cleanText(transferChannelId) || cleanText(channelId);
|
|
843
|
+
if (!normalizedTransferChannelId) throw new Error('transfer_channel_id is required.');
|
|
844
|
+
return this._request(`/api/agent-communications/transfer-channels/${encodeURIComponent(normalizedTransferChannelId)}/collaboration/raise-blocker`, {
|
|
845
|
+
method: 'POST',
|
|
846
|
+
body: {
|
|
847
|
+
blocker_kind: cleanText(blocker_kind) || cleanText(blockerKind),
|
|
848
|
+
blocker_summary: cleanText(blocker_summary) || cleanText(blockerSummary),
|
|
849
|
+
blocked_side: cleanText(blocked_side) || cleanText(blockedSide),
|
|
850
|
+
blocker_details: cleanText(blocker_details) || cleanText(blockerDetails),
|
|
851
|
+
expected_next_update: cleanText(expected_next_update) || cleanText(expectedNextUpdate),
|
|
852
|
+
participant_role: cleanText(participant_role) || cleanText(participantRole),
|
|
853
|
+
next_owner: cleanText(next_owner) || cleanText(nextOwner),
|
|
854
|
+
phase: cleanText(current_phase) || cleanText(currentPhase) || cleanText(phase),
|
|
855
|
+
reviewer_agent_session_id: cleanText(reviewer_agent_session_id) || cleanText(reviewerAgentSessionId),
|
|
856
|
+
reviewer_actor_session_id: cleanText(reviewer_actor_session_id) || cleanText(reviewerActorSessionId),
|
|
857
|
+
metadata: isPlainObject(metadata) ? metadata : {},
|
|
858
|
+
},
|
|
859
|
+
});
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
async beginCollaborationImplementation({
|
|
863
|
+
transferChannelId,
|
|
864
|
+
transfer_channel_id,
|
|
865
|
+
channelId,
|
|
866
|
+
participantRole,
|
|
867
|
+
participant_role,
|
|
868
|
+
ownerLabel,
|
|
869
|
+
owner_label,
|
|
870
|
+
ownerRoleKey,
|
|
871
|
+
owner_role_key,
|
|
872
|
+
expectedUpdateCadence,
|
|
873
|
+
expected_update_cadence,
|
|
874
|
+
phase,
|
|
875
|
+
currentPhase,
|
|
876
|
+
current_phase,
|
|
877
|
+
currentTaskSummary,
|
|
878
|
+
current_task_summary,
|
|
879
|
+
ownerAgentSessionId,
|
|
880
|
+
owner_agent_session_id,
|
|
881
|
+
ownerActorSessionId,
|
|
882
|
+
owner_actor_session_id,
|
|
883
|
+
assignedByAgentSessionId,
|
|
884
|
+
assigned_by_agent_session_id,
|
|
885
|
+
assignedByActorSessionId,
|
|
886
|
+
assigned_by_actor_session_id,
|
|
887
|
+
metadata = {},
|
|
888
|
+
} = {}) {
|
|
889
|
+
const normalizedTransferChannelId = cleanText(transfer_channel_id) || cleanText(transferChannelId) || cleanText(channelId);
|
|
890
|
+
if (!normalizedTransferChannelId) throw new Error('transfer_channel_id is required.');
|
|
891
|
+
return this._request(`/api/agent-communications/transfer-channels/${encodeURIComponent(normalizedTransferChannelId)}/collaboration/begin-implementation`, {
|
|
892
|
+
method: 'POST',
|
|
893
|
+
body: {
|
|
894
|
+
participant_role: cleanText(participant_role) || cleanText(participantRole) || cleanText(owner_role_key) || cleanText(ownerRoleKey),
|
|
895
|
+
owner_label: cleanText(owner_label) || cleanText(ownerLabel) || cleanText(owner_role_key) || cleanText(ownerRoleKey),
|
|
896
|
+
expected_update_cadence: cleanText(expected_update_cadence) || cleanText(expectedUpdateCadence),
|
|
897
|
+
phase: cleanText(current_phase) || cleanText(currentPhase) || cleanText(phase),
|
|
898
|
+
current_task_summary: cleanText(current_task_summary) || cleanText(currentTaskSummary),
|
|
899
|
+
owner_agent_session_id: cleanText(owner_agent_session_id) || cleanText(ownerAgentSessionId),
|
|
900
|
+
owner_actor_session_id: cleanText(owner_actor_session_id) || cleanText(ownerActorSessionId),
|
|
901
|
+
assigned_by_agent_session_id: cleanText(assigned_by_agent_session_id) || cleanText(assignedByAgentSessionId),
|
|
902
|
+
assigned_by_actor_session_id: cleanText(assigned_by_actor_session_id) || cleanText(assignedByActorSessionId),
|
|
903
|
+
metadata: isPlainObject(metadata) ? metadata : {},
|
|
904
|
+
},
|
|
905
|
+
});
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
async requestCollaborationClosure({
|
|
909
|
+
transferChannelId,
|
|
910
|
+
transfer_channel_id,
|
|
911
|
+
channelId,
|
|
912
|
+
senderAgentSessionId,
|
|
913
|
+
sender_agent_session_id,
|
|
914
|
+
senderActorSessionId,
|
|
915
|
+
sender_actor_session_id,
|
|
916
|
+
closureReason,
|
|
917
|
+
closure_reason,
|
|
918
|
+
evidenceRefs = [],
|
|
919
|
+
evidence_refs = [],
|
|
920
|
+
failureReason,
|
|
921
|
+
failure_reason,
|
|
922
|
+
phase,
|
|
923
|
+
currentPhase,
|
|
924
|
+
current_phase,
|
|
925
|
+
metadata = {},
|
|
926
|
+
} = {}) {
|
|
927
|
+
const normalizedTransferChannelId = cleanText(transfer_channel_id) || cleanText(transferChannelId) || cleanText(channelId);
|
|
928
|
+
if (!normalizedTransferChannelId) throw new Error('transfer_channel_id is required.');
|
|
929
|
+
return this._request(`/api/agent-communications/transfer-channels/${encodeURIComponent(normalizedTransferChannelId)}/collaboration/request-closure`, {
|
|
930
|
+
method: 'POST',
|
|
931
|
+
body: {
|
|
932
|
+
sender_agent_session_id: cleanText(sender_agent_session_id) || cleanText(senderAgentSessionId),
|
|
933
|
+
sender_actor_session_id: cleanText(sender_actor_session_id) || cleanText(senderActorSessionId),
|
|
934
|
+
closure_reason: cleanText(closure_reason) || cleanText(closureReason),
|
|
935
|
+
evidence_refs: Array.isArray(evidence_refs) ? evidence_refs : evidenceRefs,
|
|
936
|
+
failure_reason: cleanText(failure_reason) || cleanText(failureReason),
|
|
937
|
+
phase: cleanText(current_phase) || cleanText(currentPhase) || cleanText(phase),
|
|
938
|
+
metadata: isPlainObject(metadata) ? metadata : {},
|
|
939
|
+
},
|
|
940
|
+
});
|
|
941
|
+
}
|
|
942
|
+
|
|
631
943
|
async bootstrapCommunication() {
|
|
632
944
|
return this._request('/api/agent-communications/bootstrap');
|
|
633
945
|
}
|