@kitsy/cnos 1.5.0 → 1.6.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 (62) hide show
  1. package/dist/build/index.cjs +333 -117
  2. package/dist/build/index.d.cts +3 -2
  3. package/dist/build/index.d.ts +3 -2
  4. package/dist/build/index.js +13 -8
  5. package/dist/{chunk-HMM76UYZ.js → chunk-BMAD24KC.js} +1 -1
  6. package/dist/{chunk-ZTPSFXWP.js → chunk-JYWQFMW5.js} +1 -1
  7. package/dist/{chunk-FWJC4Y2D.js → chunk-MW4OVAT3.js} +1 -1
  8. package/dist/chunk-QU5CXL47.js +577 -0
  9. package/dist/{chunk-APIU4GTB.js → chunk-S7H2UULC.js} +315 -107
  10. package/dist/{chunk-WCHX2QFY.js → chunk-UJBQS7CJ.js} +1 -1
  11. package/dist/{chunk-RYGSG3GR.js → chunk-UOKVLCFL.js} +10 -10
  12. package/dist/{chunk-T6Y57KTT.js → chunk-UR7CHHNN.js} +1 -1
  13. package/dist/{chunk-J4K4JUJL.js → chunk-VGZREX5D.js} +1 -1
  14. package/dist/{chunk-EQSKV3DP.js → chunk-XSUP7JKH.js} +23 -1
  15. package/dist/configure/index.cjs +332 -122
  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/{envNaming-Dvm_LP2D.d.ts → envNaming-B7Mztkcf.d.ts} +1 -1
  20. package/dist/{envNaming-S4B-dHUx.d.cts → envNaming-gMVnPOfe.d.cts} +1 -1
  21. package/dist/index.cjs +754 -143
  22. package/dist/index.d.cts +1 -1
  23. package/dist/index.d.ts +1 -1
  24. package/dist/index.js +10 -10
  25. package/dist/internal.cjs +229 -103
  26. package/dist/internal.d.cts +16 -28
  27. package/dist/internal.d.ts +16 -28
  28. package/dist/internal.js +11 -3
  29. package/dist/plugin/basic-schema.cjs +22 -15
  30. package/dist/plugin/basic-schema.d.cts +1 -1
  31. package/dist/plugin/basic-schema.d.ts +1 -1
  32. package/dist/plugin/basic-schema.js +2 -2
  33. package/dist/plugin/cli-args.cjs +27 -18
  34. package/dist/plugin/cli-args.d.cts +1 -1
  35. package/dist/plugin/cli-args.d.ts +1 -1
  36. package/dist/plugin/cli-args.js +2 -2
  37. package/dist/plugin/dotenv.cjs +35 -26
  38. package/dist/plugin/dotenv.d.cts +2 -2
  39. package/dist/plugin/dotenv.d.ts +2 -2
  40. package/dist/plugin/dotenv.js +2 -2
  41. package/dist/plugin/env-export.cjs +34 -22
  42. package/dist/plugin/env-export.d.cts +2 -2
  43. package/dist/plugin/env-export.d.ts +2 -2
  44. package/dist/plugin/env-export.js +2 -2
  45. package/dist/plugin/filesystem.cjs +42 -33
  46. package/dist/plugin/filesystem.d.cts +1 -1
  47. package/dist/plugin/filesystem.d.ts +1 -1
  48. package/dist/plugin/filesystem.js +2 -2
  49. package/dist/plugin/process-env.cjs +24 -17
  50. package/dist/plugin/process-env.d.cts +2 -2
  51. package/dist/plugin/process-env.d.ts +2 -2
  52. package/dist/plugin/process-env.js +2 -2
  53. package/dist/{plugin-B4xwySxw.d.cts → plugin-CKrBlWGI.d.cts} +52 -3
  54. package/dist/{plugin-B4xwySxw.d.ts → plugin-CKrBlWGI.d.ts} +52 -3
  55. package/dist/runtime/index.cjs +752 -143
  56. package/dist/runtime/index.d.cts +19 -1
  57. package/dist/runtime/index.d.ts +19 -1
  58. package/dist/runtime/index.js +10 -10
  59. package/dist/{toPublicEnv-ggmphZFs.d.cts → toPublicEnv-CmBsy53P.d.cts} +1 -1
  60. package/dist/{toPublicEnv-CvhGAfsB.d.ts → toPublicEnv-q6VwWxXZ.d.ts} +1 -1
  61. package/package.json +1 -1
  62. package/dist/chunk-TO76YYS4.js +0 -189
@@ -14,7 +14,7 @@ interface SchemaRule {
14
14
  default?: unknown;
15
15
  }
