@kitsy/cnos 1.5.1 → 1.6.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 (62) hide show
  1. package/dist/build/index.cjs +325 -113
  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-6FAX2VKQ.js +577 -0
  6. package/dist/{chunk-UWFE4JE2.js → chunk-BMAD24KC.js} +1 -1
  7. package/dist/{chunk-7EI3RFUE.js → chunk-JYWQFMW5.js} +1 -1
  8. package/dist/{chunk-F2ZAIZNH.js → chunk-MW4OVAT3.js} +1 -1
  9. package/dist/{chunk-CMQK2AEF.js → chunk-N32UN66E.js} +8 -8
  10. package/dist/{chunk-BS33AW4Y.js → chunk-S7H2UULC.js} +307 -103
  11. package/dist/{chunk-H53ZRQLX.js → chunk-UJBQS7CJ.js} +1 -1
  12. package/dist/{chunk-EJAXWFNT.js → chunk-UR7CHHNN.js} +1 -1
  13. package/dist/{chunk-SZKQVA2M.js → chunk-VGZREX5D.js} +1 -1
  14. package/dist/{chunk-5F2OFKND.js → chunk-XSUP7JKH.js} +23 -1
  15. package/dist/configure/index.cjs +324 -118
  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 +698 -136
  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 +227 -102
  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 +28 -19
  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 +696 -136
  56. package/dist/runtime/index.d.cts +7 -1
  57. package/dist/runtime/index.d.ts +7 -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-TUMR7JA3.js +0 -234
@@ -68,28 +68,34 @@ var import_node_util3 = require("util");
68
68
  var execFileAsync3 = (0, import_node_util3.promisify)(import_node_child_process3.execFile);
69
69
 
70
70
  // ../core/src/manifest/loadManifest.ts
71
+ var import_promises3 = require("fs/promises");
72
+ var import_node_path3 = __toESM(require("path"), 1);
73
+
74
+ // ../core/src/utils/path.ts
71
75
  var import_promises2 = require("fs/promises");
76
+ var import_node_os = __toESM(require("os"), 1);
72
77
  var import_node_path2 = __toESM(require("path"), 1);
73
78
 
74
- // ../core/src/utils/path.ts
79
+ // ../core/src/discovery/findCnosrc.ts
75
80
  var import_promises = require("fs/promises");
76
- var import_node_os = __toESM(require("os"), 1);
77
81
  var import_node_path = __toESM(require("path"), 1);
78
- function stripNamespace(key) {
79
- return key.split(".").slice(1).join(".");
80
- }
81
82
 
82
83
  // ../core/src/utils/yaml.ts
83
84
  var import_yaml = require("yaml");
84
85
 
85
- // ../core/src/manifest/loadWorkspaceFile.ts
86
- var import_promises3 = require("fs/promises");
87
- var import_node_path3 = __toESM(require("path"), 1);
86
+ // ../core/src/utils/path.ts
87
+ function stripNamespace(key) {
88
+ return key.split(".").slice(1).join(".");
89
+ }
88
90
 
89
- // ../core/src/profiles/expandProfileChain.ts
91
+ // ../core/src/manifest/loadWorkspaceFile.ts
90
92
  var import_promises4 = require("fs/promises");
91
93
  var import_node_path4 = __toESM(require("path"), 1);
92
94
 
95
+ // ../core/src/profiles/expandProfileChain.ts
96
+ var import_promises5 = require("fs/promises");
97
+ var import_node_path5 = __toESM(require("path"), 1);
98
+
93
99
  // ../core/src/promotions/validatePromotion.ts
