@kitsy/cnos 1.1.2 → 1.3.0

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.
Files changed (66) hide show
  1. package/README.md +6 -3
  2. package/dist/browser/index.cjs +94 -0
  3. package/dist/browser/index.d.cts +16 -0
  4. package/dist/browser/index.d.ts +16 -0
  5. package/dist/browser/index.js +67 -0
  6. package/dist/build/index.cjs +2889 -0
  7. package/dist/build/index.d.cts +5 -0
  8. package/dist/build/index.d.ts +5 -0
  9. package/dist/build/index.js +26 -0
  10. package/dist/{chunk-53HXUSM6.js → chunk-CDXJISGB.js} +1 -1
  11. package/dist/{chunk-33ZDYDQJ.js → chunk-DRKDNY4I.js} +1470 -462
  12. package/dist/chunk-E7SE6N26.js +189 -0
  13. package/dist/chunk-EDCLLCNL.js +200 -0
  14. package/dist/{chunk-7FBRVJD6.js → chunk-FC3IV6A7.js} +1 -31
  15. package/dist/{chunk-JQGGSNCL.js → chunk-JDII6O72.js} +1 -1
  16. package/dist/chunk-K6QYI2T4.js +105 -0
  17. package/dist/{chunk-IHSV5AFX.js → chunk-OOKFRWTN.js} +1 -1
  18. package/dist/{chunk-HOS4E7XO.js → chunk-OWUZQ4OH.js} +1 -1
  19. package/dist/{chunk-IQOUWY6T.js → chunk-QTKXPY3N.js} +1 -1
  20. package/dist/configure/index.cjs +2928 -0
  21. package/dist/configure/index.d.cts +12 -0
  22. package/dist/configure/index.d.ts +12 -0
  23. package/dist/configure/index.js +24 -0
  24. package/dist/{envNaming-BrOk5ndZ.d.cts → envNaming-D6k66myh.d.cts} +1 -1
  25. package/dist/{envNaming-DCaNdnrF.d.ts → envNaming-Dy3WYiGK.d.ts} +1 -1
  26. package/dist/index.cjs +1396 -264
  27. package/dist/index.d.cts +2 -12
  28. package/dist/index.d.ts +2 -12
  29. package/dist/index.js +13 -143
  30. package/dist/internal.cjs +1913 -63
  31. package/dist/internal.d.cts +190 -8
  32. package/dist/internal.d.ts +190 -8
  33. package/dist/internal.js +669 -3
  34. package/dist/plugin/basic-schema.cjs +29 -2
  35. package/dist/plugin/basic-schema.d.cts +1 -1
  36. package/dist/plugin/basic-schema.d.ts +1 -1
  37. package/dist/plugin/basic-schema.js +2 -2
  38. package/dist/plugin/cli-args.cjs +29 -2
  39. package/dist/plugin/cli-args.d.cts +1 -1
  40. package/dist/plugin/cli-args.d.ts +1 -1
  41. package/dist/plugin/cli-args.js +2 -2
  42. package/dist/plugin/dotenv.cjs +38 -11
  43. package/dist/plugin/dotenv.d.cts +2 -2
  44. package/dist/plugin/dotenv.d.ts +2 -2
  45. package/dist/plugin/dotenv.js +2 -2
  46. package/dist/plugin/env-export.cjs +60 -48
  47. package/dist/plugin/env-export.d.cts +2 -2
  48. package/dist/plugin/env-export.d.ts +2 -2
  49. package/dist/plugin/env-export.js +2 -2
  50. package/dist/plugin/filesystem.cjs +46 -91
  51. package/dist/plugin/filesystem.d.cts +1 -1
  52. package/dist/plugin/filesystem.d.ts +1 -1
  53. package/dist/plugin/filesystem.js +2 -2
  54. package/dist/plugin/process-env.cjs +33 -6
  55. package/dist/plugin/process-env.d.cts +2 -2
  56. package/dist/plugin/process-env.d.ts +2 -2
  57. package/dist/plugin/process-env.js +2 -2
  58. package/dist/{plugin-BVNEHj19.d.cts → plugin-CyNkf7Dm.d.cts} +42 -2
  59. package/dist/{plugin-BVNEHj19.d.ts → plugin-CyNkf7Dm.d.ts} +42 -2
  60. package/dist/runtime/index.cjs +3116 -0
  61. package/dist/runtime/index.d.cts +23 -0
  62. package/dist/runtime/index.d.ts +23 -0
  63. package/dist/runtime/index.js +15 -0
  64. package/dist/{toPublicEnv-Dd152fFy.d.cts → toPublicEnv-Cz72m6y0.d.cts} +1 -1
  65. package/dist/{toPublicEnv-Gwz3xTK0.d.ts → toPublicEnv-D2PZkaN-.d.ts} +1 -1
  66. package/package.json +26 -1
