@epoch-agent/cli 0.2.0 → 0.3.1
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.
|
@@ -2,26 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
// src/files/env-file.ts
|
|
4
4
|
import { readFileSync } from "fs";
|
|
5
|
+
import { parseEnvText, setEnvVarText, writeEnvFile } from "@epoch-agent/infra";
|
|
5
6
|
import {
|
|
6
|
-
|
|
7
|
-
parseEnvText,
|
|
8
|
-
setEnvVarText,
|
|
9
|
-
t,
|
|
10
|
-
writeEnvFile
|
|
7
|
+
writeProviderSecret
|
|
11
8
|
} from "@epoch-agent/infra";
|
|
12
|
-
async function writeProviderKey(name, value, fallbackEnvPath) {
|
|
13
|
-
const store = getSecretStore();
|
|
14
|
-
if (!store) {
|
|
15
|
-
writeEnvFile(fallbackEnvPath, setEnvVarText(readOrEmpty(fallbackEnvPath), name, value));
|
|
16
|
-
return {
|
|
17
|
-
backend: "plaintext",
|
|
18
|
-
encrypted: false,
|
|
19
|
-
detail: t("cli.config.secret_plaintext_write", { path: fallbackEnvPath })
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
await store.set(name, value);
|
|
23
|
-
return { backend: store.backend, encrypted: store.encrypted, detail: store.detail };
|
|
24
|
-
}
|
|
25
9
|
async function exportSecretsToEnv(store, envFilePath, names) {
|
|
26
10
|
let text = readOrEmpty(envFilePath);
|
|
27
11
|
const written = [];
|
|
@@ -46,6 +30,6 @@ export {
|
|
|
46
30
|
parseEnvText,
|
|
47
31
|
setEnvVarText,
|
|
48
32
|
writeEnvFile,
|
|
49
|
-
|
|
50
|
-
|
|
33
|
+
exportSecretsToEnv,
|
|
34
|
+
writeProviderSecret
|
|
51
35
|
};
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
parseEnvText,
|
|
5
5
|
setEnvVarText,
|
|
6
6
|
writeEnvFile,
|
|
7
|
-
|
|
8
|
-
} from "./chunk-
|
|
7
|
+
writeProviderSecret
|
|
8
|
+
} from "./chunk-4SOT24BS.js";
|
|
9
9
|
export {
|
|
10
10
|
exportSecretsToEnv,
|
|
11
11
|
parseEnvText,
|
|
12
12
|
setEnvVarText as setEnvVar,
|
|
13
13
|
writeEnvFile,
|
|
14
|
-
writeProviderKey
|
|
14
|
+
writeProviderSecret as writeProviderKey
|
|
15
15
|
};
|