@kitsy/cnos 1.5.0 → 1.5.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.
@@ -279,7 +279,8 @@ var DEFAULT_INSPECTORS = ["provenance"];
279
279
  var DEFAULT_FRAMEWORK_PREFIXES = {
280
280
  next: "NEXT_PUBLIC_",
281
281
  vite: "VITE_",
282
- nuxt: "NUXT_PUBLIC_"
282
+ nuxt: "NUXT_PUBLIC_",
283
+ webpack: ""
283
284
  };
284
285
  var DEFAULT_NAMESPACES = {
285
286
  value: {
@@ -2056,11 +2057,14 @@ function resolvePublicPrefix(manifest, options) {
2056
2057
  if (!options.framework) {
2057
2058
  return "";
2058
2059
  }
2059
- const configuredPrefix = manifest.public.frameworks[options.framework];
2060
- if (!configuredPrefix) {
2060
+ const hasConfiguredPrefix = Object.prototype.hasOwnProperty.call(
2061
+ manifest.public.frameworks,
2062
+ options.framework
2063
+ );
2064
+ if (!hasConfiguredPrefix) {
2061
2065
  throw new CnosManifestError(`Unknown public framework prefix: ${options.framework}`);
2062
2066
  }
2063
- return configuredPrefix;
2067
+ return manifest.public.frameworks[options.framework] ?? "";
2064
2068
  }
2065
2069
  function toPublicEnv(graph, manifest, options = {}) {
2066
2070
  const prefix = resolvePublicPrefix(manifest, options);
@@ -2319,7 +2323,7 @@ function envVarToLogicalKey(envVar, config = {}) {
2319
2323
  // package.json
2320
2324
  var package_default = {
2321
2325
  name: "@kitsy/cnos",
2322
- version: "1.5.0",
2326
+ version: "1.5.1",
2323
2327
  description: "Batteries-included CNOS runtime package wired with the official plugins.",
2324
2328
  type: "module",
2325
2329
  main: "./dist/index.cjs",
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createCnos
3
- } from "../chunk-RYGSG3GR.js";
4
- import "../chunk-J4K4JUJL.js";
5
- import "../chunk-T6Y57KTT.js";
6
- import "../chunk-WCHX2QFY.js";
7
- import "../chunk-FWJC4Y2D.js";
8
- import "../chunk-ZTPSFXWP.js";
9
- import "../chunk-HMM76UYZ.js";
10
- import "../chunk-APIU4GTB.js";
3
+ } from "../chunk-CMQK2AEF.js";
4
+ import "../chunk-SZKQVA2M.js";
5
+ import "../chunk-EJAXWFNT.js";
6
+ import "../chunk-H53ZRQLX.js";
7
+ import "../chunk-F2ZAIZNH.js";
8
+ import "../chunk-7EI3RFUE.js";
9
+ import "../chunk-UWFE4JE2.js";
10
+ import "../chunk-BS33AW4Y.js";
11
11
 
12
12
  // src/build/index.ts
13
13
  async function resolveBrowserData(options = {}) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isSecretReference
3
- } from "./chunk-APIU4GTB.js";
3
+ } from "./chunk-BS33AW4Y.js";
4
4
 
5
5
  // src/runtime/bootstrap.ts
6
6
  import { createCipheriv, createDecipheriv, randomBytes } from "crypto";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  joinConfigPath
3
- } from "./chunk-APIU4GTB.js";
3
+ } from "./chunk-BS33AW4Y.js";
4
4
 
5
5
  // ../../plugins/cli-args/src/index.ts
6
6
  var CLI_ARGS_PLUGIN_ID = "@kitsy/cnos/plugins/cli-args";
@@ -286,7 +286,8 @@ var DEFAULT_INSPECTORS = ["provenance"];
286
286
  var DEFAULT_FRAMEWORK_PREFIXES = {
287
287
  next: "NEXT_PUBLIC_",
288
288
  vite: "VITE_",
289
- nuxt: "NUXT_PUBLIC_"
289
+ nuxt: "NUXT_PUBLIC_",
290
+ webpack: ""
290
291
  };
