@bpmsoftwaresolutions/ai-engine-client 1.1.89 → 1.1.90

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.
@@ -1,5 +1,23 @@
1
+ import { cleanText, isPlainObject } from '../utils/text.js';
2
+
1
3
  export function createActionsDomain(client) {
2
4
  return {
3
- submit: (request) => client.submitActionIntent(request),
5
+ submitActionIntent: ({ action, target = {}, payload = {}, requiredScope, requestedBy } = {}) => {
6
+ const normalizedAction = cleanText(action);
7
+ if (!normalizedAction) {
8
+ throw new Error('action is required.');
9
+ }
10
+ return client._request('/api/gateway/actions/submit', {
11
+ method: 'POST',
12
+ body: {
13
+ action: normalizedAction,
14
+ target: isPlainObject(target) ? target : {},
15
+ payload: isPlainObject(payload) ? payload : {},
16
+ required_scope: cleanText(requiredScope) || 'ai-engine.write',
17
+ requested_by: cleanText(requestedBy),
18
+ },
19
+ });
20
+ },
21
+ submit: (request) => client.actions.submitActionIntent(request),
4
22
  };
5
23
  }
@@ -1,13 +1,13 @@
1
1
  export function createBenchmarksDomain(client) {
2
2
  return {
3
- getSessionPerformanceMetrics: (request) => client.getSessionPerformanceMetrics(request),
4
- captureBenchmarkSnapshot: (body) => client.captureBenchmarkSnapshot(body),
5
- listBenchmarks: (request) => client.listBenchmarks(request),
6
- getBenchmarkMetrics: (benchmarkName) => client.getBenchmarkMetrics(benchmarkName),
7
- getBenchmarkDelta: (request) => client.getBenchmarkDelta(request),
8
- getBenchmarkTrend: (request) => client.getBenchmarkTrend(request),
9
- getPerformanceDashboard: (request) => client.getPerformanceDashboard(request),
10
- listRecentBenchmarkRuns: (request) => client.listRecentBenchmarkRuns(request),
11
- getBenchmarkRun: (benchmarkRunId) => client.getBenchmarkRun(benchmarkRunId),
3
+ getSessionPerformanceMetrics: (request) => client.performance.getSessionPerformanceMetrics(request),
4
+ captureBenchmarkSnapshot: (body) => client.performance.captureBenchmarkSnapshot(body),
5
+ listBenchmarks: (request) => client.performance.listBenchmarks(request),
6
+ getBenchmarkMetrics: (benchmarkName) => client.performance.getBenchmarkMetrics(benchmarkName),
7
+ getBenchmarkDelta: (request) => client.performance.getBenchmarkDelta(request),
8
+ getBenchmarkTrend: (request) => client.performance.getBenchmarkTrend(request),
9
+ getPerformanceDashboard: (request) => client.performance.getPerformanceDashboard(request),
10
+ listRecentBenchmarkRuns: ({ limit } = {}) => client._request('/api/benchmarks/reasoners/runs/recent', { query: { limit } }),
11
+ getBenchmarkRun: (benchmarkRunId) => client._request(`/api/benchmarks/reasoners/runs/${benchmarkRunId}`),
12
12
  };
13
13
  }
@@ -1,7 +1,7 @@
1
1
  export function createCapabilitiesDomain(client) {
2
2
  return {
3
- listCapabilities: () => client.listCapabilities(),
4
- createCapability: (body) => client.createCapability(body),
5
- testCapability: (capabilityId, body) => client.testCapability(capabilityId, body),
3
+ listCapabilities: () => client._request('/api/capabilities'),
4
+ createCapability: (body) => client._request('/api/capabilities', { method: 'POST', body }),
5
+ testCapability: (capabilityId, body = {}) => client._request(`/api/capabilities/${capabilityId}/test`, { method: 'POST', body }),
6
6
  };
7
7
  }
