@bpmsoftwaresolutions/ai-engine-client 1.0.0-beta.0 → 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 +25 -0
  2. package/package.json +1 -1
  3. package/src/index.js +127 -0
package/README.md CHANGED
@@ -86,6 +86,31 @@ const client = AIEngineClient.fromEnv();
86
86
  | `getSymbolDefinition({ symbolName, qualifiedName, ... })` | Symbol/code definition lookup. |
87
87
  | `getRelatedCode({ symbolKey, qualifiedName, relationshipType, ... })` | Related code lookup. |
88
88
 
89
+ ### Repo Inventory
90
+ | Method | Description |
91
+ |---|---|
92
+ | `listRepositories({ limit })` | List inventoried repositories. |
93
+ | `getRepository(repositoryId)` | Get repository detail. |
94
+ | `listProjects({ repositoryId, repoKey, limit })` | List inventoried projects. |
95
+ | `getProject(projectId)` | Get project detail. |
96
+ | `listCodeFiles({ repositoryId, projectId, language, pathPrefix, page, pageSize })` | Page through inventoried code files. |
97
+ | `getCodeFile(fileId)` | Get file detail. |
98
+ | `getCodeFileContentWindow(fileId, { startLine, endLine })` | Read a bounded file content window from inventory-backed content. |
99
+ | `listCodeSymbolsByFile(fileId, { limit })` | List symbols discovered in a file. |
100
+ | `getCodeSymbol(symbolId, { includeCode, maxLines })` | Get symbol detail. |
101
+ | `searchSymbols({ query, projectScope, maxResults })` | Search inventoried symbols. |
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. |
113
+
89
114
  ### Retrieval Management
90
115
  | Method | Description |
91
116
  |---|---|
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpmsoftwaresolutions/ai-engine-client",
3
- "version": "1.0.0-beta.0",
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
@@ -126,6 +126,133 @@ export class AIEngineClient {
126
126
  });
127
127
  }
128
128
 
129
+ // ─── Repo Inventory ───────────────────────────────────────────────────────
130
+
131
+ async listRepositories({ limit } = {}) {
132
+ return this._request('/api/repo/repositories', {
133
+ query: { limit },
134
+ });
135
+ }
136
+
137
+ async getRepository(repositoryId) {
138
+ return this._request(`/api/repo/repositories/${repositoryId}`);
139
+ }
140
+
141
+ async listProjects({ repositoryId, repoKey, limit } = {}) {
142
+ return this._request('/api/repo/projects', {
143
+ query: { repository_id: repositoryId, repo_key: repoKey, limit },
144
+ });
145
+ }
146
+
147
+ async getProject(projectId) {
148
+ return this._request(`/api/repo/projects/${projectId}`);
149
+ }
150
+
151
+ async listCodeFiles({ repositoryId, projectId, language, pathPrefix, page = 1, pageSize = 50 } = {}) {
152
+ return this._request('/api/repo/files', {
153
+ query: {
154
+ repository_id: repositoryId,
155
+ project_id: projectId,
156
+ language,
157
+ path_prefix: pathPrefix,
158
+ page,
159
+ page_size: pageSize,
160
+ },
161
+ });
162
+ }
163
+
164
+ async getCodeFile(fileId) {
165
+ return this._request(`/api/repo/files/${fileId}`);
166
+ }
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
+
174
+ async listCodeSymbolsByFile(fileId, { limit = 500 } = {}) {
175
+ return this._request(`/api/repo/files/${fileId}/symbols`, {
176
+ query: { limit },
177
+ });
178
+ }
179
+
180
+ async getCodeSymbol(symbolId, { includeCode = false, maxLines = 120 } = {}) {
181
+ return this._request(`/api/repo/symbols/${symbolId}`, {
182
+ query: { include_code: includeCode, max_lines: maxLines },
183
+ });
184
+ }
185
+
186
+ async searchSymbols({ query, projectScope, maxResults = 10 } = {}) {
187
+ return this._request('/api/repo/symbols/search', {
188
+ query: { query, project_scope: projectScope, max_results: maxResults },
189
+ });
190
+ }
191
+
192
+ async getSymbolRelationships(symbolId, { relationshipType, depth = 1 } = {}) {
193
+ return this._request(`/api/repo/symbols/${symbolId}/relationships`, {
194
+ query: { relationship_type: relationshipType, depth },
195
+ });
196
+ }
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
+
129
256
  // ─── Retrieval Management ──────────────────────────────────────────────────
130
257
 
131
258
  async getRetrievalStatus() {