@@ -34,6 +34,21 @@ __export(basic_schema_exports, {
34
34
  });
35
35
  module.exports = __toCommonJS(basic_schema_exports);
36
36
 
37
+ // ../core/src/keychain/linux.ts
38
+ var import_node_child_process = require("child_process");
39
+ var import_node_util = require("util");
40
+ var execFileAsync = (0, import_node_util.promisify)(import_node_child_process.execFile);
41
+
42
+ // ../core/src/keychain/macos.ts
43
+ var import_node_child_process2 = require("child_process");
44
+ var import_node_util2 = require("util");
45
+ var execFileAsync2 = (0, import_node_util2.promisify)(import_node_child_process2.execFile);
46
+
47
+ // ../core/src/keychain/windows.ts
48
+ var import_node_child_process3 = require("child_process");
49
+ var import_node_util3 = require("util");
50
+ var execFileAsync3 = (0, import_node_util3.promisify)(import_node_child_process3.execFile);
51
+
37
52
  // ../core/src/manifest/loadManifest.ts
38
53
  var import_promises2 = require("fs/promises");
39
54
  var import_node_path2 = __toESM(require("path"), 1);
@@ -205,14 +220,26 @@ function applySchemaRules(graph, schema) {
205
220
  };
206
221
  }
207
222
 
223
+ // ../core/src/secrets/auditLog.ts
224
+ var import_promises8 = require("fs/promises");
225
+ var import_node_path8 = __toESM(require("path"), 1);
226
+
208
227
  // ../core/src/utils/secretStore.ts
209
228
  var import_node_crypto = require("crypto");
229
+ var import_promises7 = require("fs/promises");
230
+ var import_node_path7 = __toESM(require("path"), 1);
231
+
232
+ // ../core/src/secrets/sessionStore.ts
210
233
  var import_promises6 = require("fs/promises");
211
234
  var import_node_path6 = __toESM(require("path"), 1);
212
235
 
236
+ // ../core/src/secrets/prompt.ts
237
+ var import_node_readline = __toESM(require("readline"), 1);
238
+ var import_node_stream = require("stream");
239
+
213
240
  // ../core/src/runtime/dump.ts
214
- var import_promises7 = require("fs/promises");
215
- var import_node_path7 = __toESM(require("path"), 1);
241
+ var import_promises9 = require("fs/promises");
242
+ var import_node_path9 = __toESM(require("path"), 1);
216
243
 
217
244
  // ../../plugins/basic-schema/src/index.ts
218
245
  function createBasicSchemaPlugin() {
@@ -1,4 +1,4 @@
1
- import { j as ValidatorPlugin } from '../plugin-BVNEHj19.cjs';
1
+ import { V as ValidatorPlugin } from '../plugin-CyNkf7Dm.cjs';
2
2
 
3
3
  declare function createBasicSchemaPlugin(): ValidatorPlugin;
4
4
 
@@ -1,4 +1,4 @@
1
- import { j as ValidatorPlugin } from '../plugin-BVNEHj19.js';
1
+ import { V as ValidatorPlugin } from '../plugin-CyNkf7Dm.js';
2
2
 
3
3
  declare function createBasicSchemaPlugin(): ValidatorPlugin;
4
4
 
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createBasicSchemaPlugin
3
- } from "../chunk-JQGGSNCL.js";
4
- import "../chunk-33ZDYDQJ.js";
3
+ } from "../chunk-JDII6O72.js";
4
+ import "../chunk-DRKDNY4I.js";
5
5
  export {
6
6
  createBasicSchemaPlugin
7
7
  };
@@ -36,6 +36,21 @@ __export(cli_args_exports, {
36
36
  });
37
37
  module.exports = __toCommonJS(cli_args_exports);
38
38
 
