@kitsy/cnos 1.6.1 → 1.8.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 (63) hide show
  1. package/dist/build/index.cjs +1332 -156
  2. package/dist/build/index.d.cts +1 -1
  3. package/dist/build/index.d.ts +1 -1
  4. package/dist/build/index.js +36 -14
  5. package/dist/{chunk-JYWQFMW5.js → chunk-2DGT7N7E.js} +1 -1
  6. package/dist/{chunk-S7H2UULC.js → chunk-2TL42I6M.js} +1323 -139
  7. package/dist/{chunk-MW4OVAT3.js → chunk-5KIQCYFH.js} +1 -1
  8. package/dist/{chunk-6FAX2VKQ.js → chunk-CW7SNVIQ.js} +195 -28
  9. package/dist/{chunk-XSUP7JKH.js → chunk-GHGJFRDL.js} +6 -2
  10. package/dist/{chunk-BMAD24KC.js → chunk-OA7FQGAG.js} +1 -1
  11. package/dist/{chunk-VGZREX5D.js → chunk-RYIARE4M.js} +1 -1
  12. package/dist/{chunk-UR7CHHNN.js → chunk-TT4NV56Z.js} +3 -2
  13. package/dist/{chunk-UJBQS7CJ.js → chunk-UL63DFLS.js} +1 -1
  14. package/dist/{chunk-N32UN66E.js → chunk-ZD4YX6VC.js} +8 -8
  15. package/dist/configure/index.cjs +1309 -155
  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/{plugin-CKrBlWGI.d.cts → core-BJ8xewez.d.cts} +142 -60
  20. package/dist/{plugin-CKrBlWGI.d.ts → core-BJ8xewez.d.ts} +142 -60
  21. package/dist/{envNaming-B7Mztkcf.d.ts → envNaming-BRyiuPoI.d.ts} +1 -1
  22. package/dist/{envNaming-gMVnPOfe.d.cts → envNaming-rx71gpi0.d.cts} +1 -1
  23. package/dist/index.cjs +1548 -227
  24. package/dist/index.d.cts +1 -1
  25. package/dist/index.d.ts +1 -1
  26. package/dist/index.js +10 -10
  27. package/dist/internal.cjs +831 -122
  28. package/dist/internal.d.cts +56 -3
  29. package/dist/internal.d.ts +56 -3
  30. package/dist/internal.js +30 -3
  31. package/dist/plugin/basic-schema.cjs +49 -23
  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 +38 -23
  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 +46 -31
  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 +56 -27
  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 +61 -39
  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 +40 -25
  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 +1548 -227
  56. package/dist/runtime/index.d.cts +3 -1
  57. package/dist/runtime/index.d.ts +3 -1
  58. package/dist/runtime/index.js +10 -10
  59. package/dist/toPublicEnv-CCSgdvI9.d.ts +13 -0
  60. package/dist/toPublicEnv-ivRtLjcw.d.cts +13 -0
  61. package/package.json +1 -1
  62. package/dist/toPublicEnv-CmBsy53P.d.cts +0 -7
  63. package/dist/toPublicEnv-q6VwWxXZ.d.ts +0 -7
@@ -1,6 +1,6 @@
1
- import { R as ResolvedGraph, D as DumpPlanOptions, d as DumpPlan, e as DumpOptions, f as DumpResult, C as CnosCreateOptions, g as CnosRuntime, h as CnosPlugin } from '../plugin-CKrBlWGI.cjs';
2
- export { a as ConfigEntry, I as InspectResult, L as LoaderPlugin, b as LogicalKey, M as ManifestFile, N as NormalizedManifest, T as ToEnvOptions, c as ToPublicEnvOptions } from '../plugin-CKrBlWGI.cjs';
3
- export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-CmBsy53P.cjs';
1
+ import { R as ResolvedGraph, D as DumpPlanOptions, d as DumpPlan, e as DumpOptions, f as DumpResult, C as CnosCreateOptions, g as CnosRuntime, h as CnosPlugin } from '../core-BJ8xewez.cjs';
2
+ export { 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, T as ToEnvOptions, c as ToPublicEnvOptions } from '../core-BJ8xewez.cjs';
3
+ export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-ivRtLjcw.cjs';
4
4
 
