@cat-factory/app 0.116.2 → 0.116.3

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.
@@ -4,7 +4,7 @@
4
4
  // rather than pooled on the workspace. Each token is double-encrypted server-side under a
5
5
  // personal PASSWORD (never stored); that password is what you'll enter when you start/retry
6
6
  // such a run (cached locally so it's usually transparent). Recurring schedules can't use them.
7
- import { computed, onMounted, ref } from 'vue'
7
+ import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue'
8
8
  import type { SubscriptionVendor } from '~/types/domain'
9
9
  import SecretInput from '~/components/common/SecretInput.vue'
10
10
 
@@ -87,7 +87,33 @@ const password = ref('')
87
87
  const expiresOn = ref('') // yyyy-mm-dd (optional)
88
88
  const busy = ref(false)
89
89
 
90
+ // A transient "credentials stored" confirmation shown inline right after a successful save.
91
+ // Emptying the form on success recomputes `disabledReason` back to "enter a token", so without
92
+ // this the user is greeted by a red validation error immediately after they succeeded — which
93
+ // reads as a failure. While this notice is set we suppress `disabledReason` and show it instead,
94
+ // then clear it after a few seconds (or the moment the user starts entering a new credential).
95
+ const savedNotice = ref<string | null>(null)
96
+ let savedTimer: ReturnType<typeof setTimeout> | undefined
97
+
98
+ function clearSavedNotice() {
99
+ savedNotice.value = null
100
+ if (savedTimer) {
101
+ clearTimeout(savedTimer)
102
+ savedTimer = undefined
103
+ }
104
+ }
105
+
106
+ // Once the user touches the form again the success notice is stale — drop it so `disabledReason`
107
+ // guides the next entry as usual. Guard on non-empty input so the programmatic clear performed by
108
+ // a successful `connect()` (which resets the fields to empty) doesn't immediately wipe the notice
109
+ // we just set; switching vendor always clears it.
110
+ watch([token, password], ([tok, pwd]) => {
111
+ if (savedNotice.value && (tok.trim() || pwd)) clearSavedNotice()
112
+ })
113
+ watch(vendor, () => clearSavedNotice())
114
+
90
115
  onMounted(() => void personal.load())
116
+ onBeforeUnmount(() => clearSavedNotice())
91
117
 
92
118
  const selectedMeta = computed(() => vendorMeta(vendor.value) ?? PERSONAL_VENDORS.value[0]!)
93
119
  const existing = computed(() => personal.subscriptions.find((s) => s.vendor === vendor.value))