@@ -1,10 +1,20 @@
1
1
  export function createContextAssemblyDomain(client) {
2
2
  return {
3
- getContextAssemblyContract: (workflowRunId, request) => client.getContextAssemblyContract(workflowRunId, request),
4
- getContextAssemblyStatus: (workflowRunId, request) => client.getContextAssemblyStatus(workflowRunId, request),
5
- getOperatorContext: (workflowRunId, request) => client.getOperatorContext(workflowRunId, request),
6
- getContextFragments: (workflowRunId, request) => client.getContextFragments(workflowRunId, request),
7
- getContextReuse: (workflowRunId, request) => client.getContextReuse(workflowRunId, request),
8
- listPromptAssemblies: (workflowRunId) => client.listPromptAssemblies(workflowRunId),
3
+ getContextAssemblyContract: (workflowRunId, { stepRunId } = {}) => client._request(`/api/context-assembly/workflow-runs/${workflowRunId}/contract`, {
4
+ query: { step_run_id: stepRunId },
5
+ }),
6
+ getContextAssemblyStatus: (workflowRunId, { stepRunId } = {}) => client._request(`/api/context-assembly/workflow-runs/${workflowRunId}/status`, {
7
+ query: { step_run_id: stepRunId },
8
+ }),
9
+ getOperatorContext: (workflowRunId, { stepRunId } = {}) => client._request(`/api/operator/runs/${workflowRunId}/context`, {
10
+ query: { step_run_id: stepRunId },
11
+ }),
12
+ getContextFragments: (workflowRunId, { stepRunId } = {}) => client._request(`/api/operator/runs/${workflowRunId}/context/fragments`, {
13
+ query: { step_run_id: stepRunId },
14
+ }),
15
+ getContextReuse: (workflowRunId, { stepRunId } = {}) => client._request(`/api/operator/runs/${workflowRunId}/context/reuse`, {
16
+ query: { step_run_id: stepRunId },
17
+ }),
18
+ listPromptAssemblies: (workflowRunId) => client._request(`/api/operator/workflow-runs/${workflowRunId}/prompt-assemblies`),
9
19
  };
10
20
  }
@@ -1,14 +1,143 @@
1
+ import { cleanList, cleanText, isPlainObject } from '../utils/text.js';
1
2
  import { createDatabaseBackupsDomain } from './database/backups.js';
2
3
 