5
5
  declare function planDump(graph: ResolvedGraph, options?: DumpPlanOptions): DumpPlan;
6
6
  declare function writeDump(graph: ResolvedGraph, options: DumpOptions): Promise<DumpResult>;
@@ -1,6 +1,6 @@
1
- import { R as ResolvedGraph, D as DumpPlanOptions, d as DumpPlan, e as DumpOptions, f as DumpResult, C as CnosCreateOptions, g as CnosRuntime, h as CnosPlugin } from '../plugin-CKrBlWGI.js';
2
- export { a as ConfigEntry, I as InspectResult, L as LoaderPlugin, b as LogicalKey, M as ManifestFile, N as NormalizedManifest, T as ToEnvOptions, c as ToPublicEnvOptions } from '../plugin-CKrBlWGI.js';
3
- export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-q6VwWxXZ.js';
1
+ import { R as ResolvedGraph, D as DumpPlanOptions, d as DumpPlan, e as DumpOptions, f as DumpResult, C as CnosCreateOptions, g as CnosRuntime, h as CnosPlugin } from '../core-BJ8xewez.js';
2
+ export { 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, T as ToEnvOptions, c as ToPublicEnvOptions } from '../core-BJ8xewez.js';
3
+ export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-CCSgdvI9.js';
4
4
 
5
5
  declare function planDump(graph: ResolvedGraph, options?: DumpPlanOptions): DumpPlan;
6
6
  declare function writeDump(graph: ResolvedGraph, options: DumpOptions): Promise<DumpResult>;
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  createCnos,
3
3
  defaultPlugins
