@tomflow/proflow-execution-runtime 0.1.0
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/README.md +5 -0
- package/conformance.json +4 -0
- package/dist/deployment/adapter.d.ts +458 -0
- package/dist/deployment/adapter.js +265 -0
- package/dist/deployment/descriptor.d.ts +105 -0
- package/dist/deployment/descriptor.js +123 -0
- package/dist/deployment/requirements.d.ts +5 -0
- package/dist/deployment/requirements.js +5 -0
- package/dist/deployment/verification.d.ts +3 -0
- package/dist/deployment/verification.js +7 -0
- package/dist/src/approval-owner.d.ts +40 -0
- package/dist/src/approval-owner.js +278 -0
- package/dist/src/browser-vision-client.d.ts +15 -0
- package/dist/src/browser-vision-client.js +79 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +50 -0
- package/dist/src/executor-port.d.ts +5 -0
- package/dist/src/executor-port.js +1 -0
- package/dist/src/executors/local-adapter.d.ts +4 -0
- package/dist/src/executors/local-adapter.js +55 -0
- package/dist/src/formal-process.d.ts +20 -0
- package/dist/src/formal-process.js +161 -0
- package/dist/src/index.d.ts +122 -0
- package/dist/src/index.js +983 -0
- package/dist/src/model-decision-client.d.ts +10 -0
- package/dist/src/model-decision-client.js +244 -0
- package/dist/src/service.d.ts +67 -0
- package/dist/src/service.js +473 -0
- package/package.json +56 -0
- package/proflow.module.json +139 -0
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { descriptor } from "./descriptor.js";
|
|
2
|
+
const base = {
|
|
3
|
+
contract: "deployment.result.v1",
|
|
4
|
+
ok: true,
|
|
5
|
+
status: "SUCCEEDED",
|
|
6
|
+
moduleRef: descriptor.moduleRef,
|
|
7
|
+
moduleVersion: descriptor.moduleVersion,
|
|
8
|
+
};
|
|
9
|
+
const unbound = {
|
|
10
|
+
...base,
|
|
11
|
+
ok: false,
|
|
12
|
+
status: "ACTION_REQUIRED",
|
|
13
|
+
actionRequired: {
|
|
14
|
+
action: "bind-runtime",
|
|
15
|
+
description: "Bind a configured Execution Runtime service",
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
export function createBehaviorAdapter(service) {
|
|
19
|
+
return {
|
|
20
|
+
describe: () => ({ result: base, observedEffects: [] }),
|
|
21
|
+
preflight: () => ({ result: base, observedEffects: [] }),
|
|
22
|
+
status: () => {
|
|
23
|
+
const status = service?.status();
|
|
24
|
+
const ready = status?.readiness === "READY";
|
|
25
|
+
return {
|
|
26
|
+
result: service
|
|
27
|
+
? {
|
|
28
|
+
...(ready
|
|
29
|
+
? base
|
|
30
|
+
: {
|
|
31
|
+
...base,
|
|
32
|
+
ok: false,
|
|
33
|
+
status: "ACTION_REQUIRED",
|
|
34
|
+
actionRequired: {
|
|
35
|
+
action: "repair-execution-runtime",
|
|
36
|
+
description: "Execution Runtime is not READY",
|
|
37
|
+
},
|
|
38
|
+
}),
|
|
39
|
+
data: status,
|
|
40
|
+
checks: [
|
|
41
|
+
{
|
|
42
|
+
id: "execution-runtime-readiness",
|
|
43
|
+
status: ready ? "PASS" : "FAIL",
|
|
44
|
+
message: `Execution Runtime readiness is ${status?.readiness ?? "NOT_READY"}`,
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
}
|
|
48
|
+
: unbound,
|
|
49
|
+
observedEffects: [],
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
verify: () => {
|
|
53
|
+
const status = service?.status();
|
|
54
|
+
const ready = status?.readiness === "READY";
|
|
55
|
+
return {
|
|
56
|
+
result: {
|
|
57
|
+
...(service && ready
|
|
58
|
+
? base
|
|
59
|
+
: service
|
|
60
|
+
? {
|
|
61
|
+
...base,
|
|
62
|
+
ok: false,
|
|
63
|
+
status: "ACTION_REQUIRED",
|
|
64
|
+
actionRequired: {
|
|
65
|
+
action: "repair-execution-runtime",
|
|
66
|
+
description: "Execution Runtime is not READY",
|
|
67
|
+
},
|
|
68
|
+
}
|
|
69
|
+
: unbound),
|
|
70
|
+
checks: [
|
|
71
|
+
{
|
|
72
|
+
id: "execution-runtime-critical-proofs",
|
|
73
|
+
status: ready ? "PASS" : "FAIL",
|
|
74
|
+
message: service
|
|
75
|
+
? `Execution Runtime readiness is ${status?.readiness ?? "NOT_READY"}`
|
|
76
|
+
: "No configured Execution Runtime process is bound",
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
observedEffects: [],
|
|
81
|
+
};
|
|
82
|
+
},
|
|
83
|
+
doctor: () => ({ result: base, observedEffects: [] }),
|
|
84
|
+
start: async () => ({
|
|
85
|
+
result: service ? { ...base, data: await service.start() } : unbound,
|
|
86
|
+
observedEffects: service
|
|
87
|
+
? [...descriptor.effects.map((item) => item.description)]
|
|
88
|
+
: [],
|
|
89
|
+
}),
|
|
90
|
+
stop: async () => {
|
|
91
|
+
if (service)
|
|
92
|
+
await service.stop();
|
|
93
|
+
return {
|
|
94
|
+
result: service ? base : unbound,
|
|
95
|
+
observedEffects: service
|
|
96
|
+
? [...descriptor.effects.map((item) => item.description)]
|
|
97
|
+
: [],
|
|
98
|
+
};
|
|
99
|
+
},
|
|
100
|
+
uninstall: async () => {
|
|
101
|
+
if (service)
|
|
102
|
+
await service.stop();
|
|
103
|
+
return {
|
|
104
|
+
result: service ? base : unbound,
|
|
105
|
+
observedEffects: service
|
|
106
|
+
? descriptor.effects
|
|
107
|
+
.filter((item) => item.retention === "remove")
|
|
108
|
+
.map((item) => item.description)
|
|
109
|
+
: [],
|
|
110
|
+
};
|
|
111
|
+
},
|
|
112
|
+
restart: async () => ({
|
|
113
|
+
result: service ? { ...base, data: await service.restart() } : unbound,
|
|
114
|
+
observedEffects: service
|
|
115
|
+
? [...descriptor.effects.map((item) => item.description)]
|
|
116
|
+
: [],
|
|
117
|
+
}),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
export const behaviorAdapter = createBehaviorAdapter();
|
|
121
|
+
export async function createServiceProcessBinding(input) {
|
|
122
|
+
const required = [
|
|
123
|
+
"databasePath",
|
|
124
|
+
"projectRoot",
|
|
125
|
+
"artifactRoot",
|
|
126
|
+
"browserExecutorConfigPath",
|
|
127
|
+
"transportCredentialFile",
|
|
128
|
+
"identity.endpoint",
|
|
129
|
+
"identity.tokenFile",
|
|
130
|
+
"modelDecision.endpoint",
|
|
131
|
+
"modelDecision.credentialFile",
|
|
132
|
+
];
|
|
133
|
+
if (!required.every((key) => input.config[key]))
|
|
134
|
+
return undefined;
|
|
135
|
+
const platformHost = input.configByModuleRef.get("platform-host");
|
|
136
|
+
const advertised = platformHost?.executionBaseUrl;
|
|
137
|
+
if (!advertised)
|
|
138
|
+
return undefined;
|
|
139
|
+
const listener = new URL(advertised);
|
|
140
|
+
if (listener.protocol !== "http:" || listener.pathname !== "/")
|
|
141
|
+
return undefined;
|
|
142
|
+
const port = listener.port === "" ? 80 : Number(listener.port);
|
|
143
|
+
if (!Number.isInteger(port) || port <= 0 || port > 65_535)
|
|
144
|
+
return undefined;
|
|
145
|
+
const { parseExecutionRuntimeProcessConfig } = await import("../src/service.js");
|
|
146
|
+
const processConfig = parseExecutionRuntimeProcessConfig({
|
|
147
|
+
host: listener.hostname,
|
|
148
|
+
port,
|
|
149
|
+
databasePath: input.config.databasePath,
|
|
150
|
+
projectRoot: input.config.projectRoot,
|
|
151
|
+
artifactRoot: input.config.artifactRoot,
|
|
152
|
+
browserExecutorConfigPath: input.config.browserExecutorConfigPath,
|
|
153
|
+
transportCredentialFile: input.config.transportCredentialFile,
|
|
154
|
+
identity: {
|
|
155
|
+
endpoint: input.config["identity.endpoint"],
|
|
156
|
+
tokenFile: input.config["identity.tokenFile"],
|
|
157
|
+
},
|
|
158
|
+
modelDecision: {
|
|
159
|
+
endpoint: input.config["modelDecision.endpoint"],
|
|
160
|
+
credentialFile: input.config["modelDecision.credentialFile"],
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
const probeAdapter = {
|
|
164
|
+
describe: behaviorAdapter.describe,
|
|
165
|
+
preflight: behaviorAdapter.preflight,
|
|
166
|
+
verify: async () => {
|
|
167
|
+
let ready = false;
|
|
168
|
+
try {
|
|
169
|
+
ready = (await fetch(new URL("/ready", listener))).ok;
|
|
170
|
+
}
|
|
171
|
+
catch {
|
|
172
|
+
ready = false;
|
|
173
|
+
}
|
|
174
|
+
return {
|
|
175
|
+
result: ready
|
|
176
|
+
? {
|
|
177
|
+
...base,
|
|
178
|
+
checks: [
|
|
179
|
+
{
|
|
180
|
+
id: "execution-runtime-critical-proofs",
|
|
181
|
+
status: "PASS",
|
|
182
|
+
message: "Managed Execution Runtime /ready probe passed",
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
}
|
|
186
|
+
: {
|
|
187
|
+
...base,
|
|
188
|
+
ok: false,
|
|
189
|
+
status: "ACTION_REQUIRED",
|
|
190
|
+
actionRequired: {
|
|
191
|
+
action: "repair-execution-runtime",
|
|
192
|
+
description: "Managed Execution Runtime /ready probe failed",
|
|
193
|
+
},
|
|
194
|
+
checks: [
|
|
195
|
+
{
|
|
196
|
+
id: "execution-runtime-critical-proofs",
|
|
197
|
+
status: "FAIL",
|
|
198
|
+
message: "Managed Execution Runtime /ready probe failed",
|
|
199
|
+
},
|
|
200
|
+
],
|
|
201
|
+
},
|
|
202
|
+
observedEffects: [],
|
|
203
|
+
};
|
|
204
|
+
},
|
|
205
|
+
doctor: behaviorAdapter.doctor,
|
|
206
|
+
};
|
|
207
|
+
return {
|
|
208
|
+
serviceProcess: {
|
|
209
|
+
contract: "deployment.service-process.v1",
|
|
210
|
+
bin: "proflow-execution-runtime",
|
|
211
|
+
startCommand: "start",
|
|
212
|
+
config: processConfig,
|
|
213
|
+
},
|
|
214
|
+
behaviorAdapter: probeAdapter,
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
export async function createProductionBinding(input) {
|
|
218
|
+
const required = [
|
|
219
|
+
"databasePath",
|
|
220
|
+
"projectRoot",
|
|
221
|
+
"artifactRoot",
|
|
222
|
+
"browserExecutorConfigPath",
|
|
223
|
+
"transportCredentialFile",
|
|
224
|
+
"identity.endpoint",
|
|
225
|
+
"identity.tokenFile",
|
|
226
|
+
"modelDecision.endpoint",
|
|
227
|
+
"modelDecision.credentialFile",
|
|
228
|
+
];
|
|
229
|
+
if (!required.every((key) => input.config[key]))
|
|
230
|
+
return undefined;
|
|
231
|
+
const platformHost = input.configByModuleRef.get("platform-host");
|
|
232
|
+
const advertised = platformHost?.executionBaseUrl;
|
|
233
|
+
if (!advertised)
|
|
234
|
+
return undefined;
|
|
235
|
+
const listener = new URL(advertised);
|
|
236
|
+
if (listener.protocol !== "http:" || listener.pathname !== "/")
|
|
237
|
+
return undefined;
|
|
238
|
+
const port = listener.port === "" ? 80 : Number(listener.port);
|
|
239
|
+
if (!Number.isInteger(port) || port <= 0 || port > 65_535)
|
|
240
|
+
return undefined;
|
|
241
|
+
const [{ createFormalExecutionRuntimeLifecycle }, { parseExecutionRuntimeProcessConfig },] = await Promise.all([
|
|
242
|
+
import("../src/formal-process.js"),
|
|
243
|
+
import("../src/service.js"),
|
|
244
|
+
]);
|
|
245
|
+
const service = createFormalExecutionRuntimeLifecycle({
|
|
246
|
+
config: parseExecutionRuntimeProcessConfig({
|
|
247
|
+
host: listener.hostname,
|
|
248
|
+
port,
|
|
249
|
+
databasePath: input.config.databasePath,
|
|
250
|
+
projectRoot: input.config.projectRoot,
|
|
251
|
+
artifactRoot: input.config.artifactRoot,
|
|
252
|
+
browserExecutorConfigPath: input.config.browserExecutorConfigPath,
|
|
253
|
+
transportCredentialFile: input.config.transportCredentialFile,
|
|
254
|
+
identity: {
|
|
255
|
+
endpoint: input.config["identity.endpoint"],
|
|
256
|
+
tokenFile: input.config["identity.tokenFile"],
|
|
257
|
+
},
|
|
258
|
+
modelDecision: {
|
|
259
|
+
endpoint: input.config["modelDecision.endpoint"],
|
|
260
|
+
credentialFile: input.config["modelDecision.credentialFile"],
|
|
261
|
+
},
|
|
262
|
+
}),
|
|
263
|
+
});
|
|
264
|
+
return { behaviorAdapter: createBehaviorAdapter(service) };
|
|
265
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
export declare const descriptor: {
|
|
2
|
+
readonly contract: "module";
|
|
3
|
+
readonly contractVersion: "1.0.0";
|
|
4
|
+
readonly moduleRef: "execution-runtime";
|
|
5
|
+
readonly packageName: "@tomflow/proflow-execution-runtime";
|
|
6
|
+
readonly moduleVersion: "0.1.0";
|
|
7
|
+
readonly kind: "service";
|
|
8
|
+
readonly templateVersion: "1.0.0";
|
|
9
|
+
readonly platformCompatibility: ">=1.0.0 <2.0.0";
|
|
10
|
+
readonly installClass: "core";
|
|
11
|
+
readonly identity: {
|
|
12
|
+
readonly domain: "execution";
|
|
13
|
+
readonly summary: "Durable, policy-controlled Execution Core orchestration over SQLite and controlled executor ports.";
|
|
14
|
+
};
|
|
15
|
+
readonly provides: readonly [{
|
|
16
|
+
readonly contractRef: "execution";
|
|
17
|
+
readonly version: "1.0.0";
|
|
18
|
+
}];
|
|
19
|
+
readonly requires: readonly [{
|
|
20
|
+
readonly contractRef: "execution-local";
|
|
21
|
+
readonly versionRange: ">=1.0.0 <2.0.0";
|
|
22
|
+
}];
|
|
23
|
+
readonly requirements: readonly [{
|
|
24
|
+
readonly kind: "runtime";
|
|
25
|
+
readonly runtime: "node";
|
|
26
|
+
readonly versionRange: ">=24.19.0";
|
|
27
|
+
}, {
|
|
28
|
+
readonly kind: "filesystem";
|
|
29
|
+
readonly path: ".proflow";
|
|
30
|
+
readonly access: "read-write";
|
|
31
|
+
}];
|
|
32
|
+
readonly configSlots: readonly [{
|
|
33
|
+
readonly key: "databasePath";
|
|
34
|
+
readonly type: "path";
|
|
35
|
+
readonly required: true;
|
|
36
|
+
readonly description: "Execution SQLite database";
|
|
37
|
+
}, {
|
|
38
|
+
readonly key: "projectRoot";
|
|
39
|
+
readonly type: "path";
|
|
40
|
+
readonly required: true;
|
|
41
|
+
readonly description: "Canonical project boundary consumed by the local executor";
|
|
42
|
+
}, {
|
|
43
|
+
readonly key: "artifactRoot";
|
|
44
|
+
readonly type: "path";
|
|
45
|
+
readonly required: true;
|
|
46
|
+
readonly description: "Execution-owned Artifact/Evidence filesystem root";
|
|
47
|
+
}, {
|
|
48
|
+
readonly key: "browserExecutorConfigPath";
|
|
49
|
+
readonly type: "path";
|
|
50
|
+
readonly required: true;
|
|
51
|
+
readonly description: "Absolute configuration path for the formal Browser Reality Bridge composition";
|
|
52
|
+
}, {
|
|
53
|
+
readonly key: "transportCredentialFile";
|
|
54
|
+
readonly type: "path";
|
|
55
|
+
readonly required: true;
|
|
56
|
+
readonly sensitive: true;
|
|
57
|
+
readonly description: "File containing the Execution Runtime transport credential";
|
|
58
|
+
}, {
|
|
59
|
+
readonly key: "identity.endpoint";
|
|
60
|
+
readonly type: "url";
|
|
61
|
+
readonly required: true;
|
|
62
|
+
readonly description: "Loopback platform-host execution identity endpoint";
|
|
63
|
+
}, {
|
|
64
|
+
readonly key: "identity.tokenFile";
|
|
65
|
+
readonly type: "path";
|
|
66
|
+
readonly required: true;
|
|
67
|
+
readonly sensitive: true;
|
|
68
|
+
readonly description: "File containing the Execution-to-platform-host identity transport credential";
|
|
69
|
+
}, {
|
|
70
|
+
readonly key: "modelDecision.endpoint";
|
|
71
|
+
readonly type: "url";
|
|
72
|
+
readonly required: true;
|
|
73
|
+
readonly description: "Loopback Model Runtime endpoint used by execution.command-risk.v1";
|
|
74
|
+
}, {
|
|
75
|
+
readonly key: "modelDecision.credentialFile";
|
|
76
|
+
readonly type: "path";
|
|
77
|
+
readonly required: true;
|
|
78
|
+
readonly sensitive: true;
|
|
79
|
+
readonly description: "File containing the Execution-to-Model transport credential";
|
|
80
|
+
}];
|
|
81
|
+
readonly lifecycle: {
|
|
82
|
+
readonly supported: readonly ["describe", "preflight", "status", "verify", "doctor", "start", "stop", "restart", "uninstall"];
|
|
83
|
+
};
|
|
84
|
+
readonly verification: {
|
|
85
|
+
readonly checks: readonly [{
|
|
86
|
+
readonly id: "execution-runtime-critical-proofs";
|
|
87
|
+
readonly description: "Execution Runtime critical proofs pass";
|
|
88
|
+
readonly lifecycle: "verify";
|
|
89
|
+
}];
|
|
90
|
+
};
|
|
91
|
+
readonly effects: readonly [{
|
|
92
|
+
readonly kind: "process";
|
|
93
|
+
readonly description: "Runs the single backend Execution Runtime service";
|
|
94
|
+
readonly retention: "remove";
|
|
95
|
+
}, {
|
|
96
|
+
readonly kind: "filesystem";
|
|
97
|
+
readonly description: "Persists execution state, output references and evidence in WAL SQLite";
|
|
98
|
+
readonly retention: "preserve";
|
|
99
|
+
}];
|
|
100
|
+
readonly documentation: readonly [{
|
|
101
|
+
readonly id: "overview";
|
|
102
|
+
readonly path: "./README.md";
|
|
103
|
+
readonly description: "Execution Runtime package overview";
|
|
104
|
+
}];
|
|
105
|
+
};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
export const descriptor = {
|
|
2
|
+
contract: "module",
|
|
3
|
+
contractVersion: "1.0.0",
|
|
4
|
+
moduleRef: "execution-runtime",
|
|
5
|
+
packageName: "@tomflow/proflow-execution-runtime",
|
|
6
|
+
moduleVersion: "0.1.0",
|
|
7
|
+
kind: "service",
|
|
8
|
+
templateVersion: "1.0.0",
|
|
9
|
+
platformCompatibility: ">=1.0.0 <2.0.0",
|
|
10
|
+
installClass: "core",
|
|
11
|
+
identity: {
|
|
12
|
+
domain: "execution",
|
|
13
|
+
summary: "Durable, policy-controlled Execution Core orchestration over SQLite and controlled executor ports.",
|
|
14
|
+
},
|
|
15
|
+
provides: [{ contractRef: "execution", version: "1.0.0" }],
|
|
16
|
+
requires: [
|
|
17
|
+
{ contractRef: "execution-local", versionRange: ">=1.0.0 <2.0.0" },
|
|
18
|
+
],
|
|
19
|
+
requirements: [
|
|
20
|
+
{ kind: "runtime", runtime: "node", versionRange: ">=24.19.0" },
|
|
21
|
+
{ kind: "filesystem", path: ".proflow", access: "read-write" },
|
|
22
|
+
],
|
|
23
|
+
configSlots: [
|
|
24
|
+
{
|
|
25
|
+
key: "databasePath",
|
|
26
|
+
type: "path",
|
|
27
|
+
required: true,
|
|
28
|
+
description: "Execution SQLite database",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
key: "projectRoot",
|
|
32
|
+
type: "path",
|
|
33
|
+
required: true,
|
|
34
|
+
description: "Canonical project boundary consumed by the local executor",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
key: "artifactRoot",
|
|
38
|
+
type: "path",
|
|
39
|
+
required: true,
|
|
40
|
+
description: "Execution-owned Artifact/Evidence filesystem root",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
key: "browserExecutorConfigPath",
|
|
44
|
+
type: "path",
|
|
45
|
+
required: true,
|
|
46
|
+
description: "Absolute configuration path for the formal Browser Reality Bridge composition",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
key: "transportCredentialFile",
|
|
50
|
+
type: "path",
|
|
51
|
+
required: true,
|
|
52
|
+
sensitive: true,
|
|
53
|
+
description: "File containing the Execution Runtime transport credential",
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
key: "identity.endpoint",
|
|
57
|
+
type: "url",
|
|
58
|
+
required: true,
|
|
59
|
+
description: "Loopback platform-host execution identity endpoint",
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
key: "identity.tokenFile",
|
|
63
|
+
type: "path",
|
|
64
|
+
required: true,
|
|
65
|
+
sensitive: true,
|
|
66
|
+
description: "File containing the Execution-to-platform-host identity transport credential",
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
key: "modelDecision.endpoint",
|
|
70
|
+
type: "url",
|
|
71
|
+
required: true,
|
|
72
|
+
description: "Loopback Model Runtime endpoint used by execution.command-risk.v1",
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
key: "modelDecision.credentialFile",
|
|
76
|
+
type: "path",
|
|
77
|
+
required: true,
|
|
78
|
+
sensitive: true,
|
|
79
|
+
description: "File containing the Execution-to-Model transport credential",
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
lifecycle: {
|
|
83
|
+
supported: [
|
|
84
|
+
"describe",
|
|
85
|
+
"preflight",
|
|
86
|
+
"status",
|
|
87
|
+
"verify",
|
|
88
|
+
"doctor",
|
|
89
|
+
"start",
|
|
90
|
+
"stop",
|
|
91
|
+
"restart",
|
|
92
|
+
"uninstall",
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
verification: {
|
|
96
|
+
checks: [
|
|
97
|
+
{
|
|
98
|
+
id: "execution-runtime-critical-proofs",
|
|
99
|
+
description: "Execution Runtime critical proofs pass",
|
|
100
|
+
lifecycle: "verify",
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
},
|
|
104
|
+
effects: [
|
|
105
|
+
{
|
|
106
|
+
kind: "process",
|
|
107
|
+
description: "Runs the single backend Execution Runtime service",
|
|
108
|
+
retention: "remove",
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
kind: "filesystem",
|
|
112
|
+
description: "Persists execution state, output references and evidence in WAL SQLite",
|
|
113
|
+
retention: "preserve",
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
documentation: [
|
|
117
|
+
{
|
|
118
|
+
id: "overview",
|
|
119
|
+
path: "./README.md",
|
|
120
|
+
description: "Execution Runtime package overview",
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type ExecuteCapabilityRequest, type ExecutionApprovalRecord } from "@tomflow/proflow-execution-contracts";
|
|
2
|
+
import type { ExecutorPrecondition } from "./executor-port.ts";
|
|
3
|
+
export declare class ExecutionApprovalOwnerError extends Error {
|
|
4
|
+
readonly code: string;
|
|
5
|
+
constructor(code: string, message: string);
|
|
6
|
+
}
|
|
7
|
+
export declare function createExecutionApprovalOwner(input: {
|
|
8
|
+
databasePath: string;
|
|
9
|
+
now?: () => Date;
|
|
10
|
+
idFactory?: () => string;
|
|
11
|
+
}): Readonly<{
|
|
12
|
+
requestApproval: (value: unknown) => ExecutionApprovalRecord;
|
|
13
|
+
ensurePendingApproval: (value: {
|
|
14
|
+
executionRef: string;
|
|
15
|
+
actorRef: string;
|
|
16
|
+
expiresAt: string;
|
|
17
|
+
precondition?: ExecutorPrecondition;
|
|
18
|
+
}) => ExecutionApprovalRecord;
|
|
19
|
+
decideApproval: (value: unknown) => ExecutionApprovalRecord;
|
|
20
|
+
revokeApproval: (value: unknown) => ExecutionApprovalRecord;
|
|
21
|
+
getApproval: (approvalRef: string) => ExecutionApprovalRecord;
|
|
22
|
+
listApprovals: (filter?: {
|
|
23
|
+
executionRef?: string;
|
|
24
|
+
status?: string;
|
|
25
|
+
}) => ExecutionApprovalRecord[];
|
|
26
|
+
validate: (value: {
|
|
27
|
+
approvalRef: string;
|
|
28
|
+
executionRef: string;
|
|
29
|
+
callerRef: string;
|
|
30
|
+
taskId?: string;
|
|
31
|
+
capability: string;
|
|
32
|
+
inputFingerprint: string;
|
|
33
|
+
request: ExecuteCapabilityRequest;
|
|
34
|
+
projectRoot?: string;
|
|
35
|
+
precondition?: ExecutorPrecondition;
|
|
36
|
+
now: string;
|
|
37
|
+
}) => boolean;
|
|
38
|
+
consume: (approvalRef: string) => ExecutionApprovalRecord;
|
|
39
|
+
close: () => void;
|
|
40
|
+
}>;
|