@bpmsoftwaresolutions/ai-engine-client 1.1.51 → 1.1.53

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 +80 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpmsoftwaresolutions/ai-engine-client",
3
- "version": "1.1.51",
3
+ "version": "1.1.53",
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.51';
2
+ export const AI_ENGINE_CLIENT_VERSION = '1.1.53';
3
3
  export const GOVERNED_MUTATION_REQUIRED_CAPABILITIES = [
4
4
  'executeVerifiedMutation',
5
5
  'post_mutation_verification',
@@ -438,8 +438,10 @@ 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),
441
442
  };
442
443
  this.collaboration = {
444
+ connectToTransferChannel: (request) => this.connectToTransferChannel(request),
443
445
  reviewProposal: (request) => this.reviewCollaborationProposal(request),
444
446
  reviseProposal: (request) => this.reviseCollaborationProposal(request),
445
447
  raiseBlocker: (request) => this.raiseCollaborationBlocker(request),
@@ -685,6 +687,83 @@ export class AIEngineClient {
685
687
  });
686
688
  }
687
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)}/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
+
688
767
  async reviseCollaborationProposal({
689
768
  transferChannelId,
690
769
  transfer_channel_id,