@bpmsoftwaresolutions/ai-engine-client 1.1.74 → 1.1.75

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpmsoftwaresolutions/ai-engine-client",
3
- "version": "1.1.74",
3
+ "version": "1.1.75",
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/client.js CHANGED
@@ -18,8 +18,16 @@ import { createNotesLabDomain } from './domains/notes-lab.js';
18
18
  import { createProjectionsDomain } from './domains/projections.js';
19
19
  import { createReportsDomain } from './domains/reports.js';
20
20
  import { createPerformanceDomain } from './domains/performance.js';
21
+ import { createImplementationArtifactsDomain } from './domains/implementation-artifacts.js';
22
+ import { createImplementationEvidenceDomain } from './domains/implementation-evidence.js';
23
+ import { createImplementationGatesDomain } from './domains/implementation-gates.js';
24
+ import { createImplementationPacketsDomain } from './domains/implementation-packets.js';
25
+ import { createImplementationItemsDomain } from './domains/implementation-items.js';
21
26
  import { createRepoDomain } from './domains/repo.js';
27
+ import { createProjectCharteringDomain } from './domains/project-chartering.js';
28
+ import { createProjectsDomain } from './domains/projects.js';
22
29
  import { createOperatorStatusDomain } from './domains/operator-status.js';
30
+ import { createRoadmapsDomain } from './domains/roadmaps.js';
23
31
  import { createScriptDiscoveryDomain } from './domains/script-discovery.js';
24
32
  import { createScriptsDomain } from './domains/scripts.js';
25
33
  import { createRetrievalManagementDomain } from './domains/retrieval-management.js';
@@ -367,6 +375,14 @@ export class AIEngineClient {
367
375
  currentProject: createCurrentProjectDomain(this),
368
376
  };
369
377
  this.database = createDatabaseDomain(this);
378
+ this.projects = createProjectsDomain(this);
379
+ this.projectChartering = createProjectCharteringDomain(this);
380
+ this.roadmaps = createRoadmapsDomain(this);
381
+ this.implementationPackets = createImplementationPacketsDomain(this);
382
+ this.implementationItems = createImplementationItemsDomain(this);
383
+ this.implementationArtifacts = createImplementationArtifactsDomain(this);
384
+ this.implementationEvidence = createImplementationEvidenceDomain(this);
385
+ this.implementationGates = createImplementationGatesDomain(this);
370
386
  this.implementationTasks = createImplementationTasksDomain(this);
371
387
  this.skills = createSkillsDomain(this);
372
388
  this.skillGovernance = createSkillGovernanceDomain(this);
@@ -5725,39 +5741,23 @@ export class AIEngineClient {
5725
5741
  }
5726
5742
 
5727
5743
  async createProjectDelivery(body = {}) {
5728
- return this._request('/api/project-delivery', { method: 'POST', body });
5744
+ return this.projectChartering.createProjectDelivery(body);
5729
5745
  }
5730
5746
 
5731
5747
  async approveProjectCharterIntent(projectId, body = {}) {
5732
- if (!projectId) throw new Error('projectId is required.');
5733
- return this._request(`/api/project-delivery/${encodeURIComponent(projectId)}/approve-charter-intent`, {
5734
- method: 'POST',
5735
- body,
5736
- });
5748
+ return this.projectChartering.approveProjectCharterIntent(projectId, body);
5737
5749
  }
5738
5750
 
5739
5751
  async approveImplementationRoadmap(projectId, body = {}) {
5740
- if (!projectId) throw new Error('projectId is required.');
5741
- return this._request(`/api/project-delivery/${encodeURIComponent(projectId)}/approve-roadmap`, {
5742
- method: 'POST',
5743
- body,
5744
- });
5752
+ return this.projectChartering.approveImplementationRoadmap(projectId, body);
5745
5753
  }
5746
5754
 
5747
5755
  async runProjectCharter(projectId, body = {}) {
5748
- if (!projectId) throw new Error('projectId is required.');
5749
- return this._request(`/api/project-delivery/${encodeURIComponent(projectId)}/run-charter`, {
5750
- method: 'POST',
5751
- body,
5752
- });
5756
+ return this.projectChartering.runProjectCharter(projectId, body);
5753
5757
  }
5754
5758
 
5755
5759
  async beginImplementationRoadmap(projectId, body = {}) {
5756
- if (!projectId) throw new Error('projectId is required.');
5757
- return this._request(`/api/project-delivery/${encodeURIComponent(projectId)}/begin-roadmap`, {
5758
- method: 'POST',
5759
- body,
5760
- });
5760
+ return this.projectChartering.beginImplementationRoadmap(projectId, body);
5761
5761
  }
5762
5762
 
