@kitsy/cnos 1.10.0 → 1.11.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.
Files changed (61) hide show
  1. package/dist/build/index.cjs +331 -63
  2. package/dist/build/index.d.cts +1 -1
  3. package/dist/build/index.d.ts +1 -1
  4. package/dist/build/index.js +13 -15
  5. package/dist/{chunk-A5U7EZCJ.js → chunk-2DMCB3PK.js} +1 -1
  6. package/dist/{chunk-RTHKUGJV.js → chunk-5JGNRADB.js} +1 -1
  7. package/dist/{chunk-3EZGPQCE.js → chunk-DPC2BV3S.js} +1 -1
  8. package/dist/{chunk-FHXLOWAB.js → chunk-KJ57PF47.js} +1 -1
  9. package/dist/{chunk-ESBHCFC6.js → chunk-NU25VFA2.js} +1 -1
  10. package/dist/{chunk-UGLATJJD.js → chunk-RNTTPI5S.js} +1 -1
  11. package/dist/{chunk-UKNL2Y4N.js → chunk-T3E57MSQ.js} +1 -1
  12. package/dist/{chunk-CSA4L64V.js → chunk-V3USPV5U.js} +8 -8
  13. package/dist/{chunk-MQ4WG3K6.js → chunk-WPB4HB2K.js} +320 -49
  14. package/dist/{chunk-EIK7OUFP.js → chunk-X4PBPUKL.js} +157 -37
  15. package/dist/configure/index.cjs +329 -59
  16. package/dist/configure/index.d.cts +3 -3
  17. package/dist/configure/index.d.ts +3 -3
  18. package/dist/configure/index.js +8 -8
  19. package/dist/{core-Ud1o2MBn.d.cts → core-CGJObpyy.d.cts} +40 -2
  20. package/dist/{core-Ud1o2MBn.d.ts → core-CGJObpyy.d.ts} +40 -2
  21. package/dist/{envNaming-DxxqiGKN.d.cts → envNaming-DIaBgT6E.d.cts} +1 -1
  22. package/dist/{envNaming-CPwXl4I6.d.ts → envNaming-_WD9sLZI.d.ts} +1 -1
  23. package/dist/index.cjs +480 -91
  24. package/dist/index.d.cts +2 -2
  25. package/dist/index.d.ts +2 -2
  26. package/dist/index.js +10 -10
  27. package/dist/internal.cjs +89 -23
  28. package/dist/internal.d.cts +3 -3
  29. package/dist/internal.d.ts +3 -3
  30. package/dist/internal.js +2 -2
  31. package/dist/plugin/basic-schema.cjs +4 -1
  32. package/dist/plugin/basic-schema.d.cts +1 -1
  33. package/dist/plugin/basic-schema.d.ts +1 -1
  34. package/dist/plugin/basic-schema.js +2 -2
  35. package/dist/plugin/cli-args.cjs +4 -1
  36. package/dist/plugin/cli-args.d.cts +1 -1
  37. package/dist/plugin/cli-args.d.ts +1 -1
  38. package/dist/plugin/cli-args.js +2 -2
  39. package/dist/plugin/dotenv.cjs +6 -3
  40. package/dist/plugin/dotenv.d.cts +2 -2
  41. package/dist/plugin/dotenv.d.ts +2 -2
  42. package/dist/plugin/dotenv.js +2 -2
  43. package/dist/plugin/env-export.cjs +5 -2
  44. package/dist/plugin/env-export.d.cts +2 -2
  45. package/dist/plugin/env-export.d.ts +2 -2
  46. package/dist/plugin/env-export.js +2 -2
  47. package/dist/plugin/filesystem.cjs +13 -10
  48. package/dist/plugin/filesystem.d.cts +1 -1
  49. package/dist/plugin/filesystem.d.ts +1 -1
  50. package/dist/plugin/filesystem.js +2 -2
  51. package/dist/plugin/process-env.cjs +4 -1
  52. package/dist/plugin/process-env.d.cts +2 -2
  53. package/dist/plugin/process-env.d.ts +2 -2
  54. package/dist/plugin/process-env.js +2 -2
  55. package/dist/runtime/index.cjs +480 -91
  56. package/dist/runtime/index.d.cts +13 -6
  57. package/dist/runtime/index.d.ts +13 -6
  58. package/dist/runtime/index.js +10 -10
  59. package/dist/{toPublicEnv-fUZMRUOz.d.cts → toPublicEnv-C3A8aLjo.d.cts} +1 -1
  60. package/dist/{toPublicEnv-C9wPSpRo.d.ts → toPublicEnv-DLNNcEso.d.ts} +1 -1
  61. package/package.json +1 -1