3
4
  export function createDatabaseDomain(client) {
4
5
  return {
5
- createDatabaseBackup: (request) => client.createDatabaseBackup(request),
6
- listDatabaseBackups: (request) => client.listDatabaseBackups(request),
7
- getDatabaseBackup: (request) => client.getDatabaseBackup(request),
8
- listDatabaseBackupOperations: (request) => client.listDatabaseBackupOperations(request),
9
- runAzureSqlBacpacBackup: (request) => client.runAzureSqlBacpacBackup(request),
10
- listAzureSqlBacpacBackups: (request) => client.listAzureSqlBacpacBackups(request),
11
- listAzureSqlBacpacBackupOperations: (request) => client.listAzureSqlBacpacBackupOperations(request),
6
+ query: ({
7
+ surface,
8
+ contractKey,
9
+ parameters = {},
10
+ fields = [],
11
+ fieldAllowlist = [],
12
+ actorScopes = [],
13
+ requiredScopes = [],
14
+ shape = 'json',
15
+ requestedBy,
16
+ } = {}) => {
17
+ const normalizedSurface = cleanText(surface) || cleanText(contractKey);
18
+ if (!normalizedSurface) {
19
+ throw new Error('surface is required.');
20
+ }
21
+ const normalizedShape = cleanText(shape) || 'json';
22
+ if (!['json', 'table', 'cards', 'markdown'].includes(normalizedShape)) {
23
+ throw new Error('shape must be one of json, table, cards, or markdown.');
24
+ }
25
+ const normalizedFields = cleanList(fields);
26
+ const normalizedAllowlist = cleanList(fieldAllowlist);
27
+ const disallowedFields = normalizedFields.filter((field) => !normalizedAllowlist.includes(field));
28
+ if (normalizedAllowlist.length > 0 && disallowedFields.length > 0) {
29
+ throw new Error(`Requested fields are not allowed: ${disallowedFields.join(', ')}.`);
30
+ }
31
+ const normalizedActorScopes = cleanList(actorScopes);
32
+ const normalizedRequiredScopes = cleanList(requiredScopes);
33
+ const missingScopes = normalizedRequiredScopes.filter((scope) => !normalizedActorScopes.includes(scope));
34
+ if (missingScopes.length > 0) {
35
+ throw new Error(`Missing required scopes: ${missingScopes.join(', ')}.`);
36
+ }
37
+ return client._request('/api/gateway/query', {
38
+ method: 'POST',
39
+ body: {
40
+ surface: normalizedSurface,
41
+ parameters: isPlainObject(parameters) ? parameters : {},
42
+ fields: normalizedFields,
43
+ field_allowlist: normalizedAllowlist,
44
+ actor_scopes: normalizedActorScopes,
45
+ required_scopes: normalizedRequiredScopes,
46
+ shape: normalizedShape,
47
+ requested_by: cleanText(requestedBy),
48
+ },
49
+ });
50
+ },
51
+ createDatabaseBackup: ({ databaseName, outputName, noWait } = {}) => client._request('/api/operator/database/backups', {
52
+ method: 'POST',
53
+ body: {
54
+ database_name: databaseName,
55
+ output_name: outputName,
56
+ no_wait: noWait,
57
+ },
58
+ }),
59
+ listDatabaseBackups: ({ prefix, limit } = {}) => client._request('/api/operator/database/backups', {
60
+ query: {
61
+ prefix,
62
+ limit,
63
+ },
64
+ }),
65
+ getDatabaseBackup: ({ backupId } = {}) => client._request(`/api/operator/database/backups/${encodeURIComponent(backupId)}`),
66
+ listDatabaseBackupOperations: ({ databaseName, operationFilter, limit } = {}) => client._request('/api/operator/database/backups/operations', {
67
+ query: {
68
+ database_name: databaseName,
69
+ operation_filter: operationFilter,
70
+ limit,
71
+ },
72
+ }),
73
+ runAzureSqlBacpacBackup: ({
74
+ databaseName,
75
+ storageAccount,
76
+ container,
77
+ resourceGroup,
78
+ serverName,
79
+ outputName,
80
+ adminUser,
81
+ adminPassword,
82
+ subscription,
83
+ storageKey,
84
+ skipContainerCreate,
85
+ noWait,
86
+ } = {}) => client._request('/api/operator/database/backups/azure-sql-bacpac', {
87
+ method: 'POST',
88
+ body: {
89
+ database_name: databaseName,
90
+ storage_account: storageAccount,
91
+ container,
92
+ resource_group: resourceGroup,
93
+ server_name: serverName,
94
+ output_name: outputName,
95
+ admin_user: adminUser,
96
+ admin_password: adminPassword,
97
+ subscription,
98
+ storage_key: storageKey,
99
+ skip_container_create: skipContainerCreate,
100
+ no_wait: noWait,
101
+ },
102
+ }),
103
+ listAzureSqlBacpacBackups: ({
104
+ storageAccount,
105
+ container,
106
+ resourceGroup,
107
+ serverName,
108
+ subscription,
109
+ storageKey,
110
+ prefix,
111
+ limit,
112
+ } = {}) => client._request('/api/operator/database/backups/azure-sql-bacpac', {
113
+ query: {
114
+ storage_account: storageAccount,
115
+ container,
116
+ resource_group: resourceGroup,
117
+ server_name: serverName,
118
+ subscription,
119
+ storage_key: storageKey,
120
+ prefix,
121
+ limit,
122
+ },
123
+ }),
124
+ listAzureSqlBacpacBackupOperations: ({
125
+ databaseName,
126
+ resourceGroup,
127
+ serverName,
128
+ subscription,
129
+ operationFilter,
130
+ limit,
131
+ } = {}) => client._request('/api/operator/database/backups/azure-sql-bacpac/operations', {
132
+ query: {
133
+ database_name: databaseName,
134
+ resource_group: resourceGroup,
135
+ server_name: serverName,
136
+ subscription,
137
+ operation_filter: operationFilter,
138
+ limit,
139
+ },
140
+ }),
12
141
  backups: createDatabaseBackupsDomain(client),
13
142
  };
14
143
  }
