@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
@@ -40,11 +40,11 @@ __export(filesystem_exports, {
40
40
  module.exports = __toCommonJS(filesystem_exports);
41
41
 
42
42
  // ../../plugins/filesystem/src/filesystemSecretsReader.ts
43
- var import_promises9 = require("fs/promises");
43
+ var import_promises11 = require("fs/promises");
44
44
 
45
45
  // ../../plugins/filesystem/src/helpers.ts
46
- var import_promises8 = require("fs/promises");
47
- var import_node_path8 = __toESM(require("path"), 1);
46
+ var import_promises10 = require("fs/promises");
47
+ var import_node_path10 = __toESM(require("path"), 1);
48
48
 
49
49
  // ../core/src/errors.ts
50
50
  var CnosError = class extends Error {
@@ -61,6 +61,21 @@ var CnosManifestError = class extends CnosError {
61
61
  manifestPath;
62
62
  };
63
63
 
64
+ // ../core/src/keychain/linux.ts
65
+ var import_node_child_process = require("child_process");
66
+ var import_node_util = require("util");
67
+ var execFileAsync = (0, import_node_util.promisify)(import_node_child_process.execFile);
68
+
69
+ // ../core/src/keychain/macos.ts
70
+ var import_node_child_process2 = require("child_process");
71
+ var import_node_util2 = require("util");
72
+ var execFileAsync2 = (0, import_node_util2.promisify)(import_node_child_process2.execFile);
73
+
74
+ // ../core/src/keychain/windows.ts
75
+ var import_node_child_process3 = require("child_process");
76
+ var import_node_util3 = require("util");
77
+ var execFileAsync3 = (0, import_node_util3.promisify)(import_node_child_process3.execFile);
78
+
64
79
  // ../core/src/manifest/loadManifest.ts
65
80
  var import_promises2 = require("fs/promises");
66
81
  var import_node_path2 = __toESM(require("path"), 1);
@@ -69,15 +84,6 @@ var import_node_path2 = __toESM(require("path"), 1);
69
84
  var import_promises = require("fs/promises");
70
85
  var import_node_os = __toESM(require("os"), 1);
71
86
  var import_node_path = __toESM(require("path"), 1);
72
- function expandHomePath(targetPath) {
73
- if (targetPath === "~") {
74
- return import_node_os.default.homedir();
75
- }
76
- if (targetPath.startsWith("~/") || targetPath.startsWith("~\\")) {
77
- return import_node_path.default.join(import_node_os.default.homedir(), targetPath.slice(2));
78
- }
79
- return targetPath;
80
- }
81
87
  function toPortablePath(targetPath) {
82
88
  return targetPath.replace(/\\/g, "/");
83
89
  }
@@ -100,81 +106,57 @@ var import_node_path4 = __toESM(require("path"), 1);
100
106
  var import_promises5 = require("fs/promises");
101
107
  var import_node_path5 = __toESM(require("path"), 1);
102
108
 
109
+ // ../core/src/secrets/auditLog.ts
110
+ var import_promises8 = require("fs/promises");
111
+ var import_node_path8 = __toESM(require("path"), 1);
112
+
103
113
  // ../core/src/utils/secretStore.ts
104
114
  var import_node_crypto = require("crypto");
115
+ var import_promises7 = require("fs/promises");
116
+ var import_node_path7 = __toESM(require("path"), 1);
117
+
118
+ // ../core/src/secrets/sessionStore.ts
105
119
  var import_promises6 = require("fs/promises");
106
120
  var import_node_path6 = __toESM(require("path"), 1);
121
+
122
+ // ../core/src/utils/secretStore.ts
107
123
  function isObject(value) {
108
124
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
109
125
  }
110
126
  function isSecretReference(value) {
111
127
  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));
112
128
  }
113
- function resolveSecretStoreRoot(processEnv = process.env) {
114
- return import_node_path6.default.resolve(expandHomePath(processEnv.CNOS_SECRET_HOME ?? "~/.cnos/secrets"));
115
- }
116
- function resolveSecretStoreFile(storeRoot, ref, vault = "default") {
117
- return import_node_path6.default.join(storeRoot, "vaults", vault, "store", ...ref.split("/")).concat(".json");
118
- }
119
- function deriveKey(passphrase, salt) {
120
- return (0, import_node_crypto.scryptSync)(passphrase, salt, 32);
121
- }
122
- function resolveSecretPassphrase(vault = "default", processEnv = process.env) {
123
- const vaultToken = vault.replace(/[^A-Za-z0-9]+/g, "_").replace(/^_+|_+$/g, "").toUpperCase();
124
- return processEnv[`CNOS_SECRET_PASSPHRASE_${vaultToken}`] ?? processEnv.CNOS_SECRET_PASSPHRASE;
125
- }
126
- function decryptDocument(document, passphrase) {
127
- const salt = Buffer.from(document.salt, "base64");
128
- const iv = Buffer.from(document.iv, "base64");
129
- const tag = Buffer.from(document.tag, "base64");
130
- const ciphertext = Buffer.from(document.ciphertext, "base64");
131
- const key = deriveKey(passphrase, salt);
132
- const decipher = (0, import_node_crypto.createDecipheriv)("aes-256-gcm", key, iv);
133
- decipher.setAuthTag(tag);
134
- const plaintext = Buffer.concat([decipher.update(ciphertext), decipher.final()]);
135
- return plaintext.toString("utf8");
136
- }
137
- async function readLocalSecret(storeRoot, ref, passphrase, vault = "default") {
138
- if (!passphrase) {
139
- throw new CnosManifestError(
140
- `Missing CNOS secret passphrase for local secret ref "${ref}". Set CNOS_SECRET_PASSPHRASE or pass processEnv explicitly.`
141
- );
142
- }
143
- const filePath = resolveSecretStoreFile(storeRoot, ref, vault);
144
- const source = await (0, import_promises6.readFile)(filePath, "utf8");
145
- const document = JSON.parse(source);
146
- if (document.version !== 1 || document.algorithm !== "aes-256-gcm" || typeof document.salt !== "string" || typeof document.iv !== "string" || typeof document.tag !== "string" || typeof document.ciphertext !== "string") {
147
- throw new CnosManifestError("Invalid local secret document", filePath);
148
- }
149
- return decryptDocument(document, passphrase);
150
- }
129
+
130
+ // ../core/src/secrets/prompt.ts
131
+ var import_node_readline = __toESM(require("readline"), 1);
132
+ var import_node_stream = require("stream");
151
133
 
152
134
  // ../core/src/runtime/dump.ts
153
- var import_promises7 = require("fs/promises");
154
- var import_node_path7 = __toESM(require("path"), 1);
135
+ var import_promises9 = require("fs/promises");
136
+ var import_node_path9 = __toESM(require("path"), 1);
155
137
 
156
138
  // ../../plugins/filesystem/src/helpers.ts
157
139
  var YAML_EXTENSIONS = /* @__PURE__ */ new Set([".yml", ".yaml"]);
158
140
  var FILESYSTEM_PLUGIN_ID = "@kitsy/cnos/plugins/filesystem";
159
141
  async function existsDirectory(targetPath) {
160
142
  try {
161
- const stat = await (0, import_promises8.readdir)(targetPath);
162
- void stat;
143
+ const stat2 = await (0, import_promises10.readdir)(targetPath);
144
+ void stat2;
163
145
  return true;
164
146
  } catch {
165
147
  return false;
166
148
  }
167
149
  }
168
150
  async function collectYamlFiles(root) {
169
- const entries = await (0, import_promises8.readdir)(root, { withFileTypes: true });
151
+ const entries = await (0, import_promises10.readdir)(root, { withFileTypes: true });
170
152
  const results = [];
171
153
  for (const entry of entries.sort((left, right) => left.name.localeCompare(right.name))) {
172
- const absolutePath = import_node_path8.default.join(root, entry.name);
154
+ const absolutePath = import_node_path10.default.join(root, entry.name);
173
155
  if (entry.isDirectory()) {
174
156
  results.push(...await collectYamlFiles(absolutePath));
175
157
  continue;
176
158
  }
177
- if (entry.isFile() && YAML_EXTENSIONS.has(import_node_path8.default.extname(entry.name).toLowerCase())) {
159
+ if (entry.isFile() && YAML_EXTENSIONS.has(import_node_path10.default.extname(entry.name).toLowerCase())) {
178
160
  results.push(absolutePath);
179
161
  }
180
162
  }
@@ -182,16 +164,16 @@ async function collectYamlFiles(root) {
182
164
  }
183
165
  async function collectFilesystemLayerFiles(manifestRoot, workspaceRoots, sourceRoot, activeLayers) {
184
166
  const files = [];
185
- const repoRoot = import_node_path8.default.dirname(manifestRoot);
167
+ const repoRoot = import_node_path10.default.dirname(manifestRoot);
186
168
  for (const workspaceRoot of workspaceRoots) {
187
- const resolvedRoot = import_node_path8.default.resolve(workspaceRoot.path, sourceRoot);
169
+ const resolvedRoot = import_node_path10.default.resolve(workspaceRoot.path, sourceRoot);
188
170
  for (const layer of activeLayers) {
189
- const layerRoot = import_node_path8.default.join(resolvedRoot, layer);
171
+ const layerRoot = import_node_path10.default.join(resolvedRoot, layer);
190
172
  if (!await existsDirectory(layerRoot)) {
191
173
  continue;
192
174
  }
193
175
  for (const absolutePath of await collectYamlFiles(layerRoot)) {
194
- const relativePath = import_node_path8.default.relative(repoRoot, absolutePath);
176
+ const relativePath = import_node_path10.default.relative(repoRoot, absolutePath);
195
177
  files.push({
196
178
  absolutePath,
197
179
  relativePath: toPortablePath(relativePath.startsWith("..") ? absolutePath : relativePath),
@@ -241,31 +223,6 @@ function yamlObjectToEntries(document, filePath, namespace, sourceId, workspaceI
241
223
  }
242
224
  }));
243
225
  }
244
- async function resolveSecretValue(value, processEnv) {
245
- if (!isSecretReference(value)) {
246
- return value;
247
- }
248
- if (value.provider === "local") {
249
- const passphrase = resolveSecretPassphrase(value.vault, processEnv);
250
- if (!passphrase) {
251
- return value;
252
- }
253
- return readLocalSecret(
254
- resolveSecretStoreRoot(processEnv),
255
- value.ref,
256
- passphrase,
257
- value.vault
258
- );
259
- }
260
- if (value.provider === "env") {
261
- const resolved = processEnv?.[value.ref];
262
- if (resolved === void 0) {
263
- return value;
264
- }
265
- return resolved;
266
- }
267
- return value;
268
- }
269
226
  function toSecretReferenceMetadata(value) {
270
227
  if (!isSecretReference(value)) {
271
228
  return void 0;
@@ -293,14 +250,12 @@ function createFilesystemSecretsPlugin() {
293
250
  );
294
251
  const entries = [];
295
252
  for (const file of files) {
296
- const document = await (0, import_promises9.readFile)(file.absolutePath, "utf8");
253
+ const document = await (0, import_promises11.readFile)(file.absolutePath, "utf8");
297
254
  const fileEntries = filesystemSecretsReader(file.relativePath, document, file.workspaceId);
298
255
  for (const entry of fileEntries) {
299
256
  const metadata = toSecretReferenceMetadata(entry.value);
300
- const resolvedValue = await resolveSecretValue(entry.value, context.processEnv);
301
257
  entries.push({
302
258
  ...entry,
303
- value: resolvedValue,
304
259
  ...metadata ? { metadata } : {}
305
260
  });
306
261
  }
@@ -311,7 +266,7 @@ function createFilesystemSecretsPlugin() {
311
266
  }
312
267
 
313
268
  // ../../plugins/filesystem/src/filesystemValuesReader.ts
314
- var import_promises10 = require("fs/promises");
269
+ var import_promises12 = require("fs/promises");
315
270
  function filesystemValuesReader(filePath, document, workspaceId = "default") {
316
271
  return yamlObjectToEntries(document, filePath, "value", "filesystem-values", workspaceId);
317
272
  }
@@ -329,7 +284,7 @@ function createFilesystemValuesPlugin() {
329
284
  );
330
285
  const entries = [];
331
286
  for (const file of files) {
332
- const document = await (0, import_promises10.readFile)(file.absolutePath, "utf8");
287
+ const document = await (0, import_promises12.readFile)(file.absolutePath, "utf8");
333
288
  entries.push(...filesystemValuesReader(file.relativePath, document, file.workspaceId));
334
289
  }
335
290
  return entries;
@@ -1,4 +1,4 @@
1
- import { L as LoaderPlugin, f as ConfigEntry, k as WorkspaceRoot, l as NamespaceName } from '../plugin-BVNEHj19.cjs';
1
+ import { L as LoaderPlugin, a as ConfigEntry, W as WorkspaceRoot, i as NamespaceName } from '../plugin-CyNkf7Dm.cjs';
2
2
 
3
3
  declare function filesystemSecretsReader(filePath: string, document: string, workspaceId?: string): ConfigEntry[];
4
4
  declare function createFilesystemSecretsPlugin(): LoaderPlugin;
@@ -1,4 +1,4 @@
1
- import { L as LoaderPlugin, f as ConfigEntry, k as WorkspaceRoot, l as NamespaceName } from '../plugin-BVNEHj19.js';
1
+ import { L as LoaderPlugin, a as ConfigEntry, W as WorkspaceRoot, i as NamespaceName } from '../plugin-CyNkf7Dm.js';
2
2
 
3
3
  declare function filesystemSecretsReader(filePath: string, document: string, workspaceId?: string): ConfigEntry[];
4
4
  declare function createFilesystemSecretsPlugin(): LoaderPlugin;
@@ -5,8 +5,8 @@ import {
5
5
  filesystemSecretsReader,
6
6
  filesystemValuesReader,
7
7
  yamlObjectToEntries
8
- } from "../chunk-7FBRVJD6.js";
9
- import "../chunk-33ZDYDQJ.js";
8
+ } from "../chunk-FC3IV6A7.js";
9
+ import "../chunk-DRKDNY4I.js";
10
10
  export {
11
11
  collectFilesystemLayerFiles,
12
12
  createFilesystemSecretsPlugin,
@@ -35,6 +35,21 @@ __export(process_env_exports, {
35
35
  });
36
36
  module.exports = __toCommonJS(process_env_exports);
37
37
 
38
+ // ../core/src/keychain/linux.ts
39
+ var import_node_child_process = require("child_process");
40
+ var import_node_util = require("util");
41
+ var execFileAsync = (0, import_node_util.promisify)(import_node_child_process.execFile);
42
+
43
+ // ../core/src/keychain/macos.ts
44
+ var import_node_child_process2 = require("child_process");
45
+ var import_node_util2 = require("util");
46
+ var execFileAsync2 = (0, import_node_util2.promisify)(import_node_child_process2.execFile);
47
+
48
+ // ../core/src/keychain/windows.ts
49
+ var import_node_child_process3 = require("child_process");
50
+ var import_node_util3 = require("util");
51
+ var execFileAsync3 = (0, import_node_util3.promisify)(import_node_child_process3.execFile);
52
+
38
53
  // ../core/src/manifest/loadManifest.ts
39
54
  var import_promises2 = require("fs/promises");
40
55
  var import_node_path2 = __toESM(require("path"), 1);
@@ -59,11 +74,27 @@ var import_node_path4 = __toESM(require("path"), 1);
59
74
  var import_promises5 = require("fs/promises");
60
75
  var import_node_path5 = __toESM(require("path"), 1);
61
76
 
77
+ // ../core/src/secrets/auditLog.ts
78
+ var import_promises8 = require("fs/promises");
79
+ var import_node_path8 = __toESM(require("path"), 1);
80
+
62
81
  // ../core/src/utils/secretStore.ts
63
82
  var import_node_crypto = require("crypto");
83
+ var import_promises7 = require("fs/promises");
84
+ var import_node_path7 = __toESM(require("path"), 1);
85
+
86
+ // ../core/src/secrets/sessionStore.ts
64
87
  var import_promises6 = require("fs/promises");
65
88
  var import_node_path6 = __toESM(require("path"), 1);
66
89
 
90
+ // ../core/src/secrets/prompt.ts
91
+ var import_node_readline = __toESM(require("readline"), 1);
92
+ var import_node_stream = require("stream");
93
+
94
+ // ../core/src/runtime/dump.ts
95
+ var import_promises9 = require("fs/promises");
96
+ var import_node_path9 = __toESM(require("path"), 1);
97
+
67
98
  // ../core/src/utils/envNaming.ts
68
99
  function normalizeMappingConfig(config = {}) {
69
100
  return {
@@ -71,8 +102,8 @@ function normalizeMappingConfig(config = {}) {
71
102
  explicit: config.explicit ?? {}
72
103
  };
73
104
  }
74
- function fromScreamingSnake(path8) {
75
- return path8.split("_").map((segment) => segment.trim().toLowerCase()).filter(Boolean).join(".");
105
+ function fromScreamingSnake(path10) {
106
+ return path10.split("_").map((segment) => segment.trim().toLowerCase()).filter(Boolean).join(".");
76
107
  }
77
108
  function envVarToLogicalKey(envVar, config = {}) {
78
109
  const normalized = normalizeMappingConfig(config);
@@ -96,10 +127,6 @@ function envVarToLogicalKey(envVar, config = {}) {
96
127
  return `value.${fromScreamingSnake(envVar)}`;
97
128
  }
98
129
 
99
- // ../core/src/runtime/dump.ts
100
- var import_promises7 = require("fs/promises");
101
- var import_node_path7 = __toESM(require("path"), 1);
102
-
103
130
  // ../../plugins/process-env/src/index.ts
104
131
  var PROCESS_ENV_PLUGIN_ID = "@kitsy/cnos/plugins/process-env";
105
132
  function processEnvEntriesFromObject(env, mapping = {}, workspaceId = "default") {
@@ -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 processEnvEntriesFromObject(env: Record<string, string | undefined>, mapping?: EnvMappingConfig, workspaceId?: string): ConfigEntry[];
5
5
  declare function createProcessEnvPlugin(): LoaderPlugin;
@@ -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 processEnvEntriesFromObject(env: Record<string, string | undefined>, mapping?: EnvMappingConfig, workspaceId?: string): ConfigEntry[];
5
5
  declare function createProcessEnvPlugin(): LoaderPlugin;
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createProcessEnvPlugin,
3
3
  processEnvEntriesFromObject
4
- } from "../chunk-53HXUSM6.js";
5
- import "../chunk-33ZDYDQJ.js";
4
+ } from "../chunk-CDXJISGB.js";
5
+ import "../chunk-DRKDNY4I.js";
6
6
  export {
7
7
  createProcessEnvPlugin,
8
8
  processEnvEntriesFromObject
@@ -44,6 +44,31 @@ interface WorkspaceContext {
44
44
  }
45
45
 
46
46
  type ResolutionArrayPolicy = 'replace' | 'append' | 'unique-append';
47
+ type NamespaceKind = 'data' | 'projection' | 'system';
48
+ type NamespaceProjectionSource = 'promote' | 'envMapping';
49
+ type VaultProviderName = 'local' | 'github-secrets' | (string & {});
50
+ type VaultAuthMethod = 'passphrase' | 'environment' | 'token' | 'iam' | 'keychain';
51
+ interface VaultAuthSourceConfig {
52
+ from?: string[];
53
+ }
54
+ interface VaultAuthDefinition {
55
+ method?: VaultAuthMethod;
56
+ passphrase?: VaultAuthSourceConfig;
57
+ token?: VaultAuthSourceConfig;
58
+ config?: Record<string, unknown>;
59
+ }
60
+ interface NamespaceDefinition {
61
+ kind: NamespaceKind;
62
+ shareable: boolean;
63
+ sensitive?: boolean;
64
+ readonly?: boolean;
65
+ source?: NamespaceProjectionSource;
66
+ }
67
+ interface VaultDefinition {
68
+ provider: VaultProviderName;
69
+ auth?: VaultAuthDefinition;
70
+ mapping?: Record<string, string>;
71
+ }
47
72
  interface ManifestFile {
48
73
  version?: number;
49
74
  project?: {
@@ -82,6 +107,8 @@ interface ManifestFile {
82
107
  promote?: LogicalKey[];
83
108
  frameworks?: Record<string, string>;
84
109
  };
110
+ namespaces?: Record<string, Partial<NamespaceDefinition>>;
111
+ vaults?: Record<string, Partial<VaultDefinition>>;
85
112
  writePolicy?: {
86
113
  define?: {
87
114
  defaultProfile?: string;
@@ -128,6 +155,8 @@ interface NormalizedManifest {
128
155
  promote: LogicalKey[];
129
156
  frameworks: Record<string, string>;
130
157
  };
158
+ namespaces: Record<string, NamespaceDefinition>;
159
+ vaults: Record<string, VaultDefinition>;
131
160
  writePolicy: {
132
161
  define: {
133
162
  defaultProfile: string;
@@ -136,9 +165,19 @@ interface NormalizedManifest {
136
165
  };
137
166
  schema: Record<LogicalKey, SchemaRule>;
138
167
  }
168
+ interface LoadManifestOptions {
169
+ root?: string;
170
+ }
171
+ interface LoadedManifest {
172
+ manifestRoot: string;
173
+ repoRoot: string;
174
+ manifestPath: string;
175
+ manifest: NormalizedManifest;
176
+ rawManifest: ManifestFile;
177
+ }
139
178
 
140
179
  type LogicalKey = string;
141
- type NamespaceName = 'value' | 'secret' | 'meta';
180
+ type NamespaceName = string;
142
181
  interface ConfigOrigin {
143
182
  file?: string;
144
183
  line?: number;
@@ -200,6 +239,7 @@ interface CnosCreateOptions {
200
239
  profile?: string;
201
240
  workspace?: string;
202
241
  globalRoot?: string;
242
+ secretResolution?: 'eager' | 'lazy';
203
243
  cnosVersion?: string;
204
244
  plugins?: CnosPlugin[];
205
245
  cliArgs?: string[];
@@ -306,4 +346,4 @@ interface ExporterPlugin extends CnosPlugin {
306
346
  export(graph: ResolvedGraph, context: ExportContext): Promise<ExportResult>;
307
347
  }
308
348
 
309
- export type { CnosCreateOptions as C, DumpPlanOptions as D, ExporterPlugin as E, InspectResult as I, LoaderPlugin as L, ManifestFile as M, NormalizedManifest as N, ResolvedGraph as R, ToEnvOptions as T, ValidationSummary as V, WorkspaceFile as W, DumpPlan as a, DumpOptions as b, DumpResult as c, CnosRuntime as d, CnosPlugin as e, ConfigEntry as f, LogicalKey as g, ToPublicEnvOptions as h, ValidationIssue as i, ValidatorPlugin as j, WorkspaceRoot as k, NamespaceName as l };
349
+ export type { CnosCreateOptions as C, DumpPlanOptions as D, ExporterPlugin as E, InspectResult as I, LoaderPlugin as L, ManifestFile as M, NormalizedManifest as N, ResolvedGraph as R, ToEnvOptions as T, ValidatorPlugin as V, WorkspaceRoot as W, ConfigEntry as a, LogicalKey as b, ToPublicEnvOptions as c, DumpPlan as d, DumpOptions as e, DumpResult as f, CnosRuntime as g, CnosPlugin as h, NamespaceName as i, LoadManifestOptions as j, LoadedManifest as k, VaultDefinition as l, ValidationSummary as m, ValidationIssue as n, WorkspaceFile as o };
@@ -44,6 +44,31 @@ interface WorkspaceContext {
44
44
  }
45
45
 
46
46
  type ResolutionArrayPolicy = 'replace' | 'append' | 'unique-append';
47
+ type NamespaceKind = 'data' | 'projection' | 'system';
48
+ type NamespaceProjectionSource = 'promote' | 'envMapping';
49
+ type VaultProviderName = 'local' | 'github-secrets' | (string & {});
50
+ type VaultAuthMethod = 'passphrase' | 'environment' | 'token' | 'iam' | 'keychain';
51
+ interface VaultAuthSourceConfig {
52
+ from?: string[];
53
+ }
54
+ interface VaultAuthDefinition {
55
+ method?: VaultAuthMethod;
56
+ passphrase?: VaultAuthSourceConfig;
57
+ token?: VaultAuthSourceConfig;
58
+ config?: Record<string, unknown>;
59
+ }
60
+ interface NamespaceDefinition {
61
+ kind: NamespaceKind;
62
+ shareable: boolean;
63
+ sensitive?: boolean;
64
+ readonly?: boolean;
65
+ source?: NamespaceProjectionSource;
66
+ }
67
+ interface VaultDefinition {
68
+ provider: VaultProviderName;
69
+ auth?: VaultAuthDefinition;
70
+ mapping?: Record<string, string>;
71
+ }
47
72
  interface ManifestFile {
48
73
  version?: number;
49
74
  project?: {
@@ -82,6 +107,8 @@ interface ManifestFile {
82
107
  promote?: LogicalKey[];
83
108
  frameworks?: Record<string, string>;
84
109
  };
110
+ namespaces?: Record<string, Partial<NamespaceDefinition>>;
111
+ vaults?: Record<string, Partial<VaultDefinition>>;
85
112
  writePolicy?: {
86
113
  define?: {
87
114
  defaultProfile?: string;
@@ -128,6 +155,8 @@ interface NormalizedManifest {
128
155
  promote: LogicalKey[];
129
156
  frameworks: Record<string, string>;
130
157
  };
158
+ namespaces: Record<string, NamespaceDefinition>;
159
+ vaults: Record<string, VaultDefinition>;
131
160
  writePolicy: {
132
161
  define: {
133
162
  defaultProfile: string;
@@ -136,9 +165,19 @@ interface NormalizedManifest {
136
165
  };
137
166
  schema: Record<LogicalKey, SchemaRule>;
138
167
  }
168
+ interface LoadManifestOptions {
169
+ root?: string;
170
+ }
171
+ interface LoadedManifest {
172
+ manifestRoot: string;
173
+ repoRoot: string;
174
+ manifestPath: string;
175
+ manifest: NormalizedManifest;
176
+ rawManifest: ManifestFile;
177
+ }
139
178
 
140
179
  type LogicalKey = string;
141
- type NamespaceName = 'value' | 'secret' | 'meta';
180
+ type NamespaceName = string;
142
181
  interface ConfigOrigin {
143
182
  file?: string;
144
183
  line?: number;
@@ -200,6 +239,7 @@ interface CnosCreateOptions {
200
239
  profile?: string;
201
240
  workspace?: string;
202
241
  globalRoot?: string;
242
+ secretResolution?: 'eager' | 'lazy';
203
243
  cnosVersion?: string;
204
244
  plugins?: CnosPlugin[];
205
245
  cliArgs?: string[];
@@ -306,4 +346,4 @@ interface ExporterPlugin extends CnosPlugin {
306
346
  export(graph: ResolvedGraph, context: ExportContext): Promise<ExportResult>;
307
347
  }
308
348
 
309
- export type { CnosCreateOptions as C, DumpPlanOptions as D, ExporterPlugin as E, InspectResult as I, LoaderPlugin as L, ManifestFile as M, NormalizedManifest as N, ResolvedGraph as R, ToEnvOptions as T, ValidationSummary as V, WorkspaceFile as W, DumpPlan as a, DumpOptions as b, DumpResult as c, CnosRuntime as d, CnosPlugin as e, ConfigEntry as f, LogicalKey as g, ToPublicEnvOptions as h, ValidationIssue as i, ValidatorPlugin as j, WorkspaceRoot as k, NamespaceName as l };
349
+ export type { CnosCreateOptions as C, DumpPlanOptions as D, ExporterPlugin as E, InspectResult as I, LoaderPlugin as L, ManifestFile as M, NormalizedManifest as N, ResolvedGraph as R, ToEnvOptions as T, ValidatorPlugin as V, WorkspaceRoot as W, ConfigEntry as a, LogicalKey as b, ToPublicEnvOptions as c, DumpPlan as d, DumpOptions as e, DumpResult as f, CnosRuntime as g, CnosPlugin as h, NamespaceName as i, LoadManifestOptions as j, LoadedManifest as k, VaultDefinition as l, ValidationSummary as m, ValidationIssue as n, WorkspaceFile as o };