package/dist/index.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- export { CnosSingleton, default as cnos, default } from './runtime/index.cjs';
2
- export { h as CnosPlugin, g as CnosRuntime, a as ConfigEntry, i as DerivedFormula, j as DerivedValue, k as ExprNode, I as InspectResult, L as LoaderPlugin, b as LogicalKey, M as ManifestFile, N as NormalizedManifest, P as ParsedDerivation, l as RuntimeProvider } from './core-Ud1o2MBn.cjs';
1
+ export { CnosSingleton, CnosSingletonProjectionOptions, default as cnos, default } from './runtime/index.cjs';
2
+ export { h as CnosPlugin, g as CnosRuntime, a as ConfigEntry, i as DerivedFormula, j as DerivedValue, k as ExprNode, I as InspectResult, L as LoaderPlugin, b as LogicalKey, M as ManifestFile, N as NormalizedManifest, P as ParsedDerivation, A as RemoteSecretVaultProvider, l as RuntimeProvider, t as SecretVaultProvider, s as SecretVaultProviderFactory, r as VaultAuthConfig, q as VaultDefinition } from './core-CGJObpyy.cjs';
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { CnosSingleton, default as cnos, default } from './runtime/index.js';
2
- export { h as CnosPlugin, g as CnosRuntime, a as ConfigEntry, i as DerivedFormula, j as DerivedValue, k as ExprNode, I as InspectResult, L as LoaderPlugin, b as LogicalKey, M as ManifestFile, N as NormalizedManifest, P as ParsedDerivation, l as RuntimeProvider } from './core-Ud1o2MBn.js';
1
+ export { CnosSingleton, CnosSingletonProjectionOptions, default as cnos, default } from './runtime/index.js';
2
+ export { h as CnosPlugin, g as CnosRuntime, a as ConfigEntry, i as DerivedFormula, j as DerivedValue, k as ExprNode, I as InspectResult, L as LoaderPlugin, b as LogicalKey, M as ManifestFile, N as NormalizedManifest, P as ParsedDerivation, A as RemoteSecretVaultProvider, l as RuntimeProvider, t as SecretVaultProvider, s as SecretVaultProviderFactory, r as VaultAuthConfig, q as VaultDefinition } from './core-CGJObpyy.js';
package/dist/index.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  runtime_default
3
- } from "./chunk-EIK7OUFP.js";
4
- import "./chunk-UKNL2Y4N.js";
5
- import "./chunk-CSA4L64V.js";
6
- import "./chunk-3EZGPQCE.js";
7
- import "./chunk-RTHKUGJV.js";
8
- import "./chunk-ESBHCFC6.js";
9
- import "./chunk-UGLATJJD.js";
10
- import "./chunk-A5U7EZCJ.js";
11
- import "./chunk-FHXLOWAB.js";
12
- import "./chunk-MQ4WG3K6.js";
3
+ } from "./chunk-X4PBPUKL.js";
4
+ import "./chunk-T3E57MSQ.js";
5
+ import "./chunk-V3USPV5U.js";
6
+ import "./chunk-DPC2BV3S.js";
7
+ import "./chunk-5JGNRADB.js";
8
+ import "./chunk-NU25VFA2.js";
9
+ import "./chunk-RNTTPI5S.js";
10
+ import "./chunk-2DMCB3PK.js";
11
+ import "./chunk-KJ57PF47.js";
12
+ import "./chunk-WPB4HB2K.js";
13
13
  export {
14
14
  runtime_default as cnos,
15
15
  runtime_default as default
package/dist/internal.cjs CHANGED
@@ -1295,11 +1295,19 @@ function normalizeVaults(vaults) {
1295
1295
  throw new CnosManifestError(`Vault "${name}" requires a provider`);
1296
1296
  }
1297
1297
  const normalizedAuth = normalizeVaultAuth(name, provider, definition.auth);
1298
- const normalizedMapping = Object.fromEntries(
1299
- Object.entries(definition.mapping ?? {}).filter(
1300
- (entry) => typeof entry[0] === "string" && typeof entry[1] === "string"
1301
- ).map(([envVar, logicalRef]) => [envVar.trim(), logicalRef.trim()]).filter(([envVar, logicalRef]) => envVar.length > 0 && logicalRef.length > 0)
1302
- );
1298
+ const normalizedMapping = normalizeVaultMapping(definition.mapping);
1299
+ const fallback = (definition.fallback ?? []).map((entry, index) => {
1300
+ const fallbackProvider = entry.provider?.trim();
1301
+ if (!fallbackProvider) {
1302
+ throw new CnosManifestError(`Vault "${name}" fallback ${index + 1} requires a provider`);
1303
+ }
1304
+ const fallbackMapping = normalizeVaultMapping(entry.mapping);
1305
+ return {
1306
+ provider: fallbackProvider,
1307
+ auth: normalizeVaultAuth(name, fallbackProvider, entry.auth),
1308
+ ...Object.keys(fallbackMapping).length > 0 ? { mapping: fallbackMapping } : {}
1309
+ };
1310
+ });
1303
1311
  return [
1304
1312
  name,
1305
1313
  {
@@ -1307,12 +1315,20 @@ function normalizeVaults(vaults) {
1307
1315
  auth: normalizedAuth,
1308
1316
  ...Object.keys(normalizedMapping).length > 0 ? {
1309
1317
  mapping: normalizedMapping
1310
- } : {}
1318
+ } : {},
1319
+ ...fallback.length > 0 ? { fallback } : {}
1311
1320
  }
1312
1321
  ];
1313
1322
  })
