@bpmsoftwaresolutions/ai-engine-client 1.1.26 → 1.1.28
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 +64 -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.27';
|
|
3
3
|
export const GOVERNED_MUTATION_REQUIRED_CAPABILITIES = [
|
|
4
4
|
'executeVerifiedMutation',
|
|
5
5
|
'post_mutation_verification',
|
|
@@ -675,6 +675,42 @@ export class AIEngineClient {
|
|
|
675
675
|
return this._request('/api/charters/run', { method: 'POST', body });
|
|
676
676
|
}
|
|
677
677
|
|
|
678
|
+
async createProjectDelivery(body = {}) {
|
|
679
|
+
return this._request('/api/project-delivery', { method: 'POST', body });
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
async approveProjectCharterIntent(projectId, body = {}) {
|
|
683
|
+
if (!projectId) throw new Error('projectId is required.');
|
|
684
|
+
return this._request(`/api/project-delivery/${encodeURIComponent(projectId)}/approve-charter-intent`, {
|
|
685
|
+
method: 'POST',
|
|
686
|
+
body,
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
async approveImplementationRoadmap(projectId, body = {}) {
|
|
691
|
+
if (!projectId) throw new Error('projectId is required.');
|
|
692
|
+
return this._request(`/api/project-delivery/${encodeURIComponent(projectId)}/approve-roadmap`, {
|
|
693
|
+
method: 'POST',
|
|
694
|
+
body,
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
async runProjectCharter(projectId, body = {}) {
|
|
699
|
+
if (!projectId) throw new Error('projectId is required.');
|
|
700
|
+
return this._request(`/api/project-delivery/${encodeURIComponent(projectId)}/run-charter`, {
|
|
701
|
+
method: 'POST',
|
|
702
|
+
body,
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
async beginImplementationRoadmap(projectId, body = {}) {
|
|
707
|
+
if (!projectId) throw new Error('projectId is required.');
|
|
708
|
+
return this._request(`/api/project-delivery/${encodeURIComponent(projectId)}/begin-roadmap`, {
|
|
709
|
+
method: 'POST',
|
|
710
|
+
body,
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
|
|
678
714
|
async persistAssistantTurn(body) {
|
|
679
715
|
return this._request('/api/v1/assistant-turns', { method: 'POST', body });
|
|
680
716
|
}
|
|
@@ -1367,13 +1403,19 @@ export class AIEngineClient {
|
|
|
1367
1403
|
createdBy,
|
|
1368
1404
|
parentTaskId,
|
|
1369
1405
|
claimId,
|
|
1406
|
+
claimProjectId,
|
|
1407
|
+
projectId,
|
|
1370
1408
|
claimedItemId,
|
|
1371
1409
|
workflowRunId,
|
|
1372
1410
|
agentSessionId,
|
|
1373
1411
|
allowedMutationSurfaces,
|
|
1374
1412
|
acknowledgedReminders,
|
|
1413
|
+
executionIntent,
|
|
1414
|
+
executionType,
|
|
1415
|
+
executionPurpose,
|
|
1375
1416
|
} = {}) {
|
|
1376
1417
|
const normalizedClaimId = cleanText(claimId);
|
|
1418
|
+
const normalizedClaimProjectId = cleanText(claimProjectId) || cleanText(projectId);
|
|
1377
1419
|
const normalizedClaimedItemId = cleanText(claimedItemId) || implementationItemId;
|
|
1378
1420
|
const normalizedWorkflowRunId = cleanText(workflowRunId);
|
|
1379
1421
|
const normalizedAgentSessionId = cleanText(agentSessionId);
|
|
@@ -1383,8 +1425,27 @@ export class AIEngineClient {
|
|
|
1383
1425
|
const normalizedAcknowledgedReminders = Array.isArray(acknowledgedReminders)
|
|
1384
1426
|
? acknowledgedReminders
|
|
1385
1427
|
: undefined;
|
|
1428
|
+
const normalizedExecutionIntent = (() => {
|
|
1429
|
+
if (executionIntent && typeof executionIntent === 'object') {
|
|
1430
|
+
const execution_type = cleanText(executionIntent.execution_type) || cleanText(executionIntent.executionType);
|
|
1431
|
+
const execution_purpose = cleanText(executionIntent.execution_purpose) || cleanText(executionIntent.executionPurpose);
|
|
1432
|
+
if (execution_type || execution_purpose) {
|
|
1433
|
+
return {
|
|
1434
|
+
...(execution_type ? { execution_type } : {}),
|
|
1435
|
+
...(execution_purpose ? { execution_purpose } : {}),
|
|
1436
|
+
};
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
const normalizedExecutionType = cleanText(executionType) || 'implementation_task';
|
|
1440
|
+
const normalizedExecutionPurpose = cleanText(executionPurpose) || cleanText(title) || 'implementation task';
|
|
1441
|
+
return {
|
|
1442
|
+
execution_type: normalizedExecutionType,
|
|
1443
|
+
execution_purpose: normalizedExecutionPurpose,
|
|
1444
|
+
};
|
|
1445
|
+
})();
|
|
1386
1446
|
await this._assertExecutionEligibility({
|
|
1387
1447
|
claim_id: normalizedClaimId,
|
|
1448
|
+
claim_project_id: normalizedClaimProjectId,
|
|
1388
1449
|
claimed_item_id: normalizedClaimedItemId,
|
|
1389
1450
|
workflow_run_id: normalizedWorkflowRunId,
|
|
1390
1451
|
agent_session_id: normalizedAgentSessionId,
|
|
@@ -1408,11 +1469,13 @@ export class AIEngineClient {
|
|
|
1408
1469
|
created_by: createdBy,
|
|
1409
1470
|
parent_task_id: parentTaskId,
|
|
1410
1471
|
claim_id: normalizedClaimId,
|
|
1472
|
+
claim_project_id: normalizedClaimProjectId,
|
|
1411
1473
|
claimed_item_id: normalizedClaimedItemId,
|
|
1412
1474
|
workflow_run_id: normalizedWorkflowRunId,
|
|
1413
1475
|
agent_session_id: normalizedAgentSessionId,
|
|
1414
1476
|
allowed_mutation_surfaces: normalizedAllowedMutationSurfaces,
|
|
1415
1477
|
acknowledged_reminders: normalizedAcknowledgedReminders,
|
|
1478
|
+
execution_intent: normalizedExecutionIntent,
|
|
1416
1479
|
},
|
|
1417
1480
|
});
|
|
1418
1481
|
}
|