@tomflow/proflow-platform-host 0.1.30 → 0.1.32

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @tomflow/proflow-platform-host
2
2
 
3
+ ## 0.1.32
4
+
5
+ ### Patch Changes
6
+
7
+ - test(platform-host): align worker provisioning contract
8
+
9
+ ## 0.1.31
10
+
11
+ ### Patch Changes
12
+
13
+ - Close the initial Monitor lifecycle with owner-backed seed/recover, activation-time rotation clocks, automatic bootstrap, and exact-target Monitor delivery.
14
+
3
15
  ## 0.1.30
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.30";
9
+ moduleVersion: "0.1.32";
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.30";
27
+ readonly moduleVersion: "0.1.32";
28
28
  };
29
29
  observedEffects: string[];
30
30
  }>;
@@ -34,7 +34,7 @@ export declare const behaviorAdapter: {
34
34
  ok: true;
35
35
  status: "SUCCEEDED";
36
36
  moduleRef: "platform-host";
37
- moduleVersion: "0.1.30";
37
+ moduleVersion: "0.1.32";
38
38
  data: {
39
39
  setupStatus: "READY";
40
40
  runtimeStatus: "RUNNING" | "STOPPED";
@@ -48,7 +48,7 @@ export declare const behaviorAdapter: {
48
48
  ok: true;
49
49
  status: "SUCCEEDED";
50
50
  moduleRef: "platform-host";
51
- moduleVersion: "0.1.30";
51
+ moduleVersion: "0.1.32";
52
52
  data: {
53
53
  endpoint: string;
54
54
  stateRoot: string;
@@ -66,7 +66,7 @@ export declare const behaviorAdapter: {
66
66
  ok: true;
67
67
  status: "SUCCEEDED";
68
68
  moduleRef: "platform-host";
69
- moduleVersion: "0.1.30";
69
+ moduleVersion: "0.1.32";
70
70
  data: {
71
71
  docs: string;
72
72
  };
@@ -79,7 +79,7 @@ export declare const behaviorAdapter: {
79
79
  ok: true;
80
80
  status: "SUCCEEDED";
81
81
  moduleRef: "platform-host";
82
- moduleVersion: "0.1.30";
82
+ moduleVersion: "0.1.32";
83
83
  data: {
84
84
  host: string;
85
85
  port: number;
@@ -90,7 +90,7 @@ export declare const behaviorAdapter: {
90
90
  result: {
91
91
  contract: "deployment.result.v1";
92
92
  moduleRef: "platform-host";
93
- moduleVersion: "0.1.30";
93
+ moduleVersion: "0.1.32";
94
94
  ok: false;
95
95
  status: "FAILED";
96
96
  error: {
@@ -107,7 +107,7 @@ export declare const behaviorAdapter: {
107
107
  readonly ok: true;
108
108
  readonly status: "SUCCEEDED";
109
109
  readonly moduleRef: "platform-host";
110
- readonly moduleVersion: "0.1.30";
110
+ readonly moduleVersion: "0.1.32";
111
111
  };
112
112
  observedEffects: string[];
113
113
  } | {
@@ -116,11 +116,11 @@ export declare const behaviorAdapter: {
116
116
  readonly ok: true;
117
117
  readonly status: "SUCCEEDED";
118
118
  readonly moduleRef: "platform-host";
119
- readonly moduleVersion: "0.1.30";
119
+ readonly moduleVersion: "0.1.32";
120
120
  } | {
121
121
  contract: "deployment.result.v1";
122
122
  moduleRef: "platform-host";
123
- moduleVersion: "0.1.30";
123
+ moduleVersion: "0.1.32";
124
124
  ok: false;
125
125
  status: "FAILED";
126
126
  error: {
@@ -63,25 +63,33 @@ async function running(context) {
63
63
  return false;
64
64
  }
65
65
  }
66
+ async function readPrivateConnection(context, input) {
67
+ const facts = await readModuleSharedFacts(context, "execution-browser-extension");
68
+ const endpoint = factString(facts, input.endpointFact);
69
+ const tokenFile = factString(facts, input.tokenFileFact);
70
+ if (!endpoint || !tokenFile)
71
+ return undefined;
72
+ const info = await stat(tokenFile);
73
+ if (process.platform !== "win32" && (info.mode & 0o077) !== 0)
74
+ throw new Error(`${input.tokenFileFact} permissions must be owner-only`);
75
+ const credential = (await readFile(tokenFile, "utf8")).trim();
76
+ if (credential.length < 32)
77
+ throw new Error(`invalid ${input.tokenFileFact} credential`);
78
+ return { endpoint, credential };
79
+ }
66
80
  async function compose(context) {
67
81
  const own = await ownFacts(context);
68
82
  const { createPlatformHost, parsePlatformHostConfig } = await import("../src/index.js");
69
83
  const url = new URL(own.endpoint);
70
84
  const host = createPlatformHost({
71
- resolveLocalToolConnection: async () => {
72
- const facts = await readModuleSharedFacts(context, "execution-browser-extension");
73
- const endpoint = factString(facts, "localToolBridgeEndpoint");
74
- const tokenFile = factString(facts, "localToolHostTokenFile");
75
- if (!endpoint || !tokenFile)
76
- return undefined;
77
- const info = await stat(tokenFile);
78
- if (process.platform !== "win32" && (info.mode & 0o077) !== 0)
79
- throw new Error("local tool credential permissions must be owner-only");
80
- const credential = (await readFile(tokenFile, "utf8")).trim();
81
- if (credential.length < 32)
82
- throw new Error("invalid local tool credential");
83
- return { endpoint, credential };
84
- },
85
+ resolveLocalToolConnection: () => readPrivateConnection(context, {
86
+ endpointFact: "localToolBridgeEndpoint",
87
+ tokenFileFact: "localToolHostTokenFile",
88
+ }),
89
+ resolveMonitorControlConnection: () => readPrivateConnection(context, {
90
+ endpointFact: "monitorControlEndpoint",
91
+ tokenFileFact: "monitorControlTokenFile",
92
+ }),
85
93
  resolveOwnerConnection: async (owner) => {
86
94
  const facts = await readModuleSharedFacts(context, owner === "execution" ? "execution-runtime" : "model-runtime");
87
95
  const baseUrl = factString(facts, "endpoint"), tokenFile = factString(facts, "transportCredentialFile");
@@ -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.30";
6
+ readonly moduleVersion: "0.1.32";
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.30",
6
+ moduleVersion: "0.1.32",
7
7
  kind: "service",
8
8
  templateVersion: "1.0.0",
9
9
  platformCompatibility: ">=1.0.0 <2.0.0",
@@ -99,6 +99,10 @@ export type LocalToolConnectionResolver = () => Promise<{
99
99
  endpoint: string;
100
100
  credential: string;
101
101
  } | undefined>;
102
+ export type MonitorControlConnectionResolver = () => Promise<{
103
+ endpoint: string;
104
+ credential: string;
105
+ } | undefined>;
102
106
  export type PlatformHostBrowserOwnerPorts = {
103
107
  task: {
104
108
  getWorkerBinding(taskId: string, roleRef: string): Promise<{
@@ -232,6 +236,7 @@ export declare function createPlatformHost(input: {
232
236
  executionCredential?: string;
233
237
  resolveOwnerConnection?: OwnerConnectionResolver;
234
238
  resolveLocalToolConnection?: LocalToolConnectionResolver;
239
+ resolveMonitorControlConnection?: MonitorControlConnectionResolver;
235
240
  }): Readonly<{
236
241
  start: () => Promise<{
237
242
  host: string;