@@ -1,16 +1,16 @@
1
1
  export function createDesignIntelligenceDomain(client) {
2
2
  return {
3
- getDesignIntelligenceDashboard: () => client.getDesignIntelligenceDashboard(),
4
- listDesignDecisions: () => client.listDesignDecisions(),
5
- getDesignDecision: (decisionId) => client.getDesignDecision(decisionId),
6
- getDesignDecisionVariants: (decisionId) => client.getDesignDecisionVariants(decisionId),
7
- getDesignDecisionCritique: (decisionId) => client.getDesignDecisionCritique(decisionId),
8
- getDesignDecisionLineage: (decisionId) => client.getDesignDecisionLineage(decisionId),
9
- listDesignPatterns: () => client.listDesignPatterns(),
10
- getDecisionLabCanvas: () => client.getDecisionLabCanvas(),
11
- getDesignRecommendations: () => client.getDesignRecommendations(),
12
- getDesignPromotions: () => client.getDesignPromotions(),
13
- previewDesignPromotion: (body) => client.previewDesignPromotion(body),
14
- getDesignIntelligenceMetrics: () => client.getDesignIntelligenceMetrics(),
3
+ getDesignIntelligenceDashboard: () => client._request('/api/design-intelligence/dashboard'),
4
+ listDesignDecisions: () => client._request('/api/design-intelligence/decisions'),
5
+ getDesignDecision: (decisionId) => client._request(`/api/design-intelligence/decisions/${decisionId}`),
6
+ getDesignDecisionVariants: (decisionId) => client._request(`/api/design-intelligence/decisions/${decisionId}/variants`),
7
+ getDesignDecisionCritique: (decisionId) => client._request(`/api/design-intelligence/decisions/${decisionId}/critique`),
8
+ getDesignDecisionLineage: (decisionId) => client._request(`/api/design-intelligence/decisions/${decisionId}/lineage`),
9
+ listDesignPatterns: () => client._request('/api/design-intelligence/patterns'),
10
+ getDecisionLabCanvas: () => client._request('/api/design-intelligence/decision-lab/canvas'),
11
+ getDesignRecommendations: () => client._request('/api/design-intelligence/recommendations'),
12
+ getDesignPromotions: () => client._request('/api/design-intelligence/promotions'),
13
+ previewDesignPromotion: (body) => client._request('/api/design-intelligence/promotions/preview', { method: 'POST', body }),
14
+ getDesignIntelligenceMetrics: () => client._request('/api/design-intelligence/metrics'),
15
15
  };
16
16
  }
@@ -1,8 +1,18 @@
1
1
  export function createExecutionTelemetryDomain(client) {
2
2
  return {
3
- getCurrent: () => client.getExecutionTelemetryCurrent(),
4
- listProcessRuns: (request) => client.listExecutionProcessRuns(request),
5
- getProcessRun: (processRunId) => client.getExecutionProcessRun(processRunId),
6
- getGeneratedExecutionUsability: (request) => client.getGeneratedExecutionUsability(request),
3
+ getExecutionTelemetryCurrent: () => client._request('/api/operator/execution-telemetry/current'),
4
+ getCurrent: () => client._request('/api/operator/execution-telemetry/current'),
5
+ listExecutionProcessRuns: ({ limit, artifactKind, status, since } = {}) => client._request('/api/operator/execution-telemetry/process-runs', {
6
+ query: { limit, artifact_kind: artifactKind, status, since },
7
+ }),
8
+ listProcessRuns: (request) => client.executionTelemetry.listExecutionProcessRuns(request),
9
+ getExecutionProcessRun: (processRunId) => client._request(`/api/operator/execution-telemetry/process-runs/${processRunId}`),
10
+ getProcessRun: (processRunId) => client.executionTelemetry.getExecutionProcessRun(processRunId),
11
+ getGeneratedExecutionUsability: ({ artifactPath, limit } = {}) => client._request('/api/operator/generated-execution-usability', {
12
+ query: { artifact_path: artifactPath, limit },
13
+ }),
14
+ getLogaGeneratedExecutionUsabilityProjection: ({ artifactPath, limit } = {}) => client._requestLogaProjection('/api/loga/ai-engine/generated-execution-usability', {
15
+ query: { artifact_path: artifactPath, limit },
16
+ }),
7
17
  };
8
18
  }
@@ -1,5 +1,16 @@
1
1
  export function createHealthDomain(client) {
2
2
  return {
3
- ping: () => client.ping(),
3
+ ping: async () => {
4
+ const [health, workflow] = await Promise.all([
5
+ client._request('/healthz'),
6
+ client.currentWorkflowStatus(),
7
+ ]);
8
+ return {
9
+ status: health.status || 'ok',
10
+ workflow_name: workflow?.summary?.workflow_name || null,
11
+ run_status: workflow?.summary?.run_status || null,
12
+ base_url: client.baseUrl,
13
+ };
14
+ },
4
15
  };
5
16
  }
