@fabricorg/platform-host 0.4.3 → 0.5.1
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/CHANGELOG.md +10 -0
- package/README.md +12 -0
- package/dist/index.cjs +261 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +82 -4
- package/dist/index.d.ts +82 -4
- package/dist/index.js +262 -3
- package/dist/index.js.map +1 -1
- package/package.json +66 -62
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ActorType, ActionId, ActionStatus, AgentActionRoute, AgentActionRiskTier, PolicyOutcome, AssetEventEnvelope, ActionDefinition, AdapterImplementation, FabricRuntimeServices, AgentActionPolicyEvaluator, RuntimePolicyDefinition } from '@fabricorg/platform';
|
|
1
|
+
import { ActorType, ActionId, ActionStatus, AgentActionRoute, AgentActionRiskTier, MutationFootprint, ExecutionPrincipal, PolicyOutcome, AssetEventEnvelope, ExecutionAttestation, ExternalReconciliation, PolicyObligation, PolicyObligationStatus, ActionDefinition, AdapterImplementation, FabricRuntimeServices, AgentActionPolicyEvaluator, MutationGovernanceResolver, RuntimePolicyDefinition } from '@fabricorg/platform';
|
|
2
2
|
|
|
3
3
|
interface PendingAssetEvent {
|
|
4
4
|
eventType: string;
|
|
@@ -29,6 +29,8 @@ interface ActionInvocationRecord {
|
|
|
29
29
|
hitlReason?: string;
|
|
30
30
|
hitlPolicyVersion?: string;
|
|
31
31
|
approvalDecision?: PersistedActionApprovalDecision;
|
|
32
|
+
mutationFootprint?: MutationFootprint;
|
|
33
|
+
executionPrincipal?: ExecutionPrincipal;
|
|
32
34
|
error?: string;
|
|
33
35
|
createdAt: Date;
|
|
34
36
|
updatedAt: Date;
|
|
@@ -59,6 +61,27 @@ interface PolicyEvaluationRecord {
|
|
|
59
61
|
outcome: PolicyOutcome;
|
|
60
62
|
createdAt: Date;
|
|
61
63
|
}
|
|
64
|
+
interface PolicyObligationRecord extends PolicyObligation {
|
|
65
|
+
actionInvocationId: string;
|
|
66
|
+
tenantId: string;
|
|
67
|
+
spaceId: string;
|
|
68
|
+
createdAt: Date;
|
|
69
|
+
updatedAt: Date;
|
|
70
|
+
}
|
|
71
|
+
interface ExecutionAttestationRecord extends ExecutionAttestation {
|
|
72
|
+
id: string;
|
|
73
|
+
actionInvocationId: string;
|
|
74
|
+
tenantId: string;
|
|
75
|
+
spaceId: string;
|
|
76
|
+
adapterInvocationId?: string;
|
|
77
|
+
recordedAt: Date;
|
|
78
|
+
}
|
|
79
|
+
interface ExternalReconciliationRecord extends ExternalReconciliation {
|
|
80
|
+
id: string;
|
|
81
|
+
actionInvocationId: string;
|
|
82
|
+
tenantId: string;
|
|
83
|
+
spaceId: string;
|
|
84
|
+
}
|
|
62
85
|
type AdapterInvocationStatus = "running" | "succeeded" | "failed";
|
|
63
86
|
interface AdapterInvocationRecord {
|
|
64
87
|
id: string;
|
|
@@ -110,6 +133,19 @@ interface ApprovalPlatformHostStore<TDb> extends PlatformHostStore<TDb> {
|
|
|
110
133
|
recordHitlDecision(actionInvocationId: string, tenantId: string, spaceId: string, decision: HitlDecisionEvidence): Promise<ActionInvocationRecord>;
|
|
111
134
|
beginApprovalDecision(input: BeginApprovalDecisionInput): Promise<ApprovalDecisionTransitionResult>;
|
|
112
135
|
}
|
|
136
|
+
/** Optional durable capabilities used when external-governance enrichment is configured. */
|
|
137
|
+
interface GovernancePlatformHostStore<TDb> extends PlatformHostStore<TDb> {
|
|
138
|
+
recordMutationGovernance(actionInvocationId: string, tenantId: string, spaceId: string, context: {
|
|
139
|
+
footprint: MutationFootprint;
|
|
140
|
+
executionPrincipal: ExecutionPrincipal;
|
|
141
|
+
}): Promise<ActionInvocationRecord>;
|
|
142
|
+
appendPolicyObligations(records: PolicyObligationRecord[]): Promise<void>;
|
|
143
|
+
listPolicyObligations(actionInvocationId: string, tenantId: string, spaceId: string): Promise<PolicyObligationRecord[]>;
|
|
144
|
+
updatePolicyObligation(actionInvocationId: string, obligationId: string, status: PolicyObligationStatus, evidenceReferences?: PolicyObligation["evidenceReferences"]): Promise<void>;
|
|
145
|
+
appendExecutionAttestation(record: ExecutionAttestationRecord): Promise<void>;
|
|
146
|
+
listExecutionAttestations(actionInvocationId: string, tenantId: string, spaceId: string): Promise<ExecutionAttestationRecord[]>;
|
|
147
|
+
appendExternalReconciliation(record: ExternalReconciliationRecord): Promise<void>;
|
|
148
|
+
}
|
|
113
149
|
interface ListActionInvocationsInput {
|
|
114
150
|
tenantId?: string;
|
|
115
151
|
spaceId?: string;
|
|
@@ -227,6 +263,23 @@ interface PlatformHostOptions<TDb> {
|
|
|
227
263
|
hitlEvaluator?: AgentActionPolicyEvaluator;
|
|
228
264
|
/** Durable evaluator/ruleset version recorded with every HITL decision. */
|
|
229
265
|
hitlPolicyVersion?: string;
|
|
266
|
+
/** Optional portable resolver; provider-specific implementations belong in integration packages. */
|
|
267
|
+
resolveMutationGovernance?: MutationGovernanceResolver;
|
|
268
|
+
/** Translate policy outcomes into durable, enforceable obligations. */
|
|
269
|
+
resolvePolicyObligations?: (outcomes: readonly PolicyOutcome[]) => Promise<PolicyObligation[]> | PolicyObligation[];
|
|
270
|
+
/** Translate a successful adapter result into audit-safe external execution evidence. */
|
|
271
|
+
extractExecutionAttestation?: (input: {
|
|
272
|
+
actionInvocationId: string;
|
|
273
|
+
adapterInvocationId: string;
|
|
274
|
+
adapterType: string;
|
|
275
|
+
operation: string;
|
|
276
|
+
vendor: string;
|
|
277
|
+
/** Audit-safe adapter input after redactAdapterInput has been applied. */
|
|
278
|
+
input: Record<string, unknown>;
|
|
279
|
+
startedAt: Date;
|
|
280
|
+
completedAt: Date;
|
|
281
|
+
output: Record<string, unknown>;
|
|
282
|
+
}) => Promise<ExecutionAttestation | undefined> | ExecutionAttestation | undefined;
|
|
230
283
|
/** Lease held while an approved invocation resumes; defaults to five minutes. */
|
|
231
284
|
approvalResumeLeaseDurationMs?: number;
|
|
232
285
|
/** Remove forbidden/sensitive fields before durable invocation persistence. */
|
|
@@ -248,16 +301,21 @@ interface GovernedActionHost {
|
|
|
248
301
|
submitAction(input: SubmitActionInput): Promise<SubmitActionResult>;
|
|
249
302
|
executeInvocation(actionInvocationId: string, tenantId: string, spaceId: string, options?: ExecuteInvocationOptions): Promise<ExecuteActionResult>;
|
|
250
303
|
resumeApprovedInvocation(actionInvocationId: string, tenantId: string, spaceId: string, decision: ActionApprovalDecision): Promise<ExecuteActionResult>;
|
|
304
|
+
recordExecutionAttestation(actionInvocationId: string, tenantId: string, spaceId: string, attestation: ExecutionAttestation): Promise<void>;
|
|
305
|
+
recordExternalReconciliation(actionInvocationId: string, tenantId: string, spaceId: string, reconciliation: ExternalReconciliation): Promise<void>;
|
|
251
306
|
}
|
|
252
307
|
|
|
253
308
|
declare function createGovernedActionHost<TDb>(options: PlatformHostOptions<TDb>): GovernedActionHost;
|
|
254
309
|
|
|
255
|
-
declare class MemoryPlatformHostStore<TDb> implements RecoverablePlatformHostStore<TDb>, ApprovalPlatformHostStore<TDb> {
|
|
310
|
+
declare class MemoryPlatformHostStore<TDb> implements RecoverablePlatformHostStore<TDb>, ApprovalPlatformHostStore<TDb>, GovernancePlatformHostStore<TDb> {
|
|
256
311
|
readonly db: TDb;
|
|
257
312
|
readonly invocations: ActionInvocationRecord[];
|
|
258
313
|
readonly policyEvaluations: PolicyEvaluationRecord[];
|
|
259
314
|
readonly adapterInvocations: AdapterInvocationRecord[];
|
|
260
315
|
readonly events: AssetEventEnvelope[];
|
|
316
|
+
readonly policyObligations: PolicyObligationRecord[];
|
|
317
|
+
readonly executionAttestations: ExecutionAttestationRecord[];
|
|
318
|
+
readonly externalReconciliations: ExternalReconciliationRecord[];
|
|
261
319
|
constructor(db: TDb);
|
|
262
320
|
transaction<TResult>(run: (db: TDb) => Promise<TResult>): Promise<TResult>;
|
|
263
321
|
createActionInvocation(input: CreateActionInvocationInput): Promise<ActionInvocationRecord>;
|
|
@@ -266,6 +324,16 @@ declare class MemoryPlatformHostStore<TDb> implements RecoverablePlatformHostSto
|
|
|
266
324
|
recordHitlDecision(actionInvocationId: string, tenantId: string, spaceId: string, decision: HitlDecisionEvidence): Promise<ActionInvocationRecord>;
|
|
267
325
|
beginApprovalDecision(input: BeginApprovalDecisionInput): Promise<ApprovalDecisionTransitionResult>;
|
|
268
326
|
appendPolicyEvaluation(record: PolicyEvaluationRecord): Promise<void>;
|
|
327
|
+
recordMutationGovernance(actionInvocationId: string, tenantId: string, spaceId: string, context: Pick<ActionInvocationRecord, "mutationFootprint" | "executionPrincipal"> & {
|
|
328
|
+
footprint: NonNullable<ActionInvocationRecord["mutationFootprint"]>;
|
|
329
|
+
executionPrincipal: NonNullable<ActionInvocationRecord["executionPrincipal"]>;
|
|
330
|
+
}): Promise<ActionInvocationRecord>;
|
|
331
|
+
appendPolicyObligations(records: PolicyObligationRecord[]): Promise<void>;
|
|
332
|
+
listPolicyObligations(actionInvocationId: string, tenantId: string, spaceId: string): Promise<PolicyObligationRecord[]>;
|
|
333
|
+
updatePolicyObligation(actionInvocationId: string, obligationId: string, status: PolicyObligationRecord["status"], evidenceReferences?: PolicyObligationRecord["evidenceReferences"]): Promise<void>;
|
|
334
|
+
appendExecutionAttestation(record: ExecutionAttestationRecord): Promise<void>;
|
|
335
|
+
listExecutionAttestations(actionInvocationId: string, tenantId: string, spaceId: string): Promise<ExecutionAttestationRecord[]>;
|
|
336
|
+
appendExternalReconciliation(record: ExternalReconciliationRecord): Promise<void>;
|
|
269
337
|
createAdapterInvocation(record: AdapterInvocationRecord): Promise<void>;
|
|
270
338
|
getAdapterInvocation(id: string): Promise<AdapterInvocationRecord | undefined>;
|
|
271
339
|
updateAdapterInvocation(id: string, patch: Partial<Pick<AdapterInvocationRecord, "status" | "output" | "error" | "attempt" | "updatedAt">>): Promise<void>;
|
|
@@ -285,7 +353,7 @@ interface PlatformHostSqlClient {
|
|
|
285
353
|
query<Row = Record<string, unknown>>(sql: string, values?: unknown[]): Promise<PlatformHostSqlResult<Row>>;
|
|
286
354
|
}
|
|
287
355
|
/** Durable mutation-pipeline ledger for Databricks Lakebase or standard Postgres. */
|
|
288
|
-
declare class PostgresPlatformHostStore<TDb> implements RecoverablePlatformHostStore<TDb>, ApprovalPlatformHostStore<TDb> {
|
|
356
|
+
declare class PostgresPlatformHostStore<TDb> implements RecoverablePlatformHostStore<TDb>, ApprovalPlatformHostStore<TDb>, GovernancePlatformHostStore<TDb> {
|
|
289
357
|
readonly db: TDb;
|
|
290
358
|
private readonly sql;
|
|
291
359
|
constructor(db: TDb, sql: PlatformHostSqlClient);
|
|
@@ -297,6 +365,16 @@ declare class PostgresPlatformHostStore<TDb> implements RecoverablePlatformHostS
|
|
|
297
365
|
recordHitlDecision(actionInvocationId: string, tenantId: string, spaceId: string, decision: HitlDecisionEvidence): Promise<ActionInvocationRecord>;
|
|
298
366
|
beginApprovalDecision(input: BeginApprovalDecisionInput): Promise<ApprovalDecisionTransitionResult>;
|
|
299
367
|
appendPolicyEvaluation(record: PolicyEvaluationRecord): Promise<void>;
|
|
368
|
+
recordMutationGovernance(actionInvocationId: string, tenantId: string, spaceId: string, context: {
|
|
369
|
+
footprint: NonNullable<ActionInvocationRecord["mutationFootprint"]>;
|
|
370
|
+
executionPrincipal: NonNullable<ActionInvocationRecord["executionPrincipal"]>;
|
|
371
|
+
}): Promise<ActionInvocationRecord>;
|
|
372
|
+
appendPolicyObligations(records: PolicyObligationRecord[]): Promise<void>;
|
|
373
|
+
listPolicyObligations(actionInvocationId: string, tenantId: string, spaceId: string): Promise<PolicyObligationRecord[]>;
|
|
374
|
+
updatePolicyObligation(actionInvocationId: string, obligationId: string, status: PolicyObligationRecord["status"], evidenceReferences?: PolicyObligationRecord["evidenceReferences"]): Promise<void>;
|
|
375
|
+
appendExecutionAttestation(record: ExecutionAttestationRecord): Promise<void>;
|
|
376
|
+
listExecutionAttestations(actionInvocationId: string, tenantId: string, spaceId: string): Promise<ExecutionAttestationRecord[]>;
|
|
377
|
+
appendExternalReconciliation(record: ExternalReconciliationRecord): Promise<void>;
|
|
300
378
|
createAdapterInvocation(record: AdapterInvocationRecord): Promise<void>;
|
|
301
379
|
getAdapterInvocation(id: string): Promise<AdapterInvocationRecord | undefined>;
|
|
302
380
|
updateAdapterInvocation(id: string, patch: Partial<Pick<AdapterInvocationRecord, "status" | "output" | "error" | "attempt" | "updatedAt">>): Promise<void>;
|
|
@@ -318,4 +396,4 @@ declare function runPlatformActionWorkerCycle<TDb>(options: PlatformActionWorker
|
|
|
318
396
|
/** Poll until aborted. Each iteration is bounded and waits without busy-spinning. */
|
|
319
397
|
declare function runPlatformActionWorker<TDb>(options: PlatformActionWorkerOptions<TDb>): Promise<void>;
|
|
320
398
|
|
|
321
|
-
export { type ActionApprovalDecision, type ActionAuthorizationInput, type ActionInvocationRecord, type AdapterInvocationRecord, type AdapterInvocationStatus, type ApprovalDecisionTransitionResult, type ApprovalPlatformHostStore, type BeginApprovalDecisionInput, type ClaimActionInvocationsInput, type CreateActionInvocationInput, type DispatchActionInput, type DispatchActionResult, type ExecuteActionResult, type ExecuteInvocationOptions, type GovernedActionHost, type HitlDecisionEvidence, type ListActionInvocationsInput, MemoryPlatformHostStore, type PendingAssetEvent, type PersistedActionApprovalDecision, type PlatformActionDispatcher, type PlatformActionWorkerCycleResult, type PlatformActionWorkerOptions, type PlatformHostAuthorization, type PlatformHostOptions, type PlatformHostSqlClient, type PlatformHostSqlResult, type PlatformHostStore, type PolicyEvaluationRecord, PostgresPlatformHostStore, type RecoverablePlatformHostStore, type SubmitActionInput, type SubmitActionResult, createGovernedActionHost, createStoreBackedActionDispatcher, runPlatformActionWorker, runPlatformActionWorkerCycle };
|
|
399
|
+
export { type ActionApprovalDecision, type ActionAuthorizationInput, type ActionInvocationRecord, type AdapterInvocationRecord, type AdapterInvocationStatus, type ApprovalDecisionTransitionResult, type ApprovalPlatformHostStore, type BeginApprovalDecisionInput, type ClaimActionInvocationsInput, type CreateActionInvocationInput, type DispatchActionInput, type DispatchActionResult, type ExecuteActionResult, type ExecuteInvocationOptions, type ExecutionAttestationRecord, type ExternalReconciliationRecord, type GovernancePlatformHostStore, type GovernedActionHost, type HitlDecisionEvidence, type ListActionInvocationsInput, MemoryPlatformHostStore, type PendingAssetEvent, type PersistedActionApprovalDecision, type PlatformActionDispatcher, type PlatformActionWorkerCycleResult, type PlatformActionWorkerOptions, type PlatformHostAuthorization, type PlatformHostOptions, type PlatformHostSqlClient, type PlatformHostSqlResult, type PlatformHostStore, type PolicyEvaluationRecord, type PolicyObligationRecord, PostgresPlatformHostStore, type RecoverablePlatformHostStore, type SubmitActionInput, type SubmitActionResult, createGovernedActionHost, createStoreBackedActionDispatcher, runPlatformActionWorker, runPlatformActionWorkerCycle };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ActorType, ActionId, ActionStatus, AgentActionRoute, AgentActionRiskTier, PolicyOutcome, AssetEventEnvelope, ActionDefinition, AdapterImplementation, FabricRuntimeServices, AgentActionPolicyEvaluator, RuntimePolicyDefinition } from '@fabricorg/platform';
|
|
1
|
+
import { ActorType, ActionId, ActionStatus, AgentActionRoute, AgentActionRiskTier, MutationFootprint, ExecutionPrincipal, PolicyOutcome, AssetEventEnvelope, ExecutionAttestation, ExternalReconciliation, PolicyObligation, PolicyObligationStatus, ActionDefinition, AdapterImplementation, FabricRuntimeServices, AgentActionPolicyEvaluator, MutationGovernanceResolver, RuntimePolicyDefinition } from '@fabricorg/platform';
|
|
2
2
|
|
|
3
3
|
interface PendingAssetEvent {
|
|
4
4
|
eventType: string;
|
|
@@ -29,6 +29,8 @@ interface ActionInvocationRecord {
|
|
|
29
29
|
hitlReason?: string;
|
|
30
30
|
hitlPolicyVersion?: string;
|
|
31
31
|
approvalDecision?: PersistedActionApprovalDecision;
|
|
32
|
+
mutationFootprint?: MutationFootprint;
|
|
33
|
+
executionPrincipal?: ExecutionPrincipal;
|
|
32
34
|
error?: string;
|
|
33
35
|
createdAt: Date;
|
|
34
36
|
updatedAt: Date;
|
|
@@ -59,6 +61,27 @@ interface PolicyEvaluationRecord {
|
|
|
59
61
|
outcome: PolicyOutcome;
|
|
60
62
|
createdAt: Date;
|
|
61
63
|
}
|
|
64
|
+
interface PolicyObligationRecord extends PolicyObligation {
|
|
65
|
+
actionInvocationId: string;
|
|
66
|
+
tenantId: string;
|
|
67
|
+
spaceId: string;
|
|
68
|
+
createdAt: Date;
|
|
69
|
+
updatedAt: Date;
|
|
70
|
+
}
|
|
71
|
+
interface ExecutionAttestationRecord extends ExecutionAttestation {
|
|
72
|
+
id: string;
|
|
73
|
+
actionInvocationId: string;
|
|
74
|
+
tenantId: string;
|
|
75
|
+
spaceId: string;
|
|
76
|
+
adapterInvocationId?: string;
|
|
77
|
+
recordedAt: Date;
|
|
78
|
+
}
|
|
79
|
+
interface ExternalReconciliationRecord extends ExternalReconciliation {
|
|
80
|
+
id: string;
|
|
81
|
+
actionInvocationId: string;
|
|
82
|
+
tenantId: string;
|
|
83
|
+
spaceId: string;
|
|
84
|
+
}
|
|
62
85
|
type AdapterInvocationStatus = "running" | "succeeded" | "failed";
|
|
63
86
|
interface AdapterInvocationRecord {
|
|
64
87
|
id: string;
|
|
@@ -110,6 +133,19 @@ interface ApprovalPlatformHostStore<TDb> extends PlatformHostStore<TDb> {
|
|
|
110
133
|
recordHitlDecision(actionInvocationId: string, tenantId: string, spaceId: string, decision: HitlDecisionEvidence): Promise<ActionInvocationRecord>;
|
|
111
134
|
beginApprovalDecision(input: BeginApprovalDecisionInput): Promise<ApprovalDecisionTransitionResult>;
|
|
112
135
|
}
|
|
136
|
+
/** Optional durable capabilities used when external-governance enrichment is configured. */
|
|
137
|
+
interface GovernancePlatformHostStore<TDb> extends PlatformHostStore<TDb> {
|
|
138
|
+
recordMutationGovernance(actionInvocationId: string, tenantId: string, spaceId: string, context: {
|
|
139
|
+
footprint: MutationFootprint;
|
|
140
|
+
executionPrincipal: ExecutionPrincipal;
|
|
141
|
+
}): Promise<ActionInvocationRecord>;
|
|
142
|
+
appendPolicyObligations(records: PolicyObligationRecord[]): Promise<void>;
|
|
143
|
+
listPolicyObligations(actionInvocationId: string, tenantId: string, spaceId: string): Promise<PolicyObligationRecord[]>;
|
|
144
|
+
updatePolicyObligation(actionInvocationId: string, obligationId: string, status: PolicyObligationStatus, evidenceReferences?: PolicyObligation["evidenceReferences"]): Promise<void>;
|
|
145
|
+
appendExecutionAttestation(record: ExecutionAttestationRecord): Promise<void>;
|
|
146
|
+
listExecutionAttestations(actionInvocationId: string, tenantId: string, spaceId: string): Promise<ExecutionAttestationRecord[]>;
|
|
147
|
+
appendExternalReconciliation(record: ExternalReconciliationRecord): Promise<void>;
|
|
148
|
+
}
|
|
113
149
|
interface ListActionInvocationsInput {
|
|
114
150
|
tenantId?: string;
|
|
115
151
|
spaceId?: string;
|
|
@@ -227,6 +263,23 @@ interface PlatformHostOptions<TDb> {
|
|
|
227
263
|
hitlEvaluator?: AgentActionPolicyEvaluator;
|
|
228
264
|
/** Durable evaluator/ruleset version recorded with every HITL decision. */
|
|
229
265
|
hitlPolicyVersion?: string;
|
|
266
|
+
/** Optional portable resolver; provider-specific implementations belong in integration packages. */
|
|
267
|
+
resolveMutationGovernance?: MutationGovernanceResolver;
|
|
268
|
+
/** Translate policy outcomes into durable, enforceable obligations. */
|
|
269
|
+
resolvePolicyObligations?: (outcomes: readonly PolicyOutcome[]) => Promise<PolicyObligation[]> | PolicyObligation[];
|
|
270
|
+
/** Translate a successful adapter result into audit-safe external execution evidence. */
|
|
271
|
+
extractExecutionAttestation?: (input: {
|
|
272
|
+
actionInvocationId: string;
|
|
273
|
+
adapterInvocationId: string;
|
|
274
|
+
adapterType: string;
|
|
275
|
+
operation: string;
|
|
276
|
+
vendor: string;
|
|
277
|
+
/** Audit-safe adapter input after redactAdapterInput has been applied. */
|
|
278
|
+
input: Record<string, unknown>;
|
|
279
|
+
startedAt: Date;
|
|
280
|
+
completedAt: Date;
|
|
281
|
+
output: Record<string, unknown>;
|
|
282
|
+
}) => Promise<ExecutionAttestation | undefined> | ExecutionAttestation | undefined;
|
|
230
283
|
/** Lease held while an approved invocation resumes; defaults to five minutes. */
|
|
231
284
|
approvalResumeLeaseDurationMs?: number;
|
|
232
285
|
/** Remove forbidden/sensitive fields before durable invocation persistence. */
|
|
@@ -248,16 +301,21 @@ interface GovernedActionHost {
|
|
|
248
301
|
submitAction(input: SubmitActionInput): Promise<SubmitActionResult>;
|
|
249
302
|
executeInvocation(actionInvocationId: string, tenantId: string, spaceId: string, options?: ExecuteInvocationOptions): Promise<ExecuteActionResult>;
|
|
250
303
|
resumeApprovedInvocation(actionInvocationId: string, tenantId: string, spaceId: string, decision: ActionApprovalDecision): Promise<ExecuteActionResult>;
|
|
304
|
+
recordExecutionAttestation(actionInvocationId: string, tenantId: string, spaceId: string, attestation: ExecutionAttestation): Promise<void>;
|
|
305
|
+
recordExternalReconciliation(actionInvocationId: string, tenantId: string, spaceId: string, reconciliation: ExternalReconciliation): Promise<void>;
|
|
251
306
|
}
|
|
252
307
|
|
|
253
308
|
declare function createGovernedActionHost<TDb>(options: PlatformHostOptions<TDb>): GovernedActionHost;
|
|
254
309
|
|
|
255
|
-
declare class MemoryPlatformHostStore<TDb> implements RecoverablePlatformHostStore<TDb>, ApprovalPlatformHostStore<TDb> {
|
|
310
|
+
declare class MemoryPlatformHostStore<TDb> implements RecoverablePlatformHostStore<TDb>, ApprovalPlatformHostStore<TDb>, GovernancePlatformHostStore<TDb> {
|
|
256
311
|
readonly db: TDb;
|
|
257
312
|
readonly invocations: ActionInvocationRecord[];
|
|
258
313
|
readonly policyEvaluations: PolicyEvaluationRecord[];
|
|
259
314
|
readonly adapterInvocations: AdapterInvocationRecord[];
|
|
260
315
|
readonly events: AssetEventEnvelope[];
|
|
316
|
+
readonly policyObligations: PolicyObligationRecord[];
|
|
317
|
+
readonly executionAttestations: ExecutionAttestationRecord[];
|
|
318
|
+
readonly externalReconciliations: ExternalReconciliationRecord[];
|
|
261
319
|
constructor(db: TDb);
|
|
262
320
|
transaction<TResult>(run: (db: TDb) => Promise<TResult>): Promise<TResult>;
|
|
263
321
|
createActionInvocation(input: CreateActionInvocationInput): Promise<ActionInvocationRecord>;
|
|
@@ -266,6 +324,16 @@ declare class MemoryPlatformHostStore<TDb> implements RecoverablePlatformHostSto
|
|
|
266
324
|
recordHitlDecision(actionInvocationId: string, tenantId: string, spaceId: string, decision: HitlDecisionEvidence): Promise<ActionInvocationRecord>;
|
|
267
325
|
beginApprovalDecision(input: BeginApprovalDecisionInput): Promise<ApprovalDecisionTransitionResult>;
|
|
268
326
|
appendPolicyEvaluation(record: PolicyEvaluationRecord): Promise<void>;
|
|
327
|
+
recordMutationGovernance(actionInvocationId: string, tenantId: string, spaceId: string, context: Pick<ActionInvocationRecord, "mutationFootprint" | "executionPrincipal"> & {
|
|
328
|
+
footprint: NonNullable<ActionInvocationRecord["mutationFootprint"]>;
|
|
329
|
+
executionPrincipal: NonNullable<ActionInvocationRecord["executionPrincipal"]>;
|
|
330
|
+
}): Promise<ActionInvocationRecord>;
|
|
331
|
+
appendPolicyObligations(records: PolicyObligationRecord[]): Promise<void>;
|
|
332
|
+
listPolicyObligations(actionInvocationId: string, tenantId: string, spaceId: string): Promise<PolicyObligationRecord[]>;
|
|
333
|
+
updatePolicyObligation(actionInvocationId: string, obligationId: string, status: PolicyObligationRecord["status"], evidenceReferences?: PolicyObligationRecord["evidenceReferences"]): Promise<void>;
|
|
334
|
+
appendExecutionAttestation(record: ExecutionAttestationRecord): Promise<void>;
|
|
335
|
+
listExecutionAttestations(actionInvocationId: string, tenantId: string, spaceId: string): Promise<ExecutionAttestationRecord[]>;
|
|
336
|
+
appendExternalReconciliation(record: ExternalReconciliationRecord): Promise<void>;
|
|
269
337
|
createAdapterInvocation(record: AdapterInvocationRecord): Promise<void>;
|
|
270
338
|
getAdapterInvocation(id: string): Promise<AdapterInvocationRecord | undefined>;
|
|
271
339
|
updateAdapterInvocation(id: string, patch: Partial<Pick<AdapterInvocationRecord, "status" | "output" | "error" | "attempt" | "updatedAt">>): Promise<void>;
|
|
@@ -285,7 +353,7 @@ interface PlatformHostSqlClient {
|
|
|
285
353
|
query<Row = Record<string, unknown>>(sql: string, values?: unknown[]): Promise<PlatformHostSqlResult<Row>>;
|
|
286
354
|
}
|
|
287
355
|
/** Durable mutation-pipeline ledger for Databricks Lakebase or standard Postgres. */
|
|
288
|
-
declare class PostgresPlatformHostStore<TDb> implements RecoverablePlatformHostStore<TDb>, ApprovalPlatformHostStore<TDb> {
|
|
356
|
+
declare class PostgresPlatformHostStore<TDb> implements RecoverablePlatformHostStore<TDb>, ApprovalPlatformHostStore<TDb>, GovernancePlatformHostStore<TDb> {
|
|
289
357
|
readonly db: TDb;
|
|
290
358
|
private readonly sql;
|
|
291
359
|
constructor(db: TDb, sql: PlatformHostSqlClient);
|
|
@@ -297,6 +365,16 @@ declare class PostgresPlatformHostStore<TDb> implements RecoverablePlatformHostS
|
|
|
297
365
|
recordHitlDecision(actionInvocationId: string, tenantId: string, spaceId: string, decision: HitlDecisionEvidence): Promise<ActionInvocationRecord>;
|
|
298
366
|
beginApprovalDecision(input: BeginApprovalDecisionInput): Promise<ApprovalDecisionTransitionResult>;
|
|
299
367
|
appendPolicyEvaluation(record: PolicyEvaluationRecord): Promise<void>;
|
|
368
|
+
recordMutationGovernance(actionInvocationId: string, tenantId: string, spaceId: string, context: {
|
|
369
|
+
footprint: NonNullable<ActionInvocationRecord["mutationFootprint"]>;
|
|
370
|
+
executionPrincipal: NonNullable<ActionInvocationRecord["executionPrincipal"]>;
|
|
371
|
+
}): Promise<ActionInvocationRecord>;
|
|
372
|
+
appendPolicyObligations(records: PolicyObligationRecord[]): Promise<void>;
|
|
373
|
+
listPolicyObligations(actionInvocationId: string, tenantId: string, spaceId: string): Promise<PolicyObligationRecord[]>;
|
|
374
|
+
updatePolicyObligation(actionInvocationId: string, obligationId: string, status: PolicyObligationRecord["status"], evidenceReferences?: PolicyObligationRecord["evidenceReferences"]): Promise<void>;
|
|
375
|
+
appendExecutionAttestation(record: ExecutionAttestationRecord): Promise<void>;
|
|
376
|
+
listExecutionAttestations(actionInvocationId: string, tenantId: string, spaceId: string): Promise<ExecutionAttestationRecord[]>;
|
|
377
|
+
appendExternalReconciliation(record: ExternalReconciliationRecord): Promise<void>;
|
|
300
378
|
createAdapterInvocation(record: AdapterInvocationRecord): Promise<void>;
|
|
301
379
|
getAdapterInvocation(id: string): Promise<AdapterInvocationRecord | undefined>;
|
|
302
380
|
updateAdapterInvocation(id: string, patch: Partial<Pick<AdapterInvocationRecord, "status" | "output" | "error" | "attempt" | "updatedAt">>): Promise<void>;
|
|
@@ -318,4 +396,4 @@ declare function runPlatformActionWorkerCycle<TDb>(options: PlatformActionWorker
|
|
|
318
396
|
/** Poll until aborted. Each iteration is bounded and waits without busy-spinning. */
|
|
319
397
|
declare function runPlatformActionWorker<TDb>(options: PlatformActionWorkerOptions<TDb>): Promise<void>;
|
|
320
398
|
|
|
321
|
-
export { type ActionApprovalDecision, type ActionAuthorizationInput, type ActionInvocationRecord, type AdapterInvocationRecord, type AdapterInvocationStatus, type ApprovalDecisionTransitionResult, type ApprovalPlatformHostStore, type BeginApprovalDecisionInput, type ClaimActionInvocationsInput, type CreateActionInvocationInput, type DispatchActionInput, type DispatchActionResult, type ExecuteActionResult, type ExecuteInvocationOptions, type GovernedActionHost, type HitlDecisionEvidence, type ListActionInvocationsInput, MemoryPlatformHostStore, type PendingAssetEvent, type PersistedActionApprovalDecision, type PlatformActionDispatcher, type PlatformActionWorkerCycleResult, type PlatformActionWorkerOptions, type PlatformHostAuthorization, type PlatformHostOptions, type PlatformHostSqlClient, type PlatformHostSqlResult, type PlatformHostStore, type PolicyEvaluationRecord, PostgresPlatformHostStore, type RecoverablePlatformHostStore, type SubmitActionInput, type SubmitActionResult, createGovernedActionHost, createStoreBackedActionDispatcher, runPlatformActionWorker, runPlatformActionWorkerCycle };
|
|
399
|
+
export { type ActionApprovalDecision, type ActionAuthorizationInput, type ActionInvocationRecord, type AdapterInvocationRecord, type AdapterInvocationStatus, type ApprovalDecisionTransitionResult, type ApprovalPlatformHostStore, type BeginApprovalDecisionInput, type ClaimActionInvocationsInput, type CreateActionInvocationInput, type DispatchActionInput, type DispatchActionResult, type ExecuteActionResult, type ExecuteInvocationOptions, type ExecutionAttestationRecord, type ExternalReconciliationRecord, type GovernancePlatformHostStore, type GovernedActionHost, type HitlDecisionEvidence, type ListActionInvocationsInput, MemoryPlatformHostStore, type PendingAssetEvent, type PersistedActionApprovalDecision, type PlatformActionDispatcher, type PlatformActionWorkerCycleResult, type PlatformActionWorkerOptions, type PlatformHostAuthorization, type PlatformHostOptions, type PlatformHostSqlClient, type PlatformHostSqlResult, type PlatformHostStore, type PolicyEvaluationRecord, type PolicyObligationRecord, PostgresPlatformHostStore, type RecoverablePlatformHostStore, type SubmitActionInput, type SubmitActionResult, createGovernedActionHost, createStoreBackedActionDispatcher, runPlatformActionWorker, runPlatformActionWorkerCycle };
|