@bpmsoftwaresolutions/ai-engine-client 1.1.52 → 1.1.54

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 +235 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpmsoftwaresolutions/ai-engine-client",
3
- "version": "1.1.52",
3
+ "version": "1.1.54",
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.52';
2
+ export const AI_ENGINE_CLIENT_VERSION = '1.1.54';
3
3
  export const GOVERNED_MUTATION_REQUIRED_CAPABILITIES = [
4
4
  'executeVerifiedMutation',
5
5
  'post_mutation_verification',
@@ -438,15 +438,27 @@ 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
+ whoIsOnline: (request) => this.whoIsOnline(request),
442
+ findOnlineParticipant: (request) => this.findOnlineParticipant(request),
443
+ sendToParticipant: (request) => this.sendToParticipant(request),
444
+ sendToRole: (request) => this.sendToRole(request),
445
+ getMyInbox: (request) => this.getMyInbox(request),
441
446
  connectToTransferChannel: (request) => this.connectToTransferChannel(request),
447
+ respondToMessageWatch: (request) => this.respondToMessageWatch(request),
442
448
  };
443
449
  this.collaboration = {
444
450
  connectToTransferChannel: (request) => this.connectToTransferChannel(request),
451
+ respondToMessageWatch: (request) => this.respondToMessageWatch(request),
445
452
  reviewProposal: (request) => this.reviewCollaborationProposal(request),
446
453
  reviseProposal: (request) => this.reviseCollaborationProposal(request),
447
454
  raiseBlocker: (request) => this.raiseCollaborationBlocker(request),
448
455
  beginImplementation: (request) => this.beginCollaborationImplementation(request),
449
456
  requestClosure: (request) => this.requestCollaborationClosure(request),
457
+ whoIsOnline: (request) => this.whoIsOnline(request),
458
+ findOnlineParticipant: (request) => this.findOnlineParticipant(request),
459
+ sendToParticipant: (request) => this.sendToParticipant(request),
460
+ sendToRole: (request) => this.sendToRole(request),
461
+ getMyInbox: (request) => this.getMyInbox(request),
450
462
  };
451
463
  }
452
464
 