@@ -1,13 +1,58 @@
1
1
  export function createLogaDomain(client) {
2
2
  return {
3
- submitUxGateRemediation: (payload) => client.submitUxGateRemediation(payload),
4
- listUxGateRemediations: (query) => client.listUxGateRemediations(query),
5
- getUxGateRemediation: (remediationId) => client.getUxGateRemediation(remediationId),
6
- appendUxRemediationTicketNote: (remediationId, payload) => client.appendUxRemediationTicketNote(remediationId, payload),
7
- listUxRemediationTicketNotes: (remediationId) => client.listUxRemediationTicketNotes(remediationId),
8
- promoteUxGateRemediationImplementationCandidate: (remediationId, payload) =>
9
- client.promoteUxGateRemediationImplementationCandidate(remediationId, payload),
10
- getUxGateRemediationProjection: (remediationId) => client.getLogaUxGateRemediationProjection(remediationId),
11
- getGeneratedExecutionUsabilityProjection: (query) => client.getLogaGeneratedExecutionUsabilityProjection(query),
3
+ submitUxGateRemediation: ({
4
+ projectionType,
5
+ projectionId,
6
+ gateRunId,
7
+ findingIds,
8
+ remediationPayload,
9
+ sourceTruth = 'sql',
10
+ clientEvidence,
11
+ createdBy,
12
+ } = {}) => client._request('/api/loga/ux-gate-remediations', {
13
+ method: 'POST',
14
+ body: {
15
+ projectionType,
16
+ projectionId,
17
+ gateRunId,
18
+ findingIds,
19
+ remediationPayload,
20
+ sourceTruth,
21
+ clientEvidence,
22
+ createdBy,
23
+ },
24
+ }),
25
+ listUxGateRemediations: ({ projectionType, status } = {}) => client._request('/api/loga/ux-gate-remediations', {
26
+ query: { projectionType, status },
27
+ }),
28
+ getUxGateRemediation: (remediationId) => client._request(`/api/loga/ux-gate-remediations/${remediationId}`),
29
+ appendUxRemediationTicketNote: (remediationId, {
30
+ noteKind,
31
+ body,
32
+ visibility,
33
+ authorActorId,
34
+ evidenceRefs,
35
+ metadata,
36
+ } = {}) => client._request(`/api/loga/ux-gate-remediations/${remediationId}/notes`, {
37
+ method: 'POST',
38
+ body: {
39
+ noteKind,
40
+ body,
41
+ visibility,
42
+ authorActorId,
43
+ evidenceRefs,
44
+ metadata,
45
+ },
46
+ }),
47
+ listUxRemediationTicketNotes: (remediationId) => client._request(`/api/loga/ux-gate-remediations/${remediationId}/notes`),
48
+ promoteUxGateRemediationImplementationCandidate: (remediationId, { promotedBy } = {}) => client._request(`/api/loga/ux-gate-remediations/${remediationId}/implementation-candidate`, {
49
+ method: 'POST',
50
+ body: { promotedBy },
51
+ }),
52
+ getLogaUxGateRemediationProjection: (remediationId) => client._requestLogaProjection(`/api/operator/projections/ux-gate-remediations/${remediationId}`),
53
+ getUxGateRemediationProjection: (remediationId) => client.loga.getLogaUxGateRemediationProjection(remediationId),
54
+ getGeneratedExecutionUsabilityProjection: (query) => client._requestLogaProjection('/api/loga/ai-engine/generated-execution-usability', {
55
+ query,
56
+ }),
12
57
  };
13
58
  }
@@ -1,7 +1,7 @@
1
1
  export function createNotesLabDomain(client) {
2
2
  return {
3
- getNotesLabConfig: () => client.getNotesLabConfig(),
4
- submitNote: (body) => client.submitNote(body),
5
- approveNoteReview: (body) => client.approveNoteReview(body),
3
+ getNotesLabConfig: () => client._request('/api/notes-lab/config'),
4
+ submitNote: (body) => client._request('/api/notes-lab/submit', { method: 'POST', body }),
5
+ approveNoteReview: (body) => client._request('/api/notes-lab/approve-review', { method: 'POST', body }),
6
6
  };
7
7
  }