39
+ // ../core/src/keychain/linux.ts
40
+ var import_node_child_process = require("child_process");
41
+ var import_node_util = require("util");
42
+ var execFileAsync = (0, import_node_util.promisify)(import_node_child_process.execFile);
43
+
44
+ // ../core/src/keychain/macos.ts
45
+ var import_node_child_process2 = require("child_process");
46
+ var import_node_util2 = require("util");
47
+ var execFileAsync2 = (0, import_node_util2.promisify)(import_node_child_process2.execFile);
48
+
49
+ // ../core/src/keychain/windows.ts
50
+ var import_node_child_process3 = require("child_process");
51
+ var import_node_util3 = require("util");
52
+ var execFileAsync3 = (0, import_node_util3.promisify)(import_node_child_process3.execFile);
53
+
39
54
  // ../core/src/manifest/loadManifest.ts
40
55
  var import_promises2 = require("fs/promises");
41
56
  var import_node_path2 = __toESM(require("path"), 1);
@@ -63,14 +78,26 @@ var import_node_path4 = __toESM(require("path"), 1);
63
78
  var import_promises5 = require("fs/promises");
64
79
  var import_node_path5 = __toESM(require("path"), 1);
65
80
 
81
+ // ../core/src/secrets/auditLog.ts
82
+ var import_promises8 = require("fs/promises");
83
+ var import_node_path8 = __toESM(require("path"), 1);
84
+
66
85
  // ../core/src/utils/secretStore.ts
67
86
  var import_node_crypto = require("crypto");
87
+ var import_promises7 = require("fs/promises");
88
+ var import_node_path7 = __toESM(require("path"), 1);
89
+
90
+ // ../core/src/secrets/sessionStore.ts
68
91
  var import_promises6 = require("fs/promises");
69
92
  var import_node_path6 = __toESM(require("path"), 1);
70
93
 
94
+ // ../core/src/secrets/prompt.ts
95
+ var import_node_readline = __toESM(require("readline"), 1);
96
+ var import_node_stream = require("stream");
97
+
71
98
  // ../core/src/runtime/dump.ts
72
- var import_promises7 = require("fs/promises");
73
- var import_node_path7 = __toESM(require("path"), 1);
99
+ var import_promises9 = require("fs/promises");
100
+ var import_node_path9 = __toESM(require("path"), 1);
74
101
 
75
102
  // ../../plugins/cli-args/src/index.ts
76
103
  var CLI_ARGS_PLUGIN_ID = "@kitsy/cnos/plugins/cli-args";
@@ -1,4 +1,4 @@
1
- import { f as ConfigEntry, L as LoaderPlugin } from '../plugin-BVNEHj19.cjs';
1
+ import { a as ConfigEntry, L as LoaderPlugin } from '../plugin-CyNkf7Dm.cjs';
2
2
 