4
- } from "../chunk-N32UN66E.js";
5
- import "../chunk-VGZREX5D.js";
6
- import "../chunk-UR7CHHNN.js";
7
- import "../chunk-UJBQS7CJ.js";
8
- import "../chunk-MW4OVAT3.js";
9
- import "../chunk-JYWQFMW5.js";
10
- import "../chunk-BMAD24KC.js";
4
+ } from "../chunk-ZD4YX6VC.js";
5
+ import "../chunk-RYIARE4M.js";
6
+ import "../chunk-TT4NV56Z.js";
7
+ import "../chunk-UL63DFLS.js";
8
+ import "../chunk-5KIQCYFH.js";
9
+ import "../chunk-2DGT7N7E.js";
10
+ import "../chunk-OA7FQGAG.js";
11
11
  import {
12
12
  planDump,
13
13
  toEnv,
14
14
  toPublicEnv,
15
15
  writeDump
16
- } from "../chunk-S7H2UULC.js";
16
+ } from "../chunk-2TL42I6M.js";
17
17
  export {
18
18
  createCnos,
19
19
  defaultPlugins,
@@ -48,6 +48,29 @@ type NamespaceKind = 'data' | 'projection' | 'system';
48
48
  type NamespaceProjectionSource = 'promote' | 'envMapping';
49
49
  type VaultProviderName = 'local' | 'github-secrets' | (string & {});
50
50
  type VaultAuthMethod = 'passphrase' | 'environment' | 'token' | 'iam' | 'keychain';
51
+ interface RuntimeNamespaceDefinition {
52
+ description?: string;
53
+ serverOnly: boolean;
54
+ builtIn?: boolean;
55
+ }
56
+ type RemoteRootProtocol = 'local' | 'git' | 'cnos';
57
+ interface RootResolution {
58
+ rootUri: string;
59
+ protocol: RemoteRootProtocol;
60
+ remote: boolean;
61
+ readOnly: boolean;
62
+ cacheDir?: string;
63
+ cacheMetaPath?: string;
64
+ ref?: string;
65
+ subpath?: string;
66
+ immutable?: boolean;
67
+ resolvedCommit?: string;
68
+ cachedAt?: string;
69
+ }
70
+ interface ResolvedRoot {
71
+ manifestRoot: string;
72
+ resolution: RootResolution;
73
+ }
51
74
  interface VaultAuthSourceConfig {
52
75
  from?: string[];
53
76
  }
@@ -107,7 +130,12 @@ interface ManifestFile {
107
130
  promote?: LogicalKey[];
108
131
  frameworks?: Record<string, string>;
109
132
  };
110
- namespaces?: Record<string, Partial<NamespaceDefinition>>;
133
+ namespaces?: (Record<string, Partial<NamespaceDefinition>> & {
134
+ runtime?: Record<string, {
135
+ description?: string;
136
+ server_only?: boolean;
137
+ }>;
138
+ }) | undefined;
111
139
  vaults?: Record<string, Partial<VaultDefinition>>;
112
140
  writePolicy?: {
113
141
  define?: {
@@ -156,6 +184,7 @@ interface NormalizedManifest {
156
184
  frameworks: Record<string, string>;
157
185
  };
158
186
  namespaces: Record<string, NamespaceDefinition>;
187
+ runtimeNamespaces: Record<string, RuntimeNamespaceDefinition>;
159
188
  vaults: Record<string, VaultDefinition>;
160
189
  writePolicy: {
161
190
  define: {
@@ -168,6 +197,10 @@ interface NormalizedManifest {
168
197
  interface LoadManifestOptions {
169
198
  root?: string;
170
199
  cwd?: string;
200
+ processEnv?: Record<string, string | undefined>;
201
+ cacheMode?: 'runtime' | 'build' | 'dev';
202
+ cacheTtlSeconds?: number;
203
+ forceRefresh?: boolean;
171
204
  }
172
205
  interface LoadedManifest {
173
206
  manifestRoot: string;
@@ -175,11 +208,70 @@ interface LoadedManifest {
175
208
  consumerRoot: string;
176
209
  anchorPath?: string;
177
210
  anchoredWorkspace?: string;
211
+ rootResolution: RootResolution;
178
212
  manifestPath: string;
179
213
  manifest: NormalizedManifest;
180
214
  rawManifest: ManifestFile;
181
215
  }
182
216
 
217
+ type CnosPluginKind = 'loader' | 'resolver' | 'validator' | 'exporter' | 'inspector';
218
+ interface CnosPlugin {
219
+ id: string;
220
+ kind: CnosPluginKind;
221
+ }
222
+ interface LoaderContext {
223
+ manifest: NormalizedManifest;
224
+ manifestConfig: Record<string, unknown>;
225
+ profile: string;
226
+ profileChain: string[];
227
+ profileActivation: ProfileActivation;
228
+ manifestRoot: string;
229
+ workspace: WorkspaceContext;
230
+ cliArgs?: string[];
231
+ processEnv?: Record<string, string | undefined>;
232
+ }
233
+ interface ValidationContext {
234
+ manifest: NormalizedManifest;
235
+ schema?: Record<LogicalKey, SchemaRule>;
236
+ }
237
+ interface ExportContext {
238
+ manifest: NormalizedManifest;
239
+ promotions: string[];
240
+ frameworkPrefixes?: string[];
241
+ workspace: WorkspaceContext;
242
+ }
243
+ interface LoaderPlugin extends CnosPlugin {
244
+ kind: 'loader';
245
+ load(context: LoaderContext): Promise<ConfigEntry[]>;
246
+ }
247
+ interface ValidationIssue {
248
+ code: string;
249
+ message: string;
250
+ key?: LogicalKey;
251
+ }
252
+ interface ValidationResult {
253
+ pluginId: string;
254
+ valid: boolean;
255
+ issues: ValidationIssue[];
256
+ }
257
+ interface ValidationSummary {
258
+ valid: boolean;
259
+ issues: ValidationIssue[];
260
+ results: ValidationResult[];
261
+ }
262
+ interface ValidatorPlugin extends CnosPlugin {
263
+ kind: 'validator';
264
+ validate(graph: ResolvedGraph, context: ValidationContext): Promise<ValidationResult>;
265
+ }
266
+ interface ExportResult {
267
+ pluginId: string;
268
+ value: Record<string, string>;
269
+ }
270
+ interface ExporterPlugin extends CnosPlugin {
271
+ kind: 'exporter';
272
+ export(graph: ResolvedGraph, context: ExportContext): Promise<ExportResult>;
273
+ }
274
+
183
275
  interface SecretReference {
184
276
  provider: string;
185
277
  ref: string;
@@ -206,6 +298,31 @@ interface SecretVaultProvider {
206
298
 
207
299
  type LogicalKey = string;
208
300
  type NamespaceName = string;
301
+ interface DerivedValue {
302
+ $derive: string | {
303
+ expr: string;
304
+ };
305
+ }
306
+ type ExprNode = {
307
+ type: 'literal';
308
+ value: string | number | boolean | null;
309
+ } | {
310
+ type: 'ref';
311
+ path: string;
312
+ } | {
313
+ type: 'call';
314
+ name: string;
315
+ args: ExprNode[];
316
+ };
317
+ interface ParsedDerivation {
318
+ type: 'template' | 'expression';
319
+ raw: string;
320
+ ast: ExprNode;
321
+ refs: string[];
322
+ runtimeRefs: string[];
323
+ isRuntimeDependent: boolean;
324
+ }
325
+ type RuntimeProvider = (key: string) => unknown;
209
326
  interface ConfigOrigin {
210
327
  file?: string;
211
328
  line?: number;
@@ -261,6 +378,18 @@ interface InspectResult {
261
378
  value: unknown;
262
379
  origin?: ConfigOrigin;
263
380
  }>;
381
+ derived?: {
382
+ type: ParsedDerivation['type'];
383
+ expression: string;
384
+ dependencies: Array<{
385
+ key: string;
386
+ value: unknown;
387
+ runtimeNamespace?: string;
388
+ }>;
389
+ runtimeDependent: boolean;
390
+ runtimeNamespaces: string[];
391
+ promotionWarning?: string;
392
+ };
264
393
  }
265
394
  interface CnosCreateOptions {
266
395
  cwd?: string;
@@ -268,6 +397,9 @@ interface CnosCreateOptions {
268
397
  profile?: string;
269
398
  workspace?: string;
270
399
  globalRoot?: string;
400
+ cacheMode?: 'runtime' | 'build' | 'dev';
401
+ cacheTtlSeconds?: number;
402
+ forceRefresh?: boolean;
271
403
  secretResolution?: 'eager' | 'lazy' | 'refreshing';
272
404
  secretRefreshTtl?: number;
273
405
  cnosVersion?: string;
@@ -318,9 +450,15 @@ interface CnosRuntime {
318
450
  toEnv(options?: ToEnvOptions): Record<string, string>;
319
451
  toPublicEnv(options?: ToPublicEnvOptions): Record<string, string>;
320
452
  toServerProjection(): ServerProjection;
453
+ registerRuntimeProvider(namespace: string, provider: RuntimeProvider): void;
321
454
  refreshSecrets(): Promise<void>;
322
455
  refreshSecret(key: LogicalKey): Promise<void>;
323
456
  }
457
+ interface DerivedFormula {
458
+ expr: string;
459
+ deps: string[];
460
+ runtimeRefs: string[];
461
+ }
324
462
  interface ServerProjection {
325
463
  version: 1;
326
464
  workspace: string;
@@ -328,8 +466,10 @@ interface ServerProjection {
328
466
  resolvedAt: string;
329
467
  configHash: string;
330
468
  values: Record<string, unknown>;
469
+ derived: Record<string, DerivedFormula>;
331
470
  secretRefs: Record<string, SecretReference>;
332
471
  publicKeys: string[];
472
+ runtimeNamespaces: string[];
333
473
  meta: {
334
474
  workspace: string;
335
475
  profile: string;
@@ -338,62 +478,4 @@ interface ServerProjection {
338
478
  };
339
479
  }
340
480
 
341
- type CnosPluginKind = 'loader' | 'resolver' | 'validator' | 'exporter' | 'inspector';
342
- interface CnosPlugin {
343
- id: string;
344
- kind: CnosPluginKind;
345
- }
346
- interface LoaderContext {
347
- manifest: NormalizedManifest;
348
- manifestConfig: Record<string, unknown>;
349
- profile: string;
350
- profileChain: string[];
351
- profileActivation: ProfileActivation;
352
- manifestRoot: string;
353
- workspace: WorkspaceContext;
354
- cliArgs?: string[];
355
- processEnv?: Record<string, string | undefined>;
356
- }
357
- interface ValidationContext {
358
- manifest: NormalizedManifest;
359
- schema?: Record<LogicalKey, SchemaRule>;
360
- }
361
- interface ExportContext {
362
- manifest: NormalizedManifest;
363
- promotions: string[];
364
- frameworkPrefixes?: string[];
365
- workspace: WorkspaceContext;
366
- }
367
- interface LoaderPlugin extends CnosPlugin {
368
- kind: 'loader';
369
- load(context: LoaderContext): Promise<ConfigEntry[]>;
370
- }
371
- interface ValidationIssue {
372
- code: string;
373
- message: string;
374
- key?: LogicalKey;
375
- }
376
- interface ValidationResult {
377
- pluginId: string;
378
- valid: boolean;
379
- issues: ValidationIssue[];
380
- }
381
- interface ValidationSummary {
382
- valid: boolean;
383
- issues: ValidationIssue[];
384
- results: ValidationResult[];
385
- }
386
- interface ValidatorPlugin extends CnosPlugin {
387
- kind: 'validator';
388
- validate(graph: ResolvedGraph, context: ValidationContext): Promise<ValidationResult>;
389
- }
390
- interface ExportResult {
391
- pluginId: string;
392
- value: Record<string, string>;
393
- }
394
- interface ExporterPlugin extends CnosPlugin {
395
- kind: 'exporter';
396
- export(graph: ResolvedGraph, context: ExportContext): Promise<ExportResult>;
397
- }
398
-
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 };
481
+ export type { CnosCreateOptions as C, DumpPlanOptions as D, ExporterPlugin as E, InspectResult as I, LoaderPlugin as L, ManifestFile as M, NormalizedManifest as N, ParsedDerivation as P, 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, DerivedFormula as i, DerivedValue as j, ExprNode as k, RuntimeProvider as l, NamespaceName as m, LoadManifestOptions as n, LoadedManifest as o, NamespaceDefinition as p, VaultDefinition as q, VaultAuthConfig as r, SecretVaultProvider as s, ResolvedRoot as t, RootResolution as u, SecretReference as v, ValidationSummary as w, ValidationIssue as x, WorkspaceFile as y };
@@ -48,6 +48,29 @@ type NamespaceKind = 'data' | 'projection' | 'system';
48
48
  type NamespaceProjectionSource = 'promote' | 'envMapping';
49
49
  type VaultProviderName = 'local' | 'github-secrets' | (string & {});
50
50
  type VaultAuthMethod = 'passphrase' | 'environment' | 'token' | 'iam' | 'keychain';
51
+ interface RuntimeNamespaceDefinition {
52
+ description?: string;
53
+ serverOnly: boolean;
54
+ builtIn?: boolean;
55
+ }
56
+ type RemoteRootProtocol = 'local' | 'git' | 'cnos';
57
+ interface RootResolution {
58
+ rootUri: string;
59
+ protocol: RemoteRootProtocol;
60
+ remote: boolean;
61
+ readOnly: boolean;
62
+ cacheDir?: string;
63
+ cacheMetaPath?: string;
64
+ ref?: string;
65
+ subpath?: string;
66
+ immutable?: boolean;
67
+ resolvedCommit?: string;
68
+ cachedAt?: string;
69
+ }
70
+ interface ResolvedRoot {
71
+ manifestRoot: string;
72
+ resolution: RootResolution;
73
+ }
51
74
  interface VaultAuthSourceConfig {
52
75
  from?: string[];
53
76
  }
@@ -107,7 +130,12 @@ interface ManifestFile {
107
130
  promote?: LogicalKey[];
108
131
  frameworks?: Record<string, string>;
109
132
  };
110
- namespaces?: Record<string, Partial<NamespaceDefinition>>;
133
+ namespaces?: (Record<string, Partial<NamespaceDefinition>> & {
134
+ runtime?: Record<string, {
135
+ description?: string;
136
+ server_only?: boolean;
137
+ }>;
138
+ }) | undefined;
111
139
  vaults?: Record<string, Partial<VaultDefinition>>;
112
140
  writePolicy?: {
113
141
  define?: {
@@ -156,6 +184,7 @@ interface NormalizedManifest {
156
184
  frameworks: Record<string, string>;
157
185
  };
158
186
  namespaces: Record<string, NamespaceDefinition>;
187
+ runtimeNamespaces: Record<string, RuntimeNamespaceDefinition>;
159
188
  vaults: Record<string, VaultDefinition>;
160
189
  writePolicy: {
161
190
  define: {
@@ -168,6 +197,10 @@ interface NormalizedManifest {
168
197
  interface LoadManifestOptions {
169
198
  root?: string;
170
199
  cwd?: string;
200
+ processEnv?: Record<string, string | undefined>;
201
+ cacheMode?: 'runtime' | 'build' | 'dev';
202
+ cacheTtlSeconds?: number;
203
+ forceRefresh?: boolean;
171
204
  }
172
205
  interface LoadedManifest {
173
206
  manifestRoot: string;
@@ -175,11 +208,70 @@ interface LoadedManifest {
175
208
  consumerRoot: string;
176
209
  anchorPath?: string;
177
210
  anchoredWorkspace?: string;
211
+ rootResolution: RootResolution;
178
212
  manifestPath: string;
179
213
  manifest: NormalizedManifest;
180
214
  rawManifest: ManifestFile;
181
215
  }
182
216
 
217
+ type CnosPluginKind = 'loader' | 'resolver' | 'validator' | 'exporter' | 'inspector';
218
+ interface CnosPlugin {
219
+ id: string;
220
+ kind: CnosPluginKind;
221
+ }
222
+ interface LoaderContext {
223
+ manifest: NormalizedManifest;
224
+ manifestConfig: Record<string, unknown>;
225
+ profile: string;
226
+ profileChain: string[];
227
+ profileActivation: ProfileActivation;
228
+ manifestRoot: string;
229
+ workspace: WorkspaceContext;
230
+ cliArgs?: string[];
231
+ processEnv?: Record<string, string | undefined>;
232
+ }
233
+ interface ValidationContext {
234
+ manifest: NormalizedManifest;
235
+ schema?: Record<LogicalKey, SchemaRule>;
236
+ }
237
+ interface ExportContext {
238
+ manifest: NormalizedManifest;
239
+ promotions: string[];
240
+ frameworkPrefixes?: string[];
241
+ workspace: WorkspaceContext;
242
+ }
243
+ interface LoaderPlugin extends CnosPlugin {
244
+ kind: 'loader';
245
+ load(context: LoaderContext): Promise<ConfigEntry[]>;
246
+ }
247
+ interface ValidationIssue {
248
+ code: string;
249
+ message: string;
250
+ key?: LogicalKey;
251
+ }
252
+ interface ValidationResult {
253
+ pluginId: string;
254
+ valid: boolean;
255
+ issues: ValidationIssue[];
256
+ }
257
+ interface ValidationSummary {
258
+ valid: boolean;
259
+ issues: ValidationIssue[];
260
+ results: ValidationResult[];
261
+ }
262
+ interface ValidatorPlugin extends CnosPlugin {
263
+ kind: 'validator';
264
+ validate(graph: ResolvedGraph, context: ValidationContext): Promise<ValidationResult>;
265
+ }
266
+ interface ExportResult {
267
+ pluginId: string;
268
+ value: Record<string, string>;
269
+ }
270
+ interface ExporterPlugin extends CnosPlugin {
271
+ kind: 'exporter';
272
+ export(graph: ResolvedGraph, context: ExportContext): Promise<ExportResult>;
273
+ }
274
+
183
275
  interface SecretReference {
184
276
  provider: string;
185
277
  ref: string;
@@ -206,6 +298,31 @@ interface SecretVaultProvider {
206
298
 
207
299
  type LogicalKey = string;
208
300
  type NamespaceName = string;
301
+ interface DerivedValue {
302
+ $derive: string | {
303
+ expr: string;
304
+ };
305
+ }
306
+ type ExprNode = {
307
+ type: 'literal';
308
+ value: string | number | boolean | null;
309
+ } | {
310
+ type: 'ref';
311
+ path: string;
312
+ } | {
313
+ type: 'call';
314
+ name: string;
315
+ args: ExprNode[];
316
+ };
317
+ interface ParsedDerivation {
318
+ type: 'template' | 'expression';
319
+ raw: string;
320
+ ast: ExprNode;
321
+ refs: string[];
322
+ runtimeRefs: string[];
323
+ isRuntimeDependent: boolean;
324
+ }
325
+ type RuntimeProvider = (key: string) => unknown;
209
326
  interface ConfigOrigin {
210
327
  file?: string;
211
328
  line?: number;
@@ -261,6 +378,18 @@ interface InspectResult {
261
378
  value: unknown;
262
379
  origin?: ConfigOrigin;
263
380
  }>;
381
+ derived?: {
382
+ type: ParsedDerivation['type'];
383
+ expression: string;
384
+ dependencies: Array<{
385
+ key: string;
386
+ value: unknown;
387
+ runtimeNamespace?: string;
388
+ }>;
389
+ runtimeDependent: boolean;
390
+ runtimeNamespaces: string[];
391
+ promotionWarning?: string;
392
+ };
264
393
  }
265
394
  interface CnosCreateOptions {
266
395
  cwd?: string;
@@ -268,6 +397,9 @@ interface CnosCreateOptions {
268
397
  profile?: string;
269
398
  workspace?: string;
270
399
  globalRoot?: string;
400
+ cacheMode?: 'runtime' | 'build' | 'dev';
401
+ cacheTtlSeconds?: number;
402
+ forceRefresh?: boolean;
271
403
  secretResolution?: 'eager' | 'lazy' | 'refreshing';
272
404
  secretRefreshTtl?: number;
273
405
  cnosVersion?: string;
@@ -318,9 +450,15 @@ interface CnosRuntime {
318
450
  toEnv(options?: ToEnvOptions): Record<string, string>;
319
451
  toPublicEnv(options?: ToPublicEnvOptions): Record<string, string>;
320
452
  toServerProjection(): ServerProjection;
453
+ registerRuntimeProvider(namespace: string, provider: RuntimeProvider): void;
321
454
  refreshSecrets(): Promise<void>;
322
455
  refreshSecret(key: LogicalKey): Promise<void>;
323
456
  }
457
+ interface DerivedFormula {
458
+ expr: string;
459
+ deps: string[];
460
+ runtimeRefs: string[];
461
+ }
324
462
  interface ServerProjection {
325
463
  version: 1;
326
464
  workspace: string;
@@ -328,8 +466,10 @@ interface ServerProjection {
328
466
  resolvedAt: string;
329
467
  configHash: string;
330
468
  values: Record<string, unknown>;
469
+ derived: Record<string, DerivedFormula>;
331
470
  secretRefs: Record<string, SecretReference>;
332
471
  publicKeys: string[];
472
+ runtimeNamespaces: string[];
333
473
  meta: {
334
474
  workspace: string;
335
475
  profile: string;
@@ -338,62 +478,4 @@ interface ServerProjection {
338
478
  };
339
479
  }
340
480
 
341
- type CnosPluginKind = 'loader' | 'resolver' | 'validator' | 'exporter' | 'inspector';
342
- interface CnosPlugin {
343
- id: string;
344
- kind: CnosPluginKind;
345
- }
346
- interface LoaderContext {
347
- manifest: NormalizedManifest;
348
- manifestConfig: Record<string, unknown>;
349
- profile: string;
350
- profileChain: string[];
351
- profileActivation: ProfileActivation;
352
- manifestRoot: string;
353
- workspace: WorkspaceContext;
354
- cliArgs?: string[];
355
- processEnv?: Record<string, string | undefined>;
356
- }
357
- interface ValidationContext {
358
- manifest: NormalizedManifest;
359
- schema?: Record<LogicalKey, SchemaRule>;
360
- }
361
- interface ExportContext {
362
- manifest: NormalizedManifest;
363
- promotions: string[];
364
- frameworkPrefixes?: string[];
365
- workspace: WorkspaceContext;
366
- }
367
- interface LoaderPlugin extends CnosPlugin {
368
- kind: 'loader';
369
- load(context: LoaderContext): Promise<ConfigEntry[]>;
370
- }
371
- interface ValidationIssue {
372
- code: string;
373
- message: string;
374
- key?: LogicalKey;
375
- }
376
- interface ValidationResult {
377
- pluginId: string;
378
- valid: boolean;
379
- issues: ValidationIssue[];
380
- }
381
- interface ValidationSummary {
382
- valid: boolean;
383
- issues: ValidationIssue[];
384
- results: ValidationResult[];
385
- }
386
- interface ValidatorPlugin extends CnosPlugin {
387
- kind: 'validator';
388
- validate(graph: ResolvedGraph, context: ValidationContext): Promise<ValidationResult>;
389
- }
390
- interface ExportResult {
391
- pluginId: string;
392
- value: Record<string, string>;
393
- }
394
- interface ExporterPlugin extends CnosPlugin {
395
- kind: 'exporter';
396
- export(graph: ResolvedGraph, context: ExportContext): Promise<ExportResult>;
397
- }
398
-
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 };
481
+ export type { CnosCreateOptions as C, DumpPlanOptions as D, ExporterPlugin as E, InspectResult as I, LoaderPlugin as L, ManifestFile as M, NormalizedManifest as N, ParsedDerivation as P, 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, DerivedFormula as i, DerivedValue as j, ExprNode as k, RuntimeProvider as l, NamespaceName as m, LoadManifestOptions as n, LoadedManifest as o, NamespaceDefinition as p, VaultDefinition as q, VaultAuthConfig as r, SecretVaultProvider as s, ResolvedRoot as t, RootResolution as u, SecretReference as v, ValidationSummary as w, ValidationIssue as x, WorkspaceFile as y };
@@ -1,4 +1,4 @@
1
- import { N as NormalizedManifest, b as LogicalKey } from './plugin-CKrBlWGI.js';
1
+ import { N as NormalizedManifest, b as LogicalKey } from './core-BJ8xewez.js';
2
2
 
3
3
  interface EnvMappingConfig {
4
4
  convention?: NormalizedManifest['envMapping']['convention'];
@@ -1,4 +1,4 @@
1
- import { N as NormalizedManifest, b as LogicalKey } from './plugin-CKrBlWGI.cjs';
1
+ import { N as NormalizedManifest, b as LogicalKey } from './core-BJ8xewez.cjs';
2
2
 
3
3
  interface EnvMappingConfig {
4
4
  convention?: NormalizedManifest['envMapping']['convention'];