@bpmsoftwaresolutions/ai-engine-client 1.1.8 → 1.1.10

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 +12 -0
  2. package/package.json +1 -1
  3. package/src/index.js +73 -0
package/README.md CHANGED
@@ -385,11 +385,23 @@ Low-level compatibility methods:
385
385
  | `submitUxGateRemediation(body)` / `client.loga.submitUxGateRemediation(body)` | `POST /api/loga/ux-gate-remediations` | Create a governed SQL-backed remediation ticket for a UX gate failure. |
386
386
  | `listUxGateRemediations({ projectionType, status })` / `client.loga.listUxGateRemediations(...)` | `GET /api/loga/ux-gate-remediations` | List governed UX gate remediation tickets. |
387
387
  | `getUxGateRemediation(remediationId)` / `client.loga.getUxGateRemediation(...)` | `GET /api/loga/ux-gate-remediations/:remediationId` | Read one governed UX gate remediation ticket. |
388
+ | `promoteUxGateRemediationImplementationCandidate(remediationId, { promotedBy })` / `client.loga.promoteUxGateRemediationImplementationCandidate(...)` | `POST /api/loga/ux-gate-remediations/:remediationId/implementation-candidate` | Promote a governed UX remediation ticket into a durable implementation packet candidate. |
389
+ | `getLogaUxGateRemediationProjection(remediationId)` / `client.loga.getUxGateRemediationProjection(...)` | `GET /api/operator/projections/ux-gate-remediations/:remediationId` | Review a governed UX remediation ticket and its linked implementation candidate as a LOGA runtime document. |
388
390
 
389
391
  These methods return markdown as `text` and expose projection headers as top-level fields plus `provenance`. LOGA should render the markdown emitted by AI Engine and use these metadata fields for contract validation, refresh behavior, evidence display, and action choreography.
390
392
 
391
393
  UX gate remediation is not a generic note or implementation-item evidence path. LOGA clients should use `submitUxGateRemediation()` when a projection fails a UX gate and should include `sourceTruth: 'sql'`, the projection identity, affected finding ids, and client evidence about the failing gate.
392
394
 
395
+ ### Generated Scripts
396
+ | Method | Endpoint | Description |
397
+ |---|---|---|
398
+ | `generateScript(body)` / `client.scripts.generate(body)` | `POST /api/scripts/generate` | Create a governed diagnostic-only helper script bound to claim, session, or workflow context. |
399
+ | `renderScript(scriptId)` / `client.scripts.render(scriptId)` | `GET /api/scripts/:scriptId/render` | Read the rendered helper script, shell-safe usage guidance, and SQL provenance. |
400
+ | `submitScriptArtifact(scriptId, body)` / `client.scripts.submitArtifact(scriptId, body)` | `POST /api/scripts/:scriptId/artifacts` | Submit governed execution evidence and attach a workflow artifact for the generated script run. |
401
+ | `getScriptRunEvidence({ workflowRunId, scriptId })` / `client.scripts.getRunEvidence(...)` | `GET /api/scripts/run-evidence` | List SQL-backed generated script runs and their evidence for a workflow run or one script id. |
402
+
403
+ Generated scripts are ephemeral helpers, not source-of-truth. The server keeps SQL authority over the run ledger and defaults each script to `diagnostic_only`, `local_helper`, and file/stdin-safe usage instead of fragile long inline commands.
404
+
393
405
  ### Retrieval Wrapper
394
406
  | Method | Description |
395
407
  |---|---|
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpmsoftwaresolutions/ai-engine-client",
3
- "version": "1.1.8",
3
+ "version": "1.1.10",
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
@@ -111,6 +111,15 @@ export class AIEngineClient {
111
111
  submitUxGateRemediation: (payload) => this.submitUxGateRemediation(payload),
112
112
  listUxGateRemediations: (query) => this.listUxGateRemediations(query),
113
113
  getUxGateRemediation: (remediationId) => this.getUxGateRemediation(remediationId),
114
+ promoteUxGateRemediationImplementationCandidate: (remediationId, payload) =>
115
+ this.promoteUxGateRemediationImplementationCandidate(remediationId, payload),
116
+ getUxGateRemediationProjection: (remediationId) => this.getLogaUxGateRemediationProjection(remediationId),
117
+ };
118
+ this.scripts = {
119
+ generate: (payload) => this.generateScript(payload),
120
+ render: (scriptId) => this.renderScript(scriptId),
121
+ submitArtifact: (scriptId, payload) => this.submitScriptArtifact(scriptId, payload),
122
+ getRunEvidence: (query) => this.getScriptRunEvidence(query),
114
123
  };
115
124
  }
116
125
 
@@ -908,6 +917,70 @@ export class AIEngineClient {
908
917
  return this._request(`/api/loga/ux-gate-remediations/${remediationId}`);
909
918
  }
910
919
 
920
+ async promoteUxGateRemediationImplementationCandidate(remediationId, { promotedBy } = {}) {
921
+ return this._request(`/api/loga/ux-gate-remediations/${remediationId}/implementation-candidate`, {
922
+ method: 'POST',
923
+ body: { promotedBy },
924
+ });
925
+ }
926
+
927
+ async getLogaUxGateRemediationProjection(remediationId) {
928
+ return this._requestLogaProjection(`/api/operator/projections/ux-gate-remediations/${remediationId}`);
929
+ }
930
+
931
+ async generateScript({
932
+ claimId,
933
+ contextSessionId,
934
+ workflowRunId,
935
+ intent = {},
936
+ renderSpec = {},
937
+ createdBy,
938
+ } = {}) {
939
+ return this._request('/api/scripts/generate', {
940
+ method: 'POST',
941
+ body: {
942
+ claimId,
943
+ contextSessionId,
944
+ workflowRunId,
945
+ intent,
946
+ renderSpec,
947
+ createdBy,
948
+ },
949
+ });
950
+ }
951
+
952
+ async renderScript(scriptId) {
953
+ return this._request(`/api/scripts/${scriptId}/render`);
954
+ }
955
+
956
+ async submitScriptArtifact(scriptId, {
957
+ workflowRunId,
958
+ output = {},
959
+ observations = [],
960
+ validation = {},
961
+ recordedBy,
962
+ } = {}) {
963
+ return this._request(`/api/scripts/${scriptId}/artifacts`, {
964
+ method: 'POST',
965
+ body: {
966
+ workflowRunId,
967
+ output,
968
+ observations,
969
+ validation,
970
+ recordedBy,
971
+ },
972
+ });
973
+ }
974
+
975
+ async getScriptRunEvidence({ workflowRunId, scriptId } = {}) {
976
+ return this._request('/api/scripts/run-evidence', {
977
+ query: {
978
+ workflowRunId,
979
+ scriptId,
980
+ },
981
+ });
982
+ }
983
+
911
984
  // ─── Roadmaps ──────────────────────────────────────────────────────────────
912
985
 
913
986
  async listProjectRoadmaps({ includeInactive } = {}) {