3
3
  interface ParsedCliArg {
4
4
  key: string;
@@ -1,4 +1,4 @@
1
- import { f as ConfigEntry, L as LoaderPlugin } from '../plugin-BVNEHj19.js';
1
+ import { a as ConfigEntry, L as LoaderPlugin } from '../plugin-CyNkf7Dm.js';
2
2
 
3
3
  interface ParsedCliArg {
4
4
  key: string;
@@ -2,8 +2,8 @@ import {
2
2
  cliArgEntriesFromArgs,
3
3
  createCliArgsPlugin,
4
4
  parseCliArgs
5
- } from "../chunk-HOS4E7XO.js";
6
- import "../chunk-33ZDYDQJ.js";
5
+ } from "../chunk-OWUZQ4OH.js";
6
+ import "../chunk-DRKDNY4I.js";
7
7
  export {
8
8
  cliArgEntriesFromArgs,
9
9
  createCliArgsPlugin,
@@ -37,8 +37,23 @@ __export(dotenv_exports, {
37
37
  module.exports = __toCommonJS(dotenv_exports);
38
38
 
39
39
  // ../../plugins/dotenv/src/index.ts
40
- var import_promises8 = require("fs/promises");
41
- var import_node_path8 = __toESM(require("path"), 1);
40
+ var import_promises10 = require("fs/promises");
41
+ var import_node_path10 = __toESM(require("path"), 1);
42
+
43
+ // ../core/src/keychain/linux.ts
44
+ var import_node_child_process = require("child_process");
45
+ var import_node_util = require("util");
46
+ var execFileAsync = (0, import_node_util.promisify)(import_node_child_process.execFile);
47
+
48
+ // ../core/src/keychain/macos.ts
49
+ var import_node_child_process2 = require("child_process");
50
+ var import_node_util2 = require("util");
51
+ var execFileAsync2 = (0, import_node_util2.promisify)(import_node_child_process2.execFile);
52
+
53
+ // ../core/src/keychain/windows.ts
54
+ var import_node_child_process3 = require("child_process");
55
+ var import_node_util3 = require("util");
56
+ var execFileAsync3 = (0, import_node_util3.promisify)(import_node_child_process3.execFile);
42
57
 
43
58
  // ../core/src/manifest/loadManifest.ts
44
59
  var import_promises2 = require("fs/promises");
@@ -89,11 +104,27 @@ var import_node_path4 = __toESM(require("path"), 1);
89
104
  var import_promises5 = require("fs/promises");
90
105
  var import_node_path5 = __toESM(require("path"), 1);
91
106
 
107
+ // ../core/src/secrets/auditLog.ts
108
+ var import_promises8 = require("fs/promises");
109
+ var import_node_path8 = __toESM(require("path"), 1);
110
+
92
111
  // ../core/src/utils/secretStore.ts
93
112
  var import_node_crypto = require("crypto");
113
+ var import_promises7 = require("fs/promises");
114
+ var import_node_path7 = __toESM(require("path"), 1);
115
+
116
+ // ../core/src/secrets/sessionStore.ts
94
117
  var import_promises6 = require("fs/promises");
95
118
  var import_node_path6 = __toESM(require("path"), 1);
96
119
 
120
+ // ../core/src/secrets/prompt.ts
121
+ var import_node_readline = __toESM(require("readline"), 1);
122
+ var import_node_stream = require("stream");
123
+
124
+ // ../core/src/runtime/dump.ts
125
+ var import_promises9 = require("fs/promises");
126
+ var import_node_path9 = __toESM(require("path"), 1);
127
+
97
128
  // ../core/src/utils/envNaming.ts
98
129
  function normalizeMappingConfig(config = {}) {
99
130
  return {
@@ -101,8 +132,8 @@ function normalizeMappingConfig(config = {}) {
101
132
  explicit: config.explicit ?? {}
102
133
  };
103
134
  }
104
- function fromScreamingSnake(path9) {
105
- return path9.split("_").map((segment) => segment.trim().toLowerCase()).filter(Boolean).join(".");
135
+ function fromScreamingSnake(path11) {
136
+ return path11.split("_").map((segment) => segment.trim().toLowerCase()).filter(Boolean).join(".");
106
137
  }
107
138
  function envVarToLogicalKey(envVar, config = {}) {
108
139
  const normalized = normalizeMappingConfig(config);
@@ -126,10 +157,6 @@ function envVarToLogicalKey(envVar, config = {}) {
126
157
  return `value.${fromScreamingSnake(envVar)}`;
127
158
  }
128
159
 
129
- // ../core/src/runtime/dump.ts
130
- var import_promises7 = require("fs/promises");
131
- var import_node_path7 = __toESM(require("path"), 1);
132
-
133
160
  // ../../plugins/dotenv/src/index.ts
134
161
  var DOTENV_PLUGIN_ID = "@kitsy/cnos/plugins/dotenv";
135
162
  function parseDoubleQuoted(value) {
@@ -187,7 +214,7 @@ function dotenvEntriesFromObject(values, mapping = {}, originFile, workspaceId =
187
214
  }
188
215
  async function readIfPresent(filePath) {
189
216
  try {
190
- return await (0, import_promises8.readFile)(filePath, "utf8");
217
+ return await (0, import_promises10.readFile)(filePath, "utf8");
191
218
  } catch {
192
219
  return void 0;
193
220
  }
@@ -206,7 +233,7 @@ function createDotenvPlugin() {
206
233
  workspace: workspaceRoot.workspaceId
207
234
  });
208
235
  for (const fileName of fileNames) {
209
- const absolutePath = import_node_path8.default.join(envRoot, fileName);
236
+ const absolutePath = import_node_path10.default.join(envRoot, fileName);
210
237
  const document = await readIfPresent(absolutePath);
211
238
  if (!document) {
212
239
  continue;
@@ -215,7 +242,7 @@ function createDotenvPlugin() {
215
242
  ...dotenvEntriesFromObject(
216
243
  parseDotenv(document),
217
244
  config.envMapping,
218
- toPortablePath(import_node_path8.default.relative(import_node_path8.default.dirname(context.manifestRoot), absolutePath)),
245
+ toPortablePath(import_node_path10.default.relative(import_node_path10.default.dirname(context.manifestRoot), absolutePath)),
219
246
  workspaceRoot.workspaceId
220
247
  )
221
248
  );
@@ -1,5 +1,5 @@
1
- import { L as LoaderPlugin, f as ConfigEntry } from '../plugin-BVNEHj19.cjs';
2
- import { E as EnvMappingConfig } from '../envNaming-BrOk5ndZ.cjs';
1
+ import { L as LoaderPlugin, a as ConfigEntry } from '../plugin-CyNkf7Dm.cjs';
2
+ import { E as EnvMappingConfig } from '../envNaming-D6k66myh.cjs';
3
3
 
4
4
  declare function parseDotenv(document: string): Record<string, string>;
5
5
  declare function dotenvEntriesFromObject(values: Record<string, string>, mapping?: EnvMappingConfig, originFile?: string, workspaceId?: string): ConfigEntry[];
@@ -1,5 +1,5 @@
1
- import { L as LoaderPlugin, f as ConfigEntry } from '../plugin-BVNEHj19.js';
2
- import { E as EnvMappingConfig } from '../envNaming-DCaNdnrF.js';
1
+ import { L as LoaderPlugin, a as ConfigEntry } from '../plugin-CyNkf7Dm.js';
2
+ import { E as EnvMappingConfig } from '../envNaming-Dy3WYiGK.js';
3
3
 
4
4
  declare function parseDotenv(document: string): Record<string, string>;
5
5
  declare function dotenvEntriesFromObject(values: Record<string, string>, mapping?: EnvMappingConfig, originFile?: string, workspaceId?: string): ConfigEntry[];
@@ -2,8 +2,8 @@ import {
2
2
  createDotenvPlugin,
3
3
  dotenvEntriesFromObject,
4
4
  parseDotenv
5
- } from "../chunk-IQOUWY6T.js";
6
- import "../chunk-33ZDYDQJ.js";
5
+ } from "../chunk-QTKXPY3N.js";
6
+ import "../chunk-DRKDNY4I.js";
7
7
  export {
8
8
  createDotenvPlugin,
9
9
  dotenvEntriesFromObject,
@@ -52,6 +52,21 @@ var CnosManifestError = class extends CnosError {
52
52
  manifestPath;
53
53
  };
54
54
 
55
+ // ../core/src/keychain/linux.ts
56
+ var import_node_child_process = require("child_process");
57
+ var import_node_util = require("util");
58
+ var execFileAsync = (0, import_node_util.promisify)(import_node_child_process.execFile);
59
+
60
+ // ../core/src/keychain/macos.ts
61
+ var import_node_child_process2 = require("child_process");
62
+ var import_node_util2 = require("util");
63
+ var execFileAsync2 = (0, import_node_util2.promisify)(import_node_child_process2.execFile);
64
+
65
+ // ../core/src/keychain/windows.ts
66
+ var import_node_child_process3 = require("child_process");
67
+ var import_node_util3 = require("util");
68
+ var execFileAsync3 = (0, import_node_util3.promisify)(import_node_child_process3.execFile);
69
+
55
70
  // ../core/src/manifest/loadManifest.ts
56
71
  var import_promises2 = require("fs/promises");
57
72
  var import_node_path2 = __toESM(require("path"), 1);
@@ -60,6 +75,9 @@ var import_node_path2 = __toESM(require("path"), 1);
60
75
  var import_promises = require("fs/promises");
61
76
  var import_node_os = __toESM(require("os"), 1);
62
77
  var import_node_path = __toESM(require("path"), 1);
78
+ function stripNamespace(key) {
79
+ return key.split(".").slice(1).join(".");
80
+ }
63
81
 
64
82
  // ../core/src/utils/yaml.ts
65
83
  var import_yaml = require("yaml");
@@ -72,14 +90,41 @@ var import_node_path3 = __toESM(require("path"), 1);
72
90
  var import_promises4 = require("fs/promises");
73
91
  var import_node_path4 = __toESM(require("path"), 1);
74
92
 
93
+ // ../core/src/promotions/validatePromotion.ts
94
+ var DEFAULT_DATA_NAMESPACE = {
95
+ kind: "data",
96
+ shareable: false
97
+ };
98
+ function getNamespaceNameForKey(key) {
99
+ const [namespace] = key.split(".");
100
+ if (!namespace || !key.includes(".")) {
101
+ throw new CnosManifestError(`Logical key must be namespace-qualified: ${key}`);
102
+ }
103
+ return namespace;
104
+ }
105
+ function getNamespaceDefinition(manifest, namespaceOrKey) {
106
+ const namespace = namespaceOrKey.includes(".") ? getNamespaceNameForKey(namespaceOrKey) : namespaceOrKey;
107
+ return manifest.namespaces[namespace] ?? DEFAULT_DATA_NAMESPACE;
108
+ }
109
+
75
110
  // ../core/src/workspaces/resolveWorkspaceContext.ts
76
111
  var import_promises5 = require("fs/promises");
77
112
  var import_node_path5 = __toESM(require("path"), 1);
78
113
 
114
+ // ../core/src/secrets/auditLog.ts
115
+ var import_promises8 = require("fs/promises");
116
+ var import_node_path8 = __toESM(require("path"), 1);
117
+
79
118
  // ../core/src/utils/secretStore.ts
80
119
  var import_node_crypto = require("crypto");
120
+ var import_promises7 = require("fs/promises");
121
+ var import_node_path7 = __toESM(require("path"), 1);
122
+
123
+ // ../core/src/secrets/sessionStore.ts
81
124
  var import_promises6 = require("fs/promises");
82
125
  var import_node_path6 = __toESM(require("path"), 1);
126
+
127
+ // ../core/src/utils/secretStore.ts
83
128
  function isObject(value) {
84
129
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
85
130
  }
@@ -87,6 +132,10 @@ function isSecretReference(value) {
87
132
  return isObject(value) && typeof value.provider === "string" && value.provider.trim().length > 0 && typeof value.ref === "string" && value.ref.trim().length > 0 && (value.vault === void 0 && true || typeof value.vault === "string" && value.vault.trim().length > 0) && Object.keys(value).every((key) => ["provider", "ref", "vault"].includes(key));
88
133
  }
89
134
 
135
+ // ../core/src/secrets/prompt.ts
136
+ var import_node_readline = __toESM(require("readline"), 1);
137
+ var import_node_stream = require("stream");
138
+
90
139
  // ../core/src/runtime/toEnv.ts
91
140
  function normalizeEnvValue(value) {
92
141
  if (value === void 0 || value === null) {
@@ -111,6 +160,10 @@ function toEnv(graph, manifest, options = {}) {
111
160
  if (!entry) {
112
161
  continue;
113
162
  }
163
+ const namespaceDefinition = getNamespaceDefinition(manifest, entry.namespace);
164
+ if (namespaceDefinition.kind !== "data" || !namespaceDefinition.shareable || namespaceDefinition.sensitive) {
165
+ continue;
166
+ }
114
167
  if (entry.namespace === "secret" && !includeSecrets) {
115
168
  continue;
116
169
  }
@@ -122,40 +175,9 @@ function toEnv(graph, manifest, options = {}) {
122
175
  return output;
123
176
  }
124
177
 
125
- // ../core/src/utils/envNaming.ts
126
- function normalizeMappingConfig(config = {}) {
127
- return {
128
- convention: config.convention,
129
- explicit: config.explicit ?? {}
130
- };
131
- }
132
- function toScreamingSnakeSegment(segment) {
133
- return segment.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[^A-Za-z0-9]+/g, "_").replace(/_+/g, "_").replace(/^_+|_+$/g, "").toUpperCase();
134
- }
135
- function toScreamingSnake(path8) {
136
- return path8.split(".").map((segment) => toScreamingSnakeSegment(segment)).filter(Boolean).join("_");
137
- }
138
- function logicalKeyToEnvVar(key, config = {}) {
139
- const normalized = normalizeMappingConfig(config);
140
- const explicitEntry = Object.entries(normalized.explicit).find(([, logicalKey]) => logicalKey === key);
141
- if (explicitEntry) {
142
- return explicitEntry[0];
143
- }
144
- if (normalized.convention !== "SCREAMING_SNAKE") {
145
- return void 0;
146
- }
147
- if (key.startsWith("value.")) {
148
- return toScreamingSnake(key.slice("value.".length));
149
- }
150
- if (key.startsWith("secret.")) {
151
- return `SECRET_${toScreamingSnake(key.slice("secret.".length))}`;
152
- }
153
- return void 0;
154
- }
155
-
156
178
  // ../core/src/runtime/toPublicEnv.ts
157
- function fallbackValueEnvVar(key) {
158
- return key.replace(/^value\./, "").replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[^A-Za-z0-9]+/g, "_").replace(/_+/g, "_").replace(/^_+|_+$/g, "").toUpperCase();
179
+ function fallbackPublicEnvVar(valuePath) {
180
+ return valuePath.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[^A-Za-z0-9]+/g, "_").replace(/_+/g, "_").replace(/^_+|_+$/g, "").toUpperCase();
159
181
  }
160
182
  function normalizeEnvValue2(value) {
161
183
  if (value === void 0 || value === null) {
@@ -182,22 +204,12 @@ function resolvePublicPrefix(manifest, options) {
182
204
  }
183
205
  return configuredPrefix;
184
206
  }
185
- function ensurePublicPromotionKey(key) {
186
- if (!key.startsWith("value.")) {
187
- throw new CnosManifestError(`public.promote may only contain value.* keys: ${key}`);
188
- }
189
- }
190
207
  function toPublicEnv(graph, manifest, options = {}) {
191
208
  const prefix = resolvePublicPrefix(manifest, options);
192
209
  const output = {};
193
- const promotions = [...manifest.public.promote].sort((left, right) => left.localeCompare(right));
194
- for (const key of promotions) {
195
- ensurePublicPromotionKey(key);
196
- const resolved = graph.entries.get(key);
197
- if (!resolved) {
198
- continue;
199
- }
200
- const baseEnvVar = logicalKeyToEnvVar(key, manifest.envMapping) ?? fallbackValueEnvVar(key);
210
+ const promotions = Array.from(graph.entries.values()).filter((entry) => entry.namespace === "public").sort((left, right) => left.key.localeCompare(right.key));
211
+ for (const resolved of promotions) {
212
+ const baseEnvVar = fallbackPublicEnvVar(stripNamespace(resolved.key));
201
213
  const envVar = prefix && !baseEnvVar.startsWith(prefix) ? `${prefix}${baseEnvVar}` : baseEnvVar;
202
214
  output[envVar] = normalizeEnvValue2(resolved.value);
203
215
  }
@@ -205,8 +217,8 @@ function toPublicEnv(graph, manifest, options = {}) {
205
217
  }
206
218
 
207
219
  // ../core/src/runtime/dump.ts
208
- var import_promises7 = require("fs/promises");
209
- var import_node_path7 = __toESM(require("path"), 1);
220
+ var import_promises9 = require("fs/promises");
221
+ var import_node_path9 = __toESM(require("path"), 1);
210
222
 
211
223
  // ../../plugins/env-export/src/index.ts
212
224
  function createEnvExportPlugin() {
@@ -1,5 +1,5 @@
1
- import { E as ExporterPlugin } from '../plugin-BVNEHj19.cjs';
2
- export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-Dd152fFy.cjs';
1
+ import { E as ExporterPlugin } from '../plugin-CyNkf7Dm.cjs';
2
+ export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-Cz72m6y0.cjs';
3
3
 
4
4
  declare function createEnvExportPlugin(): ExporterPlugin;
5
5
  declare function createPublicEnvExportPlugin(): ExporterPlugin;
@@ -1,5 +1,5 @@
1
- import { E as ExporterPlugin } from '../plugin-BVNEHj19.js';
2
- export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-Gwz3xTK0.js';
1
+ import { E as ExporterPlugin } from '../plugin-CyNkf7Dm.js';
2
+ export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-D2PZkaN-.js';
3
3
 
4
4
  declare function createEnvExportPlugin(): ExporterPlugin;
5
5
  declare function createPublicEnvExportPlugin(): ExporterPlugin;
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  createEnvExportPlugin,
3
3
  createPublicEnvExportPlugin
4
- } from "../chunk-IHSV5AFX.js";
4
+ } from "../chunk-OOKFRWTN.js";
5
5
  import {
6
6
  toEnv,
7
7
  toPublicEnv
8
- } from "../chunk-33ZDYDQJ.js";
8
+ } from "../chunk-DRKDNY4I.js";
9
9
  export {
10
10
  createEnvExportPlugin,
11
11
  createPublicEnvExportPlugin,