94
100
  var DEFAULT_DATA_NAMESPACE = {
95
101
  kind: "data",
@@ -108,21 +114,21 @@ function getNamespaceDefinition(manifest, namespaceOrKey) {
108
114
  }
109
115
 
110
116
  // ../core/src/workspaces/resolveWorkspaceContext.ts
111
- var import_promises5 = require("fs/promises");
112
- var import_node_path5 = __toESM(require("path"), 1);
117
+ var import_promises6 = require("fs/promises");
118
+ var import_node_path6 = __toESM(require("path"), 1);
113
119
 
114
120
  // ../core/src/secrets/auditLog.ts
115
- var import_promises8 = require("fs/promises");
116
- var import_node_path8 = __toESM(require("path"), 1);
121
+ var import_promises9 = require("fs/promises");
122
+ var import_node_path9 = __toESM(require("path"), 1);
117
123
 
118
124
  // ../core/src/utils/secretStore.ts
119
125
  var import_node_crypto = require("crypto");
120
- var import_promises7 = require("fs/promises");
121
- var import_node_path7 = __toESM(require("path"), 1);
126
+ var import_promises8 = require("fs/promises");
127
+ var import_node_path8 = __toESM(require("path"), 1);
122
128
 
123
129
  // ../core/src/secrets/sessionStore.ts
124
- var import_promises6 = require("fs/promises");
125
- var import_node_path6 = __toESM(require("path"), 1);
130
+ var import_promises7 = require("fs/promises");
131
+ var import_node_path7 = __toESM(require("path"), 1);
126
132
 
127
133
  // ../core/src/utils/secretStore.ts
128
134
  function isObject(value) {
@@ -136,6 +142,9 @@ function isSecretReference(value) {
136
142
  var import_node_readline = __toESM(require("readline"), 1);
137
143
  var import_node_stream = require("stream");
138
144
 
145
+ // ../core/src/runtime/toServerProjection.ts
146
+ var import_node_crypto2 = require("crypto");
147
+
139
148
  // ../core/src/runtime/toEnv.ts
140
149
  function normalizeEnvValue(value) {
141
150
  if (value === void 0 || value === null) {
@@ -220,8 +229,8 @@ function toPublicEnv(graph, manifest, options = {}) {
220
229
  }
221
230
 
222
231
  // ../core/src/runtime/dump.ts
223
- var import_promises9 = require("fs/promises");
224
- var import_node_path9 = __toESM(require("path"), 1);
232
+ var import_promises10 = require("fs/promises");
233
+ var import_node_path10 = __toESM(require("path"), 1);
225
234
 
226
235
  // ../../plugins/env-export/src/index.ts
227
236
  function createEnvExportPlugin() {
@@ -1,5 +1,5 @@
1
- import { E as ExporterPlugin } from '../plugin-B4xwySxw.cjs';
2
- export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-ggmphZFs.cjs';
1
+ import { E as ExporterPlugin } from '../plugin-CKrBlWGI.cjs';
2
+ export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-CmBsy53P.cjs';
3
3
 
4
4
  declare function createEnvExportPlugin(): ExporterPlugin;
5
5
  declare function createPublicEnvExportPlugin(): ExporterPlugin;
@@ -1,5 +1,5 @@
1
- import { E as ExporterPlugin } from '../plugin-B4xwySxw.js';
2
- export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-CvhGAfsB.js';
1
+ import { E as ExporterPlugin } from '../plugin-CKrBlWGI.js';
2
+ export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-q6VwWxXZ.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-SZKQVA2M.js";
4
+ } from "../chunk-VGZREX5D.js";
5
5
  import {
6
6
  toEnv,
7
7
  toPublicEnv
8
- } from "../chunk-BS33AW4Y.js";
8
+ } from "../chunk-S7H2UULC.js";
9
9
  export {
10
10
  createEnvExportPlugin,
11
11
  createPublicEnvExportPlugin,
@@ -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_promises11 = require("fs/promises");
43
+ var import_promises12 = require("fs/promises");
44
44
 
45
45
  // ../../plugins/filesystem/src/helpers.ts
46
- var import_promises10 = require("fs/promises");
47
- var import_node_path10 = __toESM(require("path"), 1);
46
+ var import_promises11 = require("fs/promises");
47
+ var import_node_path11 = __toESM(require("path"), 1);
48
48
 
49
49
  // ../core/src/errors.ts
50
50
  var CnosError = class extends Error {
@@ -77,16 +77,17 @@ var import_node_util3 = require("util");
77
77
  var execFileAsync3 = (0, import_node_util3.promisify)(import_node_child_process3.execFile);
78
78
 
79
79
  // ../core/src/manifest/loadManifest.ts
80
+ var import_promises3 = require("fs/promises");
81
+ var import_node_path3 = __toESM(require("path"), 1);
82
+
83
+ // ../core/src/utils/path.ts
80
84
  var import_promises2 = require("fs/promises");
85
+ var import_node_os = __toESM(require("os"), 1);
81
86
  var import_node_path2 = __toESM(require("path"), 1);
82
87
 
83
- // ../core/src/utils/path.ts
88
+ // ../core/src/discovery/findCnosrc.ts
84
89
  var import_promises = require("fs/promises");
85
- var import_node_os = __toESM(require("os"), 1);
86
90
  var import_node_path = __toESM(require("path"), 1);
87
- function toPortablePath(targetPath) {
88
- return targetPath.replace(/\\/g, "/");
89
- }
90
91
 
91
92
  // ../core/src/utils/yaml.ts
92
93
  var import_yaml = require("yaml");
@@ -94,30 +95,35 @@ function parseYaml(source) {
94
95
  return (0, import_yaml.parse)(source);
95
96
  }
96
97
 
97
- // ../core/src/manifest/loadWorkspaceFile.ts
98
- var import_promises3 = require("fs/promises");
99
- var import_node_path3 = __toESM(require("path"), 1);
98
+ // ../core/src/utils/path.ts
99
+ function toPortablePath(targetPath) {
100
+ return targetPath.replace(/\\/g, "/");
101
+ }
100
102
 
101
- // ../core/src/profiles/expandProfileChain.ts
103
+ // ../core/src/manifest/loadWorkspaceFile.ts
102
104
  var import_promises4 = require("fs/promises");
103
105
  var import_node_path4 = __toESM(require("path"), 1);
104
106
 
105
- // ../core/src/workspaces/resolveWorkspaceContext.ts
107
+ // ../core/src/profiles/expandProfileChain.ts
106
108
  var import_promises5 = require("fs/promises");
107
109
  var import_node_path5 = __toESM(require("path"), 1);
108
110
 
111
+ // ../core/src/workspaces/resolveWorkspaceContext.ts
112
+ var import_promises6 = require("fs/promises");
113
+ var import_node_path6 = __toESM(require("path"), 1);
114
+
109
115
  // ../core/src/secrets/auditLog.ts
110
- var import_promises8 = require("fs/promises");
111
- var import_node_path8 = __toESM(require("path"), 1);
116
+ var import_promises9 = require("fs/promises");
117
+ var import_node_path9 = __toESM(require("path"), 1);
112
118
 
113
119
  // ../core/src/utils/secretStore.ts
114
120
  var import_node_crypto = require("crypto");
115
- var import_promises7 = require("fs/promises");
116
- var import_node_path7 = __toESM(require("path"), 1);
121
+ var import_promises8 = require("fs/promises");
122
+ var import_node_path8 = __toESM(require("path"), 1);
117
123
 
118
124
  // ../core/src/secrets/sessionStore.ts
119
- var import_promises6 = require("fs/promises");
120
- var import_node_path6 = __toESM(require("path"), 1);
125
+ var import_promises7 = require("fs/promises");
126
+ var import_node_path7 = __toESM(require("path"), 1);
121
127
 
122
128
  // ../core/src/utils/secretStore.ts
123
129
  function isObject(value) {
@@ -131,16 +137,19 @@ function isSecretReference(value) {
131
137
  var import_node_readline = __toESM(require("readline"), 1);
132
138
  var import_node_stream = require("stream");
133
139
 
140
+ // ../core/src/runtime/toServerProjection.ts
141
+ var import_node_crypto2 = require("crypto");
142
+
134
143
  // ../core/src/runtime/dump.ts
135
- var import_promises9 = require("fs/promises");
136
- var import_node_path9 = __toESM(require("path"), 1);
144
+ var import_promises10 = require("fs/promises");
145
+ var import_node_path10 = __toESM(require("path"), 1);
137
146
 
138
147
  // ../../plugins/filesystem/src/helpers.ts
139
148
  var YAML_EXTENSIONS = /* @__PURE__ */ new Set([".yml", ".yaml"]);
140
149
  var FILESYSTEM_PLUGIN_ID = "@kitsy/cnos/plugins/filesystem";
141
150
  async function existsDirectory(targetPath) {
142
151
  try {
143
- const stat2 = await (0, import_promises10.readdir)(targetPath);
152
+ const stat2 = await (0, import_promises11.readdir)(targetPath);
144
153
  void stat2;
145
154
  return true;
146
155
  } catch {
@@ -148,15 +157,15 @@ async function existsDirectory(targetPath) {
148
157
  }
149
158
  }
150
159
  async function collectYamlFiles(root) {
151
- const entries = await (0, import_promises10.readdir)(root, { withFileTypes: true });
160
+ const entries = await (0, import_promises11.readdir)(root, { withFileTypes: true });
152
161
  const results = [];
153
162
  for (const entry of entries.sort((left, right) => left.name.localeCompare(right.name))) {
154
- const absolutePath = import_node_path10.default.join(root, entry.name);
163
+ const absolutePath = import_node_path11.default.join(root, entry.name);
155
164
  if (entry.isDirectory()) {
156
165
  results.push(...await collectYamlFiles(absolutePath));
157
166
  continue;
158
167
  }
159
- if (entry.isFile() && YAML_EXTENSIONS.has(import_node_path10.default.extname(entry.name).toLowerCase())) {
168
+ if (entry.isFile() && YAML_EXTENSIONS.has(import_node_path11.default.extname(entry.name).toLowerCase())) {
160
169
  results.push(absolutePath);
161
170
  }
162
171
  }
@@ -164,16 +173,16 @@ async function collectYamlFiles(root) {
164
173
  }
165
174
  async function collectFilesystemLayerFiles(manifestRoot, workspaceRoots, sourceRoot, activeLayers) {
166
175
  const files = [];
167
- const repoRoot = import_node_path10.default.dirname(manifestRoot);
176
+ const repoRoot = import_node_path11.default.dirname(manifestRoot);
168
177
  for (const workspaceRoot of workspaceRoots) {
169
- const resolvedRoot = import_node_path10.default.resolve(workspaceRoot.path, sourceRoot);
178
+ const resolvedRoot = import_node_path11.default.resolve(workspaceRoot.path, sourceRoot);
170
179
  for (const layer of activeLayers) {
171
- const layerRoot = import_node_path10.default.join(resolvedRoot, layer);
180
+ const layerRoot = import_node_path11.default.join(resolvedRoot, layer);
172
181
  if (!await existsDirectory(layerRoot)) {
173
182
  continue;
174
183
  }
175
184
  for (const absolutePath of await collectYamlFiles(layerRoot)) {
176
- const relativePath = import_node_path10.default.relative(repoRoot, absolutePath);
185
+ const relativePath = import_node_path11.default.relative(repoRoot, absolutePath);
177
186
  files.push({
178
187
  absolutePath,
179
188
  relativePath: toPortablePath(relativePath.startsWith("..") ? absolutePath : relativePath),
@@ -250,7 +259,7 @@ function createFilesystemSecretsPlugin() {
250
259
  );
251
260
  const entries = [];
252
261
  for (const file of files) {
253
- const document = await (0, import_promises11.readFile)(file.absolutePath, "utf8");
262
+ const document = await (0, import_promises12.readFile)(file.absolutePath, "utf8");
254
263
  const fileEntries = filesystemSecretsReader(file.relativePath, document, file.workspaceId);
255
264
  for (const entry of fileEntries) {
256
265
  const metadata = toSecretReferenceMetadata(entry.value);
@@ -266,7 +275,7 @@ function createFilesystemSecretsPlugin() {
266
275
  }
267
276
 
268
277
  // ../../plugins/filesystem/src/filesystemValuesReader.ts
269
- var import_promises12 = require("fs/promises");
278
+ var import_promises13 = require("fs/promises");
270
279
  function filesystemValuesReader(filePath, document, workspaceId = "default") {
271
280
  return yamlObjectToEntries(document, filePath, "value", "filesystem-values", workspaceId);
272
281
  }
@@ -287,7 +296,7 @@ function createFilesystemValuesPlugin() {
287
296
  ).map(([namespace]) => namespace);
288
297
  const entries = [];
289
298
  for (const file of files) {
290
- const document = await (0, import_promises12.readFile)(file.absolutePath, "utf8");
299
+ const document = await (0, import_promises13.readFile)(file.absolutePath, "utf8");
291
300
  entries.push(...filesystemValuesReader(file.relativePath, document, file.workspaceId));
292
301
  }
293
302
  for (const namespace of customNamespaces) {
@@ -302,7 +311,7 @@ function createFilesystemValuesPlugin() {
302
311
  layers
303
312
  );
304
313
  for (const file of namespaceFiles) {
305
- const document = await (0, import_promises12.readFile)(file.absolutePath, "utf8");
314
+ const document = await (0, import_promises13.readFile)(file.absolutePath, "utf8");
306
315
  entries.push(...yamlObjectToEntries(document, file.relativePath, namespace, "filesystem-values", file.workspaceId));
307
316
  }
308
317
  }
@@ -1,4 +1,4 @@
1
- import { L as LoaderPlugin, a as ConfigEntry, W as WorkspaceRoot, i as NamespaceName } from '../plugin-B4xwySxw.cjs';
1
+ import { L as LoaderPlugin, a as ConfigEntry, W as WorkspaceRoot, i as NamespaceName } from '../plugin-CKrBlWGI.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, a as ConfigEntry, W as WorkspaceRoot, i as NamespaceName } from '../plugin-B4xwySxw.js';
1
+ import { L as LoaderPlugin, a as ConfigEntry, W as WorkspaceRoot, i as NamespaceName } from '../plugin-CKrBlWGI.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-EJAXWFNT.js";
9
- import "../chunk-BS33AW4Y.js";
8
+ } from "../chunk-UR7CHHNN.js";
9
+ import "../chunk-S7H2UULC.js";
10
10
  export {
11
11
  collectFilesystemLayerFiles,
12
12
  createFilesystemSecretsPlugin,
@@ -52,49 +52,56 @@ var import_node_util3 = require("util");
52
52
  var execFileAsync3 = (0, import_node_util3.promisify)(import_node_child_process3.execFile);
53
53
 
54
54
  // ../core/src/manifest/loadManifest.ts
55
+ var import_promises3 = require("fs/promises");
56
+ var import_node_path3 = __toESM(require("path"), 1);
57
+
58
+ // ../core/src/utils/path.ts
55
59
  var import_promises2 = require("fs/promises");
60
+ var import_node_os = __toESM(require("os"), 1);
56
61
  var import_node_path2 = __toESM(require("path"), 1);
57
62
 
58
- // ../core/src/utils/path.ts
63
+ // ../core/src/discovery/findCnosrc.ts
59
64
  var import_promises = require("fs/promises");
60
- var import_node_os = __toESM(require("os"), 1);
61
65
  var import_node_path = __toESM(require("path"), 1);
62
66
 
63
67
  // ../core/src/utils/yaml.ts
64
68
  var import_yaml = require("yaml");
65
69
 
66
70
  // ../core/src/manifest/loadWorkspaceFile.ts
67
- var import_promises3 = require("fs/promises");
68
- var import_node_path3 = __toESM(require("path"), 1);
69
-
70
- // ../core/src/profiles/expandProfileChain.ts
71
71
  var import_promises4 = require("fs/promises");
72
72
  var import_node_path4 = __toESM(require("path"), 1);
73
73
 
74
- // ../core/src/workspaces/resolveWorkspaceContext.ts
74
+ // ../core/src/profiles/expandProfileChain.ts
75
75
  var import_promises5 = require("fs/promises");
76
76
  var import_node_path5 = __toESM(require("path"), 1);
77
77
 
78
+ // ../core/src/workspaces/resolveWorkspaceContext.ts
79
+ var import_promises6 = require("fs/promises");
80
+ var import_node_path6 = __toESM(require("path"), 1);
81
+
78
82
  // ../core/src/secrets/auditLog.ts
79
- var import_promises8 = require("fs/promises");
80
- var import_node_path8 = __toESM(require("path"), 1);
83
+ var import_promises9 = require("fs/promises");
84
+ var import_node_path9 = __toESM(require("path"), 1);
81
85
 
82
86
  // ../core/src/utils/secretStore.ts
83
87
  var import_node_crypto = require("crypto");
84
- var import_promises7 = require("fs/promises");
85
- var import_node_path7 = __toESM(require("path"), 1);
88
+ var import_promises8 = require("fs/promises");
89
+ var import_node_path8 = __toESM(require("path"), 1);
86
90
 
87
91
  // ../core/src/secrets/sessionStore.ts
88
- var import_promises6 = require("fs/promises");
89
- var import_node_path6 = __toESM(require("path"), 1);
92
+ var import_promises7 = require("fs/promises");
93
+ var import_node_path7 = __toESM(require("path"), 1);
90
94
 
91
95
  // ../core/src/secrets/prompt.ts
92
96
  var import_node_readline = __toESM(require("readline"), 1);
93
97
  var import_node_stream = require("stream");
94
98
 
99
+ // ../core/src/runtime/toServerProjection.ts
100
+ var import_node_crypto2 = require("crypto");
101
+
95
102
  // ../core/src/runtime/dump.ts
96
- var import_promises9 = require("fs/promises");
97
- var import_node_path9 = __toESM(require("path"), 1);
103
+ var import_promises10 = require("fs/promises");
104
+ var import_node_path10 = __toESM(require("path"), 1);
98
105
 
99
106
  // ../core/src/utils/envNaming.ts
100
107
  function normalizeMappingConfig(config = {}) {
@@ -103,8 +110,8 @@ function normalizeMappingConfig(config = {}) {
103
110
  explicit: config.explicit ?? {}
104
111
  };
105
112
  }
106
- function fromScreamingSnake(path10) {
107
- return path10.split("_").map((segment) => segment.trim().toLowerCase()).filter(Boolean).join(".");
113
+ function fromScreamingSnake(path11) {
114
+ return path11.split("_").map((segment) => segment.trim().toLowerCase()).filter(Boolean).join(".");
108
115
  }
109
116
  function envVarToLogicalKey(envVar, config = {}) {
110
117
  const normalized = normalizeMappingConfig(config);
@@ -1,5 +1,5 @@
1
- import { L as LoaderPlugin, a as ConfigEntry } from '../plugin-B4xwySxw.cjs';
2
- import { E as EnvMappingConfig } from '../envNaming-S4B-dHUx.cjs';
1
+ import { L as LoaderPlugin, a as ConfigEntry } from '../plugin-CKrBlWGI.cjs';
2
+ import { E as EnvMappingConfig } from '../envNaming-gMVnPOfe.cjs';
3
3
 
4
4
  declare function processEnvEntriesFromObject(env: Record<string, string | undefined>, mapping?: EnvMappingConfig, workspaceId?: string): ConfigEntry[];
5
5
  declare function processNamespaceEntriesFromContext(env: Record<string, string | undefined>, workspaceId?: string): ConfigEntry[];
@@ -1,5 +1,5 @@
1
- import { L as LoaderPlugin, a as ConfigEntry } from '../plugin-B4xwySxw.js';
2
- import { E as EnvMappingConfig } from '../envNaming-Dvm_LP2D.js';
1
+ import { L as LoaderPlugin, a as ConfigEntry } from '../plugin-CKrBlWGI.js';
2
+ import { E as EnvMappingConfig } from '../envNaming-B7Mztkcf.js';
3
3
 
4
4
  declare function processEnvEntriesFromObject(env: Record<string, string | undefined>, mapping?: EnvMappingConfig, workspaceId?: string): ConfigEntry[];
5
5
  declare function processNamespaceEntriesFromContext(env: Record<string, string | undefined>, workspaceId?: string): ConfigEntry[];
@@ -2,8 +2,8 @@ import {
2
2
  createProcessEnvPlugin,
3
3
  processEnvEntriesFromObject,
4
4
  processNamespaceEntriesFromContext
5
- } from "../chunk-H53ZRQLX.js";
6
- import "../chunk-BS33AW4Y.js";
5
+ } from "../chunk-UJBQS7CJ.js";
6
+ import "../chunk-S7H2UULC.js";
7
7
  export {
8
8
  createProcessEnvPlugin,
9
9
  processEnvEntriesFromObject,
@@ -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 };
@@ -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 };