@tomflow/proflow-platform-host 0.1.13 → 0.1.15
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/CHANGELOG.md +12 -0
- package/dist/deployment/adapter.d.ts +21 -24
- package/dist/deployment/adapter.js +18 -11
- package/dist/deployment/descriptor.d.ts +1 -1
- package/dist/deployment/descriptor.js +1 -1
- package/dist/src/index.d.ts +0 -12
- package/dist/src/index.js +12 -29
- package/package.json +9 -9
- package/proflow.module.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @tomflow/proflow-platform-host
|
|
2
2
|
|
|
3
|
+
## 0.1.15
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Close the Real-3 source candidate and real-workspace loop: fail-closed Browser submit verification, worker-bound Task mutation and WAKE confirmation, detached platform start ownership with shell return, discoverable docs, and targeted single-package Workspace update.
|
|
8
|
+
|
|
9
|
+
## 0.1.14
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Retire the obsolete Carrier package and Browser standalone management CLI, make Platform setup/status preserve owner and dependency semantics, and enforce read-only status observation across the final Real-3 deployment closeout.
|
|
14
|
+
|
|
3
15
|
## 0.1.13
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -6,7 +6,7 @@ export declare const behaviorAdapter: {
|
|
|
6
6
|
ok: true;
|
|
7
7
|
status: "SUCCEEDED";
|
|
8
8
|
moduleRef: "platform-host";
|
|
9
|
-
moduleVersion: "0.1.
|
|
9
|
+
moduleVersion: "0.1.15";
|
|
10
10
|
data: {
|
|
11
11
|
endpoint: string;
|
|
12
12
|
stateRoot: string;
|
|
@@ -24,7 +24,7 @@ export declare const behaviorAdapter: {
|
|
|
24
24
|
readonly ok: true;
|
|
25
25
|
readonly status: "SUCCEEDED";
|
|
26
26
|
readonly moduleRef: "platform-host";
|
|
27
|
-
readonly moduleVersion: "0.1.
|
|
27
|
+
readonly moduleVersion: "0.1.15";
|
|
28
28
|
};
|
|
29
29
|
observedEffects: string[];
|
|
30
30
|
}>;
|
|
@@ -34,12 +34,12 @@ export declare const behaviorAdapter: {
|
|
|
34
34
|
ok: true;
|
|
35
35
|
status: "SUCCEEDED";
|
|
36
36
|
moduleRef: "platform-host";
|
|
37
|
-
moduleVersion: "0.1.
|
|
37
|
+
moduleVersion: "0.1.15";
|
|
38
38
|
data: {
|
|
39
|
-
setupStatus: "
|
|
39
|
+
setupStatus: "READY";
|
|
40
40
|
runtimeStatus: "RUNNING" | "STOPPED";
|
|
41
41
|
issues?: {
|
|
42
|
-
scope: "
|
|
42
|
+
scope: "RUNTIME";
|
|
43
43
|
code: string;
|
|
44
44
|
message: string;
|
|
45
45
|
relatedModuleRefs: string[];
|
|
@@ -51,21 +51,18 @@ export declare const behaviorAdapter: {
|
|
|
51
51
|
}>;
|
|
52
52
|
readonly setup: (context: ModuleCommandContext) => Promise<{
|
|
53
53
|
result: {
|
|
54
|
-
readonly contract: "deployment.result.v1";
|
|
55
|
-
readonly ok: true;
|
|
56
|
-
readonly status: "SUCCEEDED";
|
|
57
|
-
readonly moduleRef: "platform-host";
|
|
58
|
-
readonly moduleVersion: "0.1.13";
|
|
59
|
-
} | {
|
|
60
54
|
contract: "deployment.result.v1";
|
|
55
|
+
ok: true;
|
|
56
|
+
status: "SUCCEEDED";
|
|
61
57
|
moduleRef: "platform-host";
|
|
62
|
-
moduleVersion: "0.1.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
58
|
+
moduleVersion: "0.1.15";
|
|
59
|
+
data: {
|
|
60
|
+
endpoint: string;
|
|
61
|
+
stateRoot: string;
|
|
62
|
+
identityTokenFile: string;
|
|
63
|
+
taskApplicationTokenFile: string;
|
|
64
|
+
approvalApplicationTokenFile: string;
|
|
65
|
+
gatewayTransportCredentialFile: string;
|
|
69
66
|
};
|
|
70
67
|
};
|
|
71
68
|
observedEffects: never[];
|
|
@@ -76,7 +73,7 @@ export declare const behaviorAdapter: {
|
|
|
76
73
|
ok: true;
|
|
77
74
|
status: "SUCCEEDED";
|
|
78
75
|
moduleRef: "platform-host";
|
|
79
|
-
moduleVersion: "0.1.
|
|
76
|
+
moduleVersion: "0.1.15";
|
|
80
77
|
data: {
|
|
81
78
|
docs: string;
|
|
82
79
|
};
|
|
@@ -89,7 +86,7 @@ export declare const behaviorAdapter: {
|
|
|
89
86
|
ok: true;
|
|
90
87
|
status: "SUCCEEDED";
|
|
91
88
|
moduleRef: "platform-host";
|
|
92
|
-
moduleVersion: "0.1.
|
|
89
|
+
moduleVersion: "0.1.15";
|
|
93
90
|
data: {
|
|
94
91
|
host: string;
|
|
95
92
|
port: number;
|
|
@@ -100,7 +97,7 @@ export declare const behaviorAdapter: {
|
|
|
100
97
|
result: {
|
|
101
98
|
contract: "deployment.result.v1";
|
|
102
99
|
moduleRef: "platform-host";
|
|
103
|
-
moduleVersion: "0.1.
|
|
100
|
+
moduleVersion: "0.1.15";
|
|
104
101
|
ok: false;
|
|
105
102
|
status: "FAILED";
|
|
106
103
|
error: {
|
|
@@ -117,7 +114,7 @@ export declare const behaviorAdapter: {
|
|
|
117
114
|
readonly ok: true;
|
|
118
115
|
readonly status: "SUCCEEDED";
|
|
119
116
|
readonly moduleRef: "platform-host";
|
|
120
|
-
readonly moduleVersion: "0.1.
|
|
117
|
+
readonly moduleVersion: "0.1.15";
|
|
121
118
|
};
|
|
122
119
|
observedEffects: string[];
|
|
123
120
|
} | {
|
|
@@ -126,11 +123,11 @@ export declare const behaviorAdapter: {
|
|
|
126
123
|
readonly ok: true;
|
|
127
124
|
readonly status: "SUCCEEDED";
|
|
128
125
|
readonly moduleRef: "platform-host";
|
|
129
|
-
readonly moduleVersion: "0.1.
|
|
126
|
+
readonly moduleVersion: "0.1.15";
|
|
130
127
|
} | {
|
|
131
128
|
contract: "deployment.result.v1";
|
|
132
129
|
moduleRef: "platform-host";
|
|
133
|
-
moduleVersion: "0.1.
|
|
130
|
+
moduleVersion: "0.1.15";
|
|
134
131
|
ok: false;
|
|
135
132
|
status: "FAILED";
|
|
136
133
|
error: {
|
|
@@ -45,6 +45,11 @@ async function ownFacts(context) {
|
|
|
45
45
|
await writeModuleSharedFacts(context, descriptor.moduleRef, facts);
|
|
46
46
|
return facts;
|
|
47
47
|
}
|
|
48
|
+
async function readOwnFacts(context) {
|
|
49
|
+
const facts = await readModuleSharedFacts(context, descriptor.moduleRef);
|
|
50
|
+
const endpoint = factString(facts, "endpoint");
|
|
51
|
+
return endpoint ? { endpoint } : undefined;
|
|
52
|
+
}
|
|
48
53
|
async function dependencies(context) {
|
|
49
54
|
const execution = await readModuleSharedFacts(context, "execution-runtime");
|
|
50
55
|
const model = await readModuleSharedFacts(context, "model-runtime");
|
|
@@ -65,9 +70,13 @@ async function dependencies(context) {
|
|
|
65
70
|
: undefined;
|
|
66
71
|
}
|
|
67
72
|
async function running(context) {
|
|
68
|
-
const
|
|
73
|
+
const own = await readOwnFacts(context);
|
|
74
|
+
if (!own)
|
|
75
|
+
return false;
|
|
69
76
|
try {
|
|
70
|
-
return (await fetch(`${endpoint}/ready`, {
|
|
77
|
+
return (await fetch(`${own.endpoint}/ready`, {
|
|
78
|
+
signal: AbortSignal.timeout(500),
|
|
79
|
+
})).ok;
|
|
71
80
|
}
|
|
72
81
|
catch {
|
|
73
82
|
return false;
|
|
@@ -119,25 +128,25 @@ export const behaviorAdapter = {
|
|
|
119
128
|
};
|
|
120
129
|
},
|
|
121
130
|
status: async (context) => {
|
|
122
|
-
const
|
|
131
|
+
const runtimeDependencies = await dependencies(context);
|
|
123
132
|
return {
|
|
124
133
|
result: {
|
|
125
134
|
...base,
|
|
126
135
|
data: {
|
|
127
|
-
setupStatus:
|
|
136
|
+
setupStatus: "READY",
|
|
128
137
|
runtimeStatus: (await running(context))
|
|
129
138
|
? "RUNNING"
|
|
130
139
|
: "STOPPED",
|
|
131
|
-
...(
|
|
140
|
+
...(runtimeDependencies
|
|
132
141
|
? {}
|
|
133
142
|
: {
|
|
134
143
|
issues: [
|
|
135
144
|
{
|
|
136
|
-
scope: "
|
|
145
|
+
scope: "RUNTIME",
|
|
137
146
|
code: "UPSTREAM_NOT_READY",
|
|
138
|
-
message: "等待 Execution 与 Model Runtime
|
|
147
|
+
message: "等待 Execution 与 Model Runtime 发布运行所需服务信息",
|
|
139
148
|
relatedModuleRefs: ["execution-runtime", "model-runtime"],
|
|
140
|
-
nextCommand: "platform setup
|
|
149
|
+
nextCommand: "platform setup",
|
|
141
150
|
},
|
|
142
151
|
],
|
|
143
152
|
}),
|
|
@@ -147,9 +156,7 @@ export const behaviorAdapter = {
|
|
|
147
156
|
};
|
|
148
157
|
},
|
|
149
158
|
setup: async (context) => ({
|
|
150
|
-
result:
|
|
151
|
-
? base
|
|
152
|
-
: failed("SETUP_FAILED", "required Execution/Model producer shared facts are unavailable"),
|
|
159
|
+
result: { ...base, data: await ownFacts(context) },
|
|
153
160
|
observedEffects: [],
|
|
154
161
|
}),
|
|
155
162
|
docs: async (_context) => ({
|
|
@@ -3,7 +3,7 @@ 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.15";
|
|
7
7
|
readonly kind: "service";
|
|
8
8
|
readonly templateVersion: "1.0.0";
|
|
9
9
|
readonly platformCompatibility: ">=1.0.0 <2.0.0";
|
|
@@ -3,7 +3,7 @@ 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.15",
|
|
7
7
|
kind: "service",
|
|
8
8
|
templateVersion: "1.0.0",
|
|
9
9
|
platformCompatibility: ">=1.0.0 <2.0.0",
|
package/dist/src/index.d.ts
CHANGED
|
@@ -208,18 +208,6 @@ export type PlatformHostTaskDriverPorts = {
|
|
|
208
208
|
workerRef: string | null;
|
|
209
209
|
};
|
|
210
210
|
}>;
|
|
211
|
-
startTask(input: {
|
|
212
|
-
taskId: string;
|
|
213
|
-
expectedTaskVersion: number;
|
|
214
|
-
idempotencyKey: string;
|
|
215
|
-
}): Promise<unknown>;
|
|
216
|
-
startNode(input: {
|
|
217
|
-
taskId: string;
|
|
218
|
-
nodeId: string;
|
|
219
|
-
expectedTaskVersion: number;
|
|
220
|
-
expectedNodeVersion: number;
|
|
221
|
-
idempotencyKey: string;
|
|
222
|
-
}): Promise<unknown>;
|
|
223
211
|
};
|
|
224
212
|
export type PlatformHostAgentIdentityPorts = {
|
|
225
213
|
getRegisteredRole(roleRef: string): Promise<{
|
package/dist/src/index.js
CHANGED
|
@@ -637,6 +637,7 @@ async function constructGraph(config, executionCredential, modelCredential) {
|
|
|
637
637
|
const taskOperation = taskOperations.get(operationId);
|
|
638
638
|
if (taskOperation) {
|
|
639
639
|
let actorRef = authenticatedRoleRef;
|
|
640
|
+
let canonicalWorkerRef;
|
|
640
641
|
if (typeof input.taskId === "string") {
|
|
641
642
|
const workerRef = await admitTaskParticipant(input.taskId, authenticatedRoleRef, typeof input.workerRef === "string" ? input.workerRef : undefined);
|
|
642
643
|
if (taskMutationOperations.has(operationId))
|
|
@@ -645,7 +646,8 @@ async function constructGraph(config, executionCredential, modelCredential) {
|
|
|
645
646
|
taskId: input.taskId,
|
|
646
647
|
workerRef,
|
|
647
648
|
});
|
|
648
|
-
|
|
649
|
+
canonicalWorkerRef = workerRef;
|
|
650
|
+
actorRef = `worker:${workerRef}`;
|
|
649
651
|
}
|
|
650
652
|
let canonicalTaskInput = input;
|
|
651
653
|
if (context?.fileMaterializationInputs !== undefined) {
|
|
@@ -662,8 +664,8 @@ async function constructGraph(config, executionCredential, modelCredential) {
|
|
|
662
664
|
? { taskId: input.taskId }
|
|
663
665
|
: {}),
|
|
664
666
|
roleRef: authenticatedRoleRef,
|
|
665
|
-
...(
|
|
666
|
-
? { workerRef:
|
|
667
|
+
...(canonicalWorkerRef !== undefined
|
|
668
|
+
? { workerRef: canonicalWorkerRef }
|
|
667
669
|
: {}),
|
|
668
670
|
files: context.fileMaterializationInputs,
|
|
669
671
|
}), "carrier file materialization result");
|
|
@@ -805,8 +807,7 @@ async function constructGraph(config, executionCredential, modelCredential) {
|
|
|
805
807
|
request.capability === "worker.restore" ||
|
|
806
808
|
request.capability === "worker.wake" ||
|
|
807
809
|
request.capability === "collaboration.deliver";
|
|
808
|
-
const internalBrowserCaller = request.callerRef === "platform-host:
|
|
809
|
-
request.callerRef === "platform-host:carrier-controller" ||
|
|
810
|
+
const internalBrowserCaller = request.callerRef === "platform-host:carrier-controller" ||
|
|
810
811
|
request.callerRef === "extension:task-observer" ||
|
|
811
812
|
request.callerRef === "extension:collaboration-carrier";
|
|
812
813
|
if (!internalBrowserCaller)
|
|
@@ -897,18 +898,6 @@ async function constructGraph(config, executionCredential, modelCredential) {
|
|
|
897
898
|
async getTaskDriveProjection(taskId) {
|
|
898
899
|
return unwrap(task.queries.getTaskDriveProjection({ taskId }));
|
|
899
900
|
},
|
|
900
|
-
async startTask(input) {
|
|
901
|
-
return unwrap(task.commands.startTask({
|
|
902
|
-
...input,
|
|
903
|
-
actorRef: "platform-host:task-observer",
|
|
904
|
-
}));
|
|
905
|
-
},
|
|
906
|
-
async startNode(input) {
|
|
907
|
-
return unwrap(task.commands.startNode({
|
|
908
|
-
...input,
|
|
909
|
-
actorRef: "platform-host:task-observer",
|
|
910
|
-
}));
|
|
911
|
-
},
|
|
912
901
|
});
|
|
913
902
|
const agentIdentityPorts = Object.freeze({
|
|
914
903
|
async getRegisteredRole(roleRef) {
|
|
@@ -1196,7 +1185,7 @@ async function constructGraph(config, executionCredential, modelCredential) {
|
|
|
1196
1185
|
const underlyingRef = typeof value.underlyingRef === "string"
|
|
1197
1186
|
? value.underlyingRef
|
|
1198
1187
|
: "none";
|
|
1199
|
-
|
|
1188
|
+
const wakeExecution = object(await execution.invoke("executeCapability", {
|
|
1200
1189
|
contract: "execution",
|
|
1201
1190
|
contractVersion: "1.0.0",
|
|
1202
1191
|
idempotencyKey: `task-observer-wake:${taskId}:${nodeId}:${runNo}:${trigger}:${underlyingRef}`,
|
|
@@ -1217,7 +1206,11 @@ async function constructGraph(config, executionCredential, modelCredential) {
|
|
|
1217
1206
|
trigger,
|
|
1218
1207
|
fingerprint: `wake:${taskId}:${nodeId}:${runNo}:${trigger}:${underlyingRef}`,
|
|
1219
1208
|
},
|
|
1220
|
-
});
|
|
1209
|
+
}), "task wake execution");
|
|
1210
|
+
if (wakeExecution.status !== "SUCCEEDED" ||
|
|
1211
|
+
wakeExecution.sideEffectState !== "APPLIED")
|
|
1212
|
+
throw new Error(`TASK_WAKE_NOT_CONFIRMED:${String(wakeExecution.status)}:${String(wakeExecution.sideEffectState)}`);
|
|
1213
|
+
return wakeExecution;
|
|
1221
1214
|
}
|
|
1222
1215
|
if (operation === "task.diagnostic") {
|
|
1223
1216
|
const response = object(await model.invoke("infer", {
|
|
@@ -1578,16 +1571,6 @@ export function createPlatformHost(input) {
|
|
|
1578
1571
|
throw new Error("PLATFORM_HOST_NOT_RUNNING");
|
|
1579
1572
|
return graph.taskDriverPorts.getNodeContext(taskId, nodeId);
|
|
1580
1573
|
},
|
|
1581
|
-
async startTask(input) {
|
|
1582
|
-
if (!graph)
|
|
1583
|
-
throw new Error("PLATFORM_HOST_NOT_RUNNING");
|
|
1584
|
-
return graph.taskDriverPorts.startTask(input);
|
|
1585
|
-
},
|
|
1586
|
-
async startNode(input) {
|
|
1587
|
-
if (!graph)
|
|
1588
|
-
throw new Error("PLATFORM_HOST_NOT_RUNNING");
|
|
1589
|
-
return graph.taskDriverPorts.startNode(input);
|
|
1590
|
-
},
|
|
1591
1574
|
});
|
|
1592
1575
|
const agentIdentityPorts = Object.freeze({
|
|
1593
1576
|
async getRegisteredRole(roleRef) {
|
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.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -24,19 +24,19 @@
|
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"zod": "4.1.12",
|
|
27
|
-
"@tomflow/proflow-
|
|
28
|
-
"@tomflow/proflow-
|
|
27
|
+
"@tomflow/proflow-agent-runtime": "^0.1.13",
|
|
28
|
+
"@tomflow/proflow-execution-contracts": "^0.1.10",
|
|
29
29
|
"@tomflow/proflow-module-contract": "^0.1.13",
|
|
30
30
|
"@tomflow/proflow-task-migration-runner": "^0.1.11",
|
|
31
|
+
"@tomflow/proflow-task-orchestration": "^0.1.10",
|
|
31
32
|
"@tomflow/proflow-task-store-sqlite": "^0.1.11",
|
|
32
|
-
"@tomflow/proflow-
|
|
33
|
-
"@tomflow/proflow-execution-contracts": "^0.1.10"
|
|
33
|
+
"@tomflow/proflow-execution-browser-extension": "^0.1.26"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@tomflow/proflow-agent-gateway": "^0.1.
|
|
37
|
-
"@tomflow/proflow-deployment-conformance": "^0.1.
|
|
38
|
-
"@tomflow/proflow-
|
|
39
|
-
"@tomflow/proflow-
|
|
36
|
+
"@tomflow/proflow-agent-gateway": "^0.1.15",
|
|
37
|
+
"@tomflow/proflow-deployment-conformance": "^0.1.13",
|
|
38
|
+
"@tomflow/proflow-execution-runtime": "^0.1.15",
|
|
39
|
+
"@tomflow/proflow-model-runtime": "^0.1.20"
|
|
40
40
|
},
|
|
41
41
|
"description": "Provides the ProFlow local application composition root that binds Task, Agent, Execution and Model owner transports.",
|
|
42
42
|
"keywords": [
|
package/proflow.module.json
CHANGED