@bpmsoftwaresolutions/ai-engine-client 1.0.0-beta.1 → 1.0.0-beta.3
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.
- package/README.md +14 -0
- package/package.json +1 -1
- package/src/index.js +87 -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 |
|
|
@@ -169,6 +180,7 @@ const client = AIEngineClient.fromEnv();
|
|
|
169
180
|
| `getProjectRoadmap(projectId)` | Get full roadmap for a project. |
|
|
170
181
|
| `getProjectRoadmapSummary(projectId)` | Roadmap summary. |
|
|
171
182
|
| `getProjectRoadmapActiveItem(projectId)` | Current active roadmap item. |
|
|
183
|
+
| `ensureProjectRoadmapTaskSurface(projectId, { requestedBy, assignedTo, createAcceptanceSubtasks })` | Materialize the active roadmap item's parent task and acceptance subtasks. |
|
|
172
184
|
| `listProjectOpenTasks(projectId)` | Open tasks for a project. |
|
|
173
185
|
| `getProjectPerformanceMetrics(projectId, { workflowId, workflowRunId, sinceUtc })` | Performance metrics. |
|
|
174
186
|
|
|
@@ -176,6 +188,8 @@ const client = AIEngineClient.fromEnv();
|
|
|
176
188
|
| Method | Description |
|
|
177
189
|
|---|---|
|
|
178
190
|
| `createImplementationTask(implementationItemId, { title, implementationPacketId, ... })` | Create a task on a roadmap item. |
|
|
191
|
+
|
|
192
|
+
`createProjectCharter()` now also accepts `linkedWorkflowSlug`, `ensureTaskSurface`, `assignedTo`, and `createAcceptanceSubtasks` so new API-chartered projects can immediately surface an attachable implementation item and durable task tree.
|
|
179
193
|
| `listImplementationTasks(implementationItemId)` | List tasks. |
|
|
180
194
|
| `listImplementationSubtasks(taskId)` | List subtasks. |
|
|
181
195
|
| `updateImplementationTask(taskId, updates)` | Update a task. |
|
package/package.json
CHANGED
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() {
|
|
@@ -361,9 +425,13 @@ export class AIEngineClient {
|
|
|
361
425
|
outOfScope = [],
|
|
362
426
|
assumptions = [],
|
|
363
427
|
linkedWorkflows = [],
|
|
428
|
+
linkedWorkflowSlug,
|
|
364
429
|
testingStrategy = {},
|
|
365
430
|
initialContext = {},
|
|
366
431
|
requestedBy,
|
|
432
|
+
ensureTaskSurface = true,
|
|
433
|
+
assignedTo,
|
|
434
|
+
createAcceptanceSubtasks = true,
|
|
367
435
|
} = {}) {
|
|
368
436
|
return this._request('/api/projects/charter', {
|
|
369
437
|
method: 'POST',
|
|
@@ -378,9 +446,13 @@ export class AIEngineClient {
|
|
|
378
446
|
out_of_scope: outOfScope,
|
|
379
447
|
assumptions,
|
|
380
448
|
linked_workflows: linkedWorkflows,
|
|
449
|
+
linked_workflow_slug: linkedWorkflowSlug,
|
|
381
450
|
testing_strategy: testingStrategy,
|
|
382
451
|
initial_context: initialContext,
|
|
383
452
|
requested_by: requestedBy,
|
|
453
|
+
ensure_task_surface: ensureTaskSurface,
|
|
454
|
+
assigned_to: assignedTo,
|
|
455
|
+
create_acceptance_subtasks: createAcceptanceSubtasks,
|
|
384
456
|
},
|
|
385
457
|
});
|
|
386
458
|
}
|
|
@@ -420,6 +492,21 @@ export class AIEngineClient {
|
|
|
420
492
|
return this._request(`/api/operator/projects/${projectId}/implementation-roadmap/active-item`);
|
|
421
493
|
}
|
|
422
494
|
|
|
495
|
+
async ensureProjectRoadmapTaskSurface(projectId, {
|
|
496
|
+
requestedBy,
|
|
497
|
+
assignedTo,
|
|
498
|
+
createAcceptanceSubtasks = true,
|
|
499
|
+
} = {}) {
|
|
500
|
+
return this._request(`/api/operator/projects/${projectId}/implementation-roadmap/task-surface`, {
|
|
501
|
+
method: 'POST',
|
|
502
|
+
body: {
|
|
503
|
+
requested_by: requestedBy,
|
|
504
|
+
assigned_to: assignedTo,
|
|
505
|
+
create_acceptance_subtasks: createAcceptanceSubtasks,
|
|
506
|
+
},
|
|
507
|
+
});
|
|
508
|
+
}
|
|
509
|
+
|
|
423
510
|
async listProjectOpenTasks(projectId) {
|
|
424
511
|
return this._request(`/api/operator/projects/${projectId}/open-tasks`);
|
|
425
512
|
}
|