1314
1323
  );
1315
1324
  }
1325
+ function normalizeVaultMapping(mapping) {
1326
+ return Object.fromEntries(
1327
+ Object.entries(mapping ?? {}).filter(
1328
+ (entry) => typeof entry[0] === "string" && typeof entry[1] === "string"
1329
+ ).map(([envVar, logicalRef]) => [envVar.trim(), logicalRef.trim()]).filter(([envVar, logicalRef]) => envVar.length > 0 && logicalRef.length > 0)
1330
+ );
1331
+ }
1316
1332
  function normalizeAuthSources(value) {
1317
1333
  if (!value || typeof value !== "object" || Array.isArray(value)) {
1318
1334
  return void 0;
@@ -1636,7 +1652,7 @@ function isObject(value) {
1636
1652
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
1637
1653
  }
1638
1654
  function isSecretReference(value) {
1639
- 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));
1655
+ return isObject(value) && (value.provider === void 0 || 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));
1640
1656
  }
1641
1657
  function resolveSecretStoreRoot(processEnv = process.env) {
1642
1658
  return import_node_path11.default.resolve(expandHomePath(processEnv.CNOS_SECRET_HOME ?? "~/.cnos/secrets"));
@@ -2138,7 +2154,7 @@ var LocalSecretVaultProvider = class _LocalSecretVaultProvider {
2138
2154
  };
2139
2155
 
2140
2156
  // ../core/src/secrets/providers/registry.ts
2141
- function createSecretVaultProvider(vaultId, definition, processEnv) {
2157
+ function createSecretVaultProvider(vaultId, definition, processEnv, factories = []) {
2142
2158
  if (definition.provider === "local") {
2143
2159
  return new LocalSecretVaultProvider(vaultId, definition, processEnv);
2144
2160
  }
@@ -2148,9 +2164,16 @@ function createSecretVaultProvider(vaultId, definition, processEnv) {
2148
2164
  if (definition.provider === "github-secrets") {
2149
2165
  return new GithubSecretsVaultProvider(vaultId, definition, processEnv);
2150
2166
  }
2167
+ const factory = factories.find((candidate) => candidate.provider === definition.provider);
2168
+ if (factory) {
2169
+ return factory.create(vaultId, definition, processEnv);
2170
+ }
2151
2171
  throw new CnosManifestError(`Unsupported vault provider: ${definition.provider}`);
2152
2172
  }
2153
2173
 
2174
+ // ../core/src/secrets/resolveAuth.ts
2175
+ var import_promises12 = require("fs/promises");
2176
+
2154
2177
  // ../core/src/secrets/prompt.ts
2155
2178
  var import_node_readline = __toESM(require("readline"), 1);
2156
2179
  var import_node_stream = require("stream");
@@ -2191,6 +2214,23 @@ function toAuthError(vaultId, sources) {
2191
2214
  `Cannot authenticate to vault "${vaultId}". Tried: ${sources.join(", ")}. Set ${getVaultPassphraseEnvVar(vaultId)} or run cnos vault auth ${vaultId}.`
2192
2215
  );
2193
2216
  }
2217
+ async function resolveTokenFromSource(source, processEnv) {
2218
+ if (source.startsWith("env:")) {
2219
+ return processEnv[source.slice(4)] || void 0;
2220
+ }
2221
+ if (source.startsWith("file:")) {
2222
+ try {
2223
+ const value = await (0, import_promises12.readFile)(expandHomePath(source.slice("file:".length)), "utf8");
2224
+ return value.trim() || void 0;
2225
+ } catch {
2226
+ return void 0;
2227
+ }
2228
+ }
2229
+ if (source.startsWith("keychain:")) {
2230
+ return readKeychain(source.slice("keychain:".length));
2231
+ }
2232
+ return void 0;
2233
+ }
2194
2234
  async function resolveVaultAuth(vaultId, definition, processEnv = process.env) {
2195
2235
  const sessionKey = await resolveVaultSessionKey(vaultId, processEnv);
2196
2236
  if (sessionKey) {
@@ -2206,6 +2246,32 @@ async function resolveVaultAuth(vaultId, definition, processEnv = process.env) {
2206
2246
  ...definition.auth?.config ? { config: definition.auth.config } : {}
2207
2247
  };
2208
2248
  }
2249
+ if (definition.auth?.method === "iam") {
2250
+ return {
2251
+ method: "iam",
2252
+ ...definition.auth?.config ? { config: definition.auth.config } : {}
2253
+ };
2254
+ }
2255
+ if (definition.auth?.method === "environment") {
2256
+ return {
2257
+ method: "environment",
2258
+ ...definition.auth?.config ? { config: definition.auth.config } : {}
2259
+ };
2260
+ }
2261
+ const tokenSources = definition.auth?.token?.from ?? [];
2262
+ for (const source of tokenSources) {
2263
+ const token = await resolveTokenFromSource(source, processEnv);
2264
+ if (token) {
2265
+ return {
2266
+ token,
2267
+ method: "token",
2268
+ ...definition.auth?.config ? { config: definition.auth.config } : {}
2269
+ };
2270
+ }
2271
+ }
2272
+ if (definition.auth?.method === "token") {
2273
+ throw toAuthError(vaultId, [getVaultSessionKeyEnvVar(vaultId), ...tokenSources]);
2274
+ }
2209
2275
  const sources = definition.auth?.passphrase?.from ?? [getVaultPassphraseEnvVar(vaultId)];
2210
2276
  for (const source of sources) {
2211
2277
  if (source.startsWith("env:")) {
@@ -2254,7 +2320,7 @@ async function resolveVaultAuth(vaultId, definition, processEnv = process.env) {
2254
2320
  var import_node_crypto3 = require("crypto");
2255
2321
 
2256
2322
  // ../core/src/runtime/dump.ts
2257
- var import_promises12 = require("fs/promises");
2323
+ var import_promises13 = require("fs/promises");
2258
2324
  var import_node_path13 = __toESM(require("path"), 1);
2259
2325
 
2260
2326
  // ../core/src/utils/envNaming.ts
@@ -2656,7 +2722,7 @@ function generateCodegenContent(manifest, sourcePath, typeModuleImport = "./cnos
2656
2722
  }
2657
2723
 
2658
2724
  // src/codegen/writeOutput.ts
2659
- var import_promises13 = require("fs/promises");
2725
+ var import_promises14 = require("fs/promises");
2660
2726
  var import_node_path14 = __toESM(require("path"), 1);
2661
2727
  function stripTsExtension(filePath) {
2662
2728
  return filePath.replace(/(\.d)?\.[cm]?tsx?$/i, "").replace(/\.[cm]?jsx?$/i, "");
@@ -2676,10 +2742,10 @@ async function writeCodegenOutput(options = {}) {
2676
2742
  const outputRoot = loadedManifest.rootResolution.remote ? loadedManifest.consumerRoot : loadedManifest.repoRoot;
2677
2743
  const paths = resolveCodegenPaths(outputRoot, options.out);
2678
2744
  const generated = generateCodegenContent(loadedManifest.manifest, loadedManifest.manifestPath, paths.typeImportPath);
2679
- await (0, import_promises13.mkdir)(import_node_path14.default.dirname(paths.typesPath), { recursive: true });
2680
- await (0, import_promises13.mkdir)(import_node_path14.default.dirname(paths.runtimePath), { recursive: true });
2681
- await (0, import_promises13.writeFile)(paths.typesPath, generated.typesContent, "utf8");
2682
- await (0, import_promises13.writeFile)(paths.runtimePath, generated.runtimeContent, "utf8");
2745
+ await (0, import_promises14.mkdir)(import_node_path14.default.dirname(paths.typesPath), { recursive: true });
2746
+ await (0, import_promises14.mkdir)(import_node_path14.default.dirname(paths.runtimePath), { recursive: true });
2747
+ await (0, import_promises14.writeFile)(paths.typesPath, generated.typesContent, "utf8");
2748
+ await (0, import_promises14.writeFile)(paths.runtimePath, generated.runtimeContent, "utf8");
2683
2749
  return {
2684
2750
  manifestPath: loadedManifest.manifestPath,
2685
2751
  typesPath: paths.typesPath,
@@ -2982,7 +3048,7 @@ function formatDriftReport(report) {
2982
3048
  }
2983
3049
 
2984
3050
  // src/migrate/applyManifest.ts
2985
- var import_promises14 = require("fs/promises");
3051
+ var import_promises15 = require("fs/promises");
2986
3052
  function sortRecord(record) {
2987
3053
  return Object.fromEntries(Object.entries(record).sort(([left], [right]) => left.localeCompare(right)));
2988
3054
  }
@@ -3017,7 +3083,7 @@ async function applyManifestMappings(proposals, root) {
3017
3083
  promote: Array.from(promoted).sort((left, right) => left.localeCompare(right))
3018
3084
  };
3019
3085
  }
3020
- await (0, import_promises14.writeFile)(loadedManifest.manifestPath, stringifyYaml(rawManifest), "utf8");
3086
+ await (0, import_promises15.writeFile)(loadedManifest.manifestPath, stringifyYaml(rawManifest), "utf8");
3021
3087
  return {
3022
3088
  manifestPath: loadedManifest.manifestPath,
3023
3089
  appliedMappings,
@@ -3052,7 +3118,7 @@ function proposeMapping(envVar) {
3052
3118
  }
3053
3119
 
3054
3120
  // src/migrate/rewriteSource.ts
3055
- var import_promises15 = require("fs/promises");
3121
+ var import_promises16 = require("fs/promises");
3056
3122
  function importStatementFor(kind) {
3057
3123
  return kind === "import-meta-env" ? "import cnos from '@kitsy/cnos/browser';" : "import cnos from '@kitsy/cnos';";
3058
3124
  }
@@ -3073,7 +3139,7 @@ async function rewriteSourceFiles(usages, proposals) {
3073
3139
  const backupFiles = [];
3074
3140
  const skippedUsages = [];
3075
3141
  for (const [filePath, fileUsages] of fileGroups.entries()) {
3076
- const original = await (0, import_promises15.readFile)(filePath, "utf8");
3142
+ const original = await (0, import_promises16.readFile)(filePath, "utf8");
3077
3143
  let nextSource = original;
3078
3144
  let changed = false;
3079
3145
  const importKinds = /* @__PURE__ */ new Set();
@@ -3100,7 +3166,7 @@ async function rewriteSourceFiles(usages, proposals) {
3100
3166
  continue;
3101
3167
  }
3102
3168
  const backupPath = `${filePath}.bak`;
3103
- await (0, import_promises15.copyFile)(filePath, backupPath);
3169
+ await (0, import_promises16.copyFile)(filePath, backupPath);
3104
3170
  backupFiles.push(backupPath);
3105
3171
  for (const kind of Array.from(importKinds)) {
3106
3172
  const importStatement = importStatementFor(kind);
@@ -3109,7 +3175,7 @@ async function rewriteSourceFiles(usages, proposals) {
3109
3175
  ${nextSource}`;
3110
3176
  }
3111
3177
  }
3112
- await (0, import_promises15.writeFile)(filePath, nextSource, "utf8");
3178
+ await (0, import_promises16.writeFile)(filePath, nextSource, "utf8");
3113
3179
  rewrittenFiles.push(filePath);
3114
3180
  }
3115
3181
  return {
@@ -3120,7 +3186,7 @@ ${nextSource}`;
3120
3186
  }
3121
3187
 
3122
3188
  // src/migrate/scanEnvUsage.ts
3123
- var import_promises16 = require("fs/promises");
3189
+ var import_promises17 = require("fs/promises");
3124
3190
  var import_node_path15 = __toESM(require("path"), 1);
3125
3191
  var SOURCE_EXTENSIONS = /* @__PURE__ */ new Set([".ts", ".tsx", ".js", ".jsx", ".mts", ".cts", ".mjs", ".cjs"]);
3126
3192
  var PROCESS_ENV_DOT = /process\.env\.([A-Z][A-Z0-9_]*)/g;
@@ -3128,7 +3194,7 @@ var PROCESS_ENV_BRACKET = /process\.env\[['"]([A-Z][A-Z0-9_]*)['"]\]/g;
3128
3194
  var IMPORT_META_ENV_DOT = /import\.meta\.env\.([A-Z][A-Z0-9_]*)/g;
3129
3195
  var IMPORT_META_ENV_BRACKET = /import\.meta\.env\[['"]([A-Z][A-Z0-9_]*)['"]\]/g;
3130
3196
  async function collectFiles(root) {
3131
- const entries = await (0, import_promises16.readdir)(root, { withFileTypes: true });
3197
+ const entries = await (0, import_promises17.readdir)(root, { withFileTypes: true });
3132
3198
  const files = [];
3133
3199
  for (const entry of entries) {
3134
3200
  const filePath = import_node_path15.default.join(root, entry.name);
@@ -3165,7 +3231,7 @@ async function scanEnvUsage(scanRoot) {
3165
3231
  const files = await collectFiles(scanRoot);
3166
3232
  const usages = [];
3167
3233
  for (const filePath of files) {
3168
- const source = await (0, import_promises16.readFile)(filePath, "utf8");
3234
+ const source = await (0, import_promises17.readFile)(filePath, "utf8");
3169
3235
  usages.push(...collectMatches(filePath, source, PROCESS_ENV_DOT, "process-env"));
3170
3236
  usages.push(...collectMatches(filePath, source, PROCESS_ENV_BRACKET, "process-env"));
3171
3237
  usages.push(...collectMatches(filePath, source, IMPORT_META_ENV_DOT, "import-meta-env"));
@@ -1,5 +1,5 @@
1
- import { j as DerivedValue, P as ParsedDerivation, N as NormalizedManifest, n as LoadManifestOptions, o as LoadedManifest, b as LogicalKey, p as NamespaceDefinition, q as VaultDefinition, r as VaultAuthConfig, s as SecretVaultProvider, t as ResolvedRoot, m as NamespaceName, u as RootResolution, v as SecretReference, g as CnosRuntime, w as ValidationSummary, R as ResolvedGraph, S as ServerProjection } from './core-Ud1o2MBn.cjs';
2
- export { l as RuntimeProvider, x as ValidationIssue, y as WorkspaceFile } from './core-Ud1o2MBn.cjs';
1
+ import { j as DerivedValue, P as ParsedDerivation, N as NormalizedManifest, n as LoadManifestOptions, o as LoadedManifest, b as LogicalKey, p as NamespaceDefinition, q as VaultDefinition, r as VaultAuthConfig, s as SecretVaultProviderFactory, t as SecretVaultProvider, u as ResolvedRoot, m as NamespaceName, v as RootResolution, w as SecretReference, g as CnosRuntime, x as ValidationSummary, R as ResolvedGraph, S as ServerProjection } from './core-CGJObpyy.cjs';
2
+ export { l as RuntimeProvider, y as ValidationIssue, z as WorkspaceFile } from './core-CGJObpyy.cjs';
3
3
 
4
4
  declare class CnosError extends Error {
5
5
  constructor(message: string);
@@ -36,7 +36,7 @@ declare function writeVaultSessionKey(vault: string, derivedKey: Buffer, process
36
36
  declare function clearVaultSessionKey(vault: string, processEnv?: Record<string, string | undefined>): Promise<void>;
37
37
  declare function clearAllVaultSessionKeys(processEnv?: Record<string, string | undefined>): Promise<void>;
38
38
 
39
- declare function createSecretVaultProvider(vaultId: string, definition: VaultDefinition, processEnv?: Record<string, string | undefined>): SecretVaultProvider;
39
+ declare function createSecretVaultProvider(vaultId: string, definition: VaultDefinition, processEnv?: Record<string, string | undefined>, factories?: SecretVaultProviderFactory[]): SecretVaultProvider;
40
40
 
41
41
  interface ParsedGitUri {
42
42
  uri: string;
@@ -1,5 +1,5 @@
1
- import { j as DerivedValue, P as ParsedDerivation, N as NormalizedManifest, n as LoadManifestOptions, o as LoadedManifest, b as LogicalKey, p as NamespaceDefinition, q as VaultDefinition, r as VaultAuthConfig, s as SecretVaultProvider, t as ResolvedRoot, m as NamespaceName, u as RootResolution, v as SecretReference, g as CnosRuntime, w as ValidationSummary, R as ResolvedGraph, S as ServerProjection } from './core-Ud1o2MBn.js';
2
- export { l as RuntimeProvider, x as ValidationIssue, y as WorkspaceFile } from './core-Ud1o2MBn.js';
1
+ import { j as DerivedValue, P as ParsedDerivation, N as NormalizedManifest, n as LoadManifestOptions, o as LoadedManifest, b as LogicalKey, p as NamespaceDefinition, q as VaultDefinition, r as VaultAuthConfig, s as SecretVaultProviderFactory, t as SecretVaultProvider, u as ResolvedRoot, m as NamespaceName, v as RootResolution, w as SecretReference, g as CnosRuntime, x as ValidationSummary, R as ResolvedGraph, S as ServerProjection } from './core-CGJObpyy.js';
2
+ export { l as RuntimeProvider, y as ValidationIssue, z as WorkspaceFile } from './core-CGJObpyy.js';
3
3
 
4
4
  declare class CnosError extends Error {
5
5
  constructor(message: string);
@@ -36,7 +36,7 @@ declare function writeVaultSessionKey(vault: string, derivedKey: Buffer, process
36
36
  declare function clearVaultSessionKey(vault: string, processEnv?: Record<string, string | undefined>): Promise<void>;
37
37
  declare function clearAllVaultSessionKeys(processEnv?: Record<string, string | undefined>): Promise<void>;
38
38
 
39
- declare function createSecretVaultProvider(vaultId: string, definition: VaultDefinition, processEnv?: Record<string, string | undefined>): SecretVaultProvider;
39
+ declare function createSecretVaultProvider(vaultId: string, definition: VaultDefinition, processEnv?: Record<string, string | undefined>, factories?: SecretVaultProviderFactory[]): SecretVaultProvider;
40
40
 
41
41
  interface ParsedGitUri {
42
42
  uri: string;
package/dist/internal.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  serializeRuntimeGraph,
12
12
  serializeSecretPayload,
13
13
  serializeServerProjection
14
- } from "./chunk-UKNL2Y4N.js";
14
+ } from "./chunk-T3E57MSQ.js";
15
15
  import {
16
16
  CnosAuthenticationError,
17
17
  CnosSecurityError,
@@ -64,7 +64,7 @@ import {
64
64
  writeLocalSecret,
65
65
  writeRemoteRootCacheMetadata,
66
66
  writeVaultSessionKey
67
- } from "./chunk-MQ4WG3K6.js";
67
+ } from "./chunk-WPB4HB2K.js";
68
68
 
69
69
  // src/codegen/generateTypes.ts
70
70
  function toPascalCase(value) {
@@ -270,6 +270,9 @@ var import_node_path11 = __toESM(require("path"), 1);
270
270
  var import_promises9 = require("fs/promises");
271
271
  var import_node_path10 = __toESM(require("path"), 1);
272
272
 
273
+ // ../core/src/secrets/resolveAuth.ts
274
+ var import_promises12 = require("fs/promises");
275
+
273
276
  // ../core/src/secrets/prompt.ts
274
277
  var import_node_readline = __toESM(require("readline"), 1);
275
278
  var import_node_stream = require("stream");
@@ -278,7 +281,7 @@ var import_node_stream = require("stream");
278
281
  var import_node_crypto3 = require("crypto");
279
282
 
280
283
  // ../core/src/runtime/dump.ts
281
- var import_promises12 = require("fs/promises");
284
+ var import_promises13 = require("fs/promises");
282
285
  var import_node_path13 = __toESM(require("path"), 1);
283
286
 
284
287
  // ../../plugins/basic-schema/src/index.ts
@@ -1,4 +1,4 @@
1
- import { V as ValidatorPlugin } from '../core-Ud1o2MBn.cjs';
1
+ import { V as ValidatorPlugin } from '../core-CGJObpyy.cjs';
2
2
 
3
3
  declare function createBasicSchemaPlugin(): ValidatorPlugin;
4
4
 
@@ -1,4 +1,4 @@
1
- import { V as ValidatorPlugin } from '../core-Ud1o2MBn.js';
1
+ import { V as ValidatorPlugin } from '../core-CGJObpyy.js';
2
2
 
3
3
  declare function createBasicSchemaPlugin(): ValidatorPlugin;
4
4
 
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createBasicSchemaPlugin
3
- } from "../chunk-A5U7EZCJ.js";
4
- import "../chunk-MQ4WG3K6.js";
3
+ } from "../chunk-2DMCB3PK.js";
4
+ import "../chunk-WPB4HB2K.js";
5
5
  export {
6
6
  createBasicSchemaPlugin
7
7
  };
@@ -112,6 +112,9 @@ var import_node_path11 = __toESM(require("path"), 1);
112
112
  var import_promises9 = require("fs/promises");
113
113
  var import_node_path10 = __toESM(require("path"), 1);
114
114
 
115
+ // ../core/src/secrets/resolveAuth.ts
116
+ var import_promises12 = require("fs/promises");
117
+
115
118
  // ../core/src/secrets/prompt.ts
116
119
  var import_node_readline = __toESM(require("readline"), 1);
117
120
  var import_node_stream = require("stream");
@@ -120,7 +123,7 @@ var import_node_stream = require("stream");
120
123
  var import_node_crypto3 = require("crypto");
121
124
 
122
125
  // ../core/src/runtime/dump.ts
123
- var import_promises12 = require("fs/promises");
126
+ var import_promises13 = require("fs/promises");
124
127
  var import_node_path13 = __toESM(require("path"), 1);
125
128
 
126
129
  // ../../plugins/cli-args/src/index.ts
@@ -1,4 +1,4 @@
1
- import { a as ConfigEntry, L as LoaderPlugin } from '../core-Ud1o2MBn.cjs';
1
+ import { a as ConfigEntry, L as LoaderPlugin } from '../core-CGJObpyy.cjs';
2
2
 
3
3
  interface ParsedCliArg {
4
4
  key: string;
@@ -1,4 +1,4 @@
1
- import { a as ConfigEntry, L as LoaderPlugin } from '../core-Ud1o2MBn.js';
1
+ import { a as ConfigEntry, L as LoaderPlugin } from '../core-CGJObpyy.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-FHXLOWAB.js";
6
- import "../chunk-MQ4WG3K6.js";
5
+ } from "../chunk-KJ57PF47.js";
6
+ import "../chunk-WPB4HB2K.js";
7
7
  export {
8
8
  cliArgEntriesFromArgs,
9
9
  createCliArgsPlugin,
@@ -37,7 +37,7 @@ __export(dotenv_exports, {
37
37
  module.exports = __toCommonJS(dotenv_exports);
38
38
 
39
39
  // ../../plugins/dotenv/src/index.ts
40
- var import_promises13 = require("fs/promises");
40
+ var import_promises14 = require("fs/promises");
41
41
  var import_node_path14 = __toESM(require("path"), 1);
42
42
 
43
43
  // ../core/src/keychain/linux.ts
@@ -138,6 +138,9 @@ var import_node_path11 = __toESM(require("path"), 1);
138
138
  var import_promises9 = require("fs/promises");
139
139
  var import_node_path10 = __toESM(require("path"), 1);
140
140
 
141
+ // ../core/src/secrets/resolveAuth.ts
142
+ var import_promises12 = require("fs/promises");
143
+
141
144
  // ../core/src/secrets/prompt.ts
142
145
  var import_node_readline = __toESM(require("readline"), 1);
143
146
  var import_node_stream = require("stream");
@@ -146,7 +149,7 @@ var import_node_stream = require("stream");
146
149
  var import_node_crypto3 = require("crypto");
147
150
 
148
151
  // ../core/src/runtime/dump.ts
149
- var import_promises12 = require("fs/promises");
152
+ var import_promises13 = require("fs/promises");
150
153
  var import_node_path13 = __toESM(require("path"), 1);
151
154
 
152
155
  // ../core/src/utils/envNaming.ts
@@ -267,7 +270,7 @@ function dotenvEntriesFromObject(values, mapping = {}, originFile, workspaceId =
267
270
  }
268
271
  async function readIfPresent(filePath) {
269
272
  try {
270
- return await (0, import_promises13.readFile)(filePath, "utf8");
273
+ return await (0, import_promises14.readFile)(filePath, "utf8");
271
274
  } catch {
272
275
  return void 0;
273
276
  }
@@ -1,5 +1,5 @@
1
- import { L as LoaderPlugin, a as ConfigEntry } from '../core-Ud1o2MBn.cjs';
2
- import { E as EnvMappingConfig } from '../envNaming-DxxqiGKN.cjs';
1
+ import { L as LoaderPlugin, a as ConfigEntry } from '../core-CGJObpyy.cjs';
2
+ import { E as EnvMappingConfig } from '../envNaming-DIaBgT6E.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, a as ConfigEntry } from '../core-Ud1o2MBn.js';
2
- import { E as EnvMappingConfig } from '../envNaming-CPwXl4I6.js';
1
+ import { L as LoaderPlugin, a as ConfigEntry } from '../core-CGJObpyy.js';
2
+ import { E as EnvMappingConfig } from '../envNaming-_WD9sLZI.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-3EZGPQCE.js";
6
- import "../chunk-MQ4WG3K6.js";
5
+ } from "../chunk-DPC2BV3S.js";
6
+ import "../chunk-WPB4HB2K.js";
7
7
  export {
8
8
  createDotenvPlugin,
9
9
  dotenvEntriesFromObject,
@@ -150,9 +150,12 @@ function isObject(value) {
150
150
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
151
151
  }
152
152
  function isSecretReference(value) {
153
- 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));
153
+ return isObject(value) && (value.provider === void 0 || 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));
154
154
  }
155
155
 
156
+ // ../core/src/secrets/resolveAuth.ts
157
+ var import_promises12 = require("fs/promises");
158
+
156
159
  // ../core/src/secrets/prompt.ts
157
160
  var import_node_readline = __toESM(require("readline"), 1);
158
161
  var import_node_stream = require("stream");
@@ -263,7 +266,7 @@ function toPublicEnv(graph, manifest, options = {}, helpers = {}) {
263
266
  }
264
267
 
265
268
  // ../core/src/runtime/dump.ts
266
- var import_promises12 = require("fs/promises");
269
+ var import_promises13 = require("fs/promises");
267
270
  var import_node_path13 = __toESM(require("path"), 1);
268
271
 
269
272
  // ../../plugins/env-export/src/index.ts
@@ -1,5 +1,5 @@
1
- import { E as ExporterPlugin } from '../core-Ud1o2MBn.cjs';
2
- export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-fUZMRUOz.cjs';
1
+ import { E as ExporterPlugin } from '../core-CGJObpyy.cjs';
2
+ export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-C3A8aLjo.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 '../core-Ud1o2MBn.js';
2
- export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-C9wPSpRo.js';
1
+ import { E as ExporterPlugin } from '../core-CGJObpyy.js';
2
+ export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-DLNNcEso.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-RTHKUGJV.js";
4
+ } from "../chunk-5JGNRADB.js";
5
5
  import {
6
6
  toEnv,
7
7
  toPublicEnv
8
- } from "../chunk-MQ4WG3K6.js";
8
+ } from "../chunk-WPB4HB2K.js";
9
9
  export {
10
10
  createEnvExportPlugin,
11
11
  createPublicEnvExportPlugin,