@ogment-ai/cli 0.9.0 → 0.9.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.
package/dist/cli.js CHANGED
@@ -8800,7 +8800,7 @@ const DEFAULT_OGMENT_BASE_URL = "https://dashboard.ogment.ai";
8800
8800
  */
8801
8801
  const SENTRY_DSN_BUILD = "https://4219ab98670b61086758b4d0e31ae318@o4507724844957696.ingest.us.sentry.io/4510992932405248";
8802
8802
  const SENTRY_ENVIRONMENT_BUILD = "production";
8803
- const SENTRY_RELEASE_BUILD = "cli-v0.9.0+git:f88c23e58";
8803
+ const SENTRY_RELEASE_BUILD = "cli-v0.9.1+git:99e999ee0";
8804
8804
  const packageJsonSchema = object({ version: string().min(1) });
8805
8805
  const hasCode = (value, code) => {
8806
8806
  if (typeof value !== "object" || value === null) return false;
@@ -13737,6 +13737,13 @@ const cacheSchema = object({
13737
13737
  lastCheckedAtMs: number$1().int().nonnegative(),
13738
13738
  latestVersion: string().optional()
13739
13739
  });
13740
+ const isPrereleaseVersion = (version) => {
13741
+ return (import_semver.default.parse(version)?.prerelease.length ?? 0) > 0;
13742
+ };
13743
+ const normalizeLatestVersionCandidate = (version) => {
13744
+ if (version === void 0 || isPrereleaseVersion(version)) return;
13745
+ return version;
13746
+ };
13740
13747
  const isTruthyEnvValue = (value) => {
13741
13748
  if (value === void 0) return false;
13742
13749
  const normalized = value.trim().toLowerCase();
@@ -13797,23 +13804,25 @@ const cachePathFromConfigDir = (configDir) => {
13797
13804
  const maybeGetAvailableCliUpdate = async (options, deps = {}) => {
13798
13805
  try {
13799
13806
  if (shouldSkipUpdateCheck(options.env ?? process.env)) return null;
13807
+ if (isPrereleaseVersion(options.currentVersion)) return null;
13800
13808
  const now = deps.now ?? (() => /* @__PURE__ */ new Date());
13801
13809
  const fetchLatestVersion = deps.fetchLatestVersion ?? defaultFetchLatestVersion;
13802
13810
  const cachePath = cachePathFromConfigDir(options.configDir ?? defaultConfigDir());
13803
13811
  let latestVersion;
13804
13812
  const existingCache = readCache(cachePath);
13813
+ const cachedLatestVersion = normalizeLatestVersionCandidate(existingCache?.latestVersion);
13805
13814
  const nowMs = now().getTime();
13806
13815
  if (existingCache === void 0 || nowMs - existingCache.lastCheckedAtMs >= UPDATE_CHECK_INTERVAL_MS) {
13807
13816
  try {
13808
- latestVersion = await fetchWithTimeout(options.packageName, fetchLatestVersion);
13817
+ latestVersion = normalizeLatestVersionCandidate(await fetchWithTimeout(options.packageName, fetchLatestVersion)) ?? cachedLatestVersion;
13809
13818
  } catch {
13810
- latestVersion = existingCache?.latestVersion;
13819
+ latestVersion = cachedLatestVersion;
13811
13820
  }
13812
13821
  writeCache(cachePath, {
13813
13822
  ...latestVersion === void 0 ? {} : { latestVersion },
13814
13823
  lastCheckedAtMs: nowMs
13815
13824
  });
13816
- } else latestVersion = existingCache.latestVersion;
13825
+ } else latestVersion = cachedLatestVersion;
13817
13826
  if (latestVersion !== void 0 && isNewerVersion(latestVersion, options.currentVersion)) return {
13818
13827
  currentVersion: options.currentVersion,
13819
13828
  latestVersion,
@@ -14112,6 +14121,7 @@ var OutputManager = class {
14112
14121
  //#endregion
14113
14122
  //#region ../../packages/shared/src/cli/common.ts
14114
14123
  const jsonObjectSchema = record(string(), unknown());
14124
+ const isoTimestampSchema = datetime({ offset: true });
14115
14125
  const cliErrorSchema = object({
14116
14126
  code: string().min(1),
14117
14127
  message: string().min(1)
@@ -14162,7 +14172,7 @@ const deviceCodeStartDataSchema = object({
14162
14172
  const deviceCodeStartSchema = cliSuccessEnvelopeSchema(deviceCodeStartDataSchema);
14163
14173
  const authStartDataSchema = object({
14164
14174
  authRequestId: string().min(1),
14165
- expiresAt: string().datetime(),
14175
+ expiresAt: isoTimestampSchema,
14166
14176
  userCode: string().min(1),
14167
14177
  verificationUrl: string().url()
14168
14178
  }).strict();
@@ -14244,7 +14254,7 @@ const cliCommandCompletedEventSchema = object({
14244
14254
  inputMode: cliInputModeSchema.nullable(),
14245
14255
  installationId: uuid(),
14246
14256
  success: boolean(),
14247
- timestamp: datetime({ offset: true })
14257
+ timestamp: isoTimestampSchema
14248
14258
  }).strict();
14249
14259
  const cliTelemetryAcceptedDataSchema = object({ accepted: literal(true) }).strict();
14250
14260
  const cliTelemetryAcceptedSchema = cliSuccessEnvelopeSchema(cliTelemetryAcceptedDataSchema);
@@ -72550,4 +72560,4 @@ if (shouldExecuteCli(import.meta.url, process.argv[1])) await executeCli();
72550
72560
 
72551
72561
  //#endregion
72552
72562
  export { executeCli, runCli, shouldExecuteCli };
72553
- //# debugId=856f5502-c592-445c-b0d7-d8c7048e63ba
72563
+ //# debugId=75a9f438-9e34-4abd-88d2-6cd8a68d9950