5763
5763
  async routeImplementationItem(implementationItemId, body = {}) {
@@ -6184,49 +6184,37 @@ export class AIEngineClient {
6184
6184
  assignedTo,
6185
6185
  createAcceptanceSubtasks = true,
6186
6186
  } = {}) {
6187
- return this._request('/api/projects/charter', {
6188
- method: 'POST',
6189
- body: {
6190
- project_name: projectName,
6191
- objective,
6192
- business_context: businessContext,
6193
- success_criteria: successCriteria,
6194
- priority,
6195
- constraints,
6196
- in_scope: inScope,
6197
- out_of_scope: outOfScope,
6198
- assumptions,
6199
- linked_workflows: linkedWorkflows,
6200
- linked_workflow_slug: linkedWorkflowSlug,
6201
- testing_strategy: testingStrategy,
6202
- initial_context: initialContext,
6203
- requested_by: requestedBy,
6204
- ensure_task_surface: ensureTaskSurface,
6205
- assigned_to: assignedTo,
6206
- create_acceptance_subtasks: createAcceptanceSubtasks,
6207
- },
6187
+ return this.projectChartering.createProjectCharter({
6188
+ projectName,
6189
+ objective,
6190
+ businessContext,
6191
+ successCriteria,
6192
+ priority,
6193
+ constraints,
6194
+ inScope,
6195
+ outOfScope,
6196
+ assumptions,
6197
+ linkedWorkflows,
6198
+ linkedWorkflowSlug,
6199
+ testingStrategy,
6200
+ initialContext,
6201
+ requestedBy,
6202
+ ensureTaskSurface,
6203
+ assignedTo,
6204
+ createAcceptanceSubtasks,
6208
6205
  });
6209
6206
  }
6210
6207
 
6211
6208
  async listProjects({ limit, includeInactive, processStatus, charterStatus } = {}) {
6212
- return this._request('/api/operator/projects', {
6213
- query: {
6214
- limit,
6215
- include_inactive: includeInactive,
6216
- process_status: processStatus,
6217
- charter_status: charterStatus,
6218
- },
6219
- });
6209
+ return this.projects.listProjects({ limit, includeInactive, processStatus, charterStatus });
6220
6210
  }
6221
6211
 
6222
6212
  async getProject(projectId) {
6223
- return this._request(`/api/operator/projects/${projectId}`);
6213
+ return this.projects.getProject(projectId);
6224
6214
  }
6225
6215
 
6226
6216
  async listProjectWorkflowRuns(projectId, { limit = 25 } = {}) {
6227
- return this._request(`/api/operator/projects/${projectId}/workflow-runs`, {
6228
- query: { limit },
6229
- });
6217
+ return this.projects.listProjectWorkflowRuns(projectId, { limit });
6230
6218
  }
6231
6219
 
6232
6220
  async closeProject(projectId, {
@@ -6297,26 +6285,23 @@ export class AIEngineClient {
6297
6285
  }
6298
6286
 
6299
6287
  async getProjectCharterReport(projectId) {
6300
- return this._request(`/api/operator/projects/${projectId}/charter/report`);
6288
+ return this.projects.getProjectCharterReport(projectId);
6301
6289
  }
6302
6290
 
6303
6291
  async createProjectMarkdownDownload(projectId, { reportType, includeMarkdown = false } = {}) {
6304
- return this._request(`/api/operator/projects/${projectId}/markdown-report-downloads`, {
6305
- method: 'POST',
6306
- body: { report_type: reportType, include_markdown: includeMarkdown },
6307
- });
6292
+ return this.projects.createProjectMarkdownDownload(projectId, { reportType, includeMarkdown });
6308
6293
  }
6309
6294
 
6310
6295
  async downloadProjectMarkdownReport(projectId, reportType) {
6311
- return this._requestText(`/api/operator/projects/${projectId}/markdown-reports/${reportType}/download`);
6296
+ return this.projects.downloadProjectMarkdownReport(projectId, reportType);
6312
6297
  }
6313
6298
 
6314
6299
  async downloadProjectCharterReportMarkdown(projectId) {
6315
- return this.downloadProjectMarkdownReport(projectId, 'charter');
6300
+ return this.projects.downloadProjectCharterReportMarkdown(projectId);
6316
6301
  }
6317
6302
 
6318
6303
  async getProjectBundle(projectId) {
6319
- return this._request(`/api/operator/projects/${projectId}/bundle`);
6304
+ return this.projects.getProjectBundle(projectId);
6320
6305
  }
6321
6306
 
6322
6307
  async resumeProjectWork({
@@ -6327,17 +6312,13 @@ export class AIEngineClient {
6327
6312
  requireClaim,
6328
6313
  workflowRunLimit,
6329
6314
  } = {}) {
6330
- const normalizedProjectIdentifier = cleanText(projectIdentifier) || cleanText(projectId);
6331
- if (!normalizedProjectIdentifier) {
6332
- throw new Error('projectIdentifier is required.');
6333
- }
6334
- return this._request(`/api/operator/projects/${encodeURIComponent(normalizedProjectIdentifier)}/resume-context`, {
6335
- query: {
6336
- actor_mode: actorMode,
6337
- execution_intent: executionIntent,
6338
- require_claim: requireClaim,
6339
- workflow_run_limit: workflowRunLimit,
6340
- },
6315
+ return this.projects.resumeProjectWork({
6316
+ projectIdentifier,
6317
+ projectId,
6318
+ actorMode,
6319
+ executionIntent,
6320
+ requireClaim,
6321
+ workflowRunLimit,
6341
6322
  });
6342
6323
  }
6343
6324
 
@@ -6835,29 +6816,27 @@ export class AIEngineClient {
6835
6816
  // ─── Roadmaps ──────────────────────────────────────────────────────────────
6836
6817
 
6837
6818
  async listProjectRoadmaps({ includeInactive } = {}) {
6838
- return this._request('/api/operator/projects/implementation-roadmaps', {
6839
- query: { include_inactive: includeInactive },
6840
- });
6819
+ return this.roadmaps.listProjectRoadmaps({ includeInactive });
6841
6820
  }
6842
6821
 
6843
6822
  async getProjectRoadmap(projectId) {
6844
- return this._request(`/api/operator/projects/${projectId}/implementation-roadmap`);
6823
+ return this.roadmaps.getProjectRoadmap(projectId);
6845
6824
  }
6846
6825
 
6847
6826
  async getProjectRoadmapSummary(projectId) {
6848
- return this._request(`/api/operator/projects/${projectId}/implementation-roadmap/summary`);
6827
+ return this.roadmaps.getProjectRoadmapSummary(projectId);
6849
6828
  }
6850
6829
 
6851
6830
  async getProjectRoadmapActiveItem(projectId) {
6852
- return this._request(`/api/operator/projects/${projectId}/implementation-roadmap/active-item`);
6831
+ return this.roadmaps.getProjectRoadmapActiveItem(projectId);
6853
6832
  }
6854
6833
 
6855
6834
  async getProjectImplementationRoadmapReport(projectId) {
6856
- return this._request(`/api/operator/projects/${projectId}/implementation-roadmap/report`);
6835
+ return this.roadmaps.getProjectImplementationRoadmapReport(projectId);
6857
6836
  }
6858
6837
 
6859
6838
  async downloadProjectImplementationRoadmapReportMarkdown(projectId) {
6860
- return this.downloadProjectMarkdownReport(projectId, 'implementation_roadmap');
6839
+ return this.roadmaps.downloadProjectImplementationRoadmapReportMarkdown(projectId);
6861
6840
  }
6862
6841
 
6863
6842
  async ensureProjectRoadmapTaskSurface(projectId, {
@@ -6865,13 +6844,10 @@ export class AIEngineClient {
6865
6844
  assignedTo,
6866
6845
  createAcceptanceSubtasks = true,
6867
6846
  } = {}) {
6868
- return this._request(`/api/operator/projects/${projectId}/implementation-roadmap/task-surface`, {
6869
- method: 'POST',
6870
- body: {
6871
- requested_by: requestedBy,
6872
- assigned_to: assignedTo,
6873
- create_acceptance_subtasks: createAcceptanceSubtasks,
6874
- },
6847
+ return this.roadmaps.ensureProjectRoadmapTaskSurface(projectId, {
6848
+ requestedBy,
6849
+ assignedTo,
6850
+ createAcceptanceSubtasks,
6875
6851
  });
6876
6852
  }
6877
6853
 
@@ -6976,13 +6952,11 @@ export class AIEngineClient {
6976
6952
  }
6977
6953
 
6978
6954
  async listProjectOpenTasks(projectId) {
6979
- return this._request(`/api/operator/projects/${projectId}/open-tasks`);
6955
+ return this.projects.listProjectOpenTasks(projectId);
6980
6956
  }
6981
6957
 
6982
6958
  async getProjectPerformanceMetrics(projectId, { workflowId, workflowRunId, sinceUtc } = {}) {
6983
- return this._request(`/api/operator/projects/${projectId}/performance-metrics`, {
6984
- query: { workflow_id: workflowId, workflow_run_id: workflowRunId, since_utc: sinceUtc },
6985
- });
6959
+ return this.projects.getProjectPerformanceMetrics(projectId, { workflowId, workflowRunId, sinceUtc });
6986
6960
  }
6987
6961
 
6988
6962
  _resolveImplementationPacketProjectReference(packetPayload) {
@@ -7057,127 +7031,76 @@ export class AIEngineClient {
7057
7031
  executionType,
7058
7032
  executionPurpose,
7059
7033
  } = {}) {
7060
- const normalizedClaimId = cleanText(claimId);
7061
- const normalizedClaimProjectId = cleanText(claimProjectId) || cleanText(projectId);
7062
- const normalizedClaimedItemId = cleanText(claimedItemId) || implementationItemId;
7063
- const normalizedWorkflowRunId = cleanText(workflowRunId);
7064
- const normalizedAgentSessionId = cleanText(agentSessionId);
7065
- const normalizedAllowedMutationSurfaces = Array.isArray(allowedMutationSurfaces) && allowedMutationSurfaces.length > 0
7066
- ? allowedMutationSurfaces
7067
- : ['project_roadmap_task'];
7068
- const normalizedAcknowledgedReminders = Array.isArray(acknowledgedReminders)
7069
- ? acknowledgedReminders
7070
- : undefined;
7071
- const normalizedExecutionIntent = (() => {
7072
- if (executionIntent && typeof executionIntent === 'object') {
7073
- const execution_type = cleanText(executionIntent.execution_type) || cleanText(executionIntent.executionType);
7074
- const execution_purpose = cleanText(executionIntent.execution_purpose) || cleanText(executionIntent.executionPurpose);
7075
- if (execution_type || execution_purpose) {
7076
- return {
7077
- ...(execution_type ? { execution_type } : {}),
7078
- ...(execution_purpose ? { execution_purpose } : {}),
7079
- };
7080
- }
7081
- }
7082
- const normalizedExecutionType = cleanText(executionType) || 'implementation_task';
7083
- const normalizedExecutionPurpose = cleanText(executionPurpose) || cleanText(title) || 'implementation task';
7084
- return {
7085
- execution_type: normalizedExecutionType,
7086
- execution_purpose: normalizedExecutionPurpose,
7087
- };
7088
- })();
7089
- await this._assertExecutionEligibility({
7090
- claim_id: normalizedClaimId,
7091
- claim_project_id: normalizedClaimProjectId,
7092
- claimed_item_id: normalizedClaimedItemId,
7093
- workflow_run_id: normalizedWorkflowRunId,
7094
- agent_session_id: normalizedAgentSessionId,
7095
- allowed_mutation_surfaces: normalizedAllowedMutationSurfaces,
7096
- acknowledged_reminders: normalizedAcknowledgedReminders || [],
7097
- requested_mutation_surface: 'project_roadmap_task',
7098
- verification_required: true,
7099
- });
7100
- return this._request(`/api/operator/implementation-items/${implementationItemId}/tasks`, {
7101
- method: 'POST',
7102
- body: {
7103
- title,
7104
- implementation_packet_id: implementationPacketId,
7105
- description,
7106
- priority,
7107
- assigned_to: assignedTo,
7108
- assigned_by: assignedBy,
7109
- due_at: dueAt,
7110
- sort_order: sortOrder,
7111
- notes,
7112
- created_by: createdBy,
7113
- parent_task_id: parentTaskId,
7114
- claim_id: normalizedClaimId,
7115
- claim_project_id: normalizedClaimProjectId,
7116
- claimed_item_id: normalizedClaimedItemId,
7117
- workflow_run_id: normalizedWorkflowRunId,
7118
- agent_session_id: normalizedAgentSessionId,
7119
- allowed_mutation_surfaces: normalizedAllowedMutationSurfaces,
7120
- acknowledged_reminders: normalizedAcknowledgedReminders,
7121
- execution_intent: normalizedExecutionIntent,
7122
- },
7034
+ return this.implementationItems.createImplementationTask(implementationItemId, {
7035
+ title,
7036
+ implementationPacketId,
7037
+ description,
7038
+ priority,
7039
+ assignedTo,
7040
+ assignedBy,
7041
+ dueAt,
7042
+ sortOrder,
7043
+ notes,
7044
+ createdBy,
7045
+ parentTaskId,
7046
+ claimId,
7047
+ claimProjectId,
7048
+ projectId,
7049
+ claimedItemId,
7050
+ workflowRunId,
7051
+ agentSessionId,
7052
+ allowedMutationSurfaces,
7053
+ acknowledgedReminders,
7054
+ executionIntent,
7055
+ executionType,
7056
+ executionPurpose,
7123
7057
  });
7124
7058
  }
7125
7059
 
7126
7060
  async listImplementationTasks(implementationItemId) {
7127
- return this._request(`/api/operator/implementation-items/${implementationItemId}/tasks`);
7061
+ return this.implementationItems.listImplementationTasks(implementationItemId);
7128
7062
  }
7129
7063
 
7130
7064
  async listImplementationSubtasks(taskId) {
7131
- return this._request(`/api/operator/implementation-item-tasks/${taskId}/subtasks`);
7065
+ return this.implementationItems.listImplementationSubtasks(taskId);
7132
7066
  }
7133
7067
 
7134
7068
  async updateImplementationTask(taskId, updates) {
7135
- return this._request(`/api/operator/implementation-item-tasks/${taskId}`, {
7136
- method: 'PATCH',
7137
- body: updates,
7138
- });
7069
+ return this.implementationItems.updateImplementationTask(taskId, updates);
7139
7070
  }
7140
7071
 
7141
7072
  async assignImplementationTask(taskId, { assignedTo, assignedBy } = {}) {
7142
- return this._request(`/api/operator/implementation-item-tasks/${taskId}/assign`, {
7143
- method: 'POST',
7144
- body: { assigned_to: assignedTo, assigned_by: assignedBy },
7145
- });
7073
+ return this.implementationItems.assignImplementationTask(taskId, { assignedTo, assignedBy });
7146
7074
  }
7147
7075
 
7148
7076
  async completeImplementationTask(taskId, { completedBy } = {}) {
7149
- return this._request(`/api/operator/implementation-item-tasks/${taskId}/complete`, {
7150
- method: 'POST',
7151
- body: { completed_by: completedBy },
7152
- });
7077
+ return this.implementationItems.completeImplementationTask(taskId, { completedBy });
7153
7078
  }
7154
7079
 
7155
7080
  // ─── Governed Implementation ───────────────────────────────────────────────
7156
7081
 
7157
7082
  async importImplementationPacket(body) {
7158
- return this._request('/api/governed-implementation/packets/import', { method: 'POST', body });
7083
+ return this.implementationPackets.importImplementationPacket(body);
7159
7084
  }
7160
7085
 
7161
7086
  async listImplementationPackets({ status, packetType } = {}) {
7162
- return this._request('/api/governed-implementation/packets', {
7163
- query: { status, packet_type: packetType },
7164
- });
7087
+ return this.implementationPackets.listImplementationPackets({ status, packetType });
7165
7088
  }
7166
7089
 
7167
7090
  async getImplementationPacket(packetId) {
7168
- return this._request(`/api/governed-implementation/packets/${packetId}`);
7091
+ return this.implementationPackets.getImplementationPacket(packetId);
7169
7092
  }
7170
7093
 
7171
7094
  async getImplementationItemAcceptanceChecks(implementationItemId) {
7172
- return this._request(`/api/governed-implementation/items/${implementationItemId}/acceptance-checks`);
7095
+ return this.implementationGates.getImplementationItemAcceptanceChecks(implementationItemId);
7173
7096
  }
7174
7097
 
7175
7098
  async getArtifactManifest(implementationItemId) {
7176
- return this._request(`/api/governed-implementation/items/${implementationItemId}/artifact-manifest`);
7099
+ return this.implementationArtifacts.getArtifactManifest(implementationItemId);
7177
7100
  }
7178
7101
 
7179
7102
  async getDecisionPacket(implementationItemId) {
7180
- return this._request(`/api/governed-implementation/items/${implementationItemId}/decision-packet`);
7103
+ return this.implementationArtifacts.getDecisionPacket(implementationItemId);
7181
7104
  }
7182
7105
 
7183
7106
  async updateImplementationItemStatus(implementationItemId, body) {
@@ -7224,19 +7147,15 @@ export class AIEngineClient {
7224
7147
  }
7225
7148
 
7226
7149
  async addImplementationItemEvidence(implementationItemId, body) {
7227
- return this._request(`/api/governed-implementation/items/${implementationItemId}/evidence`, {
7228
- method: 'POST', body,
7229
- });
7150
+ return this.implementationEvidence.addImplementationItemEvidence(implementationItemId, body);
7230
7151
  }
7231
7152
 
7232
7153
  async addImplementationItemActivity(implementationItemId, body) {
7233
- return this._request(`/api/governed-implementation/items/${implementationItemId}/activity`, {
7234
- method: 'POST', body,
7235
- });
7154
+ return this.implementationEvidence.addImplementationItemActivity(implementationItemId, body);
7236
7155
  }
7237
7156
 
7238
7157
  async listImplementationItemActivity(implementationItemId) {
7239
- return this._request(`/api/governed-implementation/items/${implementationItemId}/activity`);
7158
+ return this.implementationEvidence.listImplementationItemActivity(implementationItemId);
7240
7159
  }
7241
7160
 
7242
7161
  async updateAcceptanceCheckStatus(implementationItemId, acceptanceCheckId, body) {
@@ -7253,23 +7172,19 @@ export class AIEngineClient {
7253
7172
  }
7254
7173
 
7255
7174
  async createImplementationPacketGateDecision(packetId, body) {
7256
- return this._request(`/api/governed-implementation/packets/${packetId}/gate-decisions`, {
7257
- method: 'POST', body,
7258
- });
7175
+ return this.implementationGates.createImplementationPacketGateDecision(packetId, body);
7259
7176
  }
7260
7177
 
7261
7178
  async bindImplementationPacketToWorkflow(workflowId, body) {
7262
- return this._request(`/api/governed-implementation/workflows/${workflowId}/bindings`, {
7263
- method: 'POST', body,
7264
- });
7179
+ return this.implementationPackets.bindImplementationPacketToWorkflow(workflowId, body);
7265
7180
  }
7266
7181
 
7267
7182
  async getWorkflowImplementationRoadmap(workflowId) {
7268
- return this._request(`/api/governed-implementation/workflows/${workflowId}/roadmap`);
7183
+ return this.implementationPackets.getWorkflowImplementationRoadmap(workflowId);
7269
7184
  }
7270
7185
 
7271
7186
  async getWorkflowResumeContext(workflowId) {
7272
- return this._request(`/api/governed-implementation/workflows/${workflowId}/resume-context`);
7187
+ return this.implementationPackets.getWorkflowResumeContext(workflowId);
7273
7188
  }
7274
7189
 
7275
7190
  async executeVerifiedMutation({
@@ -0,0 +1,6 @@
1
+ export function createImplementationArtifactsDomain(client) {
2
+ return {
3
+ getArtifactManifest: (implementationItemId) => client._request(`/api/governed-implementation/items/${implementationItemId}/artifact-manifest`),
4
+ getDecisionPacket: (implementationItemId) => client._request(`/api/governed-implementation/items/${implementationItemId}/decision-packet`),
5
+ };
6
+ }
@@ -0,0 +1,13 @@
1
+ export function createImplementationEvidenceDomain(client) {
2
+ return {
3
+ addImplementationItemEvidence: (implementationItemId, body) => client._request(`/api/governed-implementation/items/${implementationItemId}/evidence`, {
4
+ method: 'POST',
5
+ body,
6
+ }),
7
+ addImplementationItemActivity: (implementationItemId, body) => client._request(`/api/governed-implementation/items/${implementationItemId}/activity`, {
8
+ method: 'POST',
9
+ body,
10
+ }),
11
+ listImplementationItemActivity: (implementationItemId) => client._request(`/api/governed-implementation/items/${implementationItemId}/activity`),
12
+ };
13
+ }
@@ -0,0 +1,9 @@
1
+ export function createImplementationGatesDomain(client) {
2
+ return {
3
+ getImplementationItemAcceptanceChecks: (implementationItemId) => client._request(`/api/governed-implementation/items/${implementationItemId}/acceptance-checks`),
4
+ createImplementationPacketGateDecision: (packetId, body) => client._request(`/api/governed-implementation/packets/${packetId}/gate-decisions`, {
5
+ method: 'POST',
6
+ body,
7
+ }),
8
+ };
9
+ }
@@ -0,0 +1,107 @@
1
+ export function createImplementationItemsDomain(client) {
2
+ return {
3
+ createImplementationTask: async (implementationItemId, {
4
+ title,
5
+ implementationPacketId,
6
+ description,
7
+ priority,
8
+ assignedTo,
9
+ assignedBy,
10
+ dueAt,
11
+ sortOrder,
12
+ notes,
13
+ createdBy,
14
+ parentTaskId,
15
+ claimId,
16
+ claimProjectId,
17
+ projectId,
18
+ claimedItemId,
19
+ workflowRunId,
20
+ agentSessionId,
21
+ allowedMutationSurfaces,
22
+ acknowledgedReminders,
23
+ executionIntent,
24
+ executionType,
25
+ executionPurpose,
26
+ } = {}) => {
27
+ const normalizedClaimId = String(claimId || '').trim() || null;
28
+ const normalizedClaimProjectId = String(claimProjectId || projectId || '').trim() || null;
29
+ const normalizedClaimedItemId = String(claimedItemId || implementationItemId || '').trim() || null;
30
+ const normalizedWorkflowRunId = String(workflowRunId || '').trim() || null;
31
+ const normalizedAgentSessionId = String(agentSessionId || '').trim() || null;
32
+ const normalizedAllowedMutationSurfaces = Array.isArray(allowedMutationSurfaces) && allowedMutationSurfaces.length > 0
33
+ ? allowedMutationSurfaces
34
+ : ['project_roadmap_task'];
35
+ const normalizedAcknowledgedReminders = Array.isArray(acknowledgedReminders)
36
+ ? acknowledgedReminders
37
+ : undefined;
38
+ const normalizedExecutionIntent = (() => {
39
+ if (executionIntent && typeof executionIntent === 'object') {
40
+ const execution_type = String(executionIntent.execution_type || executionIntent.executionType || '').trim();
41
+ const execution_purpose = String(executionIntent.execution_purpose || executionIntent.executionPurpose || '').trim();
42
+ if (execution_type || execution_purpose) {
43
+ return {
44
+ ...(execution_type ? { execution_type } : {}),
45
+ ...(execution_purpose ? { execution_purpose } : {}),
46
+ };
47
+ }
48
+ }
49
+ const normalizedExecutionType = String(executionType || '').trim() || 'implementation_task';
50
+ const normalizedExecutionPurpose = String(executionPurpose || title || '').trim() || 'implementation task';
51
+ return {
52
+ execution_type: normalizedExecutionType,
53
+ execution_purpose: normalizedExecutionPurpose,
54
+ };
55
+ })();
56
+ await client._assertExecutionEligibility({
57
+ claim_id: normalizedClaimId,
58
+ claim_project_id: normalizedClaimProjectId,
59
+ claimed_item_id: normalizedClaimedItemId,
60
+ workflow_run_id: normalizedWorkflowRunId,
61
+ agent_session_id: normalizedAgentSessionId,
62
+ allowed_mutation_surfaces: normalizedAllowedMutationSurfaces,
63
+ acknowledged_reminders: normalizedAcknowledgedReminders || [],
64
+ requested_mutation_surface: 'project_roadmap_task',
65
+ verification_required: true,
66
+ });
67
+ return client._request(`/api/operator/implementation-items/${implementationItemId}/tasks`, {
68
+ method: 'POST',
69
+ body: {
70
+ title,
71
+ implementation_packet_id: implementationPacketId,
72
+ description,
73
+ priority,
74
+ assigned_to: assignedTo,
75
+ assigned_by: assignedBy,
76
+ due_at: dueAt,
77
+ sort_order: sortOrder,
78
+ notes,
79
+ created_by: createdBy,
80
+ parent_task_id: parentTaskId,
81
+ claim_id: normalizedClaimId,
82
+ claim_project_id: normalizedClaimProjectId,
83
+ claimed_item_id: normalizedClaimedItemId,
84
+ workflow_run_id: normalizedWorkflowRunId,
85
+ agent_session_id: normalizedAgentSessionId,
86
+ allowed_mutation_surfaces: normalizedAllowedMutationSurfaces,
87
+ acknowledged_reminders: normalizedAcknowledgedReminders,
88
+ execution_intent: normalizedExecutionIntent,
89
+ },
90
+ });
91
+ },
92
+ listImplementationTasks: (implementationItemId) => client._request(`/api/operator/implementation-items/${implementationItemId}/tasks`),
93
+ listImplementationSubtasks: (taskId) => client._request(`/api/operator/implementation-item-tasks/${taskId}/subtasks`),
94
+ updateImplementationTask: (taskId, updates) => client._request(`/api/operator/implementation-item-tasks/${taskId}`, {
95
+ method: 'PATCH',
96
+ body: updates,
97
+ }),
98
+ assignImplementationTask: (taskId, request = {}) => client._request(`/api/operator/implementation-item-tasks/${taskId}/assign`, {
99
+ method: 'POST',
100
+ body: { assigned_to: request.assignedTo, assigned_by: request.assignedBy },
101
+ }),
102
+ completeImplementationTask: (taskId, request = {}) => client._request(`/api/operator/implementation-item-tasks/${taskId}/complete`, {
103
+ method: 'POST',
104
+ body: { completed_by: request.completedBy },
105
+ }),
106
+ };
107
+ }
@@ -0,0 +1,15 @@
1
+ export function createImplementationPacketsDomain(client) {
2
+ return {
3
+ importImplementationPacket: (body) => client._request('/api/governed-implementation/packets/import', { method: 'POST', body }),
4
+ listImplementationPackets: (request = {}) => client._request('/api/governed-implementation/packets', {
5
+ query: { status: request.status, packet_type: request.packetType },
6
+ }),
7
+ getImplementationPacket: (packetId) => client._request(`/api/governed-implementation/packets/${packetId}`),
8
+ bindImplementationPacketToWorkflow: (workflowId, body) => client._request(`/api/governed-implementation/workflows/${workflowId}/bindings`, {
9
+ method: 'POST',
10
+ body,
11
+ }),
12
+ getWorkflowImplementationRoadmap: (workflowId) => client._request(`/api/governed-implementation/workflows/${workflowId}/roadmap`),
13
+ getWorkflowResumeContext: (workflowId) => client._request(`/api/governed-implementation/workflows/${workflowId}/resume-context`),
14
+ };
15
+ }
@@ -0,0 +1,55 @@
1
+ export function createProjectCharteringDomain(client) {
2
+ return {
3
+ createProjectDelivery: (body = {}) => client._request('/api/project-delivery', { method: 'POST', body }),
4
+ approveProjectCharterIntent: (projectId, body = {}) => {
5
+ if (!projectId) throw new Error('projectId is required.');
6
+ return client._request(`/api/project-delivery/${encodeURIComponent(projectId)}/approve-charter-intent`, {
7
+ method: 'POST',
8
+ body,
9
+ });
10
+ },
11
+ approveImplementationRoadmap: (projectId, body = {}) => {
12
+ if (!projectId) throw new Error('projectId is required.');
13
+ return client._request(`/api/project-delivery/${encodeURIComponent(projectId)}/approve-roadmap`, {
14
+ method: 'POST',
15
+ body,
16
+ });
17
+ },
18
+ runProjectCharter: (projectId, body = {}) => {
19
+ if (!projectId) throw new Error('projectId is required.');
20
+ return client._request(`/api/project-delivery/${encodeURIComponent(projectId)}/run-charter`, {
21
+ method: 'POST',
22
+ body,
23
+ });
24
+ },
25
+ beginImplementationRoadmap: (projectId, body = {}) => {
26
+ if (!projectId) throw new Error('projectId is required.');
27
+ return client._request(`/api/project-delivery/${encodeURIComponent(projectId)}/begin-roadmap`, {
28
+ method: 'POST',
29
+ body,
30
+ });
31
+ },
32
+ createProjectCharter: (request = {}) => client._request('/api/projects/charter', {
33
+ method: 'POST',
34
+ body: {
35
+ project_name: request.projectName,
36
+ objective: request.objective,
37
+ business_context: request.businessContext,
38
+ success_criteria: request.successCriteria,
39
+ priority: request.priority,
40
+ constraints: request.constraints ?? [],
41
+ in_scope: request.inScope ?? [],
42
+ out_of_scope: request.outOfScope ?? [],
43
+ assumptions: request.assumptions ?? [],
44
+ linked_workflows: request.linkedWorkflows ?? [],
45
+ linked_workflow_slug: request.linkedWorkflowSlug,
46
+ testing_strategy: request.testingStrategy ?? {},
47
+ initial_context: request.initialContext ?? {},
48
+ requested_by: request.requestedBy,
49
+ ensure_task_surface: request.ensureTaskSurface ?? true,
50
+ assigned_to: request.assignedTo,
51
+ create_acceptance_subtasks: request.createAcceptanceSubtasks ?? true,
52
+ },
53
+ }),
54
+ };
55
+ }
@@ -0,0 +1,49 @@
1
+ export function createProjectsDomain(client) {
2
+ return {
3
+ listProjects: (request) => client._request('/api/operator/projects', {
4
+ query: {
5
+ limit: request?.limit,
6
+ include_inactive: request?.includeInactive,
7
+ process_status: request?.processStatus,
8
+ charter_status: request?.charterStatus,
9
+ },
10
+ }),
11
+ getProject: (projectId) => client._request(`/api/operator/projects/${projectId}`),
12
+ listProjectWorkflowRuns: (projectId, request = {}) => client._request(`/api/operator/projects/${projectId}/workflow-runs`, {
13
+ query: { limit: request.limit ?? 25 },
14
+ }),
15
+ getProjectCharterReport: (projectId) => client._request(`/api/operator/projects/${projectId}/charter/report`),
16
+ createProjectMarkdownDownload: (projectId, request = {}) => client._request(`/api/operator/projects/${projectId}/markdown-report-downloads`, {
17
+ method: 'POST',
18
+ body: {
19
+ report_type: request.reportType,
20
+ include_markdown: request.includeMarkdown ?? false,
21
+ },
22
+ }),
23
+ downloadProjectMarkdownReport: (projectId, reportType) => client._requestText(`/api/operator/projects/${projectId}/markdown-reports/${reportType}/download`),
24
+ downloadProjectCharterReportMarkdown: (projectId) => client._requestText(`/api/operator/projects/${projectId}/markdown-reports/charter/download`),
25
+ getProjectBundle: (projectId) => client._request(`/api/operator/projects/${projectId}/bundle`),
26
+ resumeProjectWork: (request = {}) => {
27
+ const normalizedProjectIdentifier = String(request.projectIdentifier || request.projectId || '').trim();
28
+ if (!normalizedProjectIdentifier) {
29
+ throw new Error('projectIdentifier is required.');
30
+ }
31
+ return client._request(`/api/operator/projects/${encodeURIComponent(normalizedProjectIdentifier)}/resume-context`, {
32
+ query: {
33
+ actor_mode: request.actorMode,
34
+ execution_intent: request.executionIntent,
35
+ require_claim: request.requireClaim,
36
+ workflow_run_limit: request.workflowRunLimit,
37
+ },
38
+ });
39
+ },
40
+ listProjectOpenTasks: (projectId) => client._request(`/api/operator/projects/${projectId}/open-tasks`),
41
+ getProjectPerformanceMetrics: (projectId, request = {}) => client._request(`/api/operator/projects/${projectId}/performance-metrics`, {
42
+ query: {
43
+ workflow_id: request.workflowId,
44
+ workflow_run_id: request.workflowRunId,
45
+ since_utc: request.sinceUtc,
46
+ },
47
+ }),
48
+ };
49
+ }
@@ -0,0 +1,20 @@
1
+ export function createRoadmapsDomain(client) {
2
+ return {
3
+ listProjectRoadmaps: (request = {}) => client._request('/api/operator/projects/implementation-roadmaps', {
4
+ query: { include_inactive: request.includeInactive },
5
+ }),
6
+ getProjectRoadmap: (projectId) => client._request(`/api/operator/projects/${projectId}/implementation-roadmap`),
7
+ getProjectRoadmapSummary: (projectId) => client._request(`/api/operator/projects/${projectId}/implementation-roadmap/summary`),
8
+ getProjectRoadmapActiveItem: (projectId) => client._request(`/api/operator/projects/${projectId}/implementation-roadmap/active-item`),
9
+ getProjectImplementationRoadmapReport: (projectId) => client._request(`/api/operator/projects/${projectId}/implementation-roadmap/report`),
10
+ downloadProjectImplementationRoadmapReportMarkdown: (projectId) => client._requestText(`/api/operator/projects/${projectId}/markdown-reports/implementation_roadmap/download`),
11
+ ensureProjectRoadmapTaskSurface: (projectId, request = {}) => client._request(`/api/operator/projects/${projectId}/implementation-roadmap/task-surface`, {
12
+ method: 'POST',
13
+ body: {
14
+ requested_by: request.requestedBy,
15
+ assigned_to: request.assignedTo,
16
+ create_acceptance_subtasks: request.createAcceptanceSubtasks ?? true,
17
+ },
18
+ }),
19
+ };
20
+ }
package/src/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export { AIEngineClient, createAIEngineClient } from './client.js';
2
- export const AI_ENGINE_CLIENT_VERSION = '1.1.74';
2
+ export const AI_ENGINE_CLIENT_VERSION = '1.1.75';
3
3
  export { GOVERNED_MUTATION_REQUIRED_CAPABILITIES, AI_ENGINE_CLIENT_CAPABILITIES, TASK_BOUND_SUBSTRATE_EXECUTION_POLICY } from './constants/governance.js';
4
4
  export { LOGA_CONTRACT, LOGA_INTERACTION_CONTRACT, LOGA_NAVIGATION_CONTRACT, LOGA_PROJECTION_WORKFLOW } from './constants/loga.js';
5
5
  export {