@@ -653,8 +665,8 @@ export class AIEngineClient {
653
665
  current_phase,
654
666
  decisionReason,
655
667
  decision_reason,
656
- evidenceRefs = [],
657
- evidence_refs = [],
668
+ evidenceRefs,
669
+ evidence_refs,
658
670
  reviewerRole,
659
671
  reviewer_role,
660
672
  reviewerAgentSessionId,
@@ -738,7 +750,7 @@ export class AIEngineClient {
738
750
  } = {}) {
739
751
  const normalizedTransferChannelId = cleanText(transfer_channel_id) || cleanText(transferChannelId) || cleanText(channel_id) || cleanText(channelId);
740
752
  if (!normalizedTransferChannelId) throw new Error('transfer_channel_id is required.');
741
- return this._request(`/api/agent-communications/transfer-channels/${encodeURIComponent(normalizedTransferChannelId)}/collaboration/connect`, {
753
+ return this._request(`/api/agent-communications/transfer-channels/${encodeURIComponent(normalizedTransferChannelId)}/connect`, {
742
754
  method: 'POST',
743
755
  body: {
744
756
  work_transfer_packet_id: cleanText(work_transfer_packet_id) || cleanText(workTransferPacketId) || cleanText(packet_id) || cleanText(packetId),
@@ -764,6 +776,53 @@ export class AIEngineClient {
764
776
  });
765
777
  }
766
778
 
779
+ async respondToMessageWatch({
780
+ transferChannelId,
781
+ transfer_channel_id,
782
+ channelId,
783
+ channel_id,
784
+ messageWatchId,
785
+ message_watch_id,
786
+ watchId,
787
+ watch_id,
788
+ expectedMessageKind,
789
+ expected_message_kind,
790
+ senderRole,
791
+ sender_role,
792
+ participantRole,
793
+ participant_role,
794
+ senderAgentSessionId,
795
+ sender_agent_session_id,
796
+ senderActorSessionId,
797
+ sender_actor_session_id,
798
+ messageKind,
799
+ message_kind,
800
+ bodyMarkdown,
801
+ body_markdown,
802
+ evidenceRefs,
803
+ evidence_refs,
804
+ payload = {},
805
+ metadata = {},
806
+ } = {}) {
807
+ const normalizedTransferChannelId = cleanText(transfer_channel_id) || cleanText(transferChannelId) || cleanText(channel_id) || cleanText(channelId);
808
+ if (!normalizedTransferChannelId) throw new Error('transfer_channel_id is required.');
809
+ return this._request(`/api/agent-communications/transfer-channels/${encodeURIComponent(normalizedTransferChannelId)}/message-watches/respond`, {
810
+ method: 'POST',
811
+ body: {
812
+ message_watch_id: cleanText(message_watch_id) || cleanText(messageWatchId) || cleanText(watch_id) || cleanText(watchId),
813
+ expected_message_kind: cleanText(expected_message_kind) || cleanText(expectedMessageKind),
814
+ sender_role: cleanText(sender_role) || cleanText(senderRole) || cleanText(participant_role) || cleanText(participantRole),
815
+ sender_agent_session_id: cleanText(sender_agent_session_id) || cleanText(senderAgentSessionId),
816
+ sender_actor_session_id: cleanText(sender_actor_session_id) || cleanText(senderActorSessionId),
817
+ message_kind: cleanText(message_kind) || cleanText(messageKind),
818
+ body_markdown: cleanText(body_markdown) || cleanText(bodyMarkdown),
819
+ evidence_refs: Array.isArray(evidence_refs) ? evidence_refs : Array.isArray(evidenceRefs) ? evidenceRefs : [],
820
+ payload: isPlainObject(payload) ? payload : {},
821
+ metadata: isPlainObject(metadata) ? metadata : {},
822
+ },
823
+ });
824
+ }
825
+
767
826
  async reviseCollaborationProposal({
768
827
  transferChannelId,
769
828
  transfer_channel_id,
@@ -1227,6 +1286,178 @@ export class AIEngineClient {
1227
1286
  });
1228
1287
  }
1229
1288
 
1289
+ async getMyInbox({
1290
+ recipientAgentSessionId,
1291
+ recipient_agent_session_id,
1292
+ recipientRoleKey,
1293
+ recipient_role_key,
1294
+ workflowRunId,
1295
+ workflow_run_id,
1296
+ } = {}) {
1297
+ return this._request('/api/agent-communications/inbox/me', {
1298
+ query: {
1299
+ recipient_agent_session_id: cleanText(recipient_agent_session_id) || cleanText(recipientAgentSessionId),
1300
+ recipient_role_key: cleanText(recipient_role_key) || cleanText(recipientRoleKey),
1301
+ workflow_run_id: cleanText(workflow_run_id) || cleanText(workflowRunId),
1302
+ },
1303
+ });
1304
+ }
1305
+
1306
+ async whoIsOnline({
1307
+ workflowRunId,
1308
+ workflow_run_id,
1309
+ transferChannelId,
1310
+ transfer_channel_id,
1311
+ participantRole,
1312
+ participant_role,
1313
+ capability,
1314
+ includeStale,
1315
+ include_stale,
1316
+ limit,
1317
+ } = {}) {
1318
+ const normalizedTransferChannelId = cleanText(transfer_channel_id) || cleanText(transferChannelId);
1319
+ const basePath = normalizedTransferChannelId
1320
+ ? `/api/agent-communications/transfer-channels/${encodeURIComponent(normalizedTransferChannelId)}/presence`
1321
+ : '/api/agent-communications/presence';
1322
+ return this._request(basePath, {
1323
+ query: {
1324
+ workflow_run_id: cleanText(workflow_run_id) || cleanText(workflowRunId),
1325
+ participant_role: cleanText(participant_role) || cleanText(participantRole),
1326
+ capability: cleanText(capability),
1327
+ include_stale: include_stale ?? includeStale,
1328
+ limit,
1329
+ },
1330
+ });
1331
+ }
1332
+
1333
+ async findOnlineParticipant({
1334
+ workflowRunId,
1335
+ workflow_run_id,
1336
+ transferChannelId,
1337
+ transfer_channel_id,
1338
+ participantRole,
1339
+ participant_role,
1340
+ capability,
1341
+ } = {}) {
1342
+ const normalizedTransferChannelId = cleanText(transfer_channel_id) || cleanText(transferChannelId);
1343
+ const body = {
1344
+ workflow_run_id: cleanText(workflow_run_id) || cleanText(workflowRunId),
1345
+ transfer_channel_id: normalizedTransferChannelId,
1346
+ participant_role: cleanText(participant_role) || cleanText(participantRole),
1347
+ capability: cleanText(capability),
1348
+ };
1349
+ const path = normalizedTransferChannelId
1350
+ ? `/api/agent-communications/transfer-channels/${encodeURIComponent(normalizedTransferChannelId)}/presence/find`
1351
+ : '/api/agent-communications/presence/find';
1352
+ return this._request(path, {
1353
+ method: 'POST',
1354
+ body,
1355
+ });
1356
+ }
1357
+
1358
+ async sendToParticipant({
1359
+ transferChannelId,
1360
+ transfer_channel_id,
1361
+ channelId,
1362
+ channel_id,
1363
+ bodyMarkdown,
1364
+ body_markdown,
1365
+ senderAgentSessionId,
1366
+ sender_agent_session_id,
1367
+ senderRole,
1368
+ sender_role,
1369
+ recipientAgentSessionId,
1370
+ recipient_agent_session_id,
1371
+ recipientRole,
1372
+ recipient_role,
1373
+ participantId,
1374
+ participant_id,
1375
+ recipientParticipantId,
1376
+ recipient_participant_id,
1377
+ workflowRunId,
1378
+ workflow_run_id,
1379
+ messageKind,
1380
+ message_kind,
1381
+ payload = {},
1382
+ scope = {},
1383
+ metadata = {},
1384
+ expectedMessageKind,
1385
+ expected_message_kind,
1386
+ } = {}) {
1387
+ const normalizedTransferChannelId = cleanText(transfer_channel_id) || cleanText(transferChannelId) || cleanText(channel_id) || cleanText(channelId);
1388
+ const path = normalizedTransferChannelId
1389
+ ? `/api/agent-communications/transfer-channels/${encodeURIComponent(normalizedTransferChannelId)}/messages/send-to-participant`
1390
+ : '/api/agent-communications/messages/send-to-participant';
1391
+ return this._request(path, {
1392
+ method: 'POST',
1393
+ body: {
1394
+ transfer_channel_id: normalizedTransferChannelId,
1395
+ workflow_run_id: cleanText(workflow_run_id) || cleanText(workflowRunId),
1396
+ body_markdown: cleanText(body_markdown) || cleanText(bodyMarkdown),
1397
+ sender_agent_session_id: cleanText(sender_agent_session_id) || cleanText(senderAgentSessionId),
1398
+ sender_role: cleanText(sender_role) || cleanText(senderRole),
1399
+ recipient_agent_session_id: cleanText(recipient_agent_session_id) || cleanText(recipientAgentSessionId),
1400
+ recipient_role: cleanText(recipient_role) || cleanText(recipientRole),
1401
+ participant_id: cleanText(participant_id) || cleanText(participantId) || cleanText(recipient_participant_id) || cleanText(recipientParticipantId),
1402
+ message_kind: cleanText(message_kind) || cleanText(messageKind),
1403
+ payload: isPlainObject(payload) ? payload : {},
1404
+ scope: isPlainObject(scope) ? scope : {},
1405
+ metadata: isPlainObject(metadata) ? metadata : {},
1406
+ expected_message_kind: cleanText(expected_message_kind) || cleanText(expectedMessageKind),
1407
+ },
1408
+ });
1409
+ }
1410
+
1411
+ async sendToRole({
1412
+ transferChannelId,
1413
+ transfer_channel_id,
1414
+ channelId,
1415
+ channel_id,
1416
+ bodyMarkdown,
1417
+ body_markdown,
1418
+ senderAgentSessionId,
1419
+ sender_agent_session_id,
1420
+ senderRole,
1421
+ sender_role,
1422
+ recipientRole,
1423
+ recipient_role,
1424
+ participantRole,
1425
+ participant_role,
1426
+ recipientAgentSessionId,
1427
+ recipient_agent_session_id,
1428
+ workflowRunId,
1429
+ workflow_run_id,
1430
+ messageKind,
1431
+ message_kind,
1432
+ payload = {},
1433
+ scope = {},
1434
+ metadata = {},
1435
+ expectedMessageKind,
1436
+ expected_message_kind,
1437
+ } = {}) {
1438
+ const normalizedTransferChannelId = cleanText(transfer_channel_id) || cleanText(transferChannelId) || cleanText(channel_id) || cleanText(channelId);
1439
+ const path = normalizedTransferChannelId
1440
+ ? `/api/agent-communications/transfer-channels/${encodeURIComponent(normalizedTransferChannelId)}/messages/send-to-role`
1441
+ : '/api/agent-communications/messages/send-to-role';
1442
+ return this._request(path, {
1443
+ method: 'POST',
1444
+ body: {
1445
+ transfer_channel_id: normalizedTransferChannelId,
1446
+ workflow_run_id: cleanText(workflow_run_id) || cleanText(workflowRunId),
1447
+ body_markdown: cleanText(body_markdown) || cleanText(bodyMarkdown),
1448
+ sender_agent_session_id: cleanText(sender_agent_session_id) || cleanText(senderAgentSessionId),
1449
+ sender_role: cleanText(sender_role) || cleanText(senderRole),
1450
+ recipient_agent_session_id: cleanText(recipient_agent_session_id) || cleanText(recipientAgentSessionId),
1451
+ recipient_role: cleanText(recipient_role) || cleanText(recipientRole) || cleanText(participant_role) || cleanText(participantRole),
1452
+ message_kind: cleanText(message_kind) || cleanText(messageKind),
1453
+ payload: isPlainObject(payload) ? payload : {},
1454
+ scope: isPlainObject(scope) ? scope : {},
1455
+ metadata: isPlainObject(metadata) ? metadata : {},
1456
+ expected_message_kind: cleanText(expected_message_kind) || cleanText(expectedMessageKind),
1457
+ },
1458
+ });
1459
+ }
1460
+
1230
1461
  async sendCommunicationMessage({
1231
1462
  communicationThreadId,
1232
1463
  communication_thread_id,