@bpmsoftwaresolutions/ai-engine-client 1.1.55 → 1.1.56

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 +156 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpmsoftwaresolutions/ai-engine-client",
3
- "version": "1.1.55",
3
+ "version": "1.1.56",
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.55';
2
+ export const AI_ENGINE_CLIENT_VERSION = '1.1.56';
3
3
  export const GOVERNED_MUTATION_REQUIRED_CAPABILITIES = [
4
4
  'executeVerifiedMutation',
5
5
  'post_mutation_verification',
@@ -440,6 +440,10 @@ export class AIEngineClient {
440
440
  acceptHandoff: (request) => this.acceptCommunicationHandoff(request),
441
441
  whoIsOnline: (request) => this.whoIsOnline(request),
442
442
  findOnlineParticipant: (request) => this.findOnlineParticipant(request),
443
+ getPresenceBoard: (request) => this.getPresenceBoard(request),
444
+ getChannelPresence: (request) => this.getChannelPresence(request),
445
+ markParticipantOnline: (request) => this.markParticipantOnline(request),
446
+ markParticipantOffline: (request) => this.markParticipantOffline(request),
443
447
  sendToParticipant: (request) => this.sendToParticipant(request),
444
448
  sendToRole: (request) => this.sendToRole(request),
445
449
  getMyInbox: (request) => this.getMyInbox(request),
@@ -456,6 +460,10 @@ export class AIEngineClient {
456
460
  requestClosure: (request) => this.requestCollaborationClosure(request),
457
461
  whoIsOnline: (request) => this.whoIsOnline(request),
458
462
  findOnlineParticipant: (request) => this.findOnlineParticipant(request),
463
+ getPresenceBoard: (request) => this.getPresenceBoard(request),
464
+ getChannelPresence: (request) => this.getChannelPresence(request),
465
+ markParticipantOnline: (request) => this.markParticipantOnline(request),
466
+ markParticipantOffline: (request) => this.markParticipantOffline(request),
459
467
  sendToParticipant: (request) => this.sendToParticipant(request),
460
468
  sendToRole: (request) => this.sendToRole(request),
461
469
  getMyInbox: (request) => this.getMyInbox(request),
@@ -649,6 +657,153 @@ export class AIEngineClient {
649
657
  return this._request('/api/agent-communications/deployment-capabilities');
650
658
  }
651
659
 
660
+ async getPresenceBoard({
661
+ workflowRunId,
662
+ workflow_run_id,
663
+ transferChannelId,
664
+ transfer_channel_id,
665
+ participantRole,
666
+ participant_role,
667
+ role,
668
+ capability,
669
+ includeStale,
670
+ include_stale,
671
+ } = {}) {
672
+ const normalizedTransferChannelId = cleanText(transfer_channel_id) || cleanText(transferChannelId);
673
+ const path = normalizedTransferChannelId
674
+ ? `/api/operator/projections/agent-communications/presence/${encodeURIComponent(normalizedTransferChannelId)}`
675
+ : '/api/operator/projections/agent-communications/presence';
676
+ return this._requestLogaProjection(path, {
677
+ query: {
678
+ workflow_run_id: cleanText(workflow_run_id) || cleanText(workflowRunId),
679
+ transfer_channel_id: normalizedTransferChannelId,
680
+ participant_role: cleanText(participant_role) || cleanText(participantRole) || cleanText(role),
681
+ capability: cleanText(capability),
682
+ include_stale: include_stale ?? includeStale,
683
+ },
684
+ });
685
+ }
686
+
687
+ async getChannelPresence({
688
+ transferChannelId,
689
+ transfer_channel_id,
690
+ channelId,
691
+ channel_id,
692
+ workflowRunId,
693
+ workflow_run_id,
694
+ participantRole,
695
+ participant_role,
696
+ role,
697
+ capability,
698
+ includeStale,
699
+ include_stale,
700
+ } = {}) {
701
+ const normalizedTransferChannelId = cleanText(transfer_channel_id) || cleanText(transferChannelId) || cleanText(channel_id) || cleanText(channelId);
702
+ if (!normalizedTransferChannelId) {
703
+ throw new Error('transferChannelId is required.');
704
+ }
705
+ return this._requestLogaProjection(`/api/operator/projections/agent-communications/presence/${encodeURIComponent(normalizedTransferChannelId)}`, {
706
+ query: {
707
+ workflow_run_id: cleanText(workflow_run_id) || cleanText(workflowRunId),
708
+ participant_role: cleanText(participant_role) || cleanText(participantRole) || cleanText(role),
709
+ capability: cleanText(capability),
710
+ include_stale: include_stale ?? includeStale,
711
+ },
712
+ });
713
+ }
714
+
715
+ async markParticipantOnline({
716
+ transferChannelId,
717
+ transfer_channel_id,
718
+ channelId,
719
+ channel_id,
720
+ workTransferPacketId,
721
+ work_transfer_packet_id,
722
+ packetId,
723
+ packet_id,
724
+ workflowRunId,
725
+ workflow_run_id,
726
+ participantRole,
727
+ participant_role,
728
+ currentPhase,
729
+ current_phase,
730
+ currentTaskSummary,
731
+ current_task_summary,
732
+ agentSessionId,
733
+ agent_session_id,
734
+ actorSessionId,
735
+ actor_session_id,
736
+ observedAt,
737
+ observed_at,
738
+ metadata = {},
739
+ } = {}) {
740
+ const normalizedTransferChannelId = cleanText(transfer_channel_id) || cleanText(transferChannelId) || cleanText(channel_id) || cleanText(channelId);
741
+ if (!normalizedTransferChannelId) throw new Error('transferChannelId is required.');
742
+ return this._request(`/api/agent-communications/transfer-channels/${encodeURIComponent(normalizedTransferChannelId)}/presence/online`, {
743
+ method: 'POST',
744
+ body: {
745
+ transfer_channel_id: normalizedTransferChannelId,
746
+ work_transfer_packet_id: cleanText(work_transfer_packet_id) || cleanText(workTransferPacketId) || cleanText(packet_id) || cleanText(packetId),
747
+ workflow_run_id: cleanText(workflow_run_id) || cleanText(workflowRunId),
748
+ participant_role: cleanText(participant_role) || cleanText(participantRole),
749
+ current_phase: cleanText(current_phase) || cleanText(currentPhase),
750
+ current_task_summary: cleanText(current_task_summary) || cleanText(currentTaskSummary),
751
+ agent_session_id: cleanText(agent_session_id) || cleanText(agentSessionId),
752
+ actor_session_id: cleanText(actor_session_id) || cleanText(actorSessionId),
753
+ observed_at: cleanText(observed_at) || cleanText(observedAt),
754
+ metadata: isPlainObject(metadata) ? metadata : {},
755
+ is_active: true,
756
+ activity_state: 'active',
757
+ },
758
+ });
759
+ }
760
+
761
+ async markParticipantOffline({
762
+ transferChannelId,
763
+ transfer_channel_id,
764
+ channelId,
765
+ channel_id,
766
+ workTransferPacketId,
767
+ work_transfer_packet_id,
768
+ packetId,
769
+ packet_id,
770
+ workflowRunId,
771
+ workflow_run_id,
772
+ participantRole,
773
+ participant_role,
774
+ currentPhase,
775
+ current_phase,
776
+ currentTaskSummary,
777
+ current_task_summary,
778
+ agentSessionId,
779
+ agent_session_id,
780
+ actorSessionId,
781
+ actor_session_id,
782
+ observedAt,
783
+ observed_at,
784
+ metadata = {},
785
+ } = {}) {
786
+ const normalizedTransferChannelId = cleanText(transfer_channel_id) || cleanText(transferChannelId) || cleanText(channel_id) || cleanText(channelId);
787
+ if (!normalizedTransferChannelId) throw new Error('transferChannelId is required.');
788
+ return this._request(`/api/agent-communications/transfer-channels/${encodeURIComponent(normalizedTransferChannelId)}/presence/offline`, {
789
+ method: 'POST',
790
+ body: {
791
+ transfer_channel_id: normalizedTransferChannelId,
792
+ work_transfer_packet_id: cleanText(work_transfer_packet_id) || cleanText(workTransferPacketId) || cleanText(packet_id) || cleanText(packetId),
793
+ workflow_run_id: cleanText(workflow_run_id) || cleanText(workflowRunId),
794
+ participant_role: cleanText(participant_role) || cleanText(participantRole),
795
+ current_phase: cleanText(current_phase) || cleanText(currentPhase),
796
+ current_task_summary: cleanText(current_task_summary) || cleanText(currentTaskSummary),
797
+ agent_session_id: cleanText(agent_session_id) || cleanText(agentSessionId),
798
+ actor_session_id: cleanText(actor_session_id) || cleanText(actorSessionId),
799
+ observed_at: cleanText(observed_at) || cleanText(observedAt),
800
+ metadata: isPlainObject(metadata) ? metadata : {},
801
+ is_active: false,
802
+ activity_state: 'offline',
803
+ },
804
+ });
805
+ }
806
+
652
807
  async reviewCollaborationProposal({
653
808
  transferChannelId,
654
809
  transfer_channel_id,