16
16
 
17
- type WorkspaceSource = 'cli' | 'workspace-file' | 'manifest-default' | 'implicit';
17
+ type WorkspaceSource = 'cli' | 'workspace-file' | 'anchor-file' | 'manifest-default' | 'implicit' | 'directory-inferred';
18
18
  type GlobalRootSource = 'cli' | 'workspace-file' | 'manifest' | 'CNOS_HOME';
19
19
  interface WorkspaceFile {
20
20
  workspace?: string;
@@ -167,15 +167,43 @@ interface NormalizedManifest {
167
167
  }
168
168
  interface LoadManifestOptions {
169
169
  root?: string;
170
+ cwd?: string;
170
171
  }
171
172
  interface LoadedManifest {
172
173
  manifestRoot: string;
173
174
  repoRoot: string;
175
+ consumerRoot: string;
176
+ anchorPath?: string;
177
+ anchoredWorkspace?: string;
174
178
  manifestPath: string;
175
179
  manifest: NormalizedManifest;
176
180
  rawManifest: ManifestFile;
177
181
  }
178
182
 
183
+ interface SecretReference {
184
+ provider: string;
185
+ ref: string;
186
+ vault?: string;
187
+ }
188
+ interface VaultAuthConfig {
189
+ passphrase?: string;
190
+ token?: string;
191
+ derivedKey?: Buffer;
192
+ method: 'passphrase' | 'environment' | 'token' | 'iam' | 'keychain';
193
+ config?: Record<string, unknown>;
194
+ }
195
+ interface SecretVaultProvider {
196
+ readonly vaultId: string;
197
+ readonly definition: VaultDefinition;
198
+ authenticate(authConfig: VaultAuthConfig): Promise<void>;
199
+ isAuthenticated(): boolean;
200
+ batchGet(refs: string[]): Promise<Map<string, string>>;
201
+ get(ref: string): Promise<string | undefined>;
202
+ set(ref: string, value: string): Promise<void>;
203
+ delete(ref: string): Promise<void>;
204
+ list(): Promise<string[]>;
205
+ }
206
+
179
207
  type LogicalKey = string;
180
208
  type NamespaceName = string;
181
209
  interface ConfigOrigin {
@@ -235,11 +263,13 @@ interface InspectResult {
235
263
  }>;
236
264
  }
237
265
  interface CnosCreateOptions {
266
+ cwd?: string;
238
267
  root?: string;
239
268
  profile?: string;
240
269
  workspace?: string;
241
270
  globalRoot?: string;
242
- secretResolution?: 'eager' | 'lazy';
271
+ secretResolution?: 'eager' | 'lazy' | 'refreshing';
272
+ secretRefreshTtl?: number;
243
273
  cnosVersion?: string;
244
274
  plugins?: CnosPlugin[];
245
275
  cliArgs?: string[];
@@ -287,6 +317,25 @@ interface CnosRuntime {
287
317
  toNamespace(namespace: NamespaceName): Record<string, unknown>;
288
318
  toEnv(options?: ToEnvOptions): Record<string, string>;
289
319
  toPublicEnv(options?: ToPublicEnvOptions): Record<string, string>;
320
+ toServerProjection(): ServerProjection;
321
+ refreshSecrets(): Promise<void>;
322
+ refreshSecret(key: LogicalKey): Promise<void>;
323
+ }
324
+ interface ServerProjection {
325
+ version: 1;
326
+ workspace: string;
327
+ profile: string;
328
+ resolvedAt: string;
329
+ configHash: string;
330
+ values: Record<string, unknown>;
331
+ secretRefs: Record<string, SecretReference>;
332
+ publicKeys: string[];
333
+ meta: {
334
+ workspace: string;
335
+ profile: string;
336
+ cnos_version: string;
337
+ namespaces?: string[];
338
+ };
290
339
  }
291
340
 
292
341
  type CnosPluginKind = 'loader' | 'resolver' | 'validator' | 'exporter' | 'inspector';
@@ -347,4 +396,4 @@ interface ExporterPlugin extends CnosPlugin {
347
396
  export(graph: ResolvedGraph, context: ExportContext): Promise<ExportResult>;
348
397
  }
349
398
 
350
- 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, NamespaceDefinition as l, VaultDefinition as m, ValidationSummary as n, ValidationIssue as o, WorkspaceFile as p };
399
+ 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, ServerProjection as S, 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, NamespaceDefinition as l, VaultDefinition as m, VaultAuthConfig as n, SecretVaultProvider as o, SecretReference as p, ValidationSummary as q, ValidationIssue as r, WorkspaceFile as s };