@@ -1,15 +1,35 @@
1
1
  export function createOperatorStatusDomain(client) {
2
2
  return {
3
- currentWorkflowStatus: () => client.currentWorkflowStatus(),
4
- currentArchitectureIntegrityStatus: () => client.currentArchitectureIntegrityStatus(),
5
- currentSecurityGovernanceStatus: (request) => client.currentSecurityGovernanceStatus(request),
6
- getExecutionTelemetryCurrent: () => client.getExecutionTelemetryCurrent(),
7
- listExecutionProcessRuns: (request) => client.listExecutionProcessRuns(request),
8
- getExecutionProcessRun: (processRunId) => client.getExecutionProcessRun(processRunId),
9
- getGeneratedExecutionUsability: (request) => client.getGeneratedExecutionUsability(request),
10
- getLogaGeneratedExecutionUsabilityProjection: (request) => client.getLogaGeneratedExecutionUsabilityProjection(request),
11
- getAntiPatternRules: () => client.getAntiPatternRules(),
12
- currentCodebaseShapeStatus: () => client.currentCodebaseShapeStatus(),
13
- getLatestMemoryProjection: () => client.getLatestMemoryProjection(),
3
+ currentWorkflowStatus: () => client._request('/api/operator/current-workflow-status'),
4
+ getCurrentWorkflowStatus: () => client._request('/api/operator/current-workflow-status'),
5
+ currentArchitectureIntegrityStatus: () => client._request('/api/operator/current-architecture-integrity-status'),
6
+ getCurrentArchitectureIntegrityStatus: () => client._request('/api/operator/current-architecture-integrity-status'),
7
+ currentSecurityGovernanceStatus: ({ environment, topN } = {}) => client._request('/api/operator/current-security-governance-status', {
8
+ query: { environment, top_n: topN },
9
+ }),
10
+ getCurrentSecurityGovernanceStatus: (request) => client._request('/api/operator/current-security-governance-status', {
11
+ query: { environment: request?.environment, top_n: request?.topN },
12
+ }),
13
+ getExecutionTelemetryCurrent: () => client._request('/api/operator/execution-telemetry/current'),
14
+ listExecutionProcessRuns: ({ limit, artifactKind, status, since } = {}) => client._request('/api/operator/execution-telemetry/process-runs', {
15
+ query: { limit, artifact_kind: artifactKind, status, since },
16
+ }),
17
+ getExecutionProcessRun: (processRunId) => client._request(`/api/operator/execution-telemetry/process-runs/${processRunId}`),
18
+ getGeneratedExecutionUsability: ({ artifactPath, limit } = {}) => client._request('/api/operator/generated-execution-usability', {
19
+ query: { artifact_path: artifactPath, limit },
20
+ }),
21
+ getLogaGeneratedExecutionUsabilityProjection: ({ artifactPath, limit } = {}) => client._requestLogaProjection('/api/loga/ai-engine/generated-execution-usability', {
22
+ query: { artifact_path: artifactPath, limit },
23
+ }),
24
+ getAntiPatternRules: () => client._request('/api/governance/anti-pattern-rules'),
25
+ currentCodebaseShapeStatus: () => client._request('/api/operator/current-codebase-shape-status'),
26
+ getLatestMemoryProjection: () => client._request('/api/v1/latest-memory-projection'),
27
+ currentProjectStatus: ({ projectId } = {}) => client._request('/api/operator/current-project-status', {
28
+ query: { project_id: projectId },
29
+ }),
30
+ getDashboard: () => client._request('/api/dashboard'),
31
+ getCommunicationCapabilities: () => client._request('/api/agent-communications/capabilities'),
32
+ getCollaborationCapabilities: () => client._request('/api/agent-communications/collaboration-capabilities'),
33
+ getDeploymentCapabilities: () => client._request('/api/agent-communications/deployment-capabilities'),
14
34
  };
15
35
  }
@@ -1,8 +1,19 @@
1
1
  export function createPerformanceDomain(client) {
2
2
  return {
3
- getSessionPerformanceMetrics: (request) => client.getSessionPerformanceMetrics(request),
4
- getBenchmarkDelta: (request) => client.getBenchmarkDelta(request),
5
- getBenchmarkTrend: (request) => client.getBenchmarkTrend(request),
6
- getPerformanceDashboard: (request) => client.getPerformanceDashboard(request),
3
+ getSessionPerformanceMetrics: ({ clientType, workflowRunId, sessionId } = {}) => client._request('/api/operator/performance/sessions', {
4
+ query: { client_type: clientType, workflow_run_id: workflowRunId, session_id: sessionId },
5
+ }),
6
+ captureBenchmarkSnapshot: (body) => client._request('/api/operator/performance/benchmarks', { method: 'POST', body }),
7
+ listBenchmarks: ({ benchmarkScope } = {}) => client._request('/api/operator/performance/benchmarks', {
8
+ query: { benchmark_scope: benchmarkScope },
9
+ }),
10
+ getBenchmarkMetrics: (benchmarkName) => client._request(`/api/operator/performance/benchmarks/${benchmarkName}/metrics`),
11
+ getBenchmarkDelta: ({ baseline, current } = {}) => client._request('/api/operator/performance/delta', { query: { baseline, current } }),
12
+ getBenchmarkTrend: ({ metricKey, dimensionValue, limit } = {}) => client._request('/api/operator/performance/trend', {
13
+ query: { metric_key: metricKey, dimension_value: dimensionValue, limit },
14
+ }),
15
+ getPerformanceDashboard: ({ clientType, workflowRunId } = {}) => client._request('/api/operator/performance/dashboard', {
16
+ query: { client_type: clientType, workflow_run_id: workflowRunId },
17
+ }),
7
18
  };
8
19
  }
