axiom 0.32.0 → 0.33.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.
package/dist/bin.cjs CHANGED
@@ -448,7 +448,7 @@ var import_api4 = require("@opentelemetry/api");
448
448
  // package.json
449
449
  var package_default = {
450
450
  name: "axiom",
451
- version: "0.32.0",
451
+ version: "0.33.0",
452
452
  type: "module",
453
453
  author: "Axiom, Inc.",
454
454
  contributors: [
@@ -1911,11 +1911,11 @@ function setupEvalProvider(connection) {
1911
1911
  axiomProvider = new import_sdk_trace_node.NodeTracerProvider({
1912
1912
  resource: (0, import_resources.resourceFromAttributes)({
1913
1913
  ["service.name"]: "axiom",
1914
- ["service.version"]: "0.32.0"
1914
+ ["service.version"]: "0.33.0"
1915
1915
  }),
1916
1916
  spanProcessors: [processor]
1917
1917
  });
1918
- axiomTracer = axiomProvider.getTracer("axiom", "0.32.0");
1918
+ axiomTracer = axiomProvider.getTracer("axiom", "0.33.0");
1919
1919
  }
1920
1920
  async function initInstrumentation(config) {
1921
1921
  if (initialized) {
@@ -1927,7 +1927,7 @@ async function initInstrumentation(config) {
1927
1927
  }
1928
1928
  initializationPromise = (async () => {
1929
1929
  if (!config.enabled) {
1930
- axiomTracer = import_api10.trace.getTracer("axiom", "0.32.0");
1930
+ axiomTracer = import_api10.trace.getTracer("axiom", "0.33.0");
1931
1931
  initialized = true;
1932
1932
  return;
1933
1933
  }
@@ -2165,30 +2165,48 @@ function ensureNoSpaceSeparatedSyntax(flagName, value, nextToken, flagType) {
2165
2165
  }
2166
2166
  }
2167
2167
  }
2168
- function validateFlagOverrides(overrides2, flagSchema) {
2168
+ function collectFlagValidationErrors(overrides2, flagSchema) {
2169
2169
  if (!flagSchema || Object.keys(overrides2).length === 0) {
2170
- return;
2170
+ return { success: true, errors: [] };
2171
2171
  }
2172
2172
  const schema = flagSchema;
2173
+ const errors = [];
2173
2174
  for (const dotPath of Object.keys(overrides2)) {
2174
2175
  const segments = parsePath(dotPath);
2175
2176
  if (!isValidPath(schema, segments)) {
2176
- console.error("\u274C Invalid CLI flags:");
2177
- console.error(` \u2022 flag '${dotPath}': Invalid flag path`);
2178
- process.exit(1);
2177
+ errors.push({ type: "invalid_path", path: dotPath });
2179
2178
  }
2180
2179
  }
2180
+ if (errors.length > 0) {
2181
+ return { success: false, errors };
2182
+ }
2181
2183
  const nestedObject = dotNotationToNested(overrides2);
2182
2184
  const result = schema.strict().partial().safeParse(nestedObject);
2183
2185
  if (!result.success) {
2184
- console.error("\u274C Invalid CLI flags:");
2185
- console.error(formatZodErrors(result.error));
2186
- const examples = generateFlagExamples(result.error);
2187
- if (examples.length > 0) {
2188
- console.error("\n\u{1F4A1} Valid examples:");
2189
- examples.forEach((example) => console.error(` ${example}`));
2186
+ errors.push({ type: "invalid_value", zodError: result.error });
2187
+ }
2188
+ return { success: errors.length === 0, errors };
2189
+ }
2190
+ function printFlagValidationErrorsAndExit(errors) {
2191
+ console.error("\u274C Invalid CLI flags:");
2192
+ for (const error of errors) {
2193
+ if (error.type === "invalid_path") {
2194
+ console.error(` \u2022 flag '${error.path}': Invalid flag path`);
2195
+ } else {
2196
+ console.error(formatZodErrors(error.zodError));
2197
+ const examples = generateFlagExamples(error.zodError);
2198
+ if (examples.length > 0) {
2199
+ console.error("\n\u{1F4A1} Valid examples:");
2200
+ examples.forEach((example) => console.error(` ${example}`));
2201
+ }
2190
2202
  }
2191
- process.exit(1);
2203
+ }
2204
+ process.exit(1);
2205
+ }
2206
+ function validateFlagOverrides(overrides2, flagSchema) {
2207
+ const result = collectFlagValidationErrors(overrides2, flagSchema);
2208
+ if (!result.success) {
2209
+ printFlagValidationErrorsAndExit(result.errors);
2192
2210
  }
2193
2211
  }
2194
2212
  function coerceValue(raw) {
@@ -2757,7 +2775,7 @@ var import_commander2 = require("commander");
2757
2775
  var loadVersionCommand = (program2) => {
2758
2776
  return program2.addCommand(
2759
2777
  new import_commander2.Command("version").description("cli version").action(() => {
2760
- console.log("0.32.0");
2778
+ console.log("0.33.0");
2761
2779
  })
2762
2780
  );
2763
2781
  };
@@ -2767,7 +2785,7 @@ var { loadEnvConfig } = import_env.default;
2767
2785
  loadEnvConfig(process.cwd());
2768
2786
  var { cleanedArgv, overrides } = extractOverrides(process.argv.slice(2));
2769
2787
  var program = new import_commander3.Command();
2770
- program.name("axiom").description("Axiom's CLI to manage your objects and run evals").version("0.32.0");
2788
+ program.name("axiom").description("Axiom's CLI to manage your objects and run evals").version("0.33.0");
2771
2789
  program.hook("preAction", async (_, actionCommand) => {
2772
2790
  const commandName = actionCommand.name();
2773
2791
  const parentCommand = actionCommand.parent;