291
292
  var DEFAULT_NAMESPACES = {
292
293
  value: {
@@ -1389,11 +1390,14 @@ function resolvePublicPrefix(manifest, options) {
1389
1390
  if (!options.framework) {
1390
1391
  return "";
1391
1392
  }
1392
- const configuredPrefix = manifest.public.frameworks[options.framework];
1393
- if (!configuredPrefix) {
1393
+ const hasConfiguredPrefix = Object.prototype.hasOwnProperty.call(
1394
+ manifest.public.frameworks,
1395
+ options.framework
1396
+ );
1397
+ if (!hasConfiguredPrefix) {
1394
1398
  throw new CnosManifestError(`Unknown public framework prefix: ${options.framework}`);
1395
1399
  }
1396
- return configuredPrefix;
1400
+ return manifest.public.frameworks[options.framework] ?? "";
1397
1401
  }
1398
1402
  function toPublicEnv(graph, manifest, options = {}) {
1399
1403
  const prefix = resolvePublicPrefix(manifest, options);
@@ -1,27 +1,27 @@
1
1
  import {
2
2
  createEnvExportPlugin,
3
3
  createPublicEnvExportPlugin
4
- } from "./chunk-J4K4JUJL.js";
4
+ } from "./chunk-SZKQVA2M.js";
5
5
  import {
6
6
  createFilesystemSecretsPlugin,
7
7
  createFilesystemValuesPlugin
8
- } from "./chunk-T6Y57KTT.js";
8
+ } from "./chunk-EJAXWFNT.js";
9
9
  import {
10
10
  createProcessEnvPlugin
11
- } from "./chunk-WCHX2QFY.js";
11
+ } from "./chunk-H53ZRQLX.js";
12
12
  import {
13
13
  createBasicSchemaPlugin
14
- } from "./chunk-FWJC4Y2D.js";
14
+ } from "./chunk-F2ZAIZNH.js";
15
15
  import {
16
16
  createCliArgsPlugin
17
- } from "./chunk-ZTPSFXWP.js";
17
+ } from "./chunk-7EI3RFUE.js";
18
18
  import {
19
19
  createDotenvPlugin
20
- } from "./chunk-HMM76UYZ.js";
20
+ } from "./chunk-UWFE4JE2.js";
21
21
  import {
22
22
  createCnos,
23
23
  createProvenanceInspector
24
- } from "./chunk-APIU4GTB.js";
24
+ } from "./chunk-BS33AW4Y.js";
25
25
 
26
26
  // src/defaultPlugins.ts
27
27
  function defaultPlugins() {
@@ -68,7 +68,7 @@ function setBootstrappedSecretHydrationRequired(value) {
68
68
  // package.json
69
69
  var package_default = {
70
70
  name: "@kitsy/cnos",
71
- version: "1.5.0",
71
+ version: "1.5.1",
72
72
  description: "Batteries-included CNOS runtime package wired with the official plugins.",
73
73
  type: "module",
74
74
  main: "./dist/index.cjs",
@@ -3,7 +3,7 @@ import {
3
3
  isSecretReference,
4
4
  parseYaml,
5
5
  toPortablePath
6
- } from "./chunk-APIU4GTB.js";
6
+ } from "./chunk-BS33AW4Y.js";
7
7
 
8
8
  // ../../plugins/filesystem/src/helpers.ts
9
9
  import { readdir } from "fs/promises";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  applySchemaRules
3
- } from "./chunk-APIU4GTB.js";
3
+ } from "./chunk-BS33AW4Y.js";
4
4
 
5
5
  // ../../plugins/basic-schema/src/index.ts
6
6
  function createBasicSchemaPlugin() {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  envVarToLogicalKey
3
- } from "./chunk-APIU4GTB.js";
3
+ } from "./chunk-BS33AW4Y.js";
4
4
 
5
5
  // ../../plugins/process-env/src/index.ts
6
6
  var PROCESS_ENV_PLUGIN_ID = "@kitsy/cnos/plugins/process-env";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  toEnv,
3
3
  toPublicEnv
4
- } from "./chunk-APIU4GTB.js";
4
+ } from "./chunk-BS33AW4Y.js";
5
5
 
6
6
  // ../../plugins/env-export/src/index.ts
7
7
  function createEnvExportPlugin() {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  graphRequiresSecretHydration,
3
3
  readRuntimeGraphFromEnv
4
- } from "./chunk-EQSKV3DP.js";
4
+ } from "./chunk-5F2OFKND.js";
5
5
  import {
6
6
  createCnos,
7
7
  getBootstrappedSecretHydrationRequired,
@@ -10,7 +10,7 @@ import {
10
10
  setBootstrappedSecretHydrationRequired,
11
11
  setSingletonReady,
12
12
  setSingletonRuntime
13
- } from "./chunk-RYGSG3GR.js";
13
+ } from "./chunk-CMQK2AEF.js";
14
14
  import {
15
15
  inspectValue,
16
16
  readOrValue,
@@ -20,7 +20,7 @@ import {
20
20
  toLogicalKey,
21
21
  toNamespaceObject,
22
22
  toPublicEnv
23
- } from "./chunk-APIU4GTB.js";
23
+ } from "./chunk-BS33AW4Y.js";
24
24
 
25
25
  // src/runtime/index.ts
26
26
  var NOT_READY_MESSAGE = "CNOS not initialized. Call await cnos.ready() or use cnos run.";
@@ -31,6 +31,31 @@ function getRuntimeOrThrow() {
31
31
  }
32
32
  return runtime;
33
33
  }
