@unson/brainbase-mcp 0.44.0 → 0.44.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/contracts/canonical-task/operation-schema.sql +58 -0
- package/contracts/canonical-task/search-indexes.sql +10 -0
- package/contracts/canonical-task/store-schema.sql +77 -0
- package/dist/automation-run.d.ts +213 -0
- package/dist/automation-run.js +479 -0
- package/dist/canonical-task-operations.d.ts +205 -0
- package/dist/canonical-task-operations.js +700 -0
- package/dist/canonical-task-postgres.d.ts +139 -0
- package/dist/canonical-task-postgres.js +554 -0
- package/dist/canonical-task-service.d.ts +13 -0
- package/dist/canonical-task-service.js +55 -3
- package/dist/canonical-task-store-config.d.ts +31 -0
- package/dist/canonical-task-store-config.js +53 -0
- package/dist/config-parser.d.ts +298 -0
- package/dist/config-parser.js +593 -0
- package/dist/connected-onboarding.d.ts +57 -0
- package/dist/connected-onboarding.js +37 -0
- package/dist/durable-wait-http.d.ts +3 -1
- package/dist/durable-wait-http.js +73 -6
- package/dist/durable-waits.d.ts +93 -3
- package/dist/durable-waits.js +320 -8
- package/dist/honcho.d.ts +25 -0
- package/dist/honcho.js +81 -0
- package/dist/judgment-event-adapter.d.ts +72 -0
- package/dist/judgment-event-adapter.js +114 -0
- package/dist/judgment-event-outbox.d.ts +182 -0
- package/dist/judgment-event-outbox.js +568 -0
- package/dist/judgment-execution-outcome.d.ts +46 -0
- package/dist/judgment-execution-outcome.js +149 -0
- package/dist/judgment-host.d.ts +18 -7
- package/dist/judgment-host.js +82 -34
- package/dist/judgment-lifecycle-core.d.ts +198 -0
- package/dist/judgment-lifecycle-core.js +464 -0
- package/dist/judgment-node-evidence.d.ts +57 -0
- package/dist/judgment-node-evidence.js +297 -0
- package/dist/judgment-runtime-resolution.d.ts +264 -0
- package/dist/judgment-runtime-resolution.js +1248 -0
- package/dist/judgment-runtime-resolution.public.d.ts +255 -0
- package/dist/knowledge-event.d.ts +28 -0
- package/dist/knowledge-event.js +114 -0
- package/dist/mcp-runtime.d.ts +75 -0
- package/dist/mcp-runtime.js +188 -0
- package/dist/meeting-automation-runtime.d.ts +102 -0
- package/dist/meeting-automation-runtime.js +249 -0
- package/dist/meeting-automation.d.ts +155 -0
- package/dist/meeting-automation.js +341 -0
- package/dist/meeting-minutes-context-receipt.d.ts +91 -0
- package/dist/meeting-minutes-context-receipt.js +280 -0
- package/dist/meeting-source-sync.d.ts +89 -0
- package/dist/meeting-source-sync.js +230 -0
- package/dist/mesh.d.ts +58 -0
- package/dist/mesh.js +134 -0
- package/dist/onboarding-runtime.d.ts +47 -0
- package/dist/onboarding-runtime.js +4719 -0
- package/dist/routine-cycle.d.ts +51 -0
- package/dist/routine-cycle.js +153 -0
- package/dist/routine-liveness.d.ts +49 -0
- package/dist/routine-liveness.js +227 -0
- package/dist/routine-runtime.d.ts +101 -0
- package/dist/routine-runtime.js +237 -0
- package/dist/routines.d.ts +3 -0
- package/dist/routines.js +3 -0
- package/dist/run-receipt.d.ts +40 -0
- package/dist/run-receipt.js +635 -0
- package/dist/runtime-host.d.ts +64 -0
- package/dist/runtime-host.js +70 -0
- package/dist/world-work.d.ts +16 -0
- package/package.json +115 -3
- package/ui/objective-editor.js +47 -11
- package/ui/world/world-district.js +18 -3
- package/ui/world/world-placement.js +13 -0
- package/ui/world/world-work-rail.js +7 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
CREATE TABLE IF NOT EXISTS canonical_task_writer (
|
|
2
|
+
singleton_id BOOLEAN PRIMARY KEY DEFAULT TRUE CHECK (singleton_id),
|
|
3
|
+
writer_token TEXT NOT NULL,
|
|
4
|
+
process_identity JSONB NOT NULL DEFAULT '{}'::jsonb,
|
|
5
|
+
source_head TEXT,
|
|
6
|
+
claimed_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
|
7
|
+
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
CREATE TABLE IF NOT EXISTS canonical_task_readiness (
|
|
11
|
+
singleton_id BOOLEAN PRIMARY KEY DEFAULT TRUE CHECK (singleton_id),
|
|
12
|
+
ready BOOLEAN NOT NULL DEFAULT FALSE,
|
|
13
|
+
writer_token TEXT,
|
|
14
|
+
manifest_hash TEXT,
|
|
15
|
+
schema_version TEXT,
|
|
16
|
+
source_head TEXT,
|
|
17
|
+
evidence_hash TEXT,
|
|
18
|
+
evidence_path TEXT,
|
|
19
|
+
reason TEXT,
|
|
20
|
+
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
CREATE TABLE IF NOT EXISTS canonical_task_readiness_audit (
|
|
24
|
+
id BIGSERIAL PRIMARY KEY,
|
|
25
|
+
action TEXT NOT NULL CHECK (action IN ('enable', 'disable')),
|
|
26
|
+
ready BOOLEAN NOT NULL,
|
|
27
|
+
actor TEXT NOT NULL,
|
|
28
|
+
change_ref TEXT NOT NULL,
|
|
29
|
+
source_head TEXT,
|
|
30
|
+
evidence_hash TEXT,
|
|
31
|
+
evidence_path TEXT,
|
|
32
|
+
reason TEXT,
|
|
33
|
+
process_identity JSONB NOT NULL DEFAULT '{}'::jsonb,
|
|
34
|
+
session_context JSONB NOT NULL DEFAULT '{}'::jsonb,
|
|
35
|
+
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
CREATE INDEX IF NOT EXISTS canonical_task_readiness_audit_created_at_idx
|
|
39
|
+
ON canonical_task_readiness_audit (created_at DESC);
|
|
40
|
+
|
|
41
|
+
CREATE TABLE IF NOT EXISTS canonical_task_operations (
|
|
42
|
+
id BIGSERIAL PRIMARY KEY,
|
|
43
|
+
scope TEXT NOT NULL,
|
|
44
|
+
operation_key TEXT NOT NULL,
|
|
45
|
+
fingerprint TEXT NOT NULL,
|
|
46
|
+
state TEXT NOT NULL CHECK (state IN ('prepared', 'running', 'completed', 'failed')),
|
|
47
|
+
writer_token TEXT NOT NULL,
|
|
48
|
+
result_json JSONB,
|
|
49
|
+
error_json JSONB,
|
|
50
|
+
authorization_snapshot JSONB,
|
|
51
|
+
recovery_checkpoint JSONB NOT NULL DEFAULT '{}'::jsonb,
|
|
52
|
+
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
|
53
|
+
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
|
54
|
+
UNIQUE (scope, operation_key)
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
CREATE INDEX IF NOT EXISTS canonical_task_operations_state_idx
|
|
58
|
+
ON canonical_task_operations (state, updated_at);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
CREATE EXTENSION IF NOT EXISTS pg_trgm;
|
|
2
|
+
|
|
3
|
+
CREATE INDEX CONCURRENTLY IF NOT EXISTS canonical_tasks_title_trgm_idx
|
|
4
|
+
ON canonical_tasks USING GIN (title gin_trgm_ops);
|
|
5
|
+
|
|
6
|
+
CREATE INDEX CONCURRENTLY IF NOT EXISTS canonical_tasks_search_cursor_idx
|
|
7
|
+
ON canonical_tasks (created_at DESC, id DESC);
|
|
8
|
+
|
|
9
|
+
CREATE INDEX CONCURRENTLY IF NOT EXISTS canonical_tasks_source_refs_idx
|
|
10
|
+
ON canonical_tasks USING GIN (source_refs jsonb_path_ops);
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
CREATE TABLE IF NOT EXISTS canonical_tasks (
|
|
2
|
+
id UUID PRIMARY KEY,
|
|
3
|
+
legacy_nocodb_id TEXT UNIQUE,
|
|
4
|
+
title TEXT NOT NULL,
|
|
5
|
+
description TEXT,
|
|
6
|
+
status TEXT NOT NULL CHECK (status IN ('pending', 'in_progress', 'waiting', 'completed', 'cancelled')),
|
|
7
|
+
priority TEXT NOT NULL CHECK (priority IN ('low', 'medium', 'high', 'urgent')),
|
|
8
|
+
assignee_person_id TEXT,
|
|
9
|
+
assignee_display_name TEXT,
|
|
10
|
+
due_at TIMESTAMPTZ,
|
|
11
|
+
waiting_on TEXT,
|
|
12
|
+
review_at TIMESTAMPTZ,
|
|
13
|
+
completed_at TIMESTAMPTZ,
|
|
14
|
+
source_refs JSONB NOT NULL DEFAULT '[]'::jsonb CHECK (jsonb_typeof(source_refs) = 'array'),
|
|
15
|
+
project_codes TEXT[] NOT NULL DEFAULT '{}'::text[],
|
|
16
|
+
purpose_label TEXT,
|
|
17
|
+
completion_contract JSONB,
|
|
18
|
+
version INTEGER NOT NULL DEFAULT 1 CHECK (version > 0),
|
|
19
|
+
idempotency_key TEXT NOT NULL UNIQUE,
|
|
20
|
+
payload_fingerprint TEXT,
|
|
21
|
+
last_operation_key TEXT,
|
|
22
|
+
last_operation_fingerprint TEXT,
|
|
23
|
+
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
|
24
|
+
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
ALTER TABLE canonical_tasks
|
|
28
|
+
ADD COLUMN IF NOT EXISTS project_codes TEXT[] NOT NULL DEFAULT '{}'::text[];
|
|
29
|
+
|
|
30
|
+
-- 何のための仕事か(例: 口コミ)。1 Taskに1つ、未分類はNULL。
|
|
31
|
+
ALTER TABLE canonical_tasks
|
|
32
|
+
ADD COLUMN IF NOT EXISTS purpose_label TEXT;
|
|
33
|
+
|
|
34
|
+
-- 確認待ちのTaskが待っている相手のGraph person ID。条件や特定の人でない待ちはNULL。
|
|
35
|
+
-- 待っている相手・条件の自由記述(waiting_on)とは別に持つ。
|
|
36
|
+
ALTER TABLE canonical_tasks
|
|
37
|
+
ADD COLUMN IF NOT EXISTS waiting_on_person_id TEXT;
|
|
38
|
+
|
|
39
|
+
-- Structured Task goal and completion criteria. Validation of the contract's
|
|
40
|
+
-- exact fields belongs to the public Task API; storage only requires an object.
|
|
41
|
+
ALTER TABLE canonical_tasks
|
|
42
|
+
ADD COLUMN IF NOT EXISTS completion_contract JSONB;
|
|
43
|
+
|
|
44
|
+
ALTER TABLE canonical_tasks
|
|
45
|
+
DROP CONSTRAINT IF EXISTS canonical_tasks_completion_contract_shape_check;
|
|
46
|
+
ALTER TABLE canonical_tasks
|
|
47
|
+
ADD CONSTRAINT canonical_tasks_completion_contract_shape_check
|
|
48
|
+
CHECK (
|
|
49
|
+
completion_contract IS NULL
|
|
50
|
+
OR jsonb_typeof(completion_contract) = 'object'
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
ALTER TABLE canonical_tasks
|
|
54
|
+
DROP CONSTRAINT IF EXISTS canonical_tasks_purpose_label_check;
|
|
55
|
+
ALTER TABLE canonical_tasks
|
|
56
|
+
ADD CONSTRAINT canonical_tasks_purpose_label_check
|
|
57
|
+
CHECK (
|
|
58
|
+
purpose_label IS NULL
|
|
59
|
+
OR (
|
|
60
|
+
char_length(purpose_label) BETWEEN 1 AND 30
|
|
61
|
+
AND purpose_label = btrim(purpose_label)
|
|
62
|
+
AND purpose_label !~ '[[:cntrl:]]'
|
|
63
|
+
)
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
ALTER TABLE canonical_tasks
|
|
67
|
+
DROP CONSTRAINT IF EXISTS canonical_tasks_status_check;
|
|
68
|
+
ALTER TABLE canonical_tasks
|
|
69
|
+
ADD CONSTRAINT canonical_tasks_status_check
|
|
70
|
+
CHECK (status IN ('pending', 'in_progress', 'waiting', 'completed', 'cancelled'));
|
|
71
|
+
|
|
72
|
+
CREATE INDEX IF NOT EXISTS canonical_tasks_status_priority_idx
|
|
73
|
+
ON canonical_tasks (status, priority);
|
|
74
|
+
CREATE INDEX IF NOT EXISTS canonical_tasks_assignee_due_idx
|
|
75
|
+
ON canonical_tasks (assignee_person_id, due_at);
|
|
76
|
+
CREATE INDEX IF NOT EXISTS canonical_tasks_project_codes_idx
|
|
77
|
+
ON canonical_tasks USING GIN (project_codes);
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { type NormalizedRunReceipt } from './run-receipt.js';
|
|
2
|
+
import { type Awaitable, type RuntimeHostContext, type RuntimeHostPorts } from './runtime-host.js';
|
|
3
|
+
export type AutomationRunOperation = 'automation.start' | 'automation.retry';
|
|
4
|
+
export type AutomationRunPhase = 'claimed' | 'runner_started' | 'receipt_persisted' | 'completed' | 'retryable' | 'uncertain' | 'unknown';
|
|
5
|
+
export interface AutomationRunRequest {
|
|
6
|
+
workflowId: string;
|
|
7
|
+
automationId?: string;
|
|
8
|
+
projectId?: string;
|
|
9
|
+
organizationId?: string;
|
|
10
|
+
orgId?: string;
|
|
11
|
+
actorId?: string;
|
|
12
|
+
sourceType?: string;
|
|
13
|
+
/** Stable source identity used for the durable claim. */
|
|
14
|
+
externalRunId: string;
|
|
15
|
+
payload?: unknown;
|
|
16
|
+
metadata?: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
export interface AutomationRunNamespace {
|
|
19
|
+
tenantId: string;
|
|
20
|
+
projectId: string;
|
|
21
|
+
organizationId: string;
|
|
22
|
+
actorId: string;
|
|
23
|
+
}
|
|
24
|
+
export interface AutomationRunIdentity {
|
|
25
|
+
operation: AutomationRunOperation;
|
|
26
|
+
key: string;
|
|
27
|
+
fingerprint: string;
|
|
28
|
+
runnerIdempotencyKey: string;
|
|
29
|
+
namespace: AutomationRunNamespace;
|
|
30
|
+
}
|
|
31
|
+
export interface AutomationRunnerStartInput {
|
|
32
|
+
request: AutomationRunRequest;
|
|
33
|
+
context: RuntimeHostContext;
|
|
34
|
+
/** External runner must use this key for its own idempotent execution. */
|
|
35
|
+
idempotencyKey: string;
|
|
36
|
+
}
|
|
37
|
+
export interface AutomationRunnerRetryInput extends AutomationRunnerStartInput {
|
|
38
|
+
previousRunId: string;
|
|
39
|
+
}
|
|
40
|
+
export interface AutomationRunnerResult {
|
|
41
|
+
/** Canonical run_receipt.v1 payload. */
|
|
42
|
+
receipt: unknown;
|
|
43
|
+
result?: unknown;
|
|
44
|
+
}
|
|
45
|
+
export interface AutomationRunnerPort {
|
|
46
|
+
start(input: AutomationRunnerStartInput): Awaitable<AutomationRunnerResult>;
|
|
47
|
+
retry?(input: AutomationRunnerRetryInput): Awaitable<AutomationRunnerResult>;
|
|
48
|
+
}
|
|
49
|
+
export interface AutomationReceiptPersistenceInput {
|
|
50
|
+
payload: unknown;
|
|
51
|
+
normalized: NormalizedRunReceipt;
|
|
52
|
+
context: RuntimeHostContext;
|
|
53
|
+
}
|
|
54
|
+
export interface AutomationReceiptPort {
|
|
55
|
+
persist(input: AutomationReceiptPersistenceInput): Awaitable<unknown>;
|
|
56
|
+
query(input: {
|
|
57
|
+
request: AutomationRunRequest;
|
|
58
|
+
context: RuntimeHostContext;
|
|
59
|
+
}): Awaitable<unknown>;
|
|
60
|
+
}
|
|
61
|
+
export type AutomationRunClaim = {
|
|
62
|
+
status: 'claimed';
|
|
63
|
+
claimToken: string;
|
|
64
|
+
attempt?: number;
|
|
65
|
+
phase: 'claimed';
|
|
66
|
+
} | {
|
|
67
|
+
status: 'replay';
|
|
68
|
+
payload: unknown;
|
|
69
|
+
normalized?: NormalizedRunReceipt;
|
|
70
|
+
runnerResult?: unknown;
|
|
71
|
+
persistedReceipt?: unknown;
|
|
72
|
+
phase: 'completed';
|
|
73
|
+
} | {
|
|
74
|
+
status: 'in_progress';
|
|
75
|
+
claimToken?: string;
|
|
76
|
+
attempt?: number;
|
|
77
|
+
phase: Exclude<AutomationRunPhase, 'completed' | 'retryable'>;
|
|
78
|
+
} | {
|
|
79
|
+
status: 'conflict';
|
|
80
|
+
reason: 'identity_mismatch' | 'uncertain';
|
|
81
|
+
phase?: AutomationRunPhase;
|
|
82
|
+
};
|
|
83
|
+
export interface AutomationRunStoreClaimInput extends AutomationRunIdentity {
|
|
84
|
+
request: AutomationRunRequest;
|
|
85
|
+
context: RuntimeHostContext;
|
|
86
|
+
}
|
|
87
|
+
export interface AutomationRunStoreCompletionInput extends AutomationRunStoreClaimInput {
|
|
88
|
+
claimToken: string;
|
|
89
|
+
payload: unknown;
|
|
90
|
+
normalized: NormalizedRunReceipt;
|
|
91
|
+
runnerResult: unknown;
|
|
92
|
+
persistedReceipt: unknown;
|
|
93
|
+
}
|
|
94
|
+
export interface AutomationRunStoreRunnerStartedInput extends AutomationRunStoreClaimInput {
|
|
95
|
+
claimToken: string;
|
|
96
|
+
}
|
|
97
|
+
export interface AutomationRunStoreReceiptPersistedInput extends AutomationRunStoreClaimInput {
|
|
98
|
+
claimToken: string;
|
|
99
|
+
payload: unknown;
|
|
100
|
+
normalized: NormalizedRunReceipt;
|
|
101
|
+
runnerResult: unknown;
|
|
102
|
+
persistedReceipt: unknown;
|
|
103
|
+
}
|
|
104
|
+
export interface AutomationRunStoreReleaseInput extends AutomationRunStoreClaimInput {
|
|
105
|
+
claimToken: string;
|
|
106
|
+
/** retryable is safe only before runner invocation; uncertain is fail-closed. */
|
|
107
|
+
outcome: 'retryable' | 'uncertain';
|
|
108
|
+
phase: AutomationRunPhase;
|
|
109
|
+
error: unknown;
|
|
110
|
+
}
|
|
111
|
+
export interface AutomationRunStoreReadInput extends AutomationRunStoreClaimInput {
|
|
112
|
+
}
|
|
113
|
+
export type AutomationRunStoredState = {
|
|
114
|
+
status: 'completed';
|
|
115
|
+
phase: 'completed';
|
|
116
|
+
payload: unknown;
|
|
117
|
+
normalized?: NormalizedRunReceipt;
|
|
118
|
+
runnerResult?: unknown;
|
|
119
|
+
persistedReceipt?: unknown;
|
|
120
|
+
} | {
|
|
121
|
+
status: 'in_progress' | 'retryable' | 'uncertain' | 'missing';
|
|
122
|
+
phase: Exclude<AutomationRunPhase, 'completed'>;
|
|
123
|
+
attempt?: number;
|
|
124
|
+
error?: unknown;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Durable consumer-owned store for the external run identity. The claim and
|
|
128
|
+
* every phase transition must be atomic in the backing store; a process-local
|
|
129
|
+
* mutex is insufficient. The store compares key, namespace, operation, and
|
|
130
|
+
* fingerprint before accepting a claim, and must never turn uncertain into a
|
|
131
|
+
* retryable record automatically.
|
|
132
|
+
*/
|
|
133
|
+
export interface AutomationRunStorePort {
|
|
134
|
+
claim(input: AutomationRunStoreClaimInput): Awaitable<AutomationRunClaim>;
|
|
135
|
+
markRunnerStarted(input: AutomationRunStoreRunnerStartedInput): Awaitable<unknown>;
|
|
136
|
+
markReceiptPersisted(input: AutomationRunStoreReceiptPersistedInput): Awaitable<unknown>;
|
|
137
|
+
complete(input: AutomationRunStoreCompletionInput): Awaitable<unknown>;
|
|
138
|
+
release(input: AutomationRunStoreReleaseInput): Awaitable<unknown>;
|
|
139
|
+
read(input: AutomationRunStoreReadInput): Awaitable<AutomationRunStoredState>;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Host-owned workflow composition around the portable run state machine.
|
|
143
|
+
*
|
|
144
|
+
* The consumer keeps workflow lookup, authorization/design policy, HITL and
|
|
145
|
+
* database persistence in its own repository. The OSS core only invokes the
|
|
146
|
+
* supplied ports in a deterministic order around the durable run phases.
|
|
147
|
+
*/
|
|
148
|
+
export type AutomationWorkflowGateDecision = true | false | {
|
|
149
|
+
allowed: boolean;
|
|
150
|
+
context?: unknown;
|
|
151
|
+
reason?: string;
|
|
152
|
+
};
|
|
153
|
+
export type AutomationWorkflowLifecyclePhase = 'prepared' | 'claimed' | 'runner_started' | 'receipt_persisted' | 'completed';
|
|
154
|
+
export interface AutomationWorkflowLifecycleInput {
|
|
155
|
+
request: AutomationRunRequest;
|
|
156
|
+
context: RuntimeHostContext;
|
|
157
|
+
identity: AutomationRunIdentity;
|
|
158
|
+
phase: AutomationWorkflowLifecyclePhase;
|
|
159
|
+
workflow?: unknown;
|
|
160
|
+
claimToken?: string;
|
|
161
|
+
previousRunId?: string;
|
|
162
|
+
}
|
|
163
|
+
export interface AutomationWorkflowTransitionInput extends AutomationWorkflowLifecycleInput {
|
|
164
|
+
from: AutomationWorkflowLifecyclePhase;
|
|
165
|
+
to: AutomationWorkflowLifecyclePhase;
|
|
166
|
+
}
|
|
167
|
+
export interface AutomationWorkflowLifecyclePort {
|
|
168
|
+
/** Consumer-owned lookup. A nullish result is a failed lookup. */
|
|
169
|
+
lookup?(input: AutomationWorkflowLifecycleInput): Awaitable<unknown>;
|
|
170
|
+
/** Consumer-owned workflow design/authorization decision. */
|
|
171
|
+
designGate?(input: AutomationWorkflowLifecycleInput): Awaitable<AutomationWorkflowGateDecision>;
|
|
172
|
+
/** Consumer-owned durable checkpoint (usually a DB write). */
|
|
173
|
+
checkpoint?(input: AutomationWorkflowLifecycleInput): Awaitable<unknown>;
|
|
174
|
+
/** Consumer-owned human approval/HITL decision. */
|
|
175
|
+
humanGate?(input: AutomationWorkflowLifecycleInput): Awaitable<AutomationWorkflowGateDecision>;
|
|
176
|
+
/** Consumer-owned transition record or state update. */
|
|
177
|
+
transition?(input: AutomationWorkflowTransitionInput): Awaitable<unknown>;
|
|
178
|
+
}
|
|
179
|
+
export interface AutomationRunPorts extends RuntimeHostPorts {
|
|
180
|
+
runner: AutomationRunnerPort;
|
|
181
|
+
receipt: AutomationReceiptPort;
|
|
182
|
+
runStore: AutomationRunStorePort;
|
|
183
|
+
/** Optional until a consumer opts its existing workflow ports into the core. */
|
|
184
|
+
lifecycle?: AutomationWorkflowLifecyclePort;
|
|
185
|
+
}
|
|
186
|
+
export interface AutomationRunResult {
|
|
187
|
+
runnerResult: unknown;
|
|
188
|
+
normalizedReceipt: NormalizedRunReceipt;
|
|
189
|
+
persistedReceipt: unknown;
|
|
190
|
+
context: RuntimeHostContext;
|
|
191
|
+
replayed?: boolean;
|
|
192
|
+
}
|
|
193
|
+
export declare class AutomationRunService {
|
|
194
|
+
private readonly ports;
|
|
195
|
+
constructor(ports: AutomationRunPorts);
|
|
196
|
+
start(request: AutomationRunRequest): Promise<AutomationRunResult>;
|
|
197
|
+
run(request: AutomationRunRequest): Promise<AutomationRunResult>;
|
|
198
|
+
retry(request: AutomationRunRequest, previousRunId: string): Promise<AutomationRunResult>;
|
|
199
|
+
rerun(request: AutomationRunRequest, previousRunId: string): Promise<AutomationRunResult>;
|
|
200
|
+
history(request: AutomationRunRequest): Promise<unknown>;
|
|
201
|
+
getRun(request: AutomationRunRequest): Promise<unknown>;
|
|
202
|
+
private execute;
|
|
203
|
+
}
|
|
204
|
+
/** Thin compatibility facade for hosts that previously composed a control runtime. */
|
|
205
|
+
export declare class AutomationControlRuntime {
|
|
206
|
+
private readonly service;
|
|
207
|
+
constructor(service: AutomationRunService);
|
|
208
|
+
start(request: AutomationRunRequest): Promise<AutomationRunResult>;
|
|
209
|
+
retry(request: AutomationRunRequest, previousRunId: string): Promise<AutomationRunResult>;
|
|
210
|
+
history(request: AutomationRunRequest): Promise<unknown>;
|
|
211
|
+
getRun(request: AutomationRunRequest): Promise<unknown>;
|
|
212
|
+
}
|
|
213
|
+
export declare function createAutomationRunService(ports: AutomationRunPorts): AutomationRunService;
|