@bpmsoftwaresolutions/ai-engine-client 1.1.88 → 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.
- package/package.json +1 -1
- package/src/client.js +282 -2369
- package/src/domains/actions.js +19 -1
- package/src/domains/benchmarks.js +9 -9
- package/src/domains/capabilities.js +3 -3
- package/src/domains/charters.js +5 -0
- package/src/domains/claims.js +58 -0
- package/src/domains/commit-governance.js +68 -0
- package/src/domains/context-assembly.js +16 -6
- package/src/domains/context-orientation.js +48 -0
- package/src/domains/context-sessions.js +46 -0
- package/src/domains/database.js +136 -7
- package/src/domains/design-intelligence.js +12 -12
- package/src/domains/execution-eligibility.js +44 -0
- package/src/domains/execution-telemetry.js +14 -4
- package/src/domains/governed-implementation.js +7 -0
- package/src/domains/health.js +12 -1
- package/src/domains/loga.js +54 -9
- package/src/domains/notes-lab.js +3 -3
- package/src/domains/operator-status.js +31 -11
- package/src/domains/performance.js +15 -4
- package/src/domains/projections.js +65 -9
- package/src/domains/reports.js +16 -1
- package/src/domains/script-discovery.js +8 -5
- package/src/domains/scripts.js +45 -4
- package/src/domains/search-contacts.js +3 -3
- package/src/domains/self-learning.js +29 -6
- package/src/domains/self-optimization.js +15 -4
- package/src/domains/session-governance.js +64 -0
- package/src/domains/skill-governance.js +5 -3
- package/src/domains/skills.js +22 -9
- package/src/domains/tool-binding-approvals.js +102 -0
- package/src/domains/tool-registry.js +18 -10
- package/src/domains/verified-mutations.js +7 -0
- package/src/domains/work-start.js +192 -0
- package/src/domains/workflow-turns.js +6 -0
- package/src/index.js +1 -1
package/src/domains/actions.js
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
|
+
import { cleanText, isPlainObject } from '../utils/text.js';
|
|
2
|
+
|
|
1
3
|
export function createActionsDomain(client) {
|
|
2
4
|
return {
|
|
3
|
-
|
|
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: (
|
|
11
|
-
getBenchmarkRun: (benchmarkRunId) => client.
|
|
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.
|
|
4
|
-
createCapability: (body) => client.
|
|
5
|
-
testCapability: (capabilityId, body) => client.
|
|
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
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { cleanText } from '../utils/text.js';
|
|
2
|
+
|
|
3
|
+
export function createClaimsDomain(client) {
|
|
4
|
+
return {
|
|
5
|
+
getClaim: (claimId) => {
|
|
6
|
+
if (!claimId) throw new Error('claimId is required.');
|
|
7
|
+
return client._request(`/api/governance/claims/${encodeURIComponent(claimId)}`);
|
|
8
|
+
},
|
|
9
|
+
claimIsValid: async (claimId) => {
|
|
10
|
+
const claim = await client.getClaim(claimId);
|
|
11
|
+
return cleanText(claim?.status) === 'active';
|
|
12
|
+
},
|
|
13
|
+
signoffClaim: (claimId, body = {}) => {
|
|
14
|
+
if (!claimId) throw new Error('claimId is required.');
|
|
15
|
+
return client._request(`/api/governance/claims/${encodeURIComponent(claimId)}/signoff`, {
|
|
16
|
+
method: 'POST',
|
|
17
|
+
body,
|
|
18
|
+
});
|
|
19
|
+
},
|
|
20
|
+
promoteClaimSurface: ({
|
|
21
|
+
claimId,
|
|
22
|
+
workflowId,
|
|
23
|
+
contextSessionId,
|
|
24
|
+
actorId,
|
|
25
|
+
requiredToolKeys,
|
|
26
|
+
intentId,
|
|
27
|
+
bindingScope,
|
|
28
|
+
usageMode,
|
|
29
|
+
operatorScope,
|
|
30
|
+
allowedArgumentPolicy,
|
|
31
|
+
...rest
|
|
32
|
+
} = {}) => {
|
|
33
|
+
if (!claimId) throw new Error('claimId is required.');
|
|
34
|
+
if (!workflowId) throw new Error('workflowId is required.');
|
|
35
|
+
if (!contextSessionId) throw new Error('contextSessionId is required.');
|
|
36
|
+
if (!actorId) throw new Error('actorId is required.');
|
|
37
|
+
if (!Array.isArray(requiredToolKeys) || requiredToolKeys.length === 0) {
|
|
38
|
+
throw new Error('requiredToolKeys must be a non-empty array.');
|
|
39
|
+
}
|
|
40
|
+
return client._request('/api/governance/claims/promote-surface', {
|
|
41
|
+
method: 'POST',
|
|
42
|
+
body: {
|
|
43
|
+
...rest,
|
|
44
|
+
claim_id: claimId,
|
|
45
|
+
workflow_id: workflowId,
|
|
46
|
+
context_session_id: contextSessionId,
|
|
47
|
+
actor_id: actorId,
|
|
48
|
+
required_tool_keys: requiredToolKeys,
|
|
49
|
+
intent_id: intentId,
|
|
50
|
+
binding_scope: bindingScope,
|
|
51
|
+
usage_mode: usageMode,
|
|
52
|
+
operator_scope: operatorScope,
|
|
53
|
+
allowed_argument_policy: allowedArgumentPolicy,
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export function createCommitGovernanceDomain(client) {
|
|
2
|
+
return {
|
|
3
|
+
evaluateCommitGovernance: ({
|
|
4
|
+
claimId,
|
|
5
|
+
contextSessionId,
|
|
6
|
+
agentId,
|
|
7
|
+
intentId,
|
|
8
|
+
changedFiles,
|
|
9
|
+
declaredScopeFiles,
|
|
10
|
+
diffSummary,
|
|
11
|
+
branch,
|
|
12
|
+
headSha,
|
|
13
|
+
} = {}) => client._request('/api/commit-governance/evaluate', {
|
|
14
|
+
method: 'POST',
|
|
15
|
+
body: {
|
|
16
|
+
claim_id: claimId,
|
|
17
|
+
context_session_id: contextSessionId,
|
|
18
|
+
agent_id: agentId,
|
|
19
|
+
intent_id: intentId,
|
|
20
|
+
changed_files: changedFiles,
|
|
21
|
+
declared_scope_files: declaredScopeFiles,
|
|
22
|
+
diff_summary: diffSummary,
|
|
23
|
+
branch,
|
|
24
|
+
head_sha: headSha,
|
|
25
|
+
},
|
|
26
|
+
}),
|
|
27
|
+
checkGitShipReadiness: ({
|
|
28
|
+
claimId,
|
|
29
|
+
actorId,
|
|
30
|
+
targetBranch,
|
|
31
|
+
shipCommand,
|
|
32
|
+
packageName,
|
|
33
|
+
declaredScopeFiles,
|
|
34
|
+
stagedFiles,
|
|
35
|
+
dirtyFiles,
|
|
36
|
+
branch,
|
|
37
|
+
headSha,
|
|
38
|
+
packageJsonVersion,
|
|
39
|
+
facadeMinClientVersion,
|
|
40
|
+
packageRelease,
|
|
41
|
+
packageJsonHash,
|
|
42
|
+
sdkVersionHash,
|
|
43
|
+
} = {}) => client._request('/api/commit-governance/ship-readiness', {
|
|
44
|
+
method: 'POST',
|
|
45
|
+
body: {
|
|
46
|
+
claim_id: claimId,
|
|
47
|
+
actor_id: actorId,
|
|
48
|
+
target_branch: targetBranch,
|
|
49
|
+
ship_command: shipCommand,
|
|
50
|
+
package_name: packageName,
|
|
51
|
+
declared_scope_files: declaredScopeFiles,
|
|
52
|
+
staged_files: stagedFiles,
|
|
53
|
+
dirty_files: dirtyFiles,
|
|
54
|
+
branch,
|
|
55
|
+
head_sha: headSha,
|
|
56
|
+
package_json_version: packageJsonVersion,
|
|
57
|
+
facade_min_client_version: facadeMinClientVersion,
|
|
58
|
+
package_release: packageRelease,
|
|
59
|
+
package_json_hash: packageJsonHash,
|
|
60
|
+
sdk_version_hash: sdkVersionHash,
|
|
61
|
+
},
|
|
62
|
+
}),
|
|
63
|
+
getCommitGovernanceEvaluation: (evaluationId) => client._request(`/api/commit-governance/evaluations/${encodeURIComponent(evaluationId)}`),
|
|
64
|
+
listCommitGovernanceEvaluationsByClaim: (claimId, { limit } = {}) => client._request(`/api/commit-governance/claims/${encodeURIComponent(claimId)}/evaluations`, {
|
|
65
|
+
query: { limit },
|
|
66
|
+
}),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
export function createContextAssemblyDomain(client) {
|
|
2
2
|
return {
|
|
3
|
-
getContextAssemblyContract: (workflowRunId,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export function createContextOrientationDomain(client) {
|
|
2
|
+
return {
|
|
3
|
+
conductOrientation: async ({
|
|
4
|
+
agentId,
|
|
5
|
+
runtimeSessionId,
|
|
6
|
+
intentId,
|
|
7
|
+
executionPurpose,
|
|
8
|
+
agentSignature,
|
|
9
|
+
understandingSummary,
|
|
10
|
+
lockClaim = true,
|
|
11
|
+
} = {}) => {
|
|
12
|
+
const { context_session, reminders } = await client.contextSessions.openContextSession({
|
|
13
|
+
agentId,
|
|
14
|
+
runtimeSessionId,
|
|
15
|
+
intentId,
|
|
16
|
+
executionPurpose,
|
|
17
|
+
});
|
|
18
|
+
const sessionId = context_session.context_session_id;
|
|
19
|
+
|
|
20
|
+
const required = (reminders || []).filter((reminder) => reminder.severity === 'required');
|
|
21
|
+
let acknowledgedCount = 0;
|
|
22
|
+
for (const reminder of required) {
|
|
23
|
+
await client.contextSessions.acknowledgeReminder(sessionId, {
|
|
24
|
+
reminderId: reminder.reminder_id,
|
|
25
|
+
agentSignature,
|
|
26
|
+
understandingSummary,
|
|
27
|
+
});
|
|
28
|
+
acknowledgedCount++;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const completion = await client.contextSessions.completeOrientation(sessionId);
|
|
32
|
+
|
|
33
|
+
let claimLockResult = null;
|
|
34
|
+
if (lockClaim) {
|
|
35
|
+
claimLockResult = await client.contextSessions.lockContextSessionClaim(sessionId);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
context_session_id: sessionId,
|
|
40
|
+
intent_id: intentId,
|
|
41
|
+
context_session: claimLockResult?.context_session || completion.context_session,
|
|
42
|
+
gate_result: claimLockResult?.gate_result || completion.gate_result,
|
|
43
|
+
acknowledged_count: acknowledgedCount,
|
|
44
|
+
claim_locked: lockClaim && !!claimLockResult,
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { cleanText } from '../utils/text.js';
|
|
2
|
+
|
|
3
|
+
export function contextSessionIdFromInput(input) {
|
|
4
|
+
if (input !== null && typeof input === 'object' && !Array.isArray(input)) {
|
|
5
|
+
return cleanText(input.contextSessionId)
|
|
6
|
+
|| cleanText(input.context_session_id)
|
|
7
|
+
|| cleanText(input.context_session?.context_session_id)
|
|
8
|
+
|| cleanText(input.claim?.context_session_id);
|
|
9
|
+
}
|
|
10
|
+
return cleanText(input);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function createContextSessionsDomain(client) {
|
|
14
|
+
return {
|
|
15
|
+
openContextSession: ({ agentId, runtimeSessionId, intentId, executionPurpose, notes } = {}) => client._request('/api/context-session/open', {
|
|
16
|
+
method: 'POST',
|
|
17
|
+
body: {
|
|
18
|
+
agent_id: agentId,
|
|
19
|
+
runtime_session_id: runtimeSessionId,
|
|
20
|
+
intent_id: intentId,
|
|
21
|
+
execution_purpose: executionPurpose,
|
|
22
|
+
notes,
|
|
23
|
+
},
|
|
24
|
+
}),
|
|
25
|
+
getOrientationWindow: (contextSessionId) => client._request(`/api/context-session/${encodeURIComponent(contextSessionId)}/window`),
|
|
26
|
+
acknowledgeReminder: (contextSessionId, { reminderId, agentSignature, understandingSummary } = {}) => client._request(`/api/context-session/${encodeURIComponent(contextSessionId)}/acknowledge`, {
|
|
27
|
+
method: 'POST',
|
|
28
|
+
body: {
|
|
29
|
+
reminder_id: reminderId,
|
|
30
|
+
agent_signature: agentSignature,
|
|
31
|
+
understanding_summary: understandingSummary,
|
|
32
|
+
},
|
|
33
|
+
}),
|
|
34
|
+
completeOrientation: (contextSessionId) => client._request(`/api/context-session/${encodeURIComponent(contextSessionId)}/complete`, {
|
|
35
|
+
method: 'POST',
|
|
36
|
+
}),
|
|
37
|
+
lockContextSessionClaim: (input) => {
|
|
38
|
+
const contextSessionId = contextSessionIdFromInput(input);
|
|
39
|
+
if (!contextSessionId) throw new Error('contextSessionId is required.');
|
|
40
|
+
return client._request(`/api/context-session/${encodeURIComponent(contextSessionId)}/lock-claim`, {
|
|
41
|
+
method: 'POST',
|
|
42
|
+
});
|
|
43
|
+
},
|
|
44
|
+
getContextSessionGateStatus: (contextSessionId) => client._request(`/api/context-session/${encodeURIComponent(contextSessionId)}/gate-status`),
|
|
45
|
+
};
|
|
46
|
+
}
|
package/src/domains/database.js
CHANGED
|
@@ -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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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.
|
|
4
|
-
listDesignDecisions: () => client.
|
|
5
|
-
getDesignDecision: (decisionId) => client.
|
|
6
|
-
getDesignDecisionVariants: (decisionId) => client.
|
|
7
|
-
getDesignDecisionCritique: (decisionId) => client.
|
|
8
|
-
getDesignDecisionLineage: (decisionId) => client.
|
|
9
|
-
listDesignPatterns: () => client.
|
|
10
|
-
getDecisionLabCanvas: () => client.
|
|
11
|
-
getDesignRecommendations: () => client.
|
|
12
|
-
getDesignPromotions: () => client.
|
|
13
|
-
previewDesignPromotion: (body) => client.
|
|
14
|
-
getDesignIntelligenceMetrics: () => client.
|
|
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
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { cleanText } from '../utils/text.js';
|
|
2
|
+
import { GOVERNED_MUTATION_REQUIRED_CAPABILITIES } from '../constants/governance.js';
|
|
3
|
+
|
|
4
|
+
export function buildEligibilityError(message, details = {}) {
|
|
5
|
+
const error = new Error(message);
|
|
6
|
+
error.code = 'EXECUTION_ELIGIBILITY_FAILED';
|
|
7
|
+
error.details = details;
|
|
8
|
+
return error;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function createExecutionEligibilityDomain(client) {
|
|
12
|
+
return {
|
|
13
|
+
getExecutionEligibility: (body = {}) => client._request('/api/governance/execution-eligibility', {
|
|
14
|
+
method: 'POST',
|
|
15
|
+
body: {
|
|
16
|
+
required_capabilities: GOVERNED_MUTATION_REQUIRED_CAPABILITIES,
|
|
17
|
+
verification_required: true,
|
|
18
|
+
...body,
|
|
19
|
+
},
|
|
20
|
+
}),
|
|
21
|
+
_assertExecutionEligibility: async (body = {}) => {
|
|
22
|
+
const eligibility = await client.getExecutionEligibility(body);
|
|
23
|
+
if (eligibility?.execution_eligible && eligibility?.mutation_allowed) {
|
|
24
|
+
return eligibility;
|
|
25
|
+
}
|
|
26
|
+
const remediation = cleanText(eligibility?.remediation_command);
|
|
27
|
+
const verification = cleanText(eligibility?.verification_command);
|
|
28
|
+
throw buildEligibilityError(
|
|
29
|
+
[
|
|
30
|
+
`Execution eligibility gate blocked mutation${cleanText(body?.requested_mutation_surface) ? ` on ${cleanText(body.requested_mutation_surface)}` : ''}.`,
|
|
31
|
+
remediation ? `Fix: ${remediation}` : null,
|
|
32
|
+
verification ? `Then verify: ${verification}` : null,
|
|
33
|
+
].filter(Boolean).join(' '),
|
|
34
|
+
{
|
|
35
|
+
required_gate: eligibility?.required_gate || 'execution_eligibility.required_gate',
|
|
36
|
+
execution_eligibility: eligibility ?? null,
|
|
37
|
+
requested_mutation_surface: cleanText(body?.requested_mutation_surface) || null,
|
|
38
|
+
remediation_command: remediation || null,
|
|
39
|
+
verification_command: verification || null,
|
|
40
|
+
},
|
|
41
|
+
);
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
}
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
export function createExecutionTelemetryDomain(client) {
|
|
2
2
|
return {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export function createGovernedImplementationDomain(client) {
|
|
2
|
+
return {
|
|
3
|
+
getExecutionEligibility: (body = {}) => client.executionEligibility.getExecutionEligibility(body),
|
|
4
|
+
_assertExecutionEligibility: (body = {}) => client.executionEligibility._assertExecutionEligibility(body),
|
|
5
|
+
executeVerifiedMutation: (request = {}) => client.verifiedMutations.executeVerifiedMutation(request),
|
|
6
|
+
};
|
|
7
|
+
}
|
package/src/domains/health.js
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
export function createHealthDomain(client) {
|
|
2
2
|
return {
|
|
3
|
-
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
|
}
|