@tomflow/proflow-platform-host 0.1.2 → 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 -132
- package/dist/deployment/adapter.js +45 -127
- 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 +13 -24
- package/proflow.module.json +6 -2
- package/CHANGELOG.md +0 -13
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.2";
|
|
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.2";
|
|
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,17 +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.
|
|
212
|
-
} | {
|
|
213
|
-
readonly contract: "deployment.result.v1";
|
|
214
|
-
readonly moduleRef: "platform-host";
|
|
215
|
-
readonly moduleVersion: "0.1.2";
|
|
216
|
-
readonly ok: false;
|
|
217
|
-
readonly status: "ACTION_REQUIRED";
|
|
218
|
-
readonly actionRequired: {
|
|
219
|
-
readonly action: "compose-platform-host";
|
|
220
|
-
readonly description: "Provide validated Host configuration and owner transports";
|
|
221
|
-
};
|
|
180
|
+
readonly moduleVersion: "0.1.4";
|
|
222
181
|
};
|
|
223
182
|
observedEffects: string[];
|
|
224
183
|
}>;
|
|
@@ -230,7 +189,7 @@ export declare const behaviorAdapter: {
|
|
|
230
189
|
readonly ok: true;
|
|
231
190
|
readonly status: "SUCCEEDED";
|
|
232
191
|
readonly moduleRef: "platform-host";
|
|
233
|
-
readonly moduleVersion: "0.1.
|
|
192
|
+
readonly moduleVersion: "0.1.4";
|
|
234
193
|
};
|
|
235
194
|
observedEffects: never[];
|
|
236
195
|
};
|
|
@@ -240,53 +199,22 @@ export declare const behaviorAdapter: {
|
|
|
240
199
|
readonly ok: true;
|
|
241
200
|
readonly status: "SUCCEEDED";
|
|
242
201
|
readonly moduleRef: "platform-host";
|
|
243
|
-
readonly moduleVersion: "0.1.
|
|
202
|
+
readonly moduleVersion: "0.1.4";
|
|
244
203
|
};
|
|
245
204
|
observedEffects: never[];
|
|
246
205
|
};
|
|
247
206
|
status: () => Promise<{
|
|
248
207
|
result: {
|
|
249
|
-
readonly contract: "deployment.result.v1";
|
|
250
|
-
readonly moduleRef: "platform-host";
|
|
251
|
-
readonly moduleVersion: "0.1.2";
|
|
252
|
-
readonly ok: false;
|
|
253
|
-
readonly status: "ACTION_REQUIRED";
|
|
254
|
-
readonly actionRequired: {
|
|
255
|
-
readonly action: "compose-platform-host";
|
|
256
|
-
readonly description: "Provide validated Host configuration and owner transports";
|
|
257
|
-
};
|
|
258
|
-
} | {
|
|
259
208
|
contract: "deployment.result.v1";
|
|
260
209
|
ok: true;
|
|
261
210
|
status: "SUCCEEDED";
|
|
262
211
|
moduleRef: "platform-host";
|
|
263
|
-
moduleVersion: "0.1.
|
|
212
|
+
moduleVersion: "0.1.4";
|
|
264
213
|
data: {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
id: string;
|
|
269
|
-
status: "FAIL" | "PASS";
|
|
270
|
-
message: string;
|
|
271
|
-
}[];
|
|
272
|
-
} | {
|
|
273
|
-
contract: "deployment.result.v1";
|
|
274
|
-
moduleRef: "platform-host";
|
|
275
|
-
moduleVersion: "0.1.2";
|
|
276
|
-
ok: false;
|
|
277
|
-
status: "ACTION_REQUIRED";
|
|
278
|
-
actionRequired: {
|
|
279
|
-
action: string;
|
|
280
|
-
description: string;
|
|
214
|
+
configStatus: "INCOMPLETE" | "INVALID" | "READY";
|
|
215
|
+
missingConfig?: string[] | undefined;
|
|
216
|
+
runtimeStatus: "FAILED" | "RUNNING" | "STOPPED" | "UNKNOWN";
|
|
281
217
|
};
|
|
282
|
-
data: {
|
|
283
|
-
readiness: "READY" | "NOT_READY";
|
|
284
|
-
} | undefined;
|
|
285
|
-
checks: {
|
|
286
|
-
id: string;
|
|
287
|
-
status: "FAIL" | "PASS";
|
|
288
|
-
message: string;
|
|
289
|
-
}[];
|
|
290
218
|
};
|
|
291
219
|
observedEffects: never[];
|
|
292
220
|
}>;
|
|
@@ -296,7 +224,7 @@ export declare const behaviorAdapter: {
|
|
|
296
224
|
ok: true;
|
|
297
225
|
status: "SUCCEEDED";
|
|
298
226
|
moduleRef: "platform-host";
|
|
299
|
-
moduleVersion: "0.1.
|
|
227
|
+
moduleVersion: "0.1.4";
|
|
300
228
|
checks: {
|
|
301
229
|
id: string;
|
|
302
230
|
status: "FAIL" | "PASS";
|
|
@@ -305,7 +233,7 @@ export declare const behaviorAdapter: {
|
|
|
305
233
|
} | {
|
|
306
234
|
contract: "deployment.result.v1";
|
|
307
235
|
moduleRef: "platform-host";
|
|
308
|
-
moduleVersion: "0.1.
|
|
236
|
+
moduleVersion: "0.1.4";
|
|
309
237
|
ok: false;
|
|
310
238
|
status: "ACTION_REQUIRED";
|
|
311
239
|
actionRequired: {
|
|
@@ -320,7 +248,7 @@ export declare const behaviorAdapter: {
|
|
|
320
248
|
} | {
|
|
321
249
|
contract: "deployment.result.v1";
|
|
322
250
|
moduleRef: "platform-host";
|
|
323
|
-
moduleVersion: "0.1.
|
|
251
|
+
moduleVersion: "0.1.4";
|
|
324
252
|
ok: false;
|
|
325
253
|
status: "ACTION_REQUIRED";
|
|
326
254
|
actionRequired: {
|
|
@@ -341,7 +269,7 @@ export declare const behaviorAdapter: {
|
|
|
341
269
|
readonly ok: true;
|
|
342
270
|
readonly status: "SUCCEEDED";
|
|
343
271
|
readonly moduleRef: "platform-host";
|
|
344
|
-
readonly moduleVersion: "0.1.
|
|
272
|
+
readonly moduleVersion: "0.1.4";
|
|
345
273
|
};
|
|
346
274
|
observedEffects: never[];
|
|
347
275
|
};
|
|
@@ -349,7 +277,7 @@ export declare const behaviorAdapter: {
|
|
|
349
277
|
result: {
|
|
350
278
|
readonly contract: "deployment.result.v1";
|
|
351
279
|
readonly moduleRef: "platform-host";
|
|
352
|
-
readonly moduleVersion: "0.1.
|
|
280
|
+
readonly moduleVersion: "0.1.4";
|
|
353
281
|
readonly ok: false;
|
|
354
282
|
readonly status: "ACTION_REQUIRED";
|
|
355
283
|
readonly actionRequired: {
|
|
@@ -361,7 +289,7 @@ export declare const behaviorAdapter: {
|
|
|
361
289
|
ok: true;
|
|
362
290
|
status: "SUCCEEDED";
|
|
363
291
|
moduleRef: "platform-host";
|
|
364
|
-
moduleVersion: "0.1.
|
|
292
|
+
moduleVersion: "0.1.4";
|
|
365
293
|
data: {
|
|
366
294
|
host: string;
|
|
367
295
|
port: number;
|
|
@@ -375,11 +303,11 @@ export declare const behaviorAdapter: {
|
|
|
375
303
|
readonly ok: true;
|
|
376
304
|
readonly status: "SUCCEEDED";
|
|
377
305
|
readonly moduleRef: "platform-host";
|
|
378
|
-
readonly moduleVersion: "0.1.
|
|
306
|
+
readonly moduleVersion: "0.1.4";
|
|
379
307
|
} | {
|
|
380
308
|
readonly contract: "deployment.result.v1";
|
|
381
309
|
readonly moduleRef: "platform-host";
|
|
382
|
-
readonly moduleVersion: "0.1.
|
|
310
|
+
readonly moduleVersion: "0.1.4";
|
|
383
311
|
readonly ok: false;
|
|
384
312
|
readonly status: "ACTION_REQUIRED";
|
|
385
313
|
readonly actionRequired: {
|
|
@@ -393,7 +321,7 @@ export declare const behaviorAdapter: {
|
|
|
393
321
|
result: {
|
|
394
322
|
readonly contract: "deployment.result.v1";
|
|
395
323
|
readonly moduleRef: "platform-host";
|
|
396
|
-
readonly moduleVersion: "0.1.
|
|
324
|
+
readonly moduleVersion: "0.1.4";
|
|
397
325
|
readonly ok: false;
|
|
398
326
|
readonly status: "ACTION_REQUIRED";
|
|
399
327
|
readonly actionRequired: {
|
|
@@ -405,7 +333,7 @@ export declare const behaviorAdapter: {
|
|
|
405
333
|
ok: true;
|
|
406
334
|
status: "SUCCEEDED";
|
|
407
335
|
moduleRef: "platform-host";
|
|
408
|
-
moduleVersion: "0.1.
|
|
336
|
+
moduleVersion: "0.1.4";
|
|
409
337
|
data: {
|
|
410
338
|
host: string;
|
|
411
339
|
port: number;
|
|
@@ -419,40 +347,16 @@ export declare const behaviorAdapter: {
|
|
|
419
347
|
readonly ok: true;
|
|
420
348
|
readonly status: "SUCCEEDED";
|
|
421
349
|
readonly moduleRef: "platform-host";
|
|
422
|
-
readonly moduleVersion: "0.1.
|
|
423
|
-
} | {
|
|
424
|
-
readonly contract: "deployment.result.v1";
|
|
425
|
-
readonly moduleRef: "platform-host";
|
|
426
|
-
readonly moduleVersion: "0.1.2";
|
|
427
|
-
readonly ok: false;
|
|
428
|
-
readonly status: "ACTION_REQUIRED";
|
|
429
|
-
readonly actionRequired: {
|
|
430
|
-
readonly action: "compose-platform-host";
|
|
431
|
-
readonly description: "Provide validated Host configuration and owner transports";
|
|
432
|
-
};
|
|
350
|
+
readonly moduleVersion: "0.1.4";
|
|
433
351
|
};
|
|
434
352
|
observedEffects: string[];
|
|
435
353
|
}>;
|
|
436
354
|
};
|
|
437
|
-
export declare function createServiceProcessBinding(input: {
|
|
438
|
-
moduleRef: string;
|
|
439
|
-
config: Record<string, string>;
|
|
440
|
-
workspaceRoot: string;
|
|
441
|
-
configByModuleRef: ReadonlyMap<string, Record<string, string>>;
|
|
442
|
-
}): Promise<{
|
|
443
|
-
serviceProcess: {
|
|
444
|
-
contract: "deployment.service-process.v1";
|
|
445
|
-
bin: "proflow-platform-host";
|
|
446
|
-
startCommand: "start";
|
|
447
|
-
config: Record<string, unknown>;
|
|
448
|
-
};
|
|
449
|
-
behaviorAdapter: Record<string, unknown>;
|
|
450
|
-
} | undefined>;
|
|
451
355
|
export declare function createProductionBinding(input: {
|
|
452
356
|
moduleRef: string;
|
|
453
357
|
config: Record<string, string>;
|
|
454
358
|
configByModuleRef: ReadonlyMap<string, Record<string, string>>;
|
|
455
359
|
}): Promise<{
|
|
456
360
|
behaviorAdapter: Record<string, unknown>;
|
|
457
|
-
}
|
|
361
|
+
}>;
|
|
458
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
|
},
|
|
@@ -101,7 +81,10 @@ export function createBehaviorAdapter(service) {
|
|
|
101
81
|
if (service)
|
|
102
82
|
await service.stop();
|
|
103
83
|
return {
|
|
104
|
-
|
|
84
|
+
// Uninstall is idempotent: an unbound service means there is no
|
|
85
|
+
// process to stop before package removal. Runtime readiness still
|
|
86
|
+
// fails closed in status/start/verify.
|
|
87
|
+
result: base,
|
|
105
88
|
observedEffects: service ? ["Manage the platform-host process"] : [],
|
|
106
89
|
};
|
|
107
90
|
},
|
|
@@ -117,94 +100,17 @@ const REQUIRED_CONFIG = [
|
|
|
117
100
|
"modelBaseUrl",
|
|
118
101
|
"modelTransportCredentialFile",
|
|
119
102
|
];
|
|
120
|
-
// Binds the real Host process only when
|
|
121
|
-
//
|
|
122
|
-
//
|
|
123
|
-
|
|
124
|
-
const config = input.config;
|
|
125
|
-
if (!REQUIRED_CONFIG.every((key) => config[key] !== undefined))
|
|
126
|
-
return undefined;
|
|
127
|
-
const executionRuntime = input.configByModuleRef.get("execution-runtime");
|
|
128
|
-
const advertised = executionRuntime?.["identity.endpoint"];
|
|
129
|
-
if (!advertised)
|
|
130
|
-
return undefined;
|
|
131
|
-
const listener = new URL(advertised);
|
|
132
|
-
if (listener.protocol !== "http:" || listener.pathname !== "/")
|
|
133
|
-
return undefined;
|
|
134
|
-
const port = listener.port === "" ? 80 : Number(listener.port);
|
|
135
|
-
if (!Number.isInteger(port) || port <= 0 || port > 65_535)
|
|
136
|
-
return undefined;
|
|
137
|
-
const { parsePlatformHostConfig } = await import("../src/index.js");
|
|
138
|
-
const processConfig = parsePlatformHostConfig({
|
|
139
|
-
stateRoot: config.stateRoot,
|
|
140
|
-
workspaceRoot: config.workspaceRoot,
|
|
141
|
-
host: listener.hostname,
|
|
142
|
-
port,
|
|
143
|
-
executionBaseUrl: config.executionBaseUrl,
|
|
144
|
-
executionTransportCredentialFile: config.executionTransportCredentialFile,
|
|
145
|
-
modelBaseUrl: config.modelBaseUrl,
|
|
146
|
-
modelTransportCredentialFile: config.modelTransportCredentialFile,
|
|
147
|
-
gatewayTransportCredentialFile: config.gatewayTransportCredentialFile,
|
|
148
|
-
roles: [],
|
|
149
|
-
});
|
|
150
|
-
const probeAdapter = {
|
|
151
|
-
describe: behaviorAdapter.describe,
|
|
152
|
-
preflight: behaviorAdapter.preflight,
|
|
153
|
-
verify: async () => {
|
|
154
|
-
let ready = false;
|
|
155
|
-
try {
|
|
156
|
-
ready = (await fetch(new URL("/ready", listener))).ok;
|
|
157
|
-
}
|
|
158
|
-
catch {
|
|
159
|
-
ready = false;
|
|
160
|
-
}
|
|
161
|
-
return {
|
|
162
|
-
result: ready
|
|
163
|
-
? {
|
|
164
|
-
...base,
|
|
165
|
-
checks: [
|
|
166
|
-
{
|
|
167
|
-
id: "platform-host-readiness",
|
|
168
|
-
status: "PASS",
|
|
169
|
-
message: "Managed Platform Host /ready probe passed",
|
|
170
|
-
},
|
|
171
|
-
],
|
|
172
|
-
}
|
|
173
|
-
: {
|
|
174
|
-
...base,
|
|
175
|
-
ok: false,
|
|
176
|
-
status: "ACTION_REQUIRED",
|
|
177
|
-
actionRequired: {
|
|
178
|
-
action: "repair-platform-host",
|
|
179
|
-
description: "Managed Platform Host /ready probe failed",
|
|
180
|
-
},
|
|
181
|
-
checks: [
|
|
182
|
-
{
|
|
183
|
-
id: "platform-host-readiness",
|
|
184
|
-
status: "FAIL",
|
|
185
|
-
message: "Managed Platform Host /ready probe failed",
|
|
186
|
-
},
|
|
187
|
-
],
|
|
188
|
-
},
|
|
189
|
-
observedEffects: [],
|
|
190
|
-
};
|
|
191
|
-
},
|
|
192
|
-
doctor: behaviorAdapter.doctor,
|
|
193
|
-
};
|
|
194
|
-
return {
|
|
195
|
-
serviceProcess: {
|
|
196
|
-
contract: "deployment.service-process.v1",
|
|
197
|
-
bin: "proflow-platform-host",
|
|
198
|
-
startCommand: "start",
|
|
199
|
-
config: processConfig,
|
|
200
|
-
},
|
|
201
|
-
behaviorAdapter: probeAdapter,
|
|
202
|
-
};
|
|
203
|
-
}
|
|
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.
|
|
204
107
|
export async function createProductionBinding(input) {
|
|
205
108
|
const config = input.config;
|
|
109
|
+
const unboundBinding = (configValid = true) => ({
|
|
110
|
+
behaviorAdapter: createBehaviorAdapter(undefined, config, configValid),
|
|
111
|
+
});
|
|
206
112
|
if (!REQUIRED_CONFIG.every((key) => config[key] !== undefined))
|
|
207
|
-
return
|
|
113
|
+
return unboundBinding();
|
|
208
114
|
// The Platform Host's public loopback endpoint is already a cross-module
|
|
209
115
|
// contract: Execution calls it through identity.endpoint. Reuse that
|
|
210
116
|
// materialized endpoint as the listener instead of binding an ephemeral port
|
|
@@ -212,26 +118,38 @@ export async function createProductionBinding(input) {
|
|
|
212
118
|
const executionRuntime = input.configByModuleRef.get("execution-runtime");
|
|
213
119
|
const advertised = executionRuntime?.["identity.endpoint"];
|
|
214
120
|
if (!advertised)
|
|
215
|
-
return
|
|
216
|
-
|
|
121
|
+
return unboundBinding();
|
|
122
|
+
let listener;
|
|
123
|
+
try {
|
|
124
|
+
listener = new URL(advertised);
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
return unboundBinding();
|
|
128
|
+
}
|
|
217
129
|
if (listener.protocol !== "http:" || listener.pathname !== "/")
|
|
218
|
-
return
|
|
130
|
+
return unboundBinding();
|
|
219
131
|
const port = listener.port === "" ? 80 : Number(listener.port);
|
|
220
132
|
if (!Number.isInteger(port) || port <= 0 || port > 65_535)
|
|
221
|
-
return
|
|
133
|
+
return unboundBinding();
|
|
222
134
|
const { createPlatformHost, parsePlatformHostConfig } = await import("../src/index.js");
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
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
|
+
}
|
|
235
153
|
const host = createPlatformHost({ config: hostConfig });
|
|
236
154
|
const service = {
|
|
237
155
|
start: () => host.start(),
|
|
@@ -239,5 +157,5 @@ export async function createProductionBinding(input) {
|
|
|
239
157
|
restart: () => host.restart(),
|
|
240
158
|
status: async () => ({ readiness: (await host.status()).readiness }),
|
|
241
159
|
};
|
|
242
|
-
return { behaviorAdapter: createBehaviorAdapter(service) };
|
|
160
|
+
return { behaviorAdapter: createBehaviorAdapter(service, input.config) };
|
|
243
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",
|
|
25
|
-
"@tomflow/proflow-agent-runtime": "^0.1.
|
|
26
|
-
"@tomflow/proflow-
|
|
27
|
-
"@tomflow/proflow-execution-
|
|
28
|
-
"@tomflow/proflow-task-
|
|
29
|
-
"@tomflow/proflow-task-
|
|
30
|
-
"@tomflow/proflow-
|
|
26
|
+
"@tomflow/proflow-agent-runtime": "^0.1.2",
|
|
27
|
+
"@tomflow/proflow-task-migration-runner": "^0.1.2",
|
|
28
|
+
"@tomflow/proflow-execution-browser-extension": "^0.1.3",
|
|
29
|
+
"@tomflow/proflow-task-store-sqlite": "^0.1.2",
|
|
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-agent-gateway": "^0.1.
|
|
35
|
+
"@tomflow/proflow-agent-gateway": "^0.1.4",
|
|
34
36
|
"@tomflow/proflow-deployment-conformance": "^0.1.2",
|
|
35
|
-
"@tomflow/proflow-execution-runtime": "^0.1.
|
|
36
|
-
"@tomflow/proflow-model-runtime": "^0.1.
|
|
37
|
-
"@tomflow/proflow-module-contract": "^0.1.1"
|
|
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,13 +0,0 @@
|
|
|
1
|
-
# @tomflow/proflow-platform-host
|
|
2
|
-
|
|
3
|
-
## 0.1.2
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- 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.
|
|
8
|
-
|
|
9
|
-
## 0.1.1
|
|
10
|
-
|
|
11
|
-
### Patch Changes
|
|
12
|
-
|
|
13
|
-
- 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.
|