@@ -1,13 +1,69 @@
1
+ import { cleanText, isPlainObject } from '../utils/text.js';
2
+
1
3
  export function createProjectionsDomain(client) {
2
4
  return {
3
- render: (request) => client.renderProjection(request),
4
- getTransferHomeProjection: () => client.getLogaTransferHomeProjection(),
5
- getTransferInboxProjection: (query) => client.getLogaTransferInboxProjection(query),
6
- getTransferPacketProjection: (workTransferPacketId) => client.getLogaTransferPacketProjection(workTransferPacketId),
7
- getTransferChannelProjection: (transferChannelId) => client.getTransferChannelProjection(transferChannelId),
8
- getTransferNegotiationEventsProjection: (query) => client.getLogaTransferNegotiationEventsProjection(query),
9
- getTransferFrictionLaneProjection: (query) => client.getLogaTransferFrictionLaneProjection(query),
10
- getTransferReceiptsProjection: (query) => client.getLogaTransferReceiptsProjection(query),
11
- getTransferClosureReviewProjection: (workTransferPacketId) => client.getLogaTransferClosureReviewProjection(workTransferPacketId),
5
+ renderProjection: ({ projectionType, viewContract = {}, requestedBy } = {}) => {
6
+ const normalizedProjectionType = cleanText(projectionType);
7
+ if (!normalizedProjectionType) {
8
+ throw new Error('projectionType is required.');
9
+ }
10
+ return client._request('/api/gateway/projections/render', {
11
+ method: 'POST',
12
+ body: {
13
+ projection_type: normalizedProjectionType,
14
+ view_contract: isPlainObject(viewContract) ? viewContract : {},
15
+ requested_by: cleanText(requestedBy),
16
+ },
17
+ });
18
+ },
19
+ render: (request) => client.projections.renderProjection(request),
20
+ getLogaOperatorHomeProjection: () => client._requestLogaProjection('/api/operator/projections/home'),
21
+ getLogaProjectCatalogProjection: () => client._requestLogaProjection('/api/operator/projections/project-catalog'),
22
+ getLogaProjectPortfolioProjection: () => client._requestLogaProjection('/api/operator/projections/project-portfolio'),
23
+ getLogaProjectRoadmapProjection: (projectId) => client._requestLogaProjection(`/api/operator/projections/projects/${projectId}/roadmap.md`),
24
+ getLogaRoadmapItemProjection: (projectId, itemKey) => client._requestLogaProjection(`/api/operator/projections/projects/${projectId}/roadmap/items/${itemKey}`),
25
+ getLogaWorkflowRunProjection: (workflowRunId) => client._requestLogaProjection(`/api/operator/projections/workflow-runs/${workflowRunId}`),
26
+ getLogaEvidencePacketProjection: (packetKey) => client._requestLogaProjection(`/api/operator/projections/evidence-packets/${packetKey}`),
27
+ getLogaTransferHomeProjection: () => client._requestLogaProjection('/api/operator/projections/transfers/home'),
28
+ getLogaTransferInboxProjection: ({ workflowRunId, recipientAgentSessionId, recipientRoleKey } = {}) => client._requestLogaProjection('/api/operator/projections/transfers/inbox', {
29
+ query: {
30
+ workflow_run_id: workflowRunId,
31
+ recipient_agent_session_id: recipientAgentSessionId,
32
+ recipient_role_key: recipientRoleKey,
33
+ },
34
+ }),
35
+ getLogaTransferPacketProjection: (workTransferPacketId) => client._requestLogaProjection(`/api/operator/projections/transfers/${workTransferPacketId}`),
36
+ getLogaTransferNegotiationEventsProjection: ({ workTransferPacketId, workflowRunId } = {}) => {
37
+ const path = workTransferPacketId
38
+ ? `/api/operator/projections/transfers/${workTransferPacketId}/negotiation-events`
39
+ : '/api/operator/projections/transfers/negotiation-events';
40
+ return client._requestLogaProjection(path, {
41
+ query: { workflow_run_id: workflowRunId },
42
+ });
43
+ },
44
+ getLogaTransferFrictionLaneProjection: ({ workflowRunId } = {}) => client._requestLogaProjection('/api/operator/projections/transfers/friction-lane', {
45
+ query: { workflow_run_id: workflowRunId },
46
+ }),
47
+ getLogaTransferReceiptsProjection: ({ workTransferPacketId, workflowRunId } = {}) => client._requestLogaProjection('/api/operator/projections/transfers/receipts', {
48
+ query: {
49
+ work_transfer_packet_id: workTransferPacketId,
50
+ workflow_run_id: workflowRunId,
51
+ },
52
+ }),
53
+ getLogaTransferClosureReviewProjection: (workTransferPacketId) => client._requestLogaProjection(`/api/operator/projections/transfers/${workTransferPacketId}/closure-review`),
54
+ getTransferChannelProjection: (transferChannelId) => {
55
+ const normalizedTransferChannelId = cleanText(transferChannelId);
56
+ if (!normalizedTransferChannelId) {
57
+ throw new Error('transferChannelId is required.');
58
+ }
59
+ return client._requestLogaProjection(`/api/operator/projections/transfers/channels/${encodeURIComponent(normalizedTransferChannelId)}`);
60
+ },
61
+ getTransferHomeProjection: () => client._requestLogaProjection('/api/operator/projections/transfers/home'),
62
+ getTransferInboxProjection: (request) => client.projections.getLogaTransferInboxProjection(request),
63
+ getTransferPacketProjection: (workTransferPacketId) => client.projections.getLogaTransferPacketProjection(workTransferPacketId),
64
+ getTransferNegotiationEventsProjection: (request) => client.projections.getLogaTransferNegotiationEventsProjection(request),
65
+ getTransferFrictionLaneProjection: (request) => client.projections.getLogaTransferFrictionLaneProjection(request),
66
+ getTransferReceiptsProjection: (request) => client.projections.getLogaTransferReceiptsProjection(request),
67
+ getTransferClosureReviewProjection: (workTransferPacketId) => client.projections.getLogaTransferClosureReviewProjection(workTransferPacketId),
12
68
  };
13
69
  }
