@cat-factory/app 0.71.0 → 0.71.2
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.
|
@@ -6,6 +6,7 @@ const ui = useUiStore()
|
|
|
6
6
|
const board = useBoardStore()
|
|
7
7
|
const execution = useExecutionStore()
|
|
8
8
|
const workspace = useWorkspaceStore()
|
|
9
|
+
const workspaceSettings = useWorkspaceSettingsStore()
|
|
9
10
|
const services = useServicesStore()
|
|
10
11
|
const toast = useToast()
|
|
11
12
|
const { t, n } = useI18n()
|
|
@@ -54,9 +55,18 @@ const LOD_LABEL_KEYS = {
|
|
|
54
55
|
} as const
|
|
55
56
|
const lodLabel = computed(() => t(LOD_LABEL_KEYS[ui.lod]))
|
|
56
57
|
|
|
57
|
-
// Live spend indicator: shown once
|
|
58
|
+
// Live spend indicator: shown once the workspace has an explicit budget configured
|
|
59
|
+
// (so the meter appears the moment a budget is set, at zero spend), or once any tokens
|
|
60
|
+
// have been metered this period (the built-in default budget still applies unconfigured).
|
|
58
61
|
const spend = computed(() => workspace.spend)
|
|
59
|
-
const
|
|
62
|
+
const budgetConfigured = computed(
|
|
63
|
+
() =>
|
|
64
|
+
workspaceSettings.settings.spendMonthlyLimit != null ||
|
|
65
|
+
workspaceSettings.settings.spendCurrency != null,
|
|
66
|
+
)
|
|
67
|
+
const showSpend = computed(
|
|
68
|
+
() => !!spend.value && (budgetConfigured.value || spend.value.costSpent > 0),
|
|
69
|
+
)
|
|
60
70
|
const spendLabel = computed(() => {
|
|
61
71
|
const s = spend.value
|
|
62
72
|
if (!s) return ''
|
|
@@ -195,6 +195,16 @@ async function saveBudget() {
|
|
|
195
195
|
icon: 'i-lucide-check',
|
|
196
196
|
color: 'success',
|
|
197
197
|
})
|
|
198
|
+
// The settings PUT only returns the settings; re-fetch the snapshot so the toolbar's
|
|
199
|
+
// spend meter reflects the newly-set limit/currency (spendService.status) right away.
|
|
200
|
+
// Best-effort and AFTER the save succeeded: a transient snapshot-refresh failure must
|
|
201
|
+
// not report a successfully-saved budget as failed (the meter also catches up on the
|
|
202
|
+
// next snapshot pushed over the stream).
|
|
203
|
+
try {
|
|
204
|
+
await useWorkspaceStore().refresh()
|
|
205
|
+
} catch {
|
|
206
|
+
// ignore — the budget is persisted; the meter will catch up on the next snapshot.
|
|
207
|
+
}
|
|
198
208
|
} catch (e) {
|
|
199
209
|
toast.add({
|
|
200
210
|
title: t('settings.workspaceSettings.toast.budgetSaveFailed'),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cat-factory/app",
|
|
3
|
-
"version": "0.71.
|
|
3
|
+
"version": "0.71.2",
|
|
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",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"valibot": "^1.4.2",
|
|
35
35
|
"vue": "^3.5.39",
|
|
36
36
|
"wretch": "^3.0.9",
|
|
37
|
-
"@cat-factory/contracts": "0.
|
|
37
|
+
"@cat-factory/contracts": "0.78.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@toad-contracts/testing": "0.3.2",
|