@bpmsoftwaresolutions/ai-engine-client 1.1.54 → 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 +164 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpmsoftwaresolutions/ai-engine-client",
3
- "version": "1.1.54",
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.54';
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,
@@ -1310,6 +1465,7 @@ export class AIEngineClient {
1310
1465
  transfer_channel_id,
1311
1466
  participantRole,
1312
1467
  participant_role,
1468
+ role,
1313
1469
  capability,
1314
1470
  includeStale,
1315
1471
  include_stale,
@@ -1322,7 +1478,7 @@ export class AIEngineClient {
1322
1478
  return this._request(basePath, {
1323
1479
  query: {
1324
1480
  workflow_run_id: cleanText(workflow_run_id) || cleanText(workflowRunId),
1325
- participant_role: cleanText(participant_role) || cleanText(participantRole),
1481
+ participant_role: cleanText(participant_role) || cleanText(participantRole) || cleanText(role),
1326
1482
  capability: cleanText(capability),
1327
1483
  include_stale: include_stale ?? includeStale,
1328
1484
  limit,
@@ -1337,13 +1493,14 @@ export class AIEngineClient {
1337
1493
  transfer_channel_id,
1338
1494
  participantRole,
1339
1495
  participant_role,
1496
+ role,
1340
1497
  capability,
1341
1498
  } = {}) {
1342
1499
  const normalizedTransferChannelId = cleanText(transfer_channel_id) || cleanText(transferChannelId);
1343
1500
  const body = {
1344
1501
  workflow_run_id: cleanText(workflow_run_id) || cleanText(workflowRunId),
1345
1502
  transfer_channel_id: normalizedTransferChannelId,
1346
- participant_role: cleanText(participant_role) || cleanText(participantRole),
1503
+ participant_role: cleanText(participant_role) || cleanText(participantRole) || cleanText(role),
1347
1504
  capability: cleanText(capability),
1348
1505
  };
1349
1506
  const path = normalizedTransferChannelId
@@ -1370,6 +1527,7 @@ export class AIEngineClient {
1370
1527
  recipient_agent_session_id,
1371
1528
  recipientRole,
1372
1529
  recipient_role,
1530
+ role,
1373
1531
  participantId,
1374
1532
  participant_id,
1375
1533
  recipientParticipantId,
@@ -1397,7 +1555,7 @@ export class AIEngineClient {
1397
1555
  sender_agent_session_id: cleanText(sender_agent_session_id) || cleanText(senderAgentSessionId),
1398
1556
  sender_role: cleanText(sender_role) || cleanText(senderRole),
1399
1557
  recipient_agent_session_id: cleanText(recipient_agent_session_id) || cleanText(recipientAgentSessionId),
1400
- recipient_role: cleanText(recipient_role) || cleanText(recipientRole),
1558
+ recipient_role: cleanText(recipient_role) || cleanText(recipientRole) || cleanText(role),
1401
1559
  participant_id: cleanText(participant_id) || cleanText(participantId) || cleanText(recipient_participant_id) || cleanText(recipientParticipantId),
1402
1560
  message_kind: cleanText(message_kind) || cleanText(messageKind),
1403
1561
  payload: isPlainObject(payload) ? payload : {},
@@ -1423,6 +1581,7 @@ export class AIEngineClient {
1423
1581
  recipient_role,
1424
1582
  participantRole,
1425
1583
  participant_role,
1584
+ role,
1426
1585
  recipientAgentSessionId,
1427
1586
  recipient_agent_session_id,
1428
1587
  workflowRunId,
@@ -1448,7 +1607,7 @@ export class AIEngineClient {
1448
1607
  sender_agent_session_id: cleanText(sender_agent_session_id) || cleanText(senderAgentSessionId),
1449
1608
  sender_role: cleanText(sender_role) || cleanText(senderRole),
1450
1609
  recipient_agent_session_id: cleanText(recipient_agent_session_id) || cleanText(recipientAgentSessionId),
1451
- recipient_role: cleanText(recipient_role) || cleanText(recipientRole) || cleanText(participant_role) || cleanText(participantRole),
1610
+ recipient_role: cleanText(recipient_role) || cleanText(recipientRole) || cleanText(role) || cleanText(participant_role) || cleanText(participantRole),
1452
1611
  message_kind: cleanText(message_kind) || cleanText(messageKind),
1453
1612
  payload: isPlainObject(payload) ? payload : {},
1454
1613
  scope: isPlainObject(scope) ? scope : {},