@tomflow/proflow-platform-host 0.1.3 → 0.1.4
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/CONFIGURATION.md +29 -0
- package/dist/deployment/adapter.d.ts +36 -112
- package/dist/deployment/adapter.js +41 -126
- package/dist/deployment/descriptor.d.ts +5 -2
- package/dist/deployment/descriptor.js +33 -8
- package/dist/src/cli.js +1 -19
- package/package.json +10 -21
- package/proflow.module.json +6 -2
- package/CHANGELOG.md +0 -19
package/CONFIGURATION.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# platform-host configuration
|
|
2
|
+
|
|
3
|
+
Canonical public config: `.proflow/config/platform-host.json`
|
|
4
|
+
|
|
5
|
+
This file is Workspace-owned data. `platform uninstall` does not delete it. Values are JSON strings. Raw secrets must not be stored here; `secretRef` fields contain opaque references only.
|
|
6
|
+
|
|
7
|
+
## Fields
|
|
8
|
+
|
|
9
|
+
| Key | Type | Required | Sensitive | Source | Meaning |
|
|
10
|
+
|---|---|---:|---:|---|---|
|
|
11
|
+
| `stateRoot` | `path` | yes | no | User or owning Module supplies an absolute/local path that exists on this Workspace. | Absolute .proflow owner state root |
|
|
12
|
+
| `workspaceRoot` | `path` | yes | no | User or owning Module supplies an absolute/local path that exists on this Workspace. | Absolute Task document workspace root |
|
|
13
|
+
| `gatewayTransportCredentialFile` | `path` | yes | yes | User or owning Module supplies an absolute/local path that exists on this Workspace. | File containing the dedicated credential accepted from agent-gateway |
|
|
14
|
+
| `executionBaseUrl` | `url` | yes | no | User or owning external/runtime Module supplies the reachable endpoint URL. | Loopback Execution Runtime public transport |
|
|
15
|
+
| `executionTransportCredentialFile` | `path` | yes | yes | User or owning Module supplies an absolute/local path that exists on this Workspace. | File containing the credential used for Platform Host calls to Execution Runtime |
|
|
16
|
+
| `modelTransportCredentialFile` | `path` | yes | yes | User or owning Module supplies an absolute/local path that exists on this Workspace. | File containing the credential used for Platform Host calls to Model Runtime |
|
|
17
|
+
| `modelBaseUrl` | `url` | yes | no | User or owning external/runtime Module supplies the reachable endpoint URL. | Loopback Model Runtime public transport |
|
|
18
|
+
|
|
19
|
+
## Materialize
|
|
20
|
+
|
|
21
|
+
Create or update the canonical JSON object at:
|
|
22
|
+
|
|
23
|
+
`.proflow/config/platform-host.json`
|
|
24
|
+
|
|
25
|
+
Use only declared keys and string values. Do not create a second Platform configuration database.
|
|
26
|
+
|
|
27
|
+
## Base completion check
|
|
28
|
+
|
|
29
|
+
Run `platform modules`. This Module should no longer report required keys in `missingConfig`. `platform start` performs the authoritative Module-owned validation before starting anything.
|
|
@@ -12,14 +12,14 @@ type PlatformHostService = {
|
|
|
12
12
|
readiness: "READY" | "NOT_READY";
|
|
13
13
|
}>;
|
|
14
14
|
};
|
|
15
|
-
export declare function createBehaviorAdapter(service?: PlatformHostService): {
|
|
15
|
+
export declare function createBehaviorAdapter(service?: PlatformHostService, config?: Record<string, string>, configValid?: boolean): {
|
|
16
16
|
describe: () => {
|
|
17
17
|
result: {
|
|
18
18
|
readonly contract: "deployment.result.v1";
|
|
19
19
|
readonly ok: true;
|
|
20
20
|
readonly status: "SUCCEEDED";
|
|
21
21
|
readonly moduleRef: "platform-host";
|
|
22
|
-
readonly moduleVersion: "0.1.
|
|
22
|
+
readonly moduleVersion: "0.1.4";
|
|
23
23
|
};
|
|
24
24
|
observedEffects: never[];
|
|
25
25
|
};
|
|
@@ -29,53 +29,22 @@ export declare function createBehaviorAdapter(service?: PlatformHostService): {
|
|
|
29
29
|
readonly ok: true;
|
|
30
30
|
readonly status: "SUCCEEDED";
|
|
31
31
|
readonly moduleRef: "platform-host";
|
|
32
|
-
readonly moduleVersion: "0.1.
|
|
32
|
+
readonly moduleVersion: "0.1.4";
|
|
33
33
|
};
|
|
34
34
|
observedEffects: never[];
|
|
35
35
|
};
|
|
36
36
|
status: () => Promise<{
|
|
37
37
|
result: {
|
|
38
|
-
readonly contract: "deployment.result.v1";
|
|
39
|
-
readonly moduleRef: "platform-host";
|
|
40
|
-
readonly moduleVersion: "0.1.3";
|
|
41
|
-
readonly ok: false;
|
|
42
|
-
readonly status: "ACTION_REQUIRED";
|
|
43
|
-
readonly actionRequired: {
|
|
44
|
-
readonly action: "compose-platform-host";
|
|
45
|
-
readonly description: "Provide validated Host configuration and owner transports";
|
|
46
|
-
};
|
|
47
|
-
} | {
|
|
48
38
|
contract: "deployment.result.v1";
|
|
49
39
|
ok: true;
|
|
50
40
|
status: "SUCCEEDED";
|
|
51
41
|
moduleRef: "platform-host";
|
|
52
|
-
moduleVersion: "0.1.
|
|
42
|
+
moduleVersion: "0.1.4";
|
|
53
43
|
data: {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
id: string;
|
|
58
|
-
status: "FAIL" | "PASS";
|
|
59
|
-
message: string;
|
|
60
|
-
}[];
|
|
61
|
-
} | {
|
|
62
|
-
contract: "deployment.result.v1";
|
|
63
|
-
moduleRef: "platform-host";
|
|
64
|
-
moduleVersion: "0.1.3";
|
|
65
|
-
ok: false;
|
|
66
|
-
status: "ACTION_REQUIRED";
|
|
67
|
-
actionRequired: {
|
|
68
|
-
action: string;
|
|
69
|
-
description: string;
|
|
44
|
+
configStatus: "INCOMPLETE" | "INVALID" | "READY";
|
|
45
|
+
missingConfig?: string[] | undefined;
|
|
46
|
+
runtimeStatus: "FAILED" | "RUNNING" | "STOPPED" | "UNKNOWN";
|
|
70
47
|
};
|
|
71
|
-
data: {
|
|
72
|
-
readiness: "READY" | "NOT_READY";
|
|
73
|
-
} | undefined;
|
|
74
|
-
checks: {
|
|
75
|
-
id: string;
|
|
76
|
-
status: "FAIL" | "PASS";
|
|
77
|
-
message: string;
|
|
78
|
-
}[];
|
|
79
48
|
};
|
|
80
49
|
observedEffects: never[];
|
|
81
50
|
}>;
|
|
@@ -85,7 +54,7 @@ export declare function createBehaviorAdapter(service?: PlatformHostService): {
|
|
|
85
54
|
ok: true;
|
|
86
55
|
status: "SUCCEEDED";
|
|
87
56
|
moduleRef: "platform-host";
|
|
88
|
-
moduleVersion: "0.1.
|
|
57
|
+
moduleVersion: "0.1.4";
|
|
89
58
|
checks: {
|
|
90
59
|
id: string;
|
|
91
60
|
status: "FAIL" | "PASS";
|
|
@@ -94,7 +63,7 @@ export declare function createBehaviorAdapter(service?: PlatformHostService): {
|
|
|
94
63
|
} | {
|
|
95
64
|
contract: "deployment.result.v1";
|
|
96
65
|
moduleRef: "platform-host";
|
|
97
|
-
moduleVersion: "0.1.
|
|
66
|
+
moduleVersion: "0.1.4";
|
|
98
67
|
ok: false;
|
|
99
68
|
status: "ACTION_REQUIRED";
|
|
100
69
|
actionRequired: {
|
|
@@ -109,7 +78,7 @@ export declare function createBehaviorAdapter(service?: PlatformHostService): {
|
|
|
109
78
|
} | {
|
|
110
79
|
contract: "deployment.result.v1";
|
|
111
80
|
moduleRef: "platform-host";
|
|
112
|
-
moduleVersion: "0.1.
|
|
81
|
+
moduleVersion: "0.1.4";
|
|
113
82
|
ok: false;
|
|
114
83
|
status: "ACTION_REQUIRED";
|
|
115
84
|
actionRequired: {
|
|
@@ -130,7 +99,7 @@ export declare function createBehaviorAdapter(service?: PlatformHostService): {
|
|
|
130
99
|
readonly ok: true;
|
|
131
100
|
readonly status: "SUCCEEDED";
|
|
132
101
|
readonly moduleRef: "platform-host";
|
|
133
|
-
readonly moduleVersion: "0.1.
|
|
102
|
+
readonly moduleVersion: "0.1.4";
|
|
134
103
|
};
|
|
135
104
|
observedEffects: never[];
|
|
136
105
|
};
|
|
@@ -138,7 +107,7 @@ export declare function createBehaviorAdapter(service?: PlatformHostService): {
|
|
|
138
107
|
result: {
|
|
139
108
|
readonly contract: "deployment.result.v1";
|
|
140
109
|
readonly moduleRef: "platform-host";
|
|
141
|
-
readonly moduleVersion: "0.1.
|
|
110
|
+
readonly moduleVersion: "0.1.4";
|
|
142
111
|
readonly ok: false;
|
|
143
112
|
readonly status: "ACTION_REQUIRED";
|
|
144
113
|
readonly actionRequired: {
|
|
@@ -150,7 +119,7 @@ export declare function createBehaviorAdapter(service?: PlatformHostService): {
|
|
|
150
119
|
ok: true;
|
|
151
120
|
status: "SUCCEEDED";
|
|
152
121
|
moduleRef: "platform-host";
|
|
153
|
-
moduleVersion: "0.1.
|
|
122
|
+
moduleVersion: "0.1.4";
|
|
154
123
|
data: {
|
|
155
124
|
host: string;
|
|
156
125
|
port: number;
|
|
@@ -164,11 +133,11 @@ export declare function createBehaviorAdapter(service?: PlatformHostService): {
|
|
|
164
133
|
readonly ok: true;
|
|
165
134
|
readonly status: "SUCCEEDED";
|
|
166
135
|
readonly moduleRef: "platform-host";
|
|
167
|
-
readonly moduleVersion: "0.1.
|
|
136
|
+
readonly moduleVersion: "0.1.4";
|
|
168
137
|
} | {
|
|
169
138
|
readonly contract: "deployment.result.v1";
|
|
170
139
|
readonly moduleRef: "platform-host";
|
|
171
|
-
readonly moduleVersion: "0.1.
|
|
140
|
+
readonly moduleVersion: "0.1.4";
|
|
172
141
|
readonly ok: false;
|
|
173
142
|
readonly status: "ACTION_REQUIRED";
|
|
174
143
|
readonly actionRequired: {
|
|
@@ -182,7 +151,7 @@ export declare function createBehaviorAdapter(service?: PlatformHostService): {
|
|
|
182
151
|
result: {
|
|
183
152
|
readonly contract: "deployment.result.v1";
|
|
184
153
|
readonly moduleRef: "platform-host";
|
|
185
|
-
readonly moduleVersion: "0.1.
|
|
154
|
+
readonly moduleVersion: "0.1.4";
|
|
186
155
|
readonly ok: false;
|
|
187
156
|
readonly status: "ACTION_REQUIRED";
|
|
188
157
|
readonly actionRequired: {
|
|
@@ -194,7 +163,7 @@ export declare function createBehaviorAdapter(service?: PlatformHostService): {
|
|
|
194
163
|
ok: true;
|
|
195
164
|
status: "SUCCEEDED";
|
|
196
165
|
moduleRef: "platform-host";
|
|
197
|
-
moduleVersion: "0.1.
|
|
166
|
+
moduleVersion: "0.1.4";
|
|
198
167
|
data: {
|
|
199
168
|
host: string;
|
|
200
169
|
port: number;
|
|
@@ -208,7 +177,7 @@ export declare function createBehaviorAdapter(service?: PlatformHostService): {
|
|
|
208
177
|
readonly ok: true;
|
|
209
178
|
readonly status: "SUCCEEDED";
|
|
210
179
|
readonly moduleRef: "platform-host";
|
|
211
|
-
readonly moduleVersion: "0.1.
|
|
180
|
+
readonly moduleVersion: "0.1.4";
|
|
212
181
|
};
|
|
213
182
|
observedEffects: string[];
|
|
214
183
|
}>;
|
|
@@ -220,7 +189,7 @@ export declare const behaviorAdapter: {
|
|
|
220
189
|
readonly ok: true;
|
|
221
190
|
readonly status: "SUCCEEDED";
|
|
222
191
|
readonly moduleRef: "platform-host";
|
|
223
|
-
readonly moduleVersion: "0.1.
|
|
192
|
+
readonly moduleVersion: "0.1.4";
|
|
224
193
|
};
|
|
225
194
|
observedEffects: never[];
|
|
226
195
|
};
|
|
@@ -230,53 +199,22 @@ export declare const behaviorAdapter: {
|
|
|
230
199
|
readonly ok: true;
|
|
231
200
|
readonly status: "SUCCEEDED";
|
|
232
201
|
readonly moduleRef: "platform-host";
|
|
233
|
-
readonly moduleVersion: "0.1.
|
|
202
|
+
readonly moduleVersion: "0.1.4";
|
|
234
203
|
};
|
|
235
204
|
observedEffects: never[];
|
|
236
205
|
};
|
|
237
206
|
status: () => Promise<{
|
|
238
207
|
result: {
|
|
239
|
-
readonly contract: "deployment.result.v1";
|
|
240
|
-
readonly moduleRef: "platform-host";
|
|
241
|
-
readonly moduleVersion: "0.1.3";
|
|
242
|
-
readonly ok: false;
|
|
243
|
-
readonly status: "ACTION_REQUIRED";
|
|
244
|
-
readonly actionRequired: {
|
|
245
|
-
readonly action: "compose-platform-host";
|
|
246
|
-
readonly description: "Provide validated Host configuration and owner transports";
|
|
247
|
-
};
|
|
248
|
-
} | {
|
|
249
208
|
contract: "deployment.result.v1";
|
|
250
209
|
ok: true;
|
|
251
210
|
status: "SUCCEEDED";
|
|
252
211
|
moduleRef: "platform-host";
|
|
253
|
-
moduleVersion: "0.1.
|
|
212
|
+
moduleVersion: "0.1.4";
|
|
254
213
|
data: {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
id: string;
|
|
259
|
-
status: "FAIL" | "PASS";
|
|
260
|
-
message: string;
|
|
261
|
-
}[];
|
|
262
|
-
} | {
|
|
263
|
-
contract: "deployment.result.v1";
|
|
264
|
-
moduleRef: "platform-host";
|
|
265
|
-
moduleVersion: "0.1.3";
|
|
266
|
-
ok: false;
|
|
267
|
-
status: "ACTION_REQUIRED";
|
|
268
|
-
actionRequired: {
|
|
269
|
-
action: string;
|
|
270
|
-
description: string;
|
|
214
|
+
configStatus: "INCOMPLETE" | "INVALID" | "READY";
|
|
215
|
+
missingConfig?: string[] | undefined;
|
|
216
|
+
runtimeStatus: "FAILED" | "RUNNING" | "STOPPED" | "UNKNOWN";
|
|
271
217
|
};
|
|
272
|
-
data: {
|
|
273
|
-
readiness: "READY" | "NOT_READY";
|
|
274
|
-
} | undefined;
|
|
275
|
-
checks: {
|
|
276
|
-
id: string;
|
|
277
|
-
status: "FAIL" | "PASS";
|
|
278
|
-
message: string;
|
|
279
|
-
}[];
|
|
280
218
|
};
|
|
281
219
|
observedEffects: never[];
|
|
282
220
|
}>;
|
|
@@ -286,7 +224,7 @@ export declare const behaviorAdapter: {
|
|
|
286
224
|
ok: true;
|
|
287
225
|
status: "SUCCEEDED";
|
|
288
226
|
moduleRef: "platform-host";
|
|
289
|
-
moduleVersion: "0.1.
|
|
227
|
+
moduleVersion: "0.1.4";
|
|
290
228
|
checks: {
|
|
291
229
|
id: string;
|
|
292
230
|
status: "FAIL" | "PASS";
|
|
@@ -295,7 +233,7 @@ export declare const behaviorAdapter: {
|
|
|
295
233
|
} | {
|
|
296
234
|
contract: "deployment.result.v1";
|
|
297
235
|
moduleRef: "platform-host";
|
|
298
|
-
moduleVersion: "0.1.
|
|
236
|
+
moduleVersion: "0.1.4";
|
|
299
237
|
ok: false;
|
|
300
238
|
status: "ACTION_REQUIRED";
|
|
301
239
|
actionRequired: {
|
|
@@ -310,7 +248,7 @@ export declare const behaviorAdapter: {
|
|
|
310
248
|
} | {
|
|
311
249
|
contract: "deployment.result.v1";
|
|
312
250
|
moduleRef: "platform-host";
|
|
313
|
-
moduleVersion: "0.1.
|
|
251
|
+
moduleVersion: "0.1.4";
|
|
314
252
|
ok: false;
|
|
315
253
|
status: "ACTION_REQUIRED";
|
|
316
254
|
actionRequired: {
|
|
@@ -331,7 +269,7 @@ export declare const behaviorAdapter: {
|
|
|
331
269
|
readonly ok: true;
|
|
332
270
|
readonly status: "SUCCEEDED";
|
|
333
271
|
readonly moduleRef: "platform-host";
|
|
334
|
-
readonly moduleVersion: "0.1.
|
|
272
|
+
readonly moduleVersion: "0.1.4";
|
|
335
273
|
};
|
|
336
274
|
observedEffects: never[];
|
|
337
275
|
};
|
|
@@ -339,7 +277,7 @@ export declare const behaviorAdapter: {
|
|
|
339
277
|
result: {
|
|
340
278
|
readonly contract: "deployment.result.v1";
|
|
341
279
|
readonly moduleRef: "platform-host";
|
|
342
|
-
readonly moduleVersion: "0.1.
|
|
280
|
+
readonly moduleVersion: "0.1.4";
|
|
343
281
|
readonly ok: false;
|
|
344
282
|
readonly status: "ACTION_REQUIRED";
|
|
345
283
|
readonly actionRequired: {
|
|
@@ -351,7 +289,7 @@ export declare const behaviorAdapter: {
|
|
|
351
289
|
ok: true;
|
|
352
290
|
status: "SUCCEEDED";
|
|
353
291
|
moduleRef: "platform-host";
|
|
354
|
-
moduleVersion: "0.1.
|
|
292
|
+
moduleVersion: "0.1.4";
|
|
355
293
|
data: {
|
|
356
294
|
host: string;
|
|
357
295
|
port: number;
|
|
@@ -365,11 +303,11 @@ export declare const behaviorAdapter: {
|
|
|
365
303
|
readonly ok: true;
|
|
366
304
|
readonly status: "SUCCEEDED";
|
|
367
305
|
readonly moduleRef: "platform-host";
|
|
368
|
-
readonly moduleVersion: "0.1.
|
|
306
|
+
readonly moduleVersion: "0.1.4";
|
|
369
307
|
} | {
|
|
370
308
|
readonly contract: "deployment.result.v1";
|
|
371
309
|
readonly moduleRef: "platform-host";
|
|
372
|
-
readonly moduleVersion: "0.1.
|
|
310
|
+
readonly moduleVersion: "0.1.4";
|
|
373
311
|
readonly ok: false;
|
|
374
312
|
readonly status: "ACTION_REQUIRED";
|
|
375
313
|
readonly actionRequired: {
|
|
@@ -383,7 +321,7 @@ export declare const behaviorAdapter: {
|
|
|
383
321
|
result: {
|
|
384
322
|
readonly contract: "deployment.result.v1";
|
|
385
323
|
readonly moduleRef: "platform-host";
|
|
386
|
-
readonly moduleVersion: "0.1.
|
|
324
|
+
readonly moduleVersion: "0.1.4";
|
|
387
325
|
readonly ok: false;
|
|
388
326
|
readonly status: "ACTION_REQUIRED";
|
|
389
327
|
readonly actionRequired: {
|
|
@@ -395,7 +333,7 @@ export declare const behaviorAdapter: {
|
|
|
395
333
|
ok: true;
|
|
396
334
|
status: "SUCCEEDED";
|
|
397
335
|
moduleRef: "platform-host";
|
|
398
|
-
moduleVersion: "0.1.
|
|
336
|
+
moduleVersion: "0.1.4";
|
|
399
337
|
data: {
|
|
400
338
|
host: string;
|
|
401
339
|
port: number;
|
|
@@ -409,30 +347,16 @@ export declare const behaviorAdapter: {
|
|
|
409
347
|
readonly ok: true;
|
|
410
348
|
readonly status: "SUCCEEDED";
|
|
411
349
|
readonly moduleRef: "platform-host";
|
|
412
|
-
readonly moduleVersion: "0.1.
|
|
350
|
+
readonly moduleVersion: "0.1.4";
|
|
413
351
|
};
|
|
414
352
|
observedEffects: string[];
|
|
415
353
|
}>;
|
|
416
354
|
};
|
|
417
|
-
export declare function createServiceProcessBinding(input: {
|
|
418
|
-
moduleRef: string;
|
|
419
|
-
config: Record<string, string>;
|
|
420
|
-
workspaceRoot: string;
|
|
421
|
-
configByModuleRef: ReadonlyMap<string, Record<string, string>>;
|
|
422
|
-
}): Promise<{
|
|
423
|
-
serviceProcess: {
|
|
424
|
-
contract: "deployment.service-process.v1";
|
|
425
|
-
bin: "proflow-platform-host";
|
|
426
|
-
startCommand: "start";
|
|
427
|
-
config: Record<string, unknown>;
|
|
428
|
-
};
|
|
429
|
-
behaviorAdapter: Record<string, unknown>;
|
|
430
|
-
} | undefined>;
|
|
431
355
|
export declare function createProductionBinding(input: {
|
|
432
356
|
moduleRef: string;
|
|
433
357
|
config: Record<string, string>;
|
|
434
358
|
configByModuleRef: ReadonlyMap<string, Record<string, string>>;
|
|
435
359
|
}): Promise<{
|
|
436
360
|
behaviorAdapter: Record<string, unknown>;
|
|
437
|
-
}
|
|
361
|
+
}>;
|
|
438
362
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { observeDeclaredModuleStatus } from "@tomflow/proflow-module-contract";
|
|
1
2
|
import { descriptor } from "./descriptor.js";
|
|
2
3
|
const base = {
|
|
3
4
|
contract: "deployment.result.v1",
|
|
@@ -15,37 +16,16 @@ const unbound = {
|
|
|
15
16
|
description: "Provide validated Host configuration and owner transports",
|
|
16
17
|
},
|
|
17
18
|
};
|
|
18
|
-
export function createBehaviorAdapter(service) {
|
|
19
|
+
export function createBehaviorAdapter(service, config, configValid = true) {
|
|
19
20
|
return {
|
|
20
21
|
describe: () => ({ result: base, observedEffects: [] }),
|
|
21
22
|
preflight: () => ({ result: base, observedEffects: [] }),
|
|
22
23
|
status: async () => {
|
|
23
24
|
const status = service ? await service.status() : undefined;
|
|
24
25
|
const ready = status?.readiness === "READY";
|
|
26
|
+
const data = observeDeclaredModuleStatus(descriptor, config, ready ? "RUNNING" : service ? "FAILED" : "UNKNOWN", configValid);
|
|
25
27
|
return {
|
|
26
|
-
result:
|
|
27
|
-
? {
|
|
28
|
-
...(ready
|
|
29
|
-
? base
|
|
30
|
-
: {
|
|
31
|
-
...base,
|
|
32
|
-
ok: false,
|
|
33
|
-
status: "ACTION_REQUIRED",
|
|
34
|
-
actionRequired: {
|
|
35
|
-
action: "repair-platform-host",
|
|
36
|
-
description: "Platform Host is not READY",
|
|
37
|
-
},
|
|
38
|
-
}),
|
|
39
|
-
data: status,
|
|
40
|
-
checks: [
|
|
41
|
-
{
|
|
42
|
-
id: "platform-host-readiness",
|
|
43
|
-
status: ready ? "PASS" : "FAIL",
|
|
44
|
-
message: `Platform Host readiness is ${status?.readiness ?? "NOT_READY"}`,
|
|
45
|
-
},
|
|
46
|
-
],
|
|
47
|
-
}
|
|
48
|
-
: unbound,
|
|
28
|
+
result: { ...base, data },
|
|
49
29
|
observedEffects: [],
|
|
50
30
|
};
|
|
51
31
|
},
|
|
@@ -120,94 +100,17 @@ const REQUIRED_CONFIG = [
|
|
|
120
100
|
"modelBaseUrl",
|
|
121
101
|
"modelTransportCredentialFile",
|
|
122
102
|
];
|
|
123
|
-
// Binds the real Host process only when
|
|
124
|
-
//
|
|
125
|
-
//
|
|
126
|
-
|
|
127
|
-
const config = input.config;
|
|
128
|
-
if (!REQUIRED_CONFIG.every((key) => config[key] !== undefined))
|
|
129
|
-
return undefined;
|
|
130
|
-
const executionRuntime = input.configByModuleRef.get("execution-runtime");
|
|
131
|
-
const advertised = executionRuntime?.["identity.endpoint"];
|
|
132
|
-
if (!advertised)
|
|
133
|
-
return undefined;
|
|
134
|
-
const listener = new URL(advertised);
|
|
135
|
-
if (listener.protocol !== "http:" || listener.pathname !== "/")
|
|
136
|
-
return undefined;
|
|
137
|
-
const port = listener.port === "" ? 80 : Number(listener.port);
|
|
138
|
-
if (!Number.isInteger(port) || port <= 0 || port > 65_535)
|
|
139
|
-
return undefined;
|
|
140
|
-
const { parsePlatformHostConfig } = await import("../src/index.js");
|
|
141
|
-
const processConfig = parsePlatformHostConfig({
|
|
142
|
-
stateRoot: config.stateRoot,
|
|
143
|
-
workspaceRoot: config.workspaceRoot,
|
|
144
|
-
host: listener.hostname,
|
|
145
|
-
port,
|
|
146
|
-
executionBaseUrl: config.executionBaseUrl,
|
|
147
|
-
executionTransportCredentialFile: config.executionTransportCredentialFile,
|
|
148
|
-
modelBaseUrl: config.modelBaseUrl,
|
|
149
|
-
modelTransportCredentialFile: config.modelTransportCredentialFile,
|
|
150
|
-
gatewayTransportCredentialFile: config.gatewayTransportCredentialFile,
|
|
151
|
-
roles: [],
|
|
152
|
-
});
|
|
153
|
-
const probeAdapter = {
|
|
154
|
-
describe: behaviorAdapter.describe,
|
|
155
|
-
preflight: behaviorAdapter.preflight,
|
|
156
|
-
verify: async () => {
|
|
157
|
-
let ready = false;
|
|
158
|
-
try {
|
|
159
|
-
ready = (await fetch(new URL("/ready", listener))).ok;
|
|
160
|
-
}
|
|
161
|
-
catch {
|
|
162
|
-
ready = false;
|
|
163
|
-
}
|
|
164
|
-
return {
|
|
165
|
-
result: ready
|
|
166
|
-
? {
|
|
167
|
-
...base,
|
|
168
|
-
checks: [
|
|
169
|
-
{
|
|
170
|
-
id: "platform-host-readiness",
|
|
171
|
-
status: "PASS",
|
|
172
|
-
message: "Managed Platform Host /ready probe passed",
|
|
173
|
-
},
|
|
174
|
-
],
|
|
175
|
-
}
|
|
176
|
-
: {
|
|
177
|
-
...base,
|
|
178
|
-
ok: false,
|
|
179
|
-
status: "ACTION_REQUIRED",
|
|
180
|
-
actionRequired: {
|
|
181
|
-
action: "repair-platform-host",
|
|
182
|
-
description: "Managed Platform Host /ready probe failed",
|
|
183
|
-
},
|
|
184
|
-
checks: [
|
|
185
|
-
{
|
|
186
|
-
id: "platform-host-readiness",
|
|
187
|
-
status: "FAIL",
|
|
188
|
-
message: "Managed Platform Host /ready probe failed",
|
|
189
|
-
},
|
|
190
|
-
],
|
|
191
|
-
},
|
|
192
|
-
observedEffects: [],
|
|
193
|
-
};
|
|
194
|
-
},
|
|
195
|
-
doctor: behaviorAdapter.doctor,
|
|
196
|
-
};
|
|
197
|
-
return {
|
|
198
|
-
serviceProcess: {
|
|
199
|
-
contract: "deployment.service-process.v1",
|
|
200
|
-
bin: "proflow-platform-host",
|
|
201
|
-
startCommand: "start",
|
|
202
|
-
config: processConfig,
|
|
203
|
-
},
|
|
204
|
-
behaviorAdapter: probeAdapter,
|
|
205
|
-
};
|
|
206
|
-
}
|
|
103
|
+
// Binds the real Host process only when materialized owner config and required
|
|
104
|
+
// dependency composition are available. Unbound bindings still carry owner
|
|
105
|
+
// config so status remains authoritative. The heavy src import is deferred
|
|
106
|
+
// until a real binding is requested.
|
|
207
107
|
export async function createProductionBinding(input) {
|
|
208
108
|
const config = input.config;
|
|
109
|
+
const unboundBinding = (configValid = true) => ({
|
|
110
|
+
behaviorAdapter: createBehaviorAdapter(undefined, config, configValid),
|
|
111
|
+
});
|
|
209
112
|
if (!REQUIRED_CONFIG.every((key) => config[key] !== undefined))
|
|
210
|
-
return
|
|
113
|
+
return unboundBinding();
|
|
211
114
|
// The Platform Host's public loopback endpoint is already a cross-module
|
|
212
115
|
// contract: Execution calls it through identity.endpoint. Reuse that
|
|
213
116
|
// materialized endpoint as the listener instead of binding an ephemeral port
|
|
@@ -215,26 +118,38 @@ export async function createProductionBinding(input) {
|
|
|
215
118
|
const executionRuntime = input.configByModuleRef.get("execution-runtime");
|
|
216
119
|
const advertised = executionRuntime?.["identity.endpoint"];
|
|
217
120
|
if (!advertised)
|
|
218
|
-
return
|
|
219
|
-
|
|
121
|
+
return unboundBinding();
|
|
122
|
+
let listener;
|
|
123
|
+
try {
|
|
124
|
+
listener = new URL(advertised);
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
return unboundBinding();
|
|
128
|
+
}
|
|
220
129
|
if (listener.protocol !== "http:" || listener.pathname !== "/")
|
|
221
|
-
return
|
|
130
|
+
return unboundBinding();
|
|
222
131
|
const port = listener.port === "" ? 80 : Number(listener.port);
|
|
223
132
|
if (!Number.isInteger(port) || port <= 0 || port > 65_535)
|
|
224
|
-
return
|
|
133
|
+
return unboundBinding();
|
|
225
134
|
const { createPlatformHost, parsePlatformHostConfig } = await import("../src/index.js");
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
135
|
+
let hostConfig;
|
|
136
|
+
try {
|
|
137
|
+
hostConfig = parsePlatformHostConfig({
|
|
138
|
+
stateRoot: config.stateRoot,
|
|
139
|
+
workspaceRoot: config.workspaceRoot,
|
|
140
|
+
host: listener.hostname,
|
|
141
|
+
port,
|
|
142
|
+
executionBaseUrl: config.executionBaseUrl,
|
|
143
|
+
executionTransportCredentialFile: config.executionTransportCredentialFile,
|
|
144
|
+
modelBaseUrl: config.modelBaseUrl,
|
|
145
|
+
modelTransportCredentialFile: config.modelTransportCredentialFile,
|
|
146
|
+
gatewayTransportCredentialFile: config.gatewayTransportCredentialFile,
|
|
147
|
+
roles: [],
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
catch {
|
|
151
|
+
return unboundBinding(false);
|
|
152
|
+
}
|
|
238
153
|
const host = createPlatformHost({ config: hostConfig });
|
|
239
154
|
const service = {
|
|
240
155
|
start: () => host.start(),
|
|
@@ -242,5 +157,5 @@ export async function createProductionBinding(input) {
|
|
|
242
157
|
restart: () => host.restart(),
|
|
243
158
|
status: async () => ({ readiness: (await host.status()).readiness }),
|
|
244
159
|
};
|
|
245
|
-
return { behaviorAdapter: createBehaviorAdapter(service) };
|
|
160
|
+
return { behaviorAdapter: createBehaviorAdapter(service, input.config) };
|
|
246
161
|
}
|
|
@@ -3,11 +3,10 @@ export declare const descriptor: {
|
|
|
3
3
|
readonly contractVersion: "1.0.0";
|
|
4
4
|
readonly moduleRef: "platform-host";
|
|
5
5
|
readonly packageName: "@tomflow/proflow-platform-host";
|
|
6
|
-
readonly moduleVersion: "0.1.
|
|
6
|
+
readonly moduleVersion: "0.1.4";
|
|
7
7
|
readonly kind: "service";
|
|
8
8
|
readonly templateVersion: "1.0.0";
|
|
9
9
|
readonly platformCompatibility: ">=1.0.0 <2.0.0";
|
|
10
|
-
readonly installClass: "core";
|
|
11
10
|
readonly identity: {
|
|
12
11
|
readonly domain: "platform-architecture";
|
|
13
12
|
readonly summary: "Provides the ProFlow local application composition root that binds Task, Agent, Execution and Model owner transports.";
|
|
@@ -92,5 +91,9 @@ export declare const descriptor: {
|
|
|
92
91
|
readonly id: "overview";
|
|
93
92
|
readonly path: "./README.md";
|
|
94
93
|
readonly description: "Platform Host package overview";
|
|
94
|
+
}, {
|
|
95
|
+
readonly id: "configuration";
|
|
96
|
+
readonly path: "./CONFIGURATION.md";
|
|
97
|
+
readonly description: "Module configuration fields, sources and materialization instructions";
|
|
95
98
|
}];
|
|
96
99
|
};
|
|
@@ -3,24 +3,44 @@ export const descriptor = {
|
|
|
3
3
|
contractVersion: "1.0.0",
|
|
4
4
|
moduleRef: "platform-host",
|
|
5
5
|
packageName: "@tomflow/proflow-platform-host",
|
|
6
|
-
moduleVersion: "0.1.
|
|
6
|
+
moduleVersion: "0.1.4",
|
|
7
7
|
kind: "service",
|
|
8
8
|
templateVersion: "1.0.0",
|
|
9
9
|
platformCompatibility: ">=1.0.0 <2.0.0",
|
|
10
|
-
installClass: "core",
|
|
11
10
|
identity: {
|
|
12
11
|
domain: "platform-architecture",
|
|
13
12
|
summary: "Provides the ProFlow local application composition root that binds Task, Agent, Execution and Model owner transports.",
|
|
14
13
|
},
|
|
15
|
-
provides: [
|
|
14
|
+
provides: [
|
|
15
|
+
{
|
|
16
|
+
contractRef: "platform-host",
|
|
17
|
+
version: "1.0.0",
|
|
18
|
+
},
|
|
19
|
+
],
|
|
16
20
|
requires: [
|
|
17
|
-
{
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
{
|
|
22
|
+
contractRef: "task-orchestration",
|
|
23
|
+
versionRange: ">=1.0.0 <2.0.0",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
contractRef: "agent-runtime",
|
|
27
|
+
versionRange: ">=1.0.0 <2.0.0",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
contractRef: "execution",
|
|
31
|
+
versionRange: ">=1.0.0 <2.0.0",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
contractRef: "model-inference",
|
|
35
|
+
versionRange: ">=1.0.0 <2.0.0",
|
|
36
|
+
},
|
|
21
37
|
],
|
|
22
38
|
requirements: [
|
|
23
|
-
{
|
|
39
|
+
{
|
|
40
|
+
kind: "runtime",
|
|
41
|
+
runtime: "node",
|
|
42
|
+
versionRange: ">=24.19.0",
|
|
43
|
+
},
|
|
24
44
|
],
|
|
25
45
|
configSlots: [
|
|
26
46
|
{
|
|
@@ -104,5 +124,10 @@ export const descriptor = {
|
|
|
104
124
|
path: "./README.md",
|
|
105
125
|
description: "Platform Host package overview",
|
|
106
126
|
},
|
|
127
|
+
{
|
|
128
|
+
id: "configuration",
|
|
129
|
+
path: "./CONFIGURATION.md",
|
|
130
|
+
description: "Module configuration fields, sources and materialization instructions",
|
|
131
|
+
},
|
|
107
132
|
],
|
|
108
133
|
};
|
package/dist/src/cli.js
CHANGED
|
@@ -1,29 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { spawnSync } from "node:child_process";
|
|
3
2
|
import { createPlatformHost, loadPlatformHostConfig } from "./index.js";
|
|
4
|
-
function installSelf() {
|
|
5
|
-
const executable = process.platform === "win32" ? "platform.cmd" : "platform";
|
|
6
|
-
const result = spawnSync(executable, ["install", "@tomflow/proflow-platform-host", "--workspace", process.cwd()], { cwd: process.cwd(), env: process.env, stdio: "inherit" });
|
|
7
|
-
if (result.error) {
|
|
8
|
-
if (result.error.code === "ENOENT") {
|
|
9
|
-
process.stderr.write("GLOBAL_PLATFORM_CLI_REQUIRED: install @tomflow/proflow-platform-cli globally before package-owned install\n");
|
|
10
|
-
process.exit(127);
|
|
11
|
-
}
|
|
12
|
-
throw result.error;
|
|
13
|
-
}
|
|
14
|
-
process.exit(result.status ?? 1);
|
|
15
|
-
}
|
|
16
3
|
async function main() {
|
|
17
4
|
const [command, configPath] = process.argv.slice(2);
|
|
18
5
|
if (command === "--help" || command === "-h") {
|
|
19
|
-
process.stdout.write("Usage: proflow-platform-host
|
|
6
|
+
process.stdout.write("Usage: proflow-platform-host start /absolute/config.json\\n");
|
|
20
7
|
process.exit(0);
|
|
21
8
|
}
|
|
22
|
-
if (command === "install") {
|
|
23
|
-
if (configPath)
|
|
24
|
-
throw new Error("Usage: proflow-platform-host install");
|
|
25
|
-
installSelf();
|
|
26
|
-
}
|
|
27
9
|
if (command !== "start" || !configPath)
|
|
28
10
|
throw new Error("Usage: proflow-platform-host start /absolute/config.json");
|
|
29
11
|
const config = await loadPlatformHostConfig(configPath);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tomflow/proflow-platform-host",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -18,23 +18,24 @@
|
|
|
18
18
|
"dist",
|
|
19
19
|
"proflow.module.json",
|
|
20
20
|
"conformance.json",
|
|
21
|
-
"README.md"
|
|
21
|
+
"README.md",
|
|
22
|
+
"CONFIGURATION.md"
|
|
22
23
|
],
|
|
23
24
|
"dependencies": {
|
|
24
25
|
"zod": "4.1.12",
|
|
26
|
+
"@tomflow/proflow-agent-runtime": "^0.1.2",
|
|
25
27
|
"@tomflow/proflow-task-migration-runner": "^0.1.2",
|
|
26
|
-
"@tomflow/proflow-agent-runtime": "^0.1.1",
|
|
27
28
|
"@tomflow/proflow-execution-browser-extension": "^0.1.3",
|
|
28
|
-
"@tomflow/proflow-execution-contracts": "^0.1.2",
|
|
29
29
|
"@tomflow/proflow-task-store-sqlite": "^0.1.2",
|
|
30
|
-
"@tomflow/proflow-task-orchestration": "^0.1.1"
|
|
30
|
+
"@tomflow/proflow-task-orchestration": "^0.1.1",
|
|
31
|
+
"@tomflow/proflow-module-contract": "^0.1.1",
|
|
32
|
+
"@tomflow/proflow-execution-contracts": "^0.1.2"
|
|
31
33
|
},
|
|
32
34
|
"devDependencies": {
|
|
33
|
-
"@tomflow/proflow-
|
|
34
|
-
"@tomflow/proflow-module-contract": "^0.1.1",
|
|
35
|
+
"@tomflow/proflow-agent-gateway": "^0.1.4",
|
|
35
36
|
"@tomflow/proflow-deployment-conformance": "^0.1.2",
|
|
36
|
-
"@tomflow/proflow-
|
|
37
|
-
"@tomflow/proflow-
|
|
37
|
+
"@tomflow/proflow-execution-runtime": "^0.1.5",
|
|
38
|
+
"@tomflow/proflow-model-runtime": "^0.1.5"
|
|
38
39
|
},
|
|
39
40
|
"description": "Provides the ProFlow local application composition root that binds Task, Agent, Execution and Model owner transports.",
|
|
40
41
|
"keywords": [
|
|
@@ -44,19 +45,7 @@
|
|
|
44
45
|
],
|
|
45
46
|
"proflow": {
|
|
46
47
|
"module": true,
|
|
47
|
-
"installClass": "core",
|
|
48
48
|
"descriptor": "./dist/deployment/descriptor.js",
|
|
49
|
-
"installRequires": [
|
|
50
|
-
"@tomflow/proflow-agent-runtime",
|
|
51
|
-
"@tomflow/proflow-execution-browser-extension",
|
|
52
|
-
"@tomflow/proflow-execution-contracts",
|
|
53
|
-
"@tomflow/proflow-execution-runtime",
|
|
54
|
-
"@tomflow/proflow-model-contracts",
|
|
55
|
-
"@tomflow/proflow-model-runtime",
|
|
56
|
-
"@tomflow/proflow-task-migration-runner",
|
|
57
|
-
"@tomflow/proflow-task-orchestration",
|
|
58
|
-
"@tomflow/proflow-task-store-sqlite"
|
|
59
|
-
],
|
|
60
49
|
"manifest": "./proflow.module.json"
|
|
61
50
|
},
|
|
62
51
|
"scripts": {
|
package/proflow.module.json
CHANGED
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
"contractVersion": "1.0.0",
|
|
4
4
|
"moduleRef": "platform-host",
|
|
5
5
|
"packageName": "@tomflow/proflow-platform-host",
|
|
6
|
-
"moduleVersion": "0.1.
|
|
6
|
+
"moduleVersion": "0.1.4",
|
|
7
7
|
"kind": "service",
|
|
8
8
|
"templateVersion": "1.0.0",
|
|
9
9
|
"platformCompatibility": ">=1.0.0 <2.0.0",
|
|
10
|
-
"installClass": "core",
|
|
11
10
|
"identity": {
|
|
12
11
|
"domain": "platform-architecture",
|
|
13
12
|
"summary": "Provides the ProFlow local application composition root that binds Task, Agent, Execution and Model owner transports."
|
|
@@ -124,6 +123,11 @@
|
|
|
124
123
|
"id": "overview",
|
|
125
124
|
"path": "./README.md",
|
|
126
125
|
"description": "Platform Host package overview"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"id": "configuration",
|
|
129
|
+
"path": "./CONFIGURATION.md",
|
|
130
|
+
"description": "Module configuration fields, sources and materialization instructions"
|
|
127
131
|
}
|
|
128
132
|
]
|
|
129
133
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# @tomflow/proflow-platform-host
|
|
2
|
-
|
|
3
|
-
## 0.1.3
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- Real-1 final remediation and black-box release closure
|
|
8
|
-
|
|
9
|
-
## 0.1.2
|
|
10
|
-
|
|
11
|
-
### Patch Changes
|
|
12
|
-
|
|
13
|
-
- Close the Real-1 global Platform control-plane contract across every published ProFlow package. Platform CLI now owns one durable global Workspace binding with canonical identity, cross-process operation locking, cwd/`--workspace` install targeting, cross-directory instance commands, whole-instance uninstall/rebind, and deterministic npm/yarn/pnpm Workspace package-manager selection. Every package-owned install entry, including newly generated Module Template packages, delegates to the Shell-global `platform` command and fails closed when that global CLI is unavailable; Deployment Conformance and the formal test plans mechanically enforce the same rule across all 24 packages.
|
|
14
|
-
|
|
15
|
-
## 0.1.1
|
|
16
|
-
|
|
17
|
-
### Patch Changes
|
|
18
|
-
|
|
19
|
-
- Close Real-1 deployment graph and Fresh Workspace bootstrap gaps: remove Contract-library runtime-provider aliases, correct Execution/Model dependency direction, materialize logical/moduleRef providers through `installRequires`, enforce repository graph validation, and keep self-install executables stable without package-manager worktree mutation.
|