@bpmsoftwaresolutions/ai-engine-client 1.1.21 → 1.1.22

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 +88 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpmsoftwaresolutions/ai-engine-client",
3
- "version": "1.1.21",
3
+ "version": "1.1.22",
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.21';
2
+ export const AI_ENGINE_CLIENT_VERSION = '1.1.20';
3
3
  export const GOVERNED_MUTATION_REQUIRED_CAPABILITIES = [
4
4
  'executeVerifiedMutation',
5
5
  'post_mutation_verification',
@@ -420,6 +420,37 @@ export class AIEngineClient {
420
420
  return this._request('/api/work/start', { method: 'POST', body });
421
421
  }
422
422
 
423
+ async startClaimedWork({
424
+ claimName,
425
+ actorId,
426
+ intentId,
427
+ declaredScopeFiles,
428
+ allowedMutationSurfaces,
429
+ runtimeSessionId,
430
+ executionPurpose,
431
+ successCriteria,
432
+ mutationAllowed,
433
+ metadata,
434
+ ...rest
435
+ } = {}) {
436
+ return this._request('/api/governance/claims/start-claimed-work', {
437
+ method: 'POST',
438
+ body: {
439
+ ...rest,
440
+ claim_name: claimName,
441
+ actor_id: actorId,
442
+ intent_id: intentId,
443
+ declared_scope_files: declaredScopeFiles,
444
+ allowed_mutation_surfaces: allowedMutationSurfaces,
445
+ runtime_session_id: runtimeSessionId,
446
+ execution_purpose: executionPurpose,
447
+ success_criteria: successCriteria,
448
+ mutation_allowed: mutationAllowed,
449
+ metadata,
450
+ },
451
+ });
452
+ }
453
+
423
454
  async claimWorkItem(body = {}) {
424
455
  return this._request('/api/governance/claims/claim-work-item', { method: 'POST', body });
425
456
  }
@@ -443,6 +474,62 @@ export class AIEngineClient {
443
474
  });
444
475
  }
445
476
 
477
+ /**
478
+ * Promote a governance claim from `missing_promoted_surface` to
479
+ * `promoted_surface_bound` by binding required tool definitions to the
480
+ * workflow and recording a completed claim signoff.
481
+ *
482
+ * @param {object} params
483
+ * @param {string} params.claimId - UUID of the claim to unblock.
484
+ * @param {string} params.workflowId - UUID of the target workflow.
485
+ * @param {string} params.contextSessionId - Oriented context session UUID.
486
+ * @param {string} params.actorId - Caller identity for audit trail.
487
+ * @param {string[]} params.requiredToolKeys - Tool keys to bind.
488
+ * @param {string} [params.intentId] - Default: 'code_mutation'.
489
+ * @param {string} [params.bindingScope] - Default: 'required'.
490
+ * @param {string} [params.usageMode] - Default: 'manual'.
491
+ * @param {string} [params.operatorScope]
492
+ * @param {object} [params.allowedArgumentPolicy]
493
+ * @returns {Promise<object>} Promotion result envelope.
494
+ */
495
+ async promoteClaimSurface({
496
+ claimId,
497
+ workflowId,
498
+ contextSessionId,
499
+ actorId,
500
+ requiredToolKeys,
501
+ intentId,
502
+ bindingScope,
503
+ usageMode,
504
+ operatorScope,
505
+ allowedArgumentPolicy,
506
+ ...rest
507
+ } = {}) {
508
+ if (!claimId) throw new Error('claimId is required.');
509
+ if (!workflowId) throw new Error('workflowId is required.');
510
+ if (!contextSessionId) throw new Error('contextSessionId is required.');
511
+ if (!actorId) throw new Error('actorId is required.');
512
+ if (!Array.isArray(requiredToolKeys) || requiredToolKeys.length === 0) {
513
+ throw new Error('requiredToolKeys must be a non-empty array.');
514
+ }
515
+ return this._request('/api/governance/claims/promote-surface', {
516
+ method: 'POST',
517
+ body: {
518
+ ...rest,
519
+ claim_id: claimId,
520
+ workflow_id: workflowId,
521
+ context_session_id: contextSessionId,
522
+ actor_id: actorId,
523
+ required_tool_keys: requiredToolKeys,
524
+ intent_id: intentId,
525
+ binding_scope: bindingScope,
526
+ usage_mode: usageMode,
527
+ operator_scope: operatorScope,
528
+ allowed_argument_policy: allowedArgumentPolicy,
529
+ },
530
+ });
531
+ }
532
+
446
533
  async completeTurn(body = {}) {
447
534
  return this._request('/api/turns/complete', { method: 'POST', body });
448
535
  }