@tomflow/proflow-platform-cli 0.1.8 → 0.1.10
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/README.md +1 -0
- package/dist/deployment/adapter.d.ts +5 -5
- package/dist/deployment/descriptor.d.ts +1 -1
- package/dist/deployment/descriptor.js +1 -1
- package/dist/src/cli.js +1 -1
- package/dist/src/persistence/config.d.ts +1 -1
- package/dist/src/persistence/config.js +30 -5
- package/package.json +1 -1
- package/proflow.module.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @tomflow/proflow-platform-cli
|
|
2
2
|
|
|
3
|
+
## 0.1.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fail closed on malformed persisted module config instead of treating it as missing configuration.
|
|
8
|
+
|
|
9
|
+
## 0.1.9
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Clarify whole-instance uninstall preservation boundaries in public CLI help and package documentation.
|
|
14
|
+
|
|
3
15
|
## 0.1.8
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -55,4 +55,5 @@ platform manifest [module]
|
|
|
55
55
|
- Requested Workspace paths are canonicalized before binding comparison. A second distinct Workspace is rejected with `WORKSPACE_ALREADY_BOUND` until the current Platform Instance is uninstalled.
|
|
56
56
|
- `status/start/stop/restart/modules/docs/verify/doctor/upgrade/uninstall` resolve the durable global binding rather than the caller's cwd. `platform status` exposes the bound Workspace path.
|
|
57
57
|
- `platform uninstall` without a module/package removes the current Platform Instance and clears its binding; it does not uninstall the global CLI package.
|
|
58
|
+
- Whole-instance uninstall removes managed ProFlow modules plus Deployment-owned `.proflow/deployment` state (plans, deployment state, verification, and instance identity). Business/domain data outside `.proflow/deployment` is intentionally preserved. v1 has no purge mode, so ordinary uninstall never claims to delete preserved domain data.
|
|
58
59
|
- Workspace package mutation is package-manager agnostic for v1: `npm`, `yarn`, and `pnpm` are supported. The CLI installation manager and the bound Workspace manager are independent facts.
|
|
@@ -5,7 +5,7 @@ export declare const behaviorAdapter: {
|
|
|
5
5
|
ok: boolean;
|
|
6
6
|
status: "SUCCEEDED";
|
|
7
7
|
moduleRef: "platform-cli";
|
|
8
|
-
moduleVersion: "0.1.
|
|
8
|
+
moduleVersion: "0.1.10";
|
|
9
9
|
data?: {} | null;
|
|
10
10
|
};
|
|
11
11
|
observedEffects: never[];
|
|
@@ -16,7 +16,7 @@ export declare const behaviorAdapter: {
|
|
|
16
16
|
ok: boolean;
|
|
17
17
|
status: "SUCCEEDED";
|
|
18
18
|
moduleRef: "platform-cli";
|
|
19
|
-
moduleVersion: "0.1.
|
|
19
|
+
moduleVersion: "0.1.10";
|
|
20
20
|
data?: {} | null;
|
|
21
21
|
};
|
|
22
22
|
observedEffects: never[];
|
|
@@ -27,7 +27,7 @@ export declare const behaviorAdapter: {
|
|
|
27
27
|
ok: boolean;
|
|
28
28
|
status: "SUCCEEDED";
|
|
29
29
|
moduleRef: "platform-cli";
|
|
30
|
-
moduleVersion: "0.1.
|
|
30
|
+
moduleVersion: "0.1.10";
|
|
31
31
|
data?: {} | null;
|
|
32
32
|
};
|
|
33
33
|
observedEffects: never[];
|
|
@@ -38,7 +38,7 @@ export declare const behaviorAdapter: {
|
|
|
38
38
|
ok: boolean;
|
|
39
39
|
status: "SUCCEEDED";
|
|
40
40
|
moduleRef: "platform-cli";
|
|
41
|
-
moduleVersion: "0.1.
|
|
41
|
+
moduleVersion: "0.1.10";
|
|
42
42
|
data?: {} | null;
|
|
43
43
|
};
|
|
44
44
|
observedEffects: never[];
|
|
@@ -49,7 +49,7 @@ export declare const behaviorAdapter: {
|
|
|
49
49
|
ok: boolean;
|
|
50
50
|
status: "SUCCEEDED";
|
|
51
51
|
moduleRef: "platform-cli";
|
|
52
|
-
moduleVersion: "0.1.
|
|
52
|
+
moduleVersion: "0.1.10";
|
|
53
53
|
data?: {} | null;
|
|
54
54
|
};
|
|
55
55
|
observedEffects: never[];
|
|
@@ -3,7 +3,7 @@ export declare const descriptor: {
|
|
|
3
3
|
readonly contractVersion: "1.0.0";
|
|
4
4
|
readonly moduleRef: "platform-cli";
|
|
5
5
|
readonly packageName: "@tomflow/proflow-platform-cli";
|
|
6
|
-
readonly moduleVersion: "0.1.
|
|
6
|
+
readonly moduleVersion: "0.1.10";
|
|
7
7
|
readonly kind: "cli";
|
|
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-cli",
|
|
5
5
|
packageName: "@tomflow/proflow-platform-cli",
|
|
6
|
-
moduleVersion: "0.1.
|
|
6
|
+
moduleVersion: "0.1.10",
|
|
7
7
|
kind: "cli",
|
|
8
8
|
templateVersion: "1.0.0",
|
|
9
9
|
platformCompatibility: ">=1.0.0 <2.0.0",
|
package/dist/src/cli.js
CHANGED
|
@@ -1288,7 +1288,7 @@ export async function runCli(argv, runtime = {}) {
|
|
|
1288
1288
|
"platform plan --intent configure --config <file>",
|
|
1289
1289
|
"platform apply <planRef>",
|
|
1290
1290
|
"platform start | status | verify | doctor | stop | restart",
|
|
1291
|
-
"platform uninstall #
|
|
1291
|
+
"platform uninstall # remove managed modules and .proflow/deployment state; preserve business/domain data outside .proflow/deployment; clear binding; keep the global CLI; v1 has no purge mode",
|
|
1292
1292
|
"append --json for the stable machine-readable contract",
|
|
1293
1293
|
],
|
|
1294
1294
|
},
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
1
2
|
import { join } from "node:path";
|
|
2
|
-
import {
|
|
3
|
+
import { PlatformError } from "../errors.js";
|
|
3
4
|
import { writeJsonAtomic } from "./atomic.js";
|
|
4
5
|
import { assertSafeFileName } from "./guards.js";
|
|
5
6
|
function configFilePath(paths, moduleRef) {
|
|
@@ -16,6 +17,32 @@ function isStringMap(value) {
|
|
|
16
17
|
}
|
|
17
18
|
return Object.values(value).every((item) => typeof item === "string");
|
|
18
19
|
}
|
|
20
|
+
function isMissingFile(error) {
|
|
21
|
+
return (typeof error === "object" &&
|
|
22
|
+
error !== null &&
|
|
23
|
+
"code" in error &&
|
|
24
|
+
error.code === "ENOENT");
|
|
25
|
+
}
|
|
26
|
+
async function readConfigValues(file, moduleRef, kind) {
|
|
27
|
+
let raw;
|
|
28
|
+
try {
|
|
29
|
+
raw = await readFile(file, "utf8");
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
if (isMissingFile(error))
|
|
33
|
+
return undefined;
|
|
34
|
+
throw new PlatformError("CONFIG_INVALID", `cannot read ${kind} config for ${moduleRef}: ${error instanceof Error ? error.message : String(error)}`);
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
const parsed = JSON.parse(raw);
|
|
38
|
+
if (!isStringMap(parsed))
|
|
39
|
+
throw new TypeError("expected a JSON object whose values are strings");
|
|
40
|
+
return parsed;
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
throw new PlatformError("CONFIG_INVALID", `${kind} config for ${moduleRef} is invalid JSON/config: ${error instanceof Error ? error.message : String(error)}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
19
46
|
// secretRef config values are opaque reference identities (e.g.
|
|
20
47
|
// `secret://model-provider/default`), not raw secrets, so they materialize to
|
|
21
48
|
// the public config file verbatim. A raw secret would go to the separate 0o600
|
|
@@ -30,10 +57,8 @@ export async function materializeConfig(paths, config) {
|
|
|
30
57
|
await writeJsonAtomic(secretsFilePath(paths, config.moduleRef), {}, 0o600);
|
|
31
58
|
}
|
|
32
59
|
export async function loadConfig(paths, moduleRef) {
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
const publicValues = isStringMap(publicRaw) ? publicRaw : undefined;
|
|
36
|
-
const secretValues = isStringMap(secretRaw) ? secretRaw : undefined;
|
|
60
|
+
const publicValues = await readConfigValues(configFilePath(paths, moduleRef), moduleRef, "public");
|
|
61
|
+
const secretValues = await readConfigValues(secretsFilePath(paths, moduleRef), moduleRef, "secret");
|
|
37
62
|
if (publicValues === undefined && secretValues === undefined)
|
|
38
63
|
return undefined;
|
|
39
64
|
return {
|
package/package.json
CHANGED
package/proflow.module.json
CHANGED