@bpmsoftwaresolutions/ai-engine-client 1.1.32 → 1.1.34

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 (3) hide show
  1. package/README.md +38 -0
  2. package/package.json +1 -1
  3. package/src/index.js +34 -1
package/README.md CHANGED
@@ -72,6 +72,11 @@ const persistedTurn = await client.persistAssistantTurn({
72
72
  assistant_summary: 'Completed the implementation step and persisted the governed turn.',
73
73
  changed_files: ['src/web/app.py'],
74
74
  });
75
+
76
+ const telemetry = await client.getExecutionTelemetryCurrent();
77
+ const processRuns = await client.listExecutionProcessRuns({ limit: 25 });
78
+ const generatedUsability = await client.getGeneratedExecutionUsability();
79
+ const logaUsability = await client.getLogaGeneratedExecutionUsabilityProjection();
75
80
  ```
76
81
 
77
82
  ## Integration Notes
@@ -194,6 +199,39 @@ renderLogaMarkdown(projection.text, {
194
199
  });
195
200
  ```
196
201
 
202
+ ### Execution Telemetry Monitoring
203
+
204
+ Use the telemetry methods when you want downstream consumers to read the governed API instead of generated files.
205
+
206
+ ```js
207
+ const current = await client.getExecutionTelemetryCurrent();
208
+ const runs = await client.listExecutionProcessRuns({ limit: 25, artifactKind: 'generated_script' });
209
+ const run = await client.getExecutionProcessRun('process-run-1');
210
+ const generated = await client.getGeneratedExecutionUsability();
211
+ const logaProjection = await client.getLogaGeneratedExecutionUsabilityProjection();
212
+
213
+ console.log(current.status, runs.process_run_count, run.process_run_id);
214
+ console.log(generated.projection_type, logaProjection.projectionType);
215
+ ```
216
+
217
+ The telemetry and LOGA surfaces are read-only and SQL-backed:
218
+
219
+ - `getExecutionTelemetryCurrent()`
220
+ - `listExecutionProcessRuns({ limit, artifactKind, status, since })`
221
+ - `getExecutionProcessRun(processRunId)`
222
+ - `getGeneratedExecutionUsability()`
223
+ - `getLogaGeneratedExecutionUsabilityProjection()`
224
+
225
+ Example shell consumer:
226
+
227
+ - [`examples/monitoring/read-execution-telemetry.mjs`](/Users/sidney/source/repos/bpm/internal/ai-engine/examples/monitoring/read-execution-telemetry.mjs)
228
+
229
+ Run it with:
230
+
231
+ ```bash
232
+ AI_ENGINE_BASE_URL="..." AI_ENGINE_ACCESS_TOKEN="..." npm run example:monitoring
233
+ ```
234
+
197
235
  ### fromEnv
198
236
 
199
237
  ```js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpmsoftwaresolutions/ai-engine-client",
3
- "version": "1.1.32",
3
+ "version": "1.1.34",
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.32';
2
+ export const AI_ENGINE_CLIENT_VERSION = '1.1.34';
3
3
  export const GOVERNED_MUTATION_REQUIRED_CAPABILITIES = [
4
4
  'executeVerifiedMutation',
5
5
  'post_mutation_verification',
@@ -251,6 +251,13 @@ export class AIEngineClient {
251
251
  promoteUxGateRemediationImplementationCandidate: (remediationId, payload) =>
252
252
  this.promoteUxGateRemediationImplementationCandidate(remediationId, payload),
253
253
  getUxGateRemediationProjection: (remediationId) => this.getLogaUxGateRemediationProjection(remediationId),
254
+ getGeneratedExecutionUsabilityProjection: (query) => this.getLogaGeneratedExecutionUsabilityProjection(query),
255
+ };
256
+ this.executionTelemetry = {
257
+ getCurrent: () => this.getExecutionTelemetryCurrent(),
258
+ listProcessRuns: (query) => this.listExecutionProcessRuns(query),
259
+ getProcessRun: (processRunId) => this.getExecutionProcessRun(processRunId),
260
+ getGeneratedExecutionUsability: (query) => this.getGeneratedExecutionUsability(query),
254
261
  };
255
262
  this.scripts = {
256
263
  generate: (payload) => this.generateScript(payload),
@@ -302,6 +309,32 @@ export class AIEngineClient {
302
309
  });
303
310
  }
304
311
 
312
+ async getExecutionTelemetryCurrent() {
313
+ return this._request('/api/operator/execution-telemetry/current');
314
+ }
315
+
316
+ async listExecutionProcessRuns({ limit, artifactKind, status, since } = {}) {
317
+ return this._request('/api/operator/execution-telemetry/process-runs', {
318
+ query: { limit, artifact_kind: artifactKind, status, since },
319
+ });
320
+ }
321
+
322
+ async getExecutionProcessRun(processRunId) {
323
+ return this._request(`/api/operator/execution-telemetry/process-runs/${processRunId}`);
324
+ }
325
+
326
+ async getGeneratedExecutionUsability({ artifactPath, limit } = {}) {
327
+ return this._request('/api/operator/generated-execution-usability', {
328
+ query: { artifact_path: artifactPath, limit },
329
+ });
330
+ }
331
+
332
+ async getLogaGeneratedExecutionUsabilityProjection({ artifactPath, limit } = {}) {
333
+ return this._requestLogaProjection('/api/loga/ai-engine/generated-execution-usability', {
334
+ query: { artifact_path: artifactPath, limit },
335
+ });
336
+ }
337
+
305
338
  async getAntiPatternRules() {
306
339
  return this._request('/api/governance/anti-pattern-rules');
307
340
  }