34
+ function stringifyLogValue(value) {
35
+ if (value === void 0) {
36
+ return "";
37
+ }
38
+ if (value === null) {
39
+ return "null";
40
+ }
41
+ if (typeof value === "string") {
42
+ return value;
43
+ }
44
+ if (typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") {
45
+ return String(value);
46
+ }
47
+ return JSON.stringify(value);
48
+ }
49
+ function formatMessage(runtime, message) {
50
+ return message.replace(/\$\{([^}]+)\}/g, (match, rawKey) => {
51
+ const key = String(rawKey).trim();
52
+ if (!key) {
53
+ return match;
54
+ }
55
+ const value = runtime.read(key);
56
+ return value === void 0 ? match : stringifyLogValue(value);
57
+ });
58
+ }
34
59
  function attachBootstrappedGraph(graph) {
35
60
  if (getSingletonRuntime()) {
36
61
  return;
@@ -111,12 +136,6 @@ function attachBootstrappedGraph(graph) {
111
136
  meta(path) {
112
137
  return readValue(graph, toLogicalKey("meta", path));
113
138
  },
114
- inspect(key) {
115
- return inspectValue(graph, key);
116
- },
117
- toObject() {
118
- return toNamespaceObject(graph);
119
- },
120
139
  toNamespace(namespace) {
121
140
  return toNamespaceObject(graph, namespace);
122
141
  },
@@ -125,6 +144,12 @@ function attachBootstrappedGraph(graph) {
125
144
  },
126
145
  toPublicEnv(options) {
127
146
  return toPublicEnv(graph, bootstrappedManifest, options);
147
+ },
148
+ inspect(key) {
149
+ return inspectValue(graph, key);
150
+ },
151
+ toObject() {
152
+ return toNamespaceObject(graph);
128
153
  }
129
154
  };
130
155
  setSingletonRuntime(runtime);
@@ -164,6 +189,26 @@ var cnos = Object.assign(
164
189
  meta(path) {
165
190
  return readValue(getRuntimeOrThrow().graph, toLogicalKey("meta", path));
166
191
  },
192
+ inspect(key) {
193
+ return getRuntimeOrThrow().inspect(key);
194
+ },
195
+ toNamespace(namespace) {
196
+ return getRuntimeOrThrow().toNamespace(namespace);
197
+ },
198
+ toEnv(options) {
199
+ return getRuntimeOrThrow().toEnv(options);
200
+ },
201
+ toPublicEnv(options) {
202
+ return getRuntimeOrThrow().toPublicEnv(options);
203
+ },
204
+ format(message) {
205
+ return formatMessage(getRuntimeOrThrow(), message);
206
+ },
207
+ log(message) {
208
+ const formatted = formatMessage(getRuntimeOrThrow(), message);
209
+ console.log(formatted);
210
+ return formatted;
211
+ },
167
212
  async ready() {
168
213
  if (getSingletonRuntime() && !getBootstrappedSecretHydrationRequired()) {
169
214
  return;
@@ -2,7 +2,7 @@ import {
2
2
  envVarToLogicalKey,
3
3
  resolveWorkspaceScopedPath,
4
4
  toPortablePath
5
- } from "./chunk-APIU4GTB.js";
5
+ } from "./chunk-BS33AW4Y.js";
6
6
 
7
7
  // ../../plugins/dotenv/src/index.ts
8
8
  import { readFile } from "fs/promises";
@@ -282,7 +282,8 @@ var DEFAULT_INSPECTORS = ["provenance"];
282
282
  var DEFAULT_FRAMEWORK_PREFIXES = {
283
283
  next: "NEXT_PUBLIC_",
284
284
  vite: "VITE_",
285
- nuxt: "NUXT_PUBLIC_"
285
+ nuxt: "NUXT_PUBLIC_",
286
+ webpack: ""
286
287
  };
287
288
  var DEFAULT_NAMESPACES = {
288
289
  value: {
@@ -2059,11 +2060,14 @@ function resolvePublicPrefix(manifest, options) {
2059
2060
  if (!options.framework) {
2060
2061
  return "";
2061
2062
  }
2062
- const configuredPrefix = manifest.public.frameworks[options.framework];
2063
- if (!configuredPrefix) {
2063
+ const hasConfiguredPrefix = Object.prototype.hasOwnProperty.call(
2064
+ manifest.public.frameworks,
2065
+ options.framework
2066
+ );
2067
+ if (!hasConfiguredPrefix) {
2064
2068
  throw new CnosManifestError(`Unknown public framework prefix: ${options.framework}`);
2065
2069
  }
2066
- return configuredPrefix;
2070
+ return manifest.public.frameworks[options.framework] ?? "";
2067
2071
  }
2068
2072
  function toPublicEnv(graph, manifest, options = {}) {
2069
2073
  const prefix = resolvePublicPrefix(manifest, options);
@@ -2364,7 +2368,7 @@ function envVarToLogicalKey(envVar, config = {}) {
2364
2368
  // package.json
2365
2369
  var package_default = {
2366
2370
  name: "@kitsy/cnos",
2367
- version: "1.5.0",
2371
+ version: "1.5.1",
2368
2372
  description: "Batteries-included CNOS runtime package wired with the official plugins.",
2369
2373
  type: "module",
2370
2374
  main: "./dist/index.cjs",
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  createCnos,
3
3
  defaultPlugins
4
- } from "../chunk-RYGSG3GR.js";
5
- import "../chunk-J4K4JUJL.js";
6
- import "../chunk-T6Y57KTT.js";
7
- import "../chunk-WCHX2QFY.js";
8
- import "../chunk-FWJC4Y2D.js";
9
- import "../chunk-ZTPSFXWP.js";
10
- import "../chunk-HMM76UYZ.js";
4
+ } from "../chunk-CMQK2AEF.js";
5
+ import "../chunk-SZKQVA2M.js";
6
+ import "../chunk-EJAXWFNT.js";
7
+ import "../chunk-H53ZRQLX.js";
8
+ import "../chunk-F2ZAIZNH.js";
9
+ import "../chunk-7EI3RFUE.js";
10
+ import "../chunk-UWFE4JE2.js";
11
11
  import {
12
12
  planDump,
13
13
  toEnv,
14
14
  toPublicEnv,
15
15
  writeDump
16
- } from "../chunk-APIU4GTB.js";
16
+ } from "../chunk-BS33AW4Y.js";
17
17
  export {
18
18
  createCnos,
19
19
  defaultPlugins,
package/dist/index.cjs CHANGED
@@ -278,7 +278,8 @@ var DEFAULT_INSPECTORS = ["provenance"];
278
278
  var DEFAULT_FRAMEWORK_PREFIXES = {
279
279
  next: "NEXT_PUBLIC_",
280
280
  vite: "VITE_",
281
- nuxt: "NUXT_PUBLIC_"
281
+ nuxt: "NUXT_PUBLIC_",
282
+ webpack: ""
282
283
  };
283
284
  var DEFAULT_NAMESPACES = {
284
285
  value: {
@@ -2055,11 +2056,14 @@ function resolvePublicPrefix(manifest, options) {
2055
2056
  if (!options.framework) {
2056
2057
  return "";
2057
2058
  }
2058
- const configuredPrefix = manifest.public.frameworks[options.framework];
2059
- if (!configuredPrefix) {
2059
+ const hasConfiguredPrefix = Object.prototype.hasOwnProperty.call(
2060
+ manifest.public.frameworks,
2061
+ options.framework
2062
+ );
2063
+ if (!hasConfiguredPrefix) {
2060
2064
  throw new CnosManifestError(`Unknown public framework prefix: ${options.framework}`);
2061
2065
  }
2062
- return configuredPrefix;
2066
+ return manifest.public.frameworks[options.framework] ?? "";
2063
2067
  }
2064
2068
  function toPublicEnv(graph, manifest, options = {}) {
2065
2069
  const prefix = resolvePublicPrefix(manifest, options);
@@ -2318,7 +2322,7 @@ function envVarToLogicalKey(envVar, config = {}) {
2318
2322
  // package.json
2319
2323
  var package_default = {
2320
2324
  name: "@kitsy/cnos",
2321
- version: "1.5.0",
2325
+ version: "1.5.1",
2322
2326
  description: "Batteries-included CNOS runtime package wired with the official plugins.",
2323
2327
  type: "module",
2324
2328
  main: "./dist/index.cjs",
@@ -3056,6 +3060,31 @@ function getRuntimeOrThrow() {
3056
3060
  }
3057
3061
  return runtime;
3058
3062
  }
3063
+ function stringifyLogValue(value) {
3064
+ if (value === void 0) {
3065
+ return "";
3066
+ }
3067
+ if (value === null) {
3068
+ return "null";
3069
+ }
3070
+ if (typeof value === "string") {
3071
+ return value;
3072
+ }
3073
+ if (typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") {
3074
+ return String(value);
3075
+ }
3076
+ return JSON.stringify(value);
3077
+ }
3078
+ function formatMessage(runtime, message) {
3079
+ return message.replace(/\$\{([^}]+)\}/g, (match, rawKey) => {
3080
+ const key = String(rawKey).trim();
3081
+ if (!key) {
3082
+ return match;
3083
+ }
3084
+ const value = runtime.read(key);
3085
+ return value === void 0 ? match : stringifyLogValue(value);
3086
+ });
3087
+ }
3059
3088
  function attachBootstrappedGraph(graph) {
3060
3089
  if (getSingletonRuntime()) {
3061
3090
  return;
@@ -3136,12 +3165,6 @@ function attachBootstrappedGraph(graph) {
3136
3165
  meta(path12) {
3137
3166
  return readValue(graph, toLogicalKey("meta", path12));
3138
3167
  },
3139
- inspect(key) {
3140
- return inspectValue(graph, key);
3141
- },
3142
- toObject() {
3143
- return toNamespaceObject(graph);
3144
- },
3145
3168
  toNamespace(namespace) {
3146
3169
  return toNamespaceObject(graph, namespace);
3147
3170
  },
@@ -3150,6 +3173,12 @@ function attachBootstrappedGraph(graph) {
3150
3173
  },
3151
3174
  toPublicEnv(options) {
3152
3175
  return toPublicEnv(graph, bootstrappedManifest, options);
3176
+ },
3177
+ inspect(key) {
3178
+ return inspectValue(graph, key);
3179
+ },
3180
+ toObject() {
3181
+ return toNamespaceObject(graph);
3153
3182
  }
3154
3183
  };
3155
3184
  setSingletonRuntime(runtime);
@@ -3189,6 +3218,26 @@ var cnos = Object.assign(
3189
3218
  meta(path12) {
3190
3219
  return readValue(getRuntimeOrThrow().graph, toLogicalKey("meta", path12));
3191
3220
  },
3221
+ inspect(key) {
3222
+ return getRuntimeOrThrow().inspect(key);
3223
+ },
3224
+ toNamespace(namespace) {
3225
+ return getRuntimeOrThrow().toNamespace(namespace);
3226
+ },
3227
+ toEnv(options) {
3228
+ return getRuntimeOrThrow().toEnv(options);
3229
+ },
3230
+ toPublicEnv(options) {
3231
+ return getRuntimeOrThrow().toPublicEnv(options);
3232
+ },
3233
+ format(message) {
3234
+ return formatMessage(getRuntimeOrThrow(), message);
3235
+ },
3236
+ log(message) {
3237
+ const formatted = formatMessage(getRuntimeOrThrow(), message);
3238
+ console.log(formatted);
3239
+ return formatted;
3240
+ },
3192
3241
  async ready() {
3193
3242
  if (getSingletonRuntime() && !getBootstrappedSecretHydrationRequired()) {
3194
3243
  return;
package/dist/index.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  runtime_default
3
- } from "./chunk-TO76YYS4.js";
4
- import "./chunk-EQSKV3DP.js";
5
- import "./chunk-RYGSG3GR.js";
6
- import "./chunk-J4K4JUJL.js";
7
- import "./chunk-T6Y57KTT.js";
8
- import "./chunk-WCHX2QFY.js";
9
- import "./chunk-FWJC4Y2D.js";
10
- import "./chunk-ZTPSFXWP.js";
11
- import "./chunk-HMM76UYZ.js";
12
- import "./chunk-APIU4GTB.js";
3
+ } from "./chunk-TUMR7JA3.js";
4
+ import "./chunk-5F2OFKND.js";
5
+ import "./chunk-CMQK2AEF.js";
6
+ import "./chunk-SZKQVA2M.js";
7
+ import "./chunk-EJAXWFNT.js";
8
+ import "./chunk-H53ZRQLX.js";
9
+ import "./chunk-F2ZAIZNH.js";
10
+ import "./chunk-7EI3RFUE.js";
11
+ import "./chunk-UWFE4JE2.js";
12
+ import "./chunk-BS33AW4Y.js";
13
13
  export {
14
14
  runtime_default as cnos,
15
15
  runtime_default as default
package/dist/internal.cjs CHANGED
@@ -305,7 +305,8 @@ var DEFAULT_INSPECTORS = ["provenance"];
305
305
  var DEFAULT_FRAMEWORK_PREFIXES = {
306
306
  next: "NEXT_PUBLIC_",
307
307
  vite: "VITE_",
308
- nuxt: "NUXT_PUBLIC_"
308
+ nuxt: "NUXT_PUBLIC_",
309
+ webpack: ""
309
310
  };
310
311
  var DEFAULT_NAMESPACES = {
311
312
  value: {
package/dist/internal.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  readRuntimeGraphFromEnv,
8
8
  serializeRuntimeGraph,
9
9
  serializeSecretPayload
10
- } from "./chunk-EQSKV3DP.js";
10
+ } from "./chunk-5F2OFKND.js";
11
11
  import {
12
12
  CnosAuthenticationError,
13
13
  CnosSecurityError,
@@ -47,7 +47,7 @@ import {
47
47
  writeKeychain,
48
48
  writeLocalSecret,
49
49
  writeVaultSessionKey
50
- } from "./chunk-APIU4GTB.js";
50
+ } from "./chunk-BS33AW4Y.js";
51
51
 
52
52
  // src/codegen/generateTypes.ts
53
53
  function toPascalCase(value) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createBasicSchemaPlugin
3
- } from "../chunk-FWJC4Y2D.js";
4
- import "../chunk-APIU4GTB.js";
3
+ } from "../chunk-F2ZAIZNH.js";
4
+ import "../chunk-BS33AW4Y.js";
5
5
  export {
6
6
  createBasicSchemaPlugin
7
7
  };
@@ -2,8 +2,8 @@ import {
2
2
  cliArgEntriesFromArgs,
3
3
  createCliArgsPlugin,
4
4
  parseCliArgs
5
- } from "../chunk-ZTPSFXWP.js";
6
- import "../chunk-APIU4GTB.js";
5
+ } from "../chunk-7EI3RFUE.js";
6
+ import "../chunk-BS33AW4Y.js";
7
7
  export {
8
8
  cliArgEntriesFromArgs,
9
9
  createCliArgsPlugin,
@@ -2,8 +2,8 @@ import {
2
2
  createDotenvPlugin,
3
3
  dotenvEntriesFromObject,
4
4
  parseDotenv
5
- } from "../chunk-HMM76UYZ.js";
6
- import "../chunk-APIU4GTB.js";
5
+ } from "../chunk-UWFE4JE2.js";
6
+ import "../chunk-BS33AW4Y.js";
7
7
  export {
8
8
  createDotenvPlugin,
9
9
  dotenvEntriesFromObject,
@@ -198,11 +198,14 @@ function resolvePublicPrefix(manifest, options) {
198
198
  if (!options.framework) {
199
199
  return "";
200
200
  }
201
- const configuredPrefix = manifest.public.frameworks[options.framework];
202
- if (!configuredPrefix) {
201
+ const hasConfiguredPrefix = Object.prototype.hasOwnProperty.call(
202
+ manifest.public.frameworks,
203
+ options.framework
204
+ );
205
+ if (!hasConfiguredPrefix) {
203
206
  throw new CnosManifestError(`Unknown public framework prefix: ${options.framework}`);
204
207
  }
205
- return configuredPrefix;
208
+ return manifest.public.frameworks[options.framework] ?? "";
206
209
  }
207
210
  function toPublicEnv(graph, manifest, options = {}) {
208
211
  const prefix = resolvePublicPrefix(manifest, options);
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  createEnvExportPlugin,
3
3
  createPublicEnvExportPlugin
4
- } from "../chunk-J4K4JUJL.js";
4
+ } from "../chunk-SZKQVA2M.js";
5
5
  import {
6
6
  toEnv,
7
7
  toPublicEnv
8
- } from "../chunk-APIU4GTB.js";
8
+ } from "../chunk-BS33AW4Y.js";
9
9
  export {
10
10
  createEnvExportPlugin,
11
11
  createPublicEnvExportPlugin,
@@ -5,8 +5,8 @@ import {
5
5
  filesystemSecretsReader,
6
6
  filesystemValuesReader,
7
7
  yamlObjectToEntries
8
- } from "../chunk-T6Y57KTT.js";
9
- import "../chunk-APIU4GTB.js";
8
+ } from "../chunk-EJAXWFNT.js";
9
+ import "../chunk-BS33AW4Y.js";
10
10
  export {
11
11
  collectFilesystemLayerFiles,
12
12
  createFilesystemSecretsPlugin,
@@ -2,8 +2,8 @@ import {
2
2
  createProcessEnvPlugin,
3
3
  processEnvEntriesFromObject,
4
4
  processNamespaceEntriesFromContext
5
- } from "../chunk-WCHX2QFY.js";
6
- import "../chunk-APIU4GTB.js";
5
+ } from "../chunk-H53ZRQLX.js";
6
+ import "../chunk-BS33AW4Y.js";
7
7
  export {
8
8
  createProcessEnvPlugin,
9
9
  processEnvEntriesFromObject,
@@ -277,7 +277,8 @@ var DEFAULT_INSPECTORS = ["provenance"];
277
277
  var DEFAULT_FRAMEWORK_PREFIXES = {
278
278
  next: "NEXT_PUBLIC_",
279
279
  vite: "VITE_",
280
- nuxt: "NUXT_PUBLIC_"
280
+ nuxt: "NUXT_PUBLIC_",
281
+ webpack: ""
281
282
  };
282
283
  var DEFAULT_NAMESPACES = {
283
284
  value: {
@@ -2054,11 +2055,14 @@ function resolvePublicPrefix(manifest, options) {
2054
2055
  if (!options.framework) {
2055
2056
  return "";
2056
2057
  }
2057
- const configuredPrefix = manifest.public.frameworks[options.framework];
2058
- if (!configuredPrefix) {
2058
+ const hasConfiguredPrefix = Object.prototype.hasOwnProperty.call(
2059
+ manifest.public.frameworks,
2060
+ options.framework
2061
+ );
2062
+ if (!hasConfiguredPrefix) {
2059
2063
  throw new CnosManifestError(`Unknown public framework prefix: ${options.framework}`);
2060
2064
  }
2061
- return configuredPrefix;
2065
+ return manifest.public.frameworks[options.framework] ?? "";
2062
2066
  }
2063
2067
  function toPublicEnv(graph, manifest, options = {}) {
2064
2068
  const prefix = resolvePublicPrefix(manifest, options);
@@ -2317,7 +2321,7 @@ function envVarToLogicalKey(envVar, config = {}) {
2317
2321
  // package.json
2318
2322
  var package_default = {
2319
2323
  name: "@kitsy/cnos",
2320
- version: "1.5.0",
2324
+ version: "1.5.1",
2321
2325
  description: "Batteries-included CNOS runtime package wired with the official plugins.",
2322
2326
  type: "module",
2323
2327
  main: "./dist/index.cjs",
@@ -3055,6 +3059,31 @@ function getRuntimeOrThrow() {
3055
3059
  }
3056
3060
  return runtime;
3057
3061
  }
3062
+ function stringifyLogValue(value) {
3063
+ if (value === void 0) {
3064
+ return "";
3065
+ }
3066
+ if (value === null) {
3067
+ return "null";
3068
+ }
3069
+ if (typeof value === "string") {
3070
+ return value;
3071
+ }
3072
+ if (typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") {
3073
+ return String(value);
3074
+ }
3075
+ return JSON.stringify(value);
3076
+ }
3077
+ function formatMessage(runtime, message) {
3078
+ return message.replace(/\$\{([^}]+)\}/g, (match, rawKey) => {
3079
+ const key = String(rawKey).trim();
3080
+ if (!key) {
3081
+ return match;
3082
+ }
3083
+ const value = runtime.read(key);
3084
+ return value === void 0 ? match : stringifyLogValue(value);
3085
+ });
3086
+ }
3058
3087
  function attachBootstrappedGraph(graph) {
3059
3088
  if (getSingletonRuntime()) {
3060
3089
  return;
@@ -3135,12 +3164,6 @@ function attachBootstrappedGraph(graph) {
3135
3164
  meta(path12) {
3136
3165
  return readValue(graph, toLogicalKey("meta", path12));
3137
3166
  },
3138
- inspect(key) {
3139
- return inspectValue(graph, key);
3140
- },
3141
- toObject() {
3142
- return toNamespaceObject(graph);
3143
- },
3144
3167
  toNamespace(namespace) {
3145
3168
  return toNamespaceObject(graph, namespace);
3146
3169
  },
@@ -3149,6 +3172,12 @@ function attachBootstrappedGraph(graph) {
3149
3172
  },
3150
3173
  toPublicEnv(options) {
3151
3174
  return toPublicEnv(graph, bootstrappedManifest, options);
3175
+ },
3176
+ inspect(key) {
3177
+ return inspectValue(graph, key);
3178
+ },
3179
+ toObject() {
3180
+ return toNamespaceObject(graph);
3152
3181
  }
3153
3182
  };
3154
3183
  setSingletonRuntime(runtime);
@@ -3188,6 +3217,26 @@ var cnos = Object.assign(
3188
3217
  meta(path12) {
3189
3218
  return readValue(getRuntimeOrThrow().graph, toLogicalKey("meta", path12));
3190
3219
  },
3220
+ inspect(key) {
3221
+ return getRuntimeOrThrow().inspect(key);
3222
+ },
3223
+ toNamespace(namespace) {
3224
+ return getRuntimeOrThrow().toNamespace(namespace);
3225
+ },
3226
+ toEnv(options) {
3227
+ return getRuntimeOrThrow().toEnv(options);
3228
+ },
3229
+ toPublicEnv(options) {
3230
+ return getRuntimeOrThrow().toPublicEnv(options);
3231
+ },
3232
+ format(message) {
3233
+ return formatMessage(getRuntimeOrThrow(), message);
3234
+ },
3235
+ log(message) {
3236
+ const formatted = formatMessage(getRuntimeOrThrow(), message);
3237
+ console.log(formatted);
3238
+ return formatted;
3239
+ },
3191
3240
  async ready() {
3192
3241
  if (getSingletonRuntime() && !getBootstrappedSecretHydrationRequired()) {
3193
3242
  return;
@@ -1,4 +1,4 @@
1
- import { b as LogicalKey } from '../plugin-B4xwySxw.cjs';
1
+ import { b as LogicalKey, g as CnosRuntime, I as InspectResult } from '../plugin-B4xwySxw.cjs';
2
2
 
3
3
  interface CnosSingleton {
4
4
  <T = unknown>(key: LogicalKey): T | undefined;
@@ -8,6 +8,12 @@ interface CnosSingleton {
8
8
  value<T = unknown>(path: string): T | undefined;
9
9
  secret<T = unknown>(path: string): T | undefined;
10
10
  meta<T = unknown>(path: string): T | undefined;
11
+ inspect(key: LogicalKey): ReturnType<CnosRuntime['inspect']>;
12
+ toNamespace(namespace: string): ReturnType<CnosRuntime['toNamespace']>;
13
+ toEnv(options?: Parameters<CnosRuntime['toEnv']>[0]): ReturnType<CnosRuntime['toEnv']>;
14
+ toPublicEnv(options?: Parameters<CnosRuntime['toPublicEnv']>[0]): ReturnType<CnosRuntime['toPublicEnv']>;
15
+ format(message: string): string;
16
+ log(message: string): string;
11
17
  ready(): Promise<void>;
12
18
  }
13
19
  declare const cnos: CnosSingleton & {
@@ -17,6 +23,12 @@ declare const cnos: CnosSingleton & {
17
23
  value<T = unknown>(path: string): T | undefined;
18
24
  secret<T = unknown>(path: string): T | undefined;
19
25
  meta<T = unknown>(path: string): T | undefined;
26
+ inspect(key: LogicalKey): InspectResult;
27
+ toNamespace(namespace: string): Record<string, unknown>;
28
+ toEnv(options: Parameters<CnosRuntime["toEnv"]>[0]): Record<string, string>;
29
+ toPublicEnv(options: Parameters<CnosRuntime["toPublicEnv"]>[0]): Record<string, string>;
30
+ format(message: string): string;
31
+ log(message: string): string;
20
32
  ready(): Promise<void>;
21
33
  };
22
34
 
@@ -1,4 +1,4 @@
1
- import { b as LogicalKey } from '../plugin-B4xwySxw.js';
1
+ import { b as LogicalKey, g as CnosRuntime, I as InspectResult } from '../plugin-B4xwySxw.js';
2
2
 
3
3
  interface CnosSingleton {
4
4
  <T = unknown>(key: LogicalKey): T | undefined;
@@ -8,6 +8,12 @@ interface CnosSingleton {
8
8
  value<T = unknown>(path: string): T | undefined;
9
9
  secret<T = unknown>(path: string): T | undefined;
10
10
  meta<T = unknown>(path: string): T | undefined;
11
+ inspect(key: LogicalKey): ReturnType<CnosRuntime['inspect']>;
12
+ toNamespace(namespace: string): ReturnType<CnosRuntime['toNamespace']>;
13
+ toEnv(options?: Parameters<CnosRuntime['toEnv']>[0]): ReturnType<CnosRuntime['toEnv']>;
14
+ toPublicEnv(options?: Parameters<CnosRuntime['toPublicEnv']>[0]): ReturnType<CnosRuntime['toPublicEnv']>;
15
+ format(message: string): string;
16
+ log(message: string): string;
11
17
  ready(): Promise<void>;
12
18
  }
13
19
  declare const cnos: CnosSingleton & {
@@ -17,6 +23,12 @@ declare const cnos: CnosSingleton & {
17
23
  value<T = unknown>(path: string): T | undefined;
18
24
  secret<T = unknown>(path: string): T | undefined;
19
25
  meta<T = unknown>(path: string): T | undefined;
26
+ inspect(key: LogicalKey): InspectResult;
27
+ toNamespace(namespace: string): Record<string, unknown>;
28
+ toEnv(options: Parameters<CnosRuntime["toEnv"]>[0]): Record<string, string>;
29
+ toPublicEnv(options: Parameters<CnosRuntime["toPublicEnv"]>[0]): Record<string, string>;
30
+ format(message: string): string;
31
+ log(message: string): string;
20
32
  ready(): Promise<void>;
21
33
  };
22
34
 
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  runtime_default
3
- } from "../chunk-TO76YYS4.js";
4
- import "../chunk-EQSKV3DP.js";
5
- import "../chunk-RYGSG3GR.js";
6
- import "../chunk-J4K4JUJL.js";
7
- import "../chunk-T6Y57KTT.js";
8
- import "../chunk-WCHX2QFY.js";
9
- import "../chunk-FWJC4Y2D.js";
10
- import "../chunk-ZTPSFXWP.js";
11
- import "../chunk-HMM76UYZ.js";
12
- import "../chunk-APIU4GTB.js";
3
+ } from "../chunk-TUMR7JA3.js";
4
+ import "../chunk-5F2OFKND.js";
5
+ import "../chunk-CMQK2AEF.js";
6
+ import "../chunk-SZKQVA2M.js";
7
+ import "../chunk-EJAXWFNT.js";
8
+ import "../chunk-H53ZRQLX.js";
9
+ import "../chunk-F2ZAIZNH.js";
10
+ import "../chunk-7EI3RFUE.js";
11
+ import "../chunk-UWFE4JE2.js";
12
+ import "../chunk-BS33AW4Y.js";
13
13
  export {
14
14
  runtime_default as default
15
15
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitsy/cnos",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Batteries-included CNOS runtime package wired with the official plugins.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",