@bpmsoftwaresolutions/ai-engine-client 1.1.3 → 1.1.4

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 +41 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpmsoftwaresolutions/ai-engine-client",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
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
@@ -280,8 +280,37 @@ export class AIEngineClient {
280
280
  return this._request('/api/dashboard');
281
281
  }
282
282
 
283
- async startSessionGovernance(body) {
284
- return this._request('/api/v1/session-governance/startup', { method: 'POST', body });
283
+ async startSessionGovernance({
284
+ intent,
285
+ objective,
286
+ allowedScopes,
287
+ allowedMutationSurfaces,
288
+ requiredToolKeys,
289
+ sessionKey,
290
+ workflowRunId,
291
+ workflowId,
292
+ workflowSlug,
293
+ governedScope,
294
+ successCriteria,
295
+ disallowedSurfaces,
296
+ ...rest
297
+ } = {}) {
298
+ return this._request('/api/v1/session-governance/startup', {
299
+ method: 'POST',
300
+ body: {
301
+ ...rest,
302
+ objective: objective ?? intent,
303
+ allowed_mutation_surfaces: allowedMutationSurfaces ?? allowedScopes,
304
+ required_tool_keys: requiredToolKeys,
305
+ session_key: sessionKey,
306
+ workflow_run_id: workflowRunId,
307
+ workflow_id: workflowId,
308
+ workflow_slug: workflowSlug,
309
+ governed_scope: governedScope,
310
+ success_criteria: successCriteria,
311
+ disallowed_surfaces: disallowedSurfaces,
312
+ },
313
+ });
285
314
  }
286
315
 
287
316
  async startWork(body = {}) {
@@ -292,6 +321,16 @@ export class AIEngineClient {
292
321
  return this._request('/api/turns/complete', { method: 'POST', body });
293
322
  }
294
323
 
324
+ async evaluateTurnCompliance(sessionId) {
325
+ return this._request(`/api/v1/session-governance/${encodeURIComponent(sessionId)}/compliance`);
326
+ }
327
+
328
+ async blockIfNonCompliant(sessionId) {
329
+ return this._request(`/api/v1/session-governance/${encodeURIComponent(sessionId)}/block-if-non-compliant`, {
330
+ method: 'POST',
331
+ });
332
+ }
333
+
295
334
  async runCharter(body = {}) {
296
335
  return this._request('/api/charters/run', { method: 'POST', body });
297
336
  }