@bpmsoftwaresolutions/ai-engine-client 1.0.0-beta.1 → 1.0.0-beta.2

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 +11 -0
  2. package/package.json +1 -1
  3. package/src/index.js +64 -0
package/README.md CHANGED
@@ -95,10 +95,21 @@ const client = AIEngineClient.fromEnv();
95
95
  | `getProject(projectId)` | Get project detail. |
96
96
  | `listCodeFiles({ repositoryId, projectId, language, pathPrefix, page, pageSize })` | Page through inventoried code files. |
97
97
  | `getCodeFile(fileId)` | Get file detail. |
98
+ | `getCodeFileContentWindow(fileId, { startLine, endLine })` | Read a bounded file content window from inventory-backed content. |
98
99
  | `listCodeSymbolsByFile(fileId, { limit })` | List symbols discovered in a file. |
99
100
  | `getCodeSymbol(symbolId, { includeCode, maxLines })` | Get symbol detail. |
100
101
  | `searchSymbols({ query, projectScope, maxResults })` | Search inventoried symbols. |
101
102
  | `getSymbolRelationships(symbolId, { relationshipType, depth })` | Read symbol relationships from the inventory graph. |
103
+ | `listCodeRelationships({ repositoryId, projectId, relationshipType, limit })` | Read repository/project scoped graph relationships. |
104
+ | `listActionObservations({ repositoryId, projectPath, filePath, symbolId, actionKind, limit })` | Read latest action-grammar observations for a repo scope. |
105
+ | `listCodebaseShapeFindings({ repositoryId, projectPath, filePath, severity, status, limit })` | List latest codebase-shape findings for the selected repo scope. |
106
+ | `listObjectFlowObservations({ repositoryId, projectPath, filePath, objectKind, boundaryKind, limit })` | List latest object-flow observations for the selected repo scope. |
107
+ | `getChangeAnalysis({ fileId, symbolId, limit })` | Aggregate relationships, findings, and structural observations for one file or symbol. |
108
+ | `listRefactorCandidates({ repositoryRoot, limit })` | List governed refactor candidates derived from SQL-backed findings. |
109
+ | `analyzeRefactorCandidate({ filePath, requestedBy, packetId, refactorIntent })` | Build a replayable refactor packet preview for one candidate file. |
110
+ | `getRepoRetrievalPacket(retrievalPacketId)` | Read a retrieval packet through the repo boundary. |
111
+ | `getRepoRetrievalPacketFragments(retrievalPacketId)` | Read the packet fragments for a retrieval packet. |
112
+ | `evaluateProposalScope({ filePath, projectId, changeType, requestedBy, refactorIntent })` | Evaluate governance, scope, and open-task posture for a proposed refactor slice. |
102
113
 
103
114
  ### Retrieval Management
104
115
  | Method | Description |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpmsoftwaresolutions/ai-engine-client",
3
- "version": "1.0.0-beta.1",
3
+ "version": "1.0.0-beta.2",
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
@@ -165,6 +165,12 @@ export class AIEngineClient {
165
165
  return this._request(`/api/repo/files/${fileId}`);
166
166
  }
167
167
 
168
+ async getCodeFileContentWindow(fileId, { startLine = 1, endLine } = {}) {
169
+ return this._request(`/api/repo/files/${fileId}/content-window`, {
170
+ query: { start_line: startLine, end_line: endLine ?? startLine },
171
+ });
172
+ }
173
+
168
174
  async listCodeSymbolsByFile(fileId, { limit = 500 } = {}) {
169
175
  return this._request(`/api/repo/files/${fileId}/symbols`, {
170
176
  query: { limit },
@@ -189,6 +195,64 @@ export class AIEngineClient {
189
195
  });
190
196
  }
191
197
 
198
+ async listCodeRelationships({ repositoryId, projectId, relationshipType, limit = 100 } = {}) {
199
+ return this._request('/api/repo/relationships', {
200
+ query: { repository_id: repositoryId, project_id: projectId, relationship_type: relationshipType, limit },
201
+ });
202
+ }
203
+
204
+ async listActionObservations({ repositoryId, projectPath, filePath, symbolId, actionKind, limit = 100 } = {}) {
205
+ return this._request('/api/repo/action-observations', {
206
+ query: { repository_id: repositoryId, project_path: projectPath, file_path: filePath, symbol_id: symbolId, action_kind: actionKind, limit },
207
+ });
208
+ }
209
+
210
+ async listCodebaseShapeFindings({ repositoryId, projectPath, filePath, severity, status, limit = 100 } = {}) {
211
+ return this._request('/api/repo/shape/findings', {
212
+ query: { repository_id: repositoryId, project_path: projectPath, file_path: filePath, severity, status, limit },
213
+ });
214
+ }
215
+
216
+ async listObjectFlowObservations({ repositoryId, projectPath, filePath, objectKind, boundaryKind, limit = 100 } = {}) {
217
+ return this._request('/api/repo/object-flow-observations', {
218
+ query: { repository_id: repositoryId, project_path: projectPath, file_path: filePath, object_kind: objectKind, boundary_kind: boundaryKind, limit },
219
+ });
220
+ }
221
+
222
+ async getChangeAnalysis({ fileId, symbolId, limit = 25 } = {}) {
223
+ return this._request('/api/repo/change-analysis', {
224
+ query: { file_id: fileId, symbol_id: symbolId, limit },
225
+ });
226
+ }
227
+
228
+ async listRefactorCandidates({ repositoryRoot, limit = 10 } = {}) {
229
+ return this._request('/api/repo/refactor-candidates', {
230
+ query: { repository_root: repositoryRoot, limit },
231
+ });
232
+ }
233
+
234
+ async analyzeRefactorCandidate({ filePath, requestedBy, packetId, refactorIntent } = {}) {
235
+ return this._request('/api/repo/refactor-candidate-analysis', {
236
+ method: 'POST',
237
+ body: { file_path: filePath, requested_by: requestedBy, packet_id: packetId, refactor_intent: refactorIntent },
238
+ });
239
+ }
240
+
241
+ async getRepoRetrievalPacket(retrievalPacketId) {
242
+ return this._request(`/api/repo/retrieval/packets/${retrievalPacketId}`);
243
+ }
244
+
245
+ async getRepoRetrievalPacketFragments(retrievalPacketId) {
246
+ return this._request(`/api/repo/retrieval/packets/${retrievalPacketId}/fragments`);
247
+ }
248
+
249
+ async evaluateProposalScope({ filePath, projectId, changeType = 'refactor', requestedBy, refactorIntent } = {}) {
250
+ return this._request('/api/repo/proposal-scope-evaluation', {
251
+ method: 'POST',
252
+ body: { file_path: filePath, project_id: projectId, change_type: changeType, requested_by: requestedBy, refactor_intent: refactorIntent },
253
+ });
254
+ }
255
+
192
256
  // ─── Retrieval Management ──────────────────────────────────────────────────
193
257
 
194
258
  async getRetrievalStatus() {