@@ -2,7 +2,22 @@ import { cleanText, isPlainObject } from '../utils/text.js';
2
2
 
3
3
  export function createReportsDomain(client) {
4
4
  return {
5
- run({ reportKey, definition = {}, requestedBy } = {}) {
5
+ runReport: ({ reportKey, definition = {}, requestedBy } = {}) => {
6
+ const normalizedReportKey = cleanText(reportKey);
7
+ if (!normalizedReportKey) {
8
+ throw new Error('reportKey is required.');
9
+ }
10
+ return client._request('/api/gateway/reports/run', {
11
+ method: 'POST',
12
+ body: {
13
+ report_key: normalizedReportKey,
14
+ definition: isPlainObject(definition) ? definition : {},
15
+ requested_by: cleanText(requestedBy),
16
+ },
17
+ });
18
+ },
19
+ run: (request) => client.reports.runReport(request),
20
+ runReportDefinition: ({ reportKey, definition = {}, requestedBy } = {}) => {
6
21
  const normalizedReportKey = cleanText(reportKey);
7
22
  if (!normalizedReportKey) {
8
23
  throw new Error('reportKey is required.');
@@ -1,9 +1,12 @@
1
1
  export function createScriptDiscoveryDomain(client) {
2
2
  return {
3
- scanScripts: (body) => client.scanScripts(body),
4
- listDiscoveredScriptAssets: (request) => client.listDiscoveredScriptAssets(request),
5
- listDiscoveredCapabilities: (request) => client.listDiscoveredCapabilities(request),
6
- listWorkflowCandidates: (request) => client.listWorkflowCandidates(request),
7
- promoteWorkflowCandidate: (workflowCandidateId, body) => client.promoteWorkflowCandidate(workflowCandidateId, body),
3
+ scanScripts: (body = {}) => client._request('/api/script-discovery/scan', { method: 'POST', body }),
4
+ listDiscoveredScriptAssets: ({ limit } = {}) => client._request('/api/script-discovery/script-assets', { query: { limit } }),
5
+ listDiscoveredCapabilities: ({ limit } = {}) => client._request('/api/script-discovery/discovered-capabilities', { query: { limit } }),
6
+ listWorkflowCandidates: ({ limit } = {}) => client._request('/api/script-discovery/workflow-candidates', { query: { limit } }),
7
+ promoteWorkflowCandidate: (workflowCandidateId, body = {}) => client._request(`/api/script-discovery/workflow-candidates/${workflowCandidateId}/promote`, {
8
+ method: 'POST',
9
+ body,
10
+ }),
8
11
  };
9
12
  }