@@ -118,6 +144,7 @@ const renewals = computed(() =>
118
144
 
119
145
  async function connect() {
120
146
  if (!token.value.trim() || password.value.length < 6) return
147
+ const vendorName = selectedMeta.value.label
121
148
  busy.value = true
122
149
  try {
123
150
  await personal.store({
@@ -133,13 +160,19 @@ async function connect() {
133
160
  password.value = ''
134
161
  label.value = ''
135
162
  expiresOn.value = ''
163
+ // Confirm success inline (and transiently) so emptying the form doesn't surface the
164
+ // `disabledReason` validation text as if the save had failed. It clears after a few
165
+ // seconds, or as soon as the user starts entering another credential.
166
+ savedNotice.value = t('personalSubscriptions.saved', { vendor: vendorName })
167
+ if (savedTimer) clearTimeout(savedTimer)
168
+ savedTimer = setTimeout(clearSavedNotice, 5000)
136
169
  // A connected subscription makes its vendor's models usable, so refresh the catalog:
137
170
  // this clears the "No AI model configured" banner and, if the default preset still
138
171
  // points at models this subscription doesn't cover, reactively surfaces the
139
172
  // preset-mismatch prompt (with its "pick a different preset" link).
140
173
  if (workspace.workspaceId) await models.refresh(workspace.workspaceId)
141
174
  toast.add({
142
- title: t('personalSubscriptions.toast.connected', { vendor: selectedMeta.value.label }),
175
+ title: t('personalSubscriptions.toast.connected', { vendor: vendorName }),
143
176
  icon: 'i-lucide-check',
144
177
  color: 'success',
145
178
  })
@@ -266,7 +299,11 @@ async function disconnect(v: SubscriptionVendor) {
266
299
  </UFormField>
267
300
  </div>
268
301
  <div class="flex items-center justify-end gap-3">
269
- <p v-if="disabledReason" class="text-sm text-rose-400">{{ disabledReason }}</p>
302
+ <p v-if="savedNotice" class="flex items-center gap-1.5 text-sm text-emerald-400">
303
+ <UIcon name="i-lucide-check" class="size-4" />
304
+ {{ savedNotice }}
305
+ </p>
306
+ <p v-else-if="disabledReason" class="text-sm text-rose-400">{{ disabledReason }}</p>
270
307
  <UButton
271
308
  :loading="busy"
272
309
  :disabled="disabledReason !== null"
@@ -2569,6 +2569,7 @@
2569
2569
  "token": "Geben Sie Ihr Token ein, um fortzufahren",
2570
2570
  "password": "Geben Sie ein persönliches Passwort mit mindestens 6 Zeichen ein"
2571
2571
  },
2572
+ "saved": "{vendor}-Zugangsdaten sicher gespeichert",
2572
2573
  "expires": "Läuft ab am {date}",
2573
2574
  "noExpiry": "Kein Ablaufdatum gesetzt",
2574
2575
  "renewal": {
@@ -538,6 +538,7 @@
538
538
  "token": "Enter your token to continue",
539
539
  "password": "Enter a personal password of at least 6 characters"
540
540
  },
541
+ "saved": "{vendor} credentials stored securely",
541
542
  "expires": "Expires {date}",
542
543
  "noExpiry": "No expiry set",
543
544
  "renewal": {
@@ -487,6 +487,7 @@
487
487
  "token": "Introduce tu token para continuar",
488
488
  "password": "Introduce una contraseña personal de al menos 6 caracteres"
489
489
  },
490
+ "saved": "Credenciales de {vendor} guardadas de forma segura",
490
491
  "expires": "Caduca el {date}",
491
492
  "noExpiry": "Sin fecha de caducidad",
492
493
  "renewal": {
@@ -487,6 +487,7 @@
487
487
  "token": "Saisissez votre jeton pour continuer",
488
488
  "password": "Saisissez un mot de passe personnel d'au moins 6 caractères"
489
489
  },
490
+ "saved": "Identifiants {vendor} enregistrés en toute sécurité",
490
491
  "expires": "Expire le {date}",
491
492
  "noExpiry": "Aucune date d'expiration",
492
493
  "renewal": {
@@ -487,6 +487,7 @@
487
487
  "token": "הזן את הטוקן שלך כדי להמשיך",
488
488
  "password": "הזן סיסמה אישית באורך 6 תווים לפחות"
489
489
  },
490
+ "saved": "פרטי ההתחברות של {vendor} נשמרו בבטחה",
490
491
  "expires": "פג בתאריך {date}",
491
492
  "noExpiry": "לא הוגדרה תפוגה",
492
493
  "renewal": {
@@ -2569,6 +2569,7 @@
2569
2569
  "token": "Inserisci il tuo token per continuare",
2570
2570
  "password": "Inserisci una password personale di almeno 6 caratteri"
2571
2571
  },
2572
+ "saved": "Credenziali {vendor} salvate in modo sicuro",
2572
2573
  "expires": "Scade il {date}",
2573
2574
  "noExpiry": "Nessuna scadenza impostata",
2574
2575
  "renewal": {
@@ -487,6 +487,7 @@
487
487
  "token": "続行するにはトークンを入力してください",
488
488
  "password": "6文字以上の個人パスワードを入力してください"
489
489
  },
490
+ "saved": "{vendor} の認証情報を安全に保存しました",
490
491
  "expires": "有効期限 {date}",
491
492
  "noExpiry": "有効期限は未設定",
492
493
  "renewal": {
@@ -487,6 +487,7 @@
487
487
  "token": "Wprowadź token, aby kontynuować",
488
488
  "password": "Wprowadź hasło osobiste o długości co najmniej 6 znaków"
489
489
  },
490
+ "saved": "Poświadczenia {vendor} zapisane bezpiecznie",
490
491
  "expires": "Wygasa {date}",
491
492
  "noExpiry": "Brak daty wygaśnięcia",
492
493
  "renewal": {
@@ -487,6 +487,7 @@
487
487
  "token": "Devam etmek için token'ınızı girin",
488
488
  "password": "En az 6 karakterlik kişisel bir parola girin"
489
489
  },
490
+ "saved": "{vendor} kimlik bilgileri güvenli şekilde kaydedildi",
490
491
  "expires": "Son kullanma {date}",
491
492
  "noExpiry": "Son kullanma tarihi ayarlanmadı",
492
493
  "renewal": {
@@ -487,6 +487,7 @@
487
487
  "token": "Введіть свій токен, щоб продовжити",
488
488
  "password": "Введіть особистий пароль щонайменше з 6 символів"
489
489
  },
490
+ "saved": "Облікові дані {vendor} надійно збережено",
490
491
  "expires": "Завершується {date}",
491
492
  "noExpiry": "Дата завершення не вказана",
492
493
  "renewal": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cat-factory/app",
3
- "version": "0.116.2",
3
+ "version": "0.116.3",
4
4
  "description": "Reusable Nuxt layer for the Agent Architecture Board SPA (components, stores, composables, pages). Consume it from a thin deployment app via `extends: ['@cat-factory/app']` and point it at your backend with NUXT_PUBLIC_API_BASE. See deploy/frontend for an example.",
5
5
  "repository": {
6
6
  "type": "git",