@tomflow/proflow-agent-gateway 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 +26 -0
- package/dist/deployment/adapter.d.ts +38 -126
- package/dist/deployment/adapter.js +46 -110
- package/dist/deployment/descriptor.d.ts +5 -2
- package/dist/deployment/descriptor.js +29 -7
- package/dist/src/cli.js +1 -19
- package/package.json +13 -20
- package/proflow.module.json +6 -2
- package/CHANGELOG.md +0 -13
package/CONFIGURATION.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# agent-gateway configuration
|
|
2
|
+
|
|
3
|
+
Canonical public config: `.proflow/config/agent-gateway.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
|
+
| `localBaseUrl` | `url` | yes | no | User or owning external/runtime Module supplies the reachable endpoint URL. | Loopback HTTP listener URL owned by Agent Gateway and targeted by the public ingress resource |
|
|
12
|
+
| `publicBaseUrl` | `url` | yes | no | User or owning external/runtime Module supplies the reachable endpoint URL. | Public HTTPS URL supplied by the dev-tunnel resource |
|
|
13
|
+
| `downstreamCredentialFile` | `path` | yes | yes | User or owning Module supplies an absolute/local path that exists on this Workspace. | File containing the dedicated Gateway-to-platform-host transport credential |
|
|
14
|
+
| `publicIngressModuleRef` | `moduleRef` | no | no | Another installed ProFlow Module reference selected from `platform docs` / Module topology. | External resource module governing the public ingress |
|
|
15
|
+
|
|
16
|
+
## Materialize
|
|
17
|
+
|
|
18
|
+
Create or update the canonical JSON object at:
|
|
19
|
+
|
|
20
|
+
`.proflow/config/agent-gateway.json`
|
|
21
|
+
|
|
22
|
+
Use only declared keys and string values. Do not create a second Platform configuration database.
|
|
23
|
+
|
|
24
|
+
## Base completion check
|
|
25
|
+
|
|
26
|
+
Run `platform modules`. This Module should no longer report required keys in `missingConfig`. `platform start` performs the authoritative Module-owned validation before starting anything.
|
|
@@ -13,14 +13,14 @@ type GatewayProcess = {
|
|
|
13
13
|
}>;
|
|
14
14
|
status(): unknown;
|
|
15
15
|
};
|
|
16
|
-
export declare function createBehaviorAdapter(service?: GatewayProcess): {
|
|
16
|
+
export declare function createBehaviorAdapter(service?: GatewayProcess, config?: Record<string, string>, configValid?: boolean): {
|
|
17
17
|
describe: () => {
|
|
18
18
|
result: {
|
|
19
19
|
readonly contract: "deployment.result.v1";
|
|
20
20
|
readonly ok: true;
|
|
21
21
|
readonly status: "SUCCEEDED";
|
|
22
22
|
readonly moduleRef: "agent-gateway";
|
|
23
|
-
readonly moduleVersion: "0.1.
|
|
23
|
+
readonly moduleVersion: "0.1.4";
|
|
24
24
|
};
|
|
25
25
|
observedEffects: never[];
|
|
26
26
|
};
|
|
@@ -30,49 +30,22 @@ export declare function createBehaviorAdapter(service?: GatewayProcess): {
|
|
|
30
30
|
readonly ok: true;
|
|
31
31
|
readonly status: "SUCCEEDED";
|
|
32
32
|
readonly moduleRef: "agent-gateway";
|
|
33
|
-
readonly moduleVersion: "0.1.
|
|
33
|
+
readonly moduleVersion: "0.1.4";
|
|
34
34
|
};
|
|
35
35
|
observedEffects: never[];
|
|
36
36
|
};
|
|
37
37
|
status: () => Promise<{
|
|
38
38
|
result: {
|
|
39
|
-
readonly contract: "deployment.result.v1";
|
|
40
|
-
readonly moduleRef: "agent-gateway";
|
|
41
|
-
readonly moduleVersion: "0.1.2";
|
|
42
|
-
readonly ok: false;
|
|
43
|
-
readonly status: "ACTION_REQUIRED";
|
|
44
|
-
readonly actionRequired: {
|
|
45
|
-
readonly action: "compose-gateway";
|
|
46
|
-
readonly description: "Provide owner ports and process configuration";
|
|
47
|
-
};
|
|
48
|
-
} | {
|
|
49
39
|
contract: "deployment.result.v1";
|
|
50
40
|
ok: true;
|
|
51
41
|
status: "SUCCEEDED";
|
|
52
42
|
moduleRef: "agent-gateway";
|
|
53
|
-
moduleVersion: "0.1.
|
|
54
|
-
data:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
message: string;
|
|
59
|
-
}[];
|
|
60
|
-
} | {
|
|
61
|
-
contract: "deployment.result.v1";
|
|
62
|
-
moduleRef: "agent-gateway";
|
|
63
|
-
moduleVersion: "0.1.2";
|
|
64
|
-
ok: false;
|
|
65
|
-
status: "ACTION_REQUIRED";
|
|
66
|
-
actionRequired: {
|
|
67
|
-
action: string;
|
|
68
|
-
description: string;
|
|
43
|
+
moduleVersion: "0.1.4";
|
|
44
|
+
data: {
|
|
45
|
+
configStatus: "INCOMPLETE" | "INVALID" | "READY";
|
|
46
|
+
missingConfig?: string[] | undefined;
|
|
47
|
+
runtimeStatus: "FAILED" | "RUNNING" | "STOPPED" | "UNKNOWN";
|
|
69
48
|
};
|
|
70
|
-
data: unknown;
|
|
71
|
-
checks: {
|
|
72
|
-
id: string;
|
|
73
|
-
status: "FAIL" | "PASS";
|
|
74
|
-
message: string;
|
|
75
|
-
}[];
|
|
76
49
|
};
|
|
77
50
|
observedEffects: never[];
|
|
78
51
|
}>;
|
|
@@ -82,7 +55,7 @@ export declare function createBehaviorAdapter(service?: GatewayProcess): {
|
|
|
82
55
|
ok: true;
|
|
83
56
|
status: "SUCCEEDED";
|
|
84
57
|
moduleRef: "agent-gateway";
|
|
85
|
-
moduleVersion: "0.1.
|
|
58
|
+
moduleVersion: "0.1.4";
|
|
86
59
|
checks: {
|
|
87
60
|
id: string;
|
|
88
61
|
status: "FAIL" | "PASS";
|
|
@@ -91,7 +64,7 @@ export declare function createBehaviorAdapter(service?: GatewayProcess): {
|
|
|
91
64
|
} | {
|
|
92
65
|
contract: "deployment.result.v1";
|
|
93
66
|
moduleRef: "agent-gateway";
|
|
94
|
-
moduleVersion: "0.1.
|
|
67
|
+
moduleVersion: "0.1.4";
|
|
95
68
|
ok: false;
|
|
96
69
|
status: "ACTION_REQUIRED";
|
|
97
70
|
actionRequired: {
|
|
@@ -106,7 +79,7 @@ export declare function createBehaviorAdapter(service?: GatewayProcess): {
|
|
|
106
79
|
} | {
|
|
107
80
|
contract: "deployment.result.v1";
|
|
108
81
|
moduleRef: "agent-gateway";
|
|
109
|
-
moduleVersion: "0.1.
|
|
82
|
+
moduleVersion: "0.1.4";
|
|
110
83
|
ok: false;
|
|
111
84
|
status: "ACTION_REQUIRED";
|
|
112
85
|
actionRequired: {
|
|
@@ -127,7 +100,7 @@ export declare function createBehaviorAdapter(service?: GatewayProcess): {
|
|
|
127
100
|
readonly ok: true;
|
|
128
101
|
readonly status: "SUCCEEDED";
|
|
129
102
|
readonly moduleRef: "agent-gateway";
|
|
130
|
-
readonly moduleVersion: "0.1.
|
|
103
|
+
readonly moduleVersion: "0.1.4";
|
|
131
104
|
};
|
|
132
105
|
observedEffects: never[];
|
|
133
106
|
};
|
|
@@ -137,7 +110,7 @@ export declare function createBehaviorAdapter(service?: GatewayProcess): {
|
|
|
137
110
|
ok: true;
|
|
138
111
|
status: "SUCCEEDED";
|
|
139
112
|
moduleRef: "agent-gateway";
|
|
140
|
-
moduleVersion: "0.1.
|
|
113
|
+
moduleVersion: "0.1.4";
|
|
141
114
|
data: {
|
|
142
115
|
host: string;
|
|
143
116
|
port: number;
|
|
@@ -145,7 +118,7 @@ export declare function createBehaviorAdapter(service?: GatewayProcess): {
|
|
|
145
118
|
} | {
|
|
146
119
|
contract: "deployment.result.v1";
|
|
147
120
|
moduleRef: "agent-gateway";
|
|
148
|
-
moduleVersion: "0.1.
|
|
121
|
+
moduleVersion: "0.1.4";
|
|
149
122
|
status: "ACTION_REQUIRED";
|
|
150
123
|
ok: boolean;
|
|
151
124
|
actionRequired: {
|
|
@@ -161,11 +134,11 @@ export declare function createBehaviorAdapter(service?: GatewayProcess): {
|
|
|
161
134
|
readonly ok: true;
|
|
162
135
|
readonly status: "SUCCEEDED";
|
|
163
136
|
readonly moduleRef: "agent-gateway";
|
|
164
|
-
readonly moduleVersion: "0.1.
|
|
137
|
+
readonly moduleVersion: "0.1.4";
|
|
165
138
|
} | {
|
|
166
139
|
readonly contract: "deployment.result.v1";
|
|
167
140
|
readonly moduleRef: "agent-gateway";
|
|
168
|
-
readonly moduleVersion: "0.1.
|
|
141
|
+
readonly moduleVersion: "0.1.4";
|
|
169
142
|
readonly ok: false;
|
|
170
143
|
readonly status: "ACTION_REQUIRED";
|
|
171
144
|
readonly actionRequired: {
|
|
@@ -181,17 +154,7 @@ export declare function createBehaviorAdapter(service?: GatewayProcess): {
|
|
|
181
154
|
readonly ok: true;
|
|
182
155
|
readonly status: "SUCCEEDED";
|
|
183
156
|
readonly moduleRef: "agent-gateway";
|
|
184
|
-
readonly moduleVersion: "0.1.
|
|
185
|
-
} | {
|
|
186
|
-
readonly contract: "deployment.result.v1";
|
|
187
|
-
readonly moduleRef: "agent-gateway";
|
|
188
|
-
readonly moduleVersion: "0.1.2";
|
|
189
|
-
readonly ok: false;
|
|
190
|
-
readonly status: "ACTION_REQUIRED";
|
|
191
|
-
readonly actionRequired: {
|
|
192
|
-
readonly action: "compose-gateway";
|
|
193
|
-
readonly description: "Provide owner ports and process configuration";
|
|
194
|
-
};
|
|
157
|
+
readonly moduleVersion: "0.1.4";
|
|
195
158
|
};
|
|
196
159
|
observedEffects: string[];
|
|
197
160
|
}>;
|
|
@@ -201,7 +164,7 @@ export declare function createBehaviorAdapter(service?: GatewayProcess): {
|
|
|
201
164
|
ok: true;
|
|
202
165
|
status: "SUCCEEDED";
|
|
203
166
|
moduleRef: "agent-gateway";
|
|
204
|
-
moduleVersion: "0.1.
|
|
167
|
+
moduleVersion: "0.1.4";
|
|
205
168
|
data: {
|
|
206
169
|
host: string;
|
|
207
170
|
port: number;
|
|
@@ -209,7 +172,7 @@ export declare function createBehaviorAdapter(service?: GatewayProcess): {
|
|
|
209
172
|
} | {
|
|
210
173
|
contract: "deployment.result.v1";
|
|
211
174
|
moduleRef: "agent-gateway";
|
|
212
|
-
moduleVersion: "0.1.
|
|
175
|
+
moduleVersion: "0.1.4";
|
|
213
176
|
status: "ACTION_REQUIRED";
|
|
214
177
|
ok: boolean;
|
|
215
178
|
actionRequired: {
|
|
@@ -227,7 +190,7 @@ export declare const behaviorAdapter: {
|
|
|
227
190
|
readonly ok: true;
|
|
228
191
|
readonly status: "SUCCEEDED";
|
|
229
192
|
readonly moduleRef: "agent-gateway";
|
|
230
|
-
readonly moduleVersion: "0.1.
|
|
193
|
+
readonly moduleVersion: "0.1.4";
|
|
231
194
|
};
|
|
232
195
|
observedEffects: never[];
|
|
233
196
|
};
|
|
@@ -237,49 +200,22 @@ export declare const behaviorAdapter: {
|
|
|
237
200
|
readonly ok: true;
|
|
238
201
|
readonly status: "SUCCEEDED";
|
|
239
202
|
readonly moduleRef: "agent-gateway";
|
|
240
|
-
readonly moduleVersion: "0.1.
|
|
203
|
+
readonly moduleVersion: "0.1.4";
|
|
241
204
|
};
|
|
242
205
|
observedEffects: never[];
|
|
243
206
|
};
|
|
244
207
|
status: () => Promise<{
|
|
245
208
|
result: {
|
|
246
|
-
readonly contract: "deployment.result.v1";
|
|
247
|
-
readonly moduleRef: "agent-gateway";
|
|
248
|
-
readonly moduleVersion: "0.1.2";
|
|
249
|
-
readonly ok: false;
|
|
250
|
-
readonly status: "ACTION_REQUIRED";
|
|
251
|
-
readonly actionRequired: {
|
|
252
|
-
readonly action: "compose-gateway";
|
|
253
|
-
readonly description: "Provide owner ports and process configuration";
|
|
254
|
-
};
|
|
255
|
-
} | {
|
|
256
209
|
contract: "deployment.result.v1";
|
|
257
210
|
ok: true;
|
|
258
211
|
status: "SUCCEEDED";
|
|
259
212
|
moduleRef: "agent-gateway";
|
|
260
|
-
moduleVersion: "0.1.
|
|
261
|
-
data:
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
message: string;
|
|
266
|
-
}[];
|
|
267
|
-
} | {
|
|
268
|
-
contract: "deployment.result.v1";
|
|
269
|
-
moduleRef: "agent-gateway";
|
|
270
|
-
moduleVersion: "0.1.2";
|
|
271
|
-
ok: false;
|
|
272
|
-
status: "ACTION_REQUIRED";
|
|
273
|
-
actionRequired: {
|
|
274
|
-
action: string;
|
|
275
|
-
description: string;
|
|
213
|
+
moduleVersion: "0.1.4";
|
|
214
|
+
data: {
|
|
215
|
+
configStatus: "INCOMPLETE" | "INVALID" | "READY";
|
|
216
|
+
missingConfig?: string[] | undefined;
|
|
217
|
+
runtimeStatus: "FAILED" | "RUNNING" | "STOPPED" | "UNKNOWN";
|
|
276
218
|
};
|
|
277
|
-
data: unknown;
|
|
278
|
-
checks: {
|
|
279
|
-
id: string;
|
|
280
|
-
status: "FAIL" | "PASS";
|
|
281
|
-
message: string;
|
|
282
|
-
}[];
|
|
283
219
|
};
|
|
284
220
|
observedEffects: never[];
|
|
285
221
|
}>;
|
|
@@ -289,7 +225,7 @@ export declare const behaviorAdapter: {
|
|
|
289
225
|
ok: true;
|
|
290
226
|
status: "SUCCEEDED";
|
|
291
227
|
moduleRef: "agent-gateway";
|
|
292
|
-
moduleVersion: "0.1.
|
|
228
|
+
moduleVersion: "0.1.4";
|
|
293
229
|
checks: {
|
|
294
230
|
id: string;
|
|
295
231
|
status: "FAIL" | "PASS";
|
|
@@ -298,7 +234,7 @@ export declare const behaviorAdapter: {
|
|
|
298
234
|
} | {
|
|
299
235
|
contract: "deployment.result.v1";
|
|
300
236
|
moduleRef: "agent-gateway";
|
|
301
|
-
moduleVersion: "0.1.
|
|
237
|
+
moduleVersion: "0.1.4";
|
|
302
238
|
ok: false;
|
|
303
239
|
status: "ACTION_REQUIRED";
|
|
304
240
|
actionRequired: {
|
|
@@ -313,7 +249,7 @@ export declare const behaviorAdapter: {
|
|
|
313
249
|
} | {
|
|
314
250
|
contract: "deployment.result.v1";
|
|
315
251
|
moduleRef: "agent-gateway";
|
|
316
|
-
moduleVersion: "0.1.
|
|
252
|
+
moduleVersion: "0.1.4";
|
|
317
253
|
ok: false;
|
|
318
254
|
status: "ACTION_REQUIRED";
|
|
319
255
|
actionRequired: {
|
|
@@ -334,7 +270,7 @@ export declare const behaviorAdapter: {
|
|
|
334
270
|
readonly ok: true;
|
|
335
271
|
readonly status: "SUCCEEDED";
|
|
336
272
|
readonly moduleRef: "agent-gateway";
|
|
337
|
-
readonly moduleVersion: "0.1.
|
|
273
|
+
readonly moduleVersion: "0.1.4";
|
|
338
274
|
};
|
|
339
275
|
observedEffects: never[];
|
|
340
276
|
};
|
|
@@ -344,7 +280,7 @@ export declare const behaviorAdapter: {
|
|
|
344
280
|
ok: true;
|
|
345
281
|
status: "SUCCEEDED";
|
|
346
282
|
moduleRef: "agent-gateway";
|
|
347
|
-
moduleVersion: "0.1.
|
|
283
|
+
moduleVersion: "0.1.4";
|
|
348
284
|
data: {
|
|
349
285
|
host: string;
|
|
350
286
|
port: number;
|
|
@@ -352,7 +288,7 @@ export declare const behaviorAdapter: {
|
|
|
352
288
|
} | {
|
|
353
289
|
contract: "deployment.result.v1";
|
|
354
290
|
moduleRef: "agent-gateway";
|
|
355
|
-
moduleVersion: "0.1.
|
|
291
|
+
moduleVersion: "0.1.4";
|
|
356
292
|
status: "ACTION_REQUIRED";
|
|
357
293
|
ok: boolean;
|
|
358
294
|
actionRequired: {
|
|
@@ -368,11 +304,11 @@ export declare const behaviorAdapter: {
|
|
|
368
304
|
readonly ok: true;
|
|
369
305
|
readonly status: "SUCCEEDED";
|
|
370
306
|
readonly moduleRef: "agent-gateway";
|
|
371
|
-
readonly moduleVersion: "0.1.
|
|
307
|
+
readonly moduleVersion: "0.1.4";
|
|
372
308
|
} | {
|
|
373
309
|
readonly contract: "deployment.result.v1";
|
|
374
310
|
readonly moduleRef: "agent-gateway";
|
|
375
|
-
readonly moduleVersion: "0.1.
|
|
311
|
+
readonly moduleVersion: "0.1.4";
|
|
376
312
|
readonly ok: false;
|
|
377
313
|
readonly status: "ACTION_REQUIRED";
|
|
378
314
|
readonly actionRequired: {
|
|
@@ -388,17 +324,7 @@ export declare const behaviorAdapter: {
|
|
|
388
324
|
readonly ok: true;
|
|
389
325
|
readonly status: "SUCCEEDED";
|
|
390
326
|
readonly moduleRef: "agent-gateway";
|
|
391
|
-
readonly moduleVersion: "0.1.
|
|
392
|
-
} | {
|
|
393
|
-
readonly contract: "deployment.result.v1";
|
|
394
|
-
readonly moduleRef: "agent-gateway";
|
|
395
|
-
readonly moduleVersion: "0.1.2";
|
|
396
|
-
readonly ok: false;
|
|
397
|
-
readonly status: "ACTION_REQUIRED";
|
|
398
|
-
readonly actionRequired: {
|
|
399
|
-
readonly action: "compose-gateway";
|
|
400
|
-
readonly description: "Provide owner ports and process configuration";
|
|
401
|
-
};
|
|
327
|
+
readonly moduleVersion: "0.1.4";
|
|
402
328
|
};
|
|
403
329
|
observedEffects: string[];
|
|
404
330
|
}>;
|
|
@@ -408,7 +334,7 @@ export declare const behaviorAdapter: {
|
|
|
408
334
|
ok: true;
|
|
409
335
|
status: "SUCCEEDED";
|
|
410
336
|
moduleRef: "agent-gateway";
|
|
411
|
-
moduleVersion: "0.1.
|
|
337
|
+
moduleVersion: "0.1.4";
|
|
412
338
|
data: {
|
|
413
339
|
host: string;
|
|
414
340
|
port: number;
|
|
@@ -416,7 +342,7 @@ export declare const behaviorAdapter: {
|
|
|
416
342
|
} | {
|
|
417
343
|
contract: "deployment.result.v1";
|
|
418
344
|
moduleRef: "agent-gateway";
|
|
419
|
-
moduleVersion: "0.1.
|
|
345
|
+
moduleVersion: "0.1.4";
|
|
420
346
|
status: "ACTION_REQUIRED";
|
|
421
347
|
ok: boolean;
|
|
422
348
|
actionRequired: {
|
|
@@ -427,20 +353,6 @@ export declare const behaviorAdapter: {
|
|
|
427
353
|
observedEffects: string[];
|
|
428
354
|
}>;
|
|
429
355
|
};
|
|
430
|
-
export declare function createServiceProcessBinding(input: {
|
|
431
|
-
moduleRef: string;
|
|
432
|
-
config: Record<string, string>;
|
|
433
|
-
workspaceRoot: string;
|
|
434
|
-
configByModuleRef: ReadonlyMap<string, Record<string, string>>;
|
|
435
|
-
}): Promise<{
|
|
436
|
-
serviceProcess: {
|
|
437
|
-
contract: "deployment.service-process.v1";
|
|
438
|
-
bin: "proflow-agent-gateway";
|
|
439
|
-
startCommand: "start";
|
|
440
|
-
config: Record<string, unknown>;
|
|
441
|
-
};
|
|
442
|
-
behaviorAdapter: Record<string, unknown>;
|
|
443
|
-
} | undefined>;
|
|
444
356
|
export declare function createProductionBinding(input: {
|
|
445
357
|
moduleRef: string;
|
|
446
358
|
config: Record<string, string>;
|
|
@@ -448,5 +360,5 @@ export declare function createProductionBinding(input: {
|
|
|
448
360
|
configByModuleRef: ReadonlyMap<string, Record<string, string>>;
|
|
449
361
|
}): Promise<{
|
|
450
362
|
behaviorAdapter: Record<string, unknown>;
|
|
451
|
-
}
|
|
363
|
+
}>;
|
|
452
364
|
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,38 +16,16 @@ const unbound = {
|
|
|
15
16
|
description: "Provide owner ports and process configuration",
|
|
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
|
-
const processStatus = service?.status();
|
|
24
24
|
const readiness = service ? await service.readiness() : undefined;
|
|
25
25
|
const ready = readiness?.status === "READY";
|
|
26
|
+
const data = observeDeclaredModuleStatus(descriptor, config, ready ? "RUNNING" : service ? "FAILED" : "UNKNOWN", configValid);
|
|
26
27
|
return {
|
|
27
|
-
result:
|
|
28
|
-
? {
|
|
29
|
-
...(ready
|
|
30
|
-
? base
|
|
31
|
-
: {
|
|
32
|
-
...base,
|
|
33
|
-
ok: false,
|
|
34
|
-
status: "ACTION_REQUIRED",
|
|
35
|
-
actionRequired: {
|
|
36
|
-
action: "repair-gateway",
|
|
37
|
-
description: "Gateway is not READY",
|
|
38
|
-
},
|
|
39
|
-
}),
|
|
40
|
-
data: processStatus,
|
|
41
|
-
checks: [
|
|
42
|
-
{
|
|
43
|
-
id: "gateway-readiness",
|
|
44
|
-
status: ready ? "PASS" : "FAIL",
|
|
45
|
-
message: `Gateway readiness is ${readiness?.status ?? "NOT_READY"}`,
|
|
46
|
-
},
|
|
47
|
-
],
|
|
48
|
-
}
|
|
49
|
-
: unbound,
|
|
28
|
+
result: { ...base, data },
|
|
50
29
|
observedEffects: [],
|
|
51
30
|
};
|
|
52
31
|
},
|
|
@@ -110,7 +89,10 @@ export function createBehaviorAdapter(service) {
|
|
|
110
89
|
if (service)
|
|
111
90
|
await service.stop();
|
|
112
91
|
return {
|
|
113
|
-
|
|
92
|
+
// Uninstall is idempotent: an unbound service means there is no
|
|
93
|
+
// process to stop before package removal. Runtime readiness still
|
|
94
|
+
// fails closed in status/start/verify.
|
|
95
|
+
result: base,
|
|
114
96
|
observedEffects: service ? ["Manage the declared service process"] : [],
|
|
115
97
|
};
|
|
116
98
|
},
|
|
@@ -133,108 +115,62 @@ export function createBehaviorAdapter(service) {
|
|
|
133
115
|
};
|
|
134
116
|
}
|
|
135
117
|
export const behaviorAdapter = createBehaviorAdapter();
|
|
136
|
-
export async function
|
|
118
|
+
export async function createProductionBinding(input) {
|
|
119
|
+
const unboundBinding = (configValid = true) => ({
|
|
120
|
+
behaviorAdapter: createBehaviorAdapter(undefined, input.config, configValid),
|
|
121
|
+
});
|
|
137
122
|
const localBaseUrl = input.config.localBaseUrl;
|
|
138
123
|
const publicBaseUrl = input.config.publicBaseUrl;
|
|
139
124
|
const downstreamCredentialFile = input.config.downstreamCredentialFile;
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
return
|
|
125
|
+
if (!localBaseUrl || !publicBaseUrl || !downstreamCredentialFile)
|
|
126
|
+
return unboundBinding();
|
|
127
|
+
let listener;
|
|
128
|
+
let publicUrl;
|
|
129
|
+
try {
|
|
130
|
+
listener = new URL(localBaseUrl);
|
|
131
|
+
publicUrl = new URL(publicBaseUrl);
|
|
132
|
+
}
|
|
133
|
+
catch {
|
|
134
|
+
return unboundBinding(false);
|
|
150
135
|
}
|
|
151
|
-
const listener = new URL(localBaseUrl);
|
|
152
136
|
if (listener.protocol !== "http:" ||
|
|
153
137
|
!new Set(["127.0.0.1", "localhost", "::1", "[::1]"]).has(listener.hostname) ||
|
|
154
|
-
listener.pathname !== "/"
|
|
155
|
-
|
|
138
|
+
listener.pathname !== "/" ||
|
|
139
|
+
publicUrl.protocol !== "https:")
|
|
140
|
+
return unboundBinding(false);
|
|
156
141
|
const port = listener.port === "" ? 80 : Number(listener.port);
|
|
157
142
|
if (!Number.isInteger(port) || port <= 0 || port > 65_535)
|
|
158
|
-
return
|
|
159
|
-
const [{ join }, { parseAgentGatewayProcessConfig }] = await Promise.all([
|
|
160
|
-
import("node:path"),
|
|
161
|
-
import("../src/process.js"),
|
|
162
|
-
]);
|
|
163
|
-
const processConfig = parseAgentGatewayProcessConfig({
|
|
164
|
-
host: listener.hostname,
|
|
165
|
-
port,
|
|
166
|
-
publicBaseUrl,
|
|
167
|
-
downstreamBaseUrl,
|
|
168
|
-
credentialFile: join(stateRoot, "agent", "secrets", "role-credentials.json"),
|
|
169
|
-
downstreamCredentialFile,
|
|
170
|
-
});
|
|
171
|
-
const probeService = {
|
|
172
|
-
async start() {
|
|
173
|
-
throw new Error("managed by Platform CLI service supervisor");
|
|
174
|
-
},
|
|
175
|
-
async stop() { },
|
|
176
|
-
async restart() {
|
|
177
|
-
throw new Error("managed by Platform CLI service supervisor");
|
|
178
|
-
},
|
|
179
|
-
async readiness() {
|
|
180
|
-
try {
|
|
181
|
-
const response = await fetch(new URL("/ready", listener));
|
|
182
|
-
return {
|
|
183
|
-
status: response.ok ? "READY" : "NOT_READY",
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
catch {
|
|
187
|
-
return { status: "NOT_READY" };
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
status: () => ({
|
|
191
|
-
endpoint: listener.href.replace(/\/$/, ""),
|
|
192
|
-
managed: true,
|
|
193
|
-
}),
|
|
194
|
-
};
|
|
195
|
-
return {
|
|
196
|
-
serviceProcess: {
|
|
197
|
-
contract: "deployment.service-process.v1",
|
|
198
|
-
bin: "proflow-agent-gateway",
|
|
199
|
-
startCommand: "start",
|
|
200
|
-
config: processConfig,
|
|
201
|
-
},
|
|
202
|
-
behaviorAdapter: createBehaviorAdapter(probeService),
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
export async function createProductionBinding(input) {
|
|
206
|
-
const localBaseUrl = input.config.localBaseUrl;
|
|
207
|
-
const publicBaseUrl = input.config.publicBaseUrl;
|
|
208
|
-
const downstreamCredentialFile = input.config.downstreamCredentialFile;
|
|
143
|
+
return unboundBinding(false);
|
|
209
144
|
const platformHost = input.configByModuleRef.get("platform-host");
|
|
210
145
|
const executionRuntime = input.configByModuleRef.get("execution-runtime");
|
|
211
146
|
const stateRoot = platformHost?.stateRoot;
|
|
212
147
|
const downstreamBaseUrl = executionRuntime?.["identity.endpoint"];
|
|
213
|
-
if (!
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
148
|
+
if (!stateRoot || !downstreamBaseUrl)
|
|
149
|
+
return unboundBinding();
|
|
150
|
+
try {
|
|
151
|
+
const downstream = new URL(downstreamBaseUrl);
|
|
152
|
+
if (downstream.protocol !== "http:" ||
|
|
153
|
+
!["localhost", "127.0.0.1", "::1"].includes(downstream.hostname))
|
|
154
|
+
return unboundBinding();
|
|
155
|
+
}
|
|
156
|
+
catch {
|
|
157
|
+
return unboundBinding();
|
|
219
158
|
}
|
|
220
|
-
const listener = new URL(localBaseUrl);
|
|
221
|
-
if (listener.protocol !== "http:" ||
|
|
222
|
-
!new Set(["127.0.0.1", "localhost", "::1", "[::1]"]).has(listener.hostname) ||
|
|
223
|
-
listener.pathname !== "/")
|
|
224
|
-
return undefined;
|
|
225
|
-
const port = listener.port === "" ? 80 : Number(listener.port);
|
|
226
|
-
if (!Number.isInteger(port) || port <= 0 || port > 65_535)
|
|
227
|
-
return undefined;
|
|
228
159
|
const [{ join }, { createAgentGatewayProcess, parseAgentGatewayProcessConfig },] = await Promise.all([import("node:path"), import("../src/process.js")]);
|
|
229
|
-
|
|
230
|
-
|
|
160
|
+
let processConfig;
|
|
161
|
+
try {
|
|
162
|
+
processConfig = parseAgentGatewayProcessConfig({
|
|
231
163
|
host: listener.hostname,
|
|
232
164
|
port,
|
|
233
165
|
publicBaseUrl,
|
|
234
166
|
downstreamBaseUrl,
|
|
235
167
|
credentialFile: join(stateRoot, "agent", "secrets", "role-credentials.json"),
|
|
236
168
|
downstreamCredentialFile,
|
|
237
|
-
})
|
|
238
|
-
}
|
|
239
|
-
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
catch {
|
|
172
|
+
return unboundBinding(false);
|
|
173
|
+
}
|
|
174
|
+
const service = await createAgentGatewayProcess({ config: processConfig });
|
|
175
|
+
return { behaviorAdapter: createBehaviorAdapter(service, input.config) };
|
|
240
176
|
}
|
|
@@ -3,11 +3,10 @@ export declare const descriptor: {
|
|
|
3
3
|
readonly contractVersion: "1.0.0";
|
|
4
4
|
readonly moduleRef: "agent-gateway";
|
|
5
5
|
readonly packageName: "@tomflow/proflow-agent-gateway";
|
|
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: "agent-runtime-collaboration";
|
|
13
12
|
readonly summary: "The sole Custom GPT Actions HTTP ingress and OpenAI transport anti-corruption layer.";
|
|
@@ -73,5 +72,9 @@ export declare const descriptor: {
|
|
|
73
72
|
readonly id: "overview";
|
|
74
73
|
readonly path: "./README.md";
|
|
75
74
|
readonly description: "Agent Gateway package overview";
|
|
75
|
+
}, {
|
|
76
|
+
readonly id: "configuration";
|
|
77
|
+
readonly path: "./CONFIGURATION.md";
|
|
78
|
+
readonly description: "Module configuration fields, sources and materialization instructions";
|
|
76
79
|
}];
|
|
77
80
|
};
|
|
@@ -3,23 +3,40 @@ export const descriptor = {
|
|
|
3
3
|
contractVersion: "1.0.0",
|
|
4
4
|
moduleRef: "agent-gateway",
|
|
5
5
|
packageName: "@tomflow/proflow-agent-gateway",
|
|
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: "agent-runtime-collaboration",
|
|
13
12
|
summary: "The sole Custom GPT Actions HTTP ingress and OpenAI transport anti-corruption layer.",
|
|
14
13
|
},
|
|
15
|
-
provides: [
|
|
14
|
+
provides: [
|
|
15
|
+
{
|
|
16
|
+
contractRef: "custom-gpt-actions-gateway",
|
|
17
|
+
version: "1.0.0",
|
|
18
|
+
},
|
|
19
|
+
],
|
|
16
20
|
requires: [
|
|
17
|
-
{
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
{
|
|
22
|
+
contractRef: "agent-runtime",
|
|
23
|
+
versionRange: ">=1.0.0 <2.0.0",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
contractRef: "task-orchestration",
|
|
27
|
+
versionRange: ">=1.0.0 <2.0.0",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
contractRef: "execution",
|
|
31
|
+
versionRange: ">=1.0.0 <2.0.0",
|
|
32
|
+
},
|
|
20
33
|
],
|
|
21
34
|
requirements: [
|
|
22
|
-
{
|
|
35
|
+
{
|
|
36
|
+
kind: "runtime",
|
|
37
|
+
runtime: "node",
|
|
38
|
+
versionRange: ">=24.19.0",
|
|
39
|
+
},
|
|
23
40
|
],
|
|
24
41
|
configSlots: [
|
|
25
42
|
{
|
|
@@ -84,5 +101,10 @@ export const descriptor = {
|
|
|
84
101
|
path: "./README.md",
|
|
85
102
|
description: "Agent Gateway package overview",
|
|
86
103
|
},
|
|
104
|
+
{
|
|
105
|
+
id: "configuration",
|
|
106
|
+
path: "./CONFIGURATION.md",
|
|
107
|
+
description: "Module configuration fields, sources and materialization instructions",
|
|
108
|
+
},
|
|
87
109
|
],
|
|
88
110
|
};
|
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 { createAgentGatewayProcess, loadAgentGatewayProcessConfig, } from "./process.js";
|
|
4
|
-
function installSelf() {
|
|
5
|
-
const executable = process.platform === "win32" ? "platform.cmd" : "platform";
|
|
6
|
-
const result = spawnSync(executable, ["install", "@tomflow/proflow-agent-gateway", "--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-agent-gateway
|
|
6
|
+
process.stdout.write("Usage: proflow-agent-gateway 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-agent-gateway install");
|
|
25
|
-
installSelf();
|
|
26
|
-
}
|
|
27
9
|
if (command !== "start" || !configPath)
|
|
28
10
|
throw new Error("Usage: proflow-agent-gateway start /absolute/config.json");
|
|
29
11
|
const config = await loadAgentGatewayProcessConfig(configPath);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tomflow/proflow-agent-gateway",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -19,22 +19,23 @@
|
|
|
19
19
|
"dist",
|
|
20
20
|
"proflow.module.json",
|
|
21
21
|
"conformance.json",
|
|
22
|
-
"README.md"
|
|
22
|
+
"README.md",
|
|
23
|
+
"CONFIGURATION.md"
|
|
23
24
|
],
|
|
24
25
|
"dependencies": {
|
|
25
|
-
"zod": "4.1.12"
|
|
26
|
+
"zod": "4.1.12",
|
|
27
|
+
"@tomflow/proflow-module-contract": "^0.1.1"
|
|
26
28
|
},
|
|
27
29
|
"devDependencies": {
|
|
28
|
-
"@tomflow/proflow-
|
|
29
|
-
"@tomflow/proflow-execution-local": "^0.1.
|
|
30
|
-
"@tomflow/proflow-platform-host": "^0.1.2",
|
|
31
|
-
"@tomflow/proflow-task-orchestration": "^0.1.1",
|
|
32
|
-
"@tomflow/proflow-task-migration-runner": "^0.1.1",
|
|
33
|
-
"@tomflow/proflow-task-store-sqlite": "^0.1.1",
|
|
34
|
-
"@tomflow/proflow-execution-browser-extension": "^0.1.2",
|
|
30
|
+
"@tomflow/proflow-agent-runtime": "^0.1.2",
|
|
31
|
+
"@tomflow/proflow-execution-local": "^0.1.3",
|
|
35
32
|
"@tomflow/proflow-deployment-conformance": "^0.1.2",
|
|
36
|
-
"@tomflow/proflow-
|
|
37
|
-
"@tomflow/proflow-
|
|
33
|
+
"@tomflow/proflow-task-store-sqlite": "^0.1.2",
|
|
34
|
+
"@tomflow/proflow-task-migration-runner": "^0.1.2",
|
|
35
|
+
"@tomflow/proflow-task-orchestration": "^0.1.1",
|
|
36
|
+
"@tomflow/proflow-execution-browser-extension": "^0.1.3",
|
|
37
|
+
"@tomflow/proflow-platform-host": "^0.1.4",
|
|
38
|
+
"@tomflow/proflow-execution-runtime": "^0.1.5"
|
|
38
39
|
},
|
|
39
40
|
"description": "The sole Custom GPT Actions HTTP ingress and OpenAI transport anti-corruption layer.",
|
|
40
41
|
"keywords": [
|
|
@@ -44,15 +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-dev-tunnel",
|
|
52
|
-
"@tomflow/proflow-execution-runtime",
|
|
53
|
-
"@tomflow/proflow-platform-host",
|
|
54
|
-
"@tomflow/proflow-task-orchestration"
|
|
55
|
-
],
|
|
56
49
|
"manifest": "./proflow.module.json"
|
|
57
50
|
},
|
|
58
51
|
"scripts": {
|
package/proflow.module.json
CHANGED
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
"contractVersion": "1.0.0",
|
|
4
4
|
"moduleRef": "agent-gateway",
|
|
5
5
|
"packageName": "@tomflow/proflow-agent-gateway",
|
|
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": "agent-runtime-collaboration",
|
|
13
12
|
"summary": "The sole Custom GPT Actions HTTP ingress and OpenAI transport anti-corruption layer."
|
|
@@ -101,6 +100,11 @@
|
|
|
101
100
|
"id": "overview",
|
|
102
101
|
"path": "./README.md",
|
|
103
102
|
"description": "Agent Gateway package overview"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"id": "configuration",
|
|
106
|
+
"path": "./CONFIGURATION.md",
|
|
107
|
+
"description": "Module configuration fields, sources and materialization instructions"
|
|
104
108
|
}
|
|
105
109
|
]
|
|
106
110
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# @tomflow/proflow-agent-gateway
|
|
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.
|