@bpmsoftwaresolutions/ai-engine-client 1.1.24 → 1.1.26
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 +38 -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.26';
|
|
3
3
|
export const GOVERNED_MUTATION_REQUIRED_CAPABILITIES = [
|
|
4
4
|
'executeVerifiedMutation',
|
|
5
5
|
'post_mutation_verification',
|
|
@@ -455,6 +455,11 @@ export class AIEngineClient {
|
|
|
455
455
|
return this._request('/api/governance/claims/claim-work-item', { method: 'POST', body });
|
|
456
456
|
}
|
|
457
457
|
|
|
458
|
+
async getClaim(claimId) {
|
|
459
|
+
if (!claimId) throw new Error('claimId is required.');
|
|
460
|
+
return this._request(`/api/governance/claims/${encodeURIComponent(claimId)}`);
|
|
461
|
+
}
|
|
462
|
+
|
|
458
463
|
async getExecutionEligibility(body = {}) {
|
|
459
464
|
return this._request('/api/governance/execution-eligibility', {
|
|
460
465
|
method: 'POST',
|
|
@@ -1361,7 +1366,33 @@ export class AIEngineClient {
|
|
|
1361
1366
|
notes,
|
|
1362
1367
|
createdBy,
|
|
1363
1368
|
parentTaskId,
|
|
1369
|
+
claimId,
|
|
1370
|
+
claimedItemId,
|
|
1371
|
+
workflowRunId,
|
|
1372
|
+
agentSessionId,
|
|
1373
|
+
allowedMutationSurfaces,
|
|
1374
|
+
acknowledgedReminders,
|
|
1364
1375
|
} = {}) {
|
|
1376
|
+
const normalizedClaimId = cleanText(claimId);
|
|
1377
|
+
const normalizedClaimedItemId = cleanText(claimedItemId) || implementationItemId;
|
|
1378
|
+
const normalizedWorkflowRunId = cleanText(workflowRunId);
|
|
1379
|
+
const normalizedAgentSessionId = cleanText(agentSessionId);
|
|
1380
|
+
const normalizedAllowedMutationSurfaces = Array.isArray(allowedMutationSurfaces) && allowedMutationSurfaces.length > 0
|
|
1381
|
+
? allowedMutationSurfaces
|
|
1382
|
+
: ['project_roadmap_task'];
|
|
1383
|
+
const normalizedAcknowledgedReminders = Array.isArray(acknowledgedReminders)
|
|
1384
|
+
? acknowledgedReminders
|
|
1385
|
+
: undefined;
|
|
1386
|
+
await this._assertExecutionEligibility({
|
|
1387
|
+
claim_id: normalizedClaimId,
|
|
1388
|
+
claimed_item_id: normalizedClaimedItemId,
|
|
1389
|
+
workflow_run_id: normalizedWorkflowRunId,
|
|
1390
|
+
agent_session_id: normalizedAgentSessionId,
|
|
1391
|
+
allowed_mutation_surfaces: normalizedAllowedMutationSurfaces,
|
|
1392
|
+
acknowledged_reminders: normalizedAcknowledgedReminders || [],
|
|
1393
|
+
requested_mutation_surface: 'project_roadmap_task',
|
|
1394
|
+
verification_required: true,
|
|
1395
|
+
});
|
|
1365
1396
|
return this._request(`/api/operator/implementation-items/${implementationItemId}/tasks`, {
|
|
1366
1397
|
method: 'POST',
|
|
1367
1398
|
body: {
|
|
@@ -1376,6 +1407,12 @@ export class AIEngineClient {
|
|
|
1376
1407
|
notes,
|
|
1377
1408
|
created_by: createdBy,
|
|
1378
1409
|
parent_task_id: parentTaskId,
|
|
1410
|
+
claim_id: normalizedClaimId,
|
|
1411
|
+
claimed_item_id: normalizedClaimedItemId,
|
|
1412
|
+
workflow_run_id: normalizedWorkflowRunId,
|
|
1413
|
+
agent_session_id: normalizedAgentSessionId,
|
|
1414
|
+
allowed_mutation_surfaces: normalizedAllowedMutationSurfaces,
|
|
1415
|
+
acknowledged_reminders: normalizedAcknowledgedReminders,
|
|
1379
1416
|
},
|
|
1380
1417
|
});
|
|
1381
1418
|
}
|