@cat-factory/app 0.50.0 → 0.50.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/app/components/panels/inspector/ServiceFragments.vue +31 -5
- package/app/components/panels/inspector/TaskStructure.vue +31 -5
- package/i18n/locales/en.json +3 -1
- package/i18n/locales/es.json +3 -1
- package/i18n/locales/fr.json +3 -1
- package/i18n/locales/pl.json +3 -1
- package/i18n/locales/uk.json +3 -1
- package/package.json +1 -1
|
@@ -9,27 +9,53 @@ const props = defineProps<{ block: Block }>()
|
|
|
9
9
|
|
|
10
10
|
const board = useBoardStore()
|
|
11
11
|
const fragments = useFragmentsStore()
|
|
12
|
+
const ui = useUiStore()
|
|
13
|
+
const accounts = useAccountsStore()
|
|
12
14
|
const { t } = useI18n()
|
|
13
15
|
|
|
14
16
|
onMounted(() => fragments.ensureLoaded())
|
|
15
17
|
|
|
18
|
+
type MenuItem = { label: string; icon?: string; onSelect: () => void }
|
|
19
|
+
|
|
16
20
|
const selectedFragments = computed(() =>
|
|
17
21
|
(props.block.serviceFragmentIds ?? [])
|
|
18
22
|
.map((id) => fragments.getFragment(id))
|
|
19
23
|
.filter((f): f is NonNullable<typeof f> => !!f),
|
|
20
24
|
)
|
|
21
25
|
|
|
22
|
-
//
|
|
23
|
-
|
|
26
|
+
// A trailing group that jumps from "attach a fragment" to authoring/editing the
|
|
27
|
+
// library itself (board tier always; account tier when accounts are enabled).
|
|
28
|
+
// Open to every member — managing fragments is not an admin-only action.
|
|
29
|
+
const manageItems = computed<MenuItem[]>(() => {
|
|
30
|
+
const items: MenuItem[] = [
|
|
31
|
+
{
|
|
32
|
+
label: t('inspector.fragments.manageBoard'),
|
|
33
|
+
icon: 'i-lucide-book-marked',
|
|
34
|
+
onSelect: () => ui.openFragmentLibrary(),
|
|
35
|
+
},
|
|
36
|
+
]
|
|
37
|
+
if (accounts.enabled) {
|
|
38
|
+
items.push({
|
|
39
|
+
label: t('inspector.fragments.manageAccount'),
|
|
40
|
+
icon: 'i-lucide-users',
|
|
41
|
+
onSelect: () => ui.openAccountSettings('fragments'),
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
|
+
return items
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
// Picker menu: every pool fragment not already selected, grouped by category, with
|
|
48
|
+
// the management links appended as the final group.
|
|
49
|
+
const fragmentMenu = computed<MenuItem[][]>(() => {
|
|
24
50
|
const selected = new Set(props.block.serviceFragmentIds ?? [])
|
|
25
|
-
const groups = new Map<string,
|
|
51
|
+
const groups = new Map<string, MenuItem[]>()
|
|
26
52
|
for (const f of fragments.fragments) {
|
|
27
53
|
if (selected.has(f.id)) continue
|
|
28
54
|
const items = groups.get(f.category) ?? []
|
|
29
55
|
items.push({ label: f.title, onSelect: () => addFragment(f.id) })
|
|
30
56
|
groups.set(f.category, items)
|
|
31
57
|
}
|
|
32
|
-
return [...groups.values()]
|
|
58
|
+
return [...groups.values(), manageItems.value]
|
|
33
59
|
})
|
|
34
60
|
|
|
35
61
|
function addFragment(id: string) {
|
|
@@ -52,7 +78,7 @@ function removeFragment(id: string) {
|
|
|
52
78
|
<span class="text-[11px] font-semibold uppercase tracking-wide text-slate-400">
|
|
53
79
|
{{ t('inspector.fragments.serviceTitle') }}
|
|
54
80
|
</span>
|
|
55
|
-
<UDropdownMenu
|
|
81
|
+
<UDropdownMenu :items="fragmentMenu">
|
|
56
82
|
<UButton
|
|
57
83
|
size="xs"
|
|
58
84
|
variant="ghost"
|
|
@@ -5,8 +5,12 @@ const props = defineProps<{ block: Block }>()
|
|
|
5
5
|
|
|
6
6
|
const board = useBoardStore()
|
|
7
7
|
const fragments = useFragmentsStore()
|
|
8
|
+
const ui = useUiStore()
|
|
9
|
+
const accounts = useAccountsStore()
|
|
8
10
|
const { t } = useI18n()
|
|
9
11
|
|
|
12
|
+
type MenuItem = { label: string; icon?: string; onSelect: () => void }
|
|
13
|
+
|
|
10
14
|
// ---- best-practice prompt fragments ----------------------------------------
|
|
11
15
|
// Selected fragments (resolved against the catalog; unknown ids are dropped).
|
|
12
16
|
const selectedFragments = computed(() =>
|
|
@@ -15,18 +19,40 @@ const selectedFragments = computed(() =>
|
|
|
15
19
|
.filter((f): f is NonNullable<typeof f> => !!f),
|
|
16
20
|
)
|
|
17
21
|
|
|
22
|
+
// A trailing group that jumps from "attach a fragment" to authoring/editing the
|
|
23
|
+
// library itself (board tier always; account tier when accounts are enabled).
|
|
24
|
+
// Open to every member — managing fragments is not an admin-only action.
|
|
25
|
+
const manageItems = computed<MenuItem[]>(() => {
|
|
26
|
+
const items: MenuItem[] = [
|
|
27
|
+
{
|
|
28
|
+
label: t('inspector.fragments.manageBoard'),
|
|
29
|
+
icon: 'i-lucide-book-marked',
|
|
30
|
+
onSelect: () => ui.openFragmentLibrary(),
|
|
31
|
+
},
|
|
32
|
+
]
|
|
33
|
+
if (accounts.enabled) {
|
|
34
|
+
items.push({
|
|
35
|
+
label: t('inspector.fragments.manageAccount'),
|
|
36
|
+
icon: 'i-lucide-users',
|
|
37
|
+
onSelect: () => ui.openAccountSettings('fragments'),
|
|
38
|
+
})
|
|
39
|
+
}
|
|
40
|
+
return items
|
|
41
|
+
})
|
|
42
|
+
|
|
18
43
|
// Picker menu: fragments suitable for this block's type, not already selected,
|
|
19
|
-
// grouped by category so the dropdown reads like the catalog
|
|
20
|
-
|
|
44
|
+
// grouped by category so the dropdown reads like the catalog, with the management
|
|
45
|
+
// links appended as the final group.
|
|
46
|
+
const fragmentMenu = computed<MenuItem[][]>(() => {
|
|
21
47
|
const selected = new Set(props.block.fragmentIds ?? [])
|
|
22
|
-
const groups = new Map<string,
|
|
48
|
+
const groups = new Map<string, MenuItem[]>()
|
|
23
49
|
for (const f of fragments.forBlockType(props.block.type)) {
|
|
24
50
|
if (selected.has(f.id)) continue
|
|
25
51
|
const items = groups.get(f.category) ?? []
|
|
26
52
|
items.push({ label: f.title, onSelect: () => addFragment(f.id) })
|
|
27
53
|
groups.set(f.category, items)
|
|
28
54
|
}
|
|
29
|
-
return [...groups.values()]
|
|
55
|
+
return [...groups.values(), manageItems.value]
|
|
30
56
|
})
|
|
31
57
|
|
|
32
58
|
function addFragment(id: string) {
|
|
@@ -65,7 +91,7 @@ function removeFragment(id: string) {
|
|
|
65
91
|
<span class="text-[11px] font-semibold uppercase tracking-wide text-slate-400">
|
|
66
92
|
{{ t('inspector.structure.bestPractices') }}
|
|
67
93
|
</span>
|
|
68
|
-
<UDropdownMenu
|
|
94
|
+
<UDropdownMenu :items="fragmentMenu">
|
|
69
95
|
<UButton
|
|
70
96
|
size="xs"
|
|
71
97
|
variant="ghost"
|
package/i18n/locales/en.json
CHANGED
|
@@ -397,7 +397,9 @@
|
|
|
397
397
|
},
|
|
398
398
|
"fragments": {
|
|
399
399
|
"serviceTitle": "Service best practices",
|
|
400
|
-
"serviceEmpty": "None. Code-aware agents on this service follow their default guidance."
|
|
400
|
+
"serviceEmpty": "None. Code-aware agents on this service follow their default guidance.",
|
|
401
|
+
"manageBoard": "Manage this board's fragment library…",
|
|
402
|
+
"manageAccount": "Manage account fragments…"
|
|
401
403
|
},
|
|
402
404
|
"releaseHealth": {
|
|
403
405
|
"title": "Post-release health",
|
package/i18n/locales/es.json
CHANGED
|
@@ -361,7 +361,9 @@
|
|
|
361
361
|
},
|
|
362
362
|
"fragments": {
|
|
363
363
|
"serviceTitle": "Buenas prácticas del servicio",
|
|
364
|
-
"serviceEmpty": "Ninguna. Los agentes que conocen el código en este servicio siguen su guía predeterminada."
|
|
364
|
+
"serviceEmpty": "Ninguna. Los agentes que conocen el código en este servicio siguen su guía predeterminada.",
|
|
365
|
+
"manageBoard": "Gestionar la biblioteca de fragmentos de este tablero…",
|
|
366
|
+
"manageAccount": "Gestionar los fragmentos de la cuenta…"
|
|
365
367
|
},
|
|
366
368
|
"releaseHealth": {
|
|
367
369
|
"title": "Salud posterior al lanzamiento",
|
package/i18n/locales/fr.json
CHANGED
|
@@ -361,7 +361,9 @@
|
|
|
361
361
|
},
|
|
362
362
|
"fragments": {
|
|
363
363
|
"serviceTitle": "Bonnes pratiques du service",
|
|
364
|
-
"serviceEmpty": "Aucune. Les agents conscients du code sur ce service suivent leurs consignes par défaut."
|
|
364
|
+
"serviceEmpty": "Aucune. Les agents conscients du code sur ce service suivent leurs consignes par défaut.",
|
|
365
|
+
"manageBoard": "Gérer la bibliothèque de fragments de ce tableau…",
|
|
366
|
+
"manageAccount": "Gérer les fragments du compte…"
|
|
365
367
|
},
|
|
366
368
|
"releaseHealth": {
|
|
367
369
|
"title": "Santé post-déploiement",
|
package/i18n/locales/pl.json
CHANGED
|
@@ -361,7 +361,9 @@
|
|
|
361
361
|
},
|
|
362
362
|
"fragments": {
|
|
363
363
|
"serviceTitle": "Dobre praktyki usługi",
|
|
364
|
-
"serviceEmpty": "Brak. Agenci świadomi kodu w tej usłudze stosują swoje domyślne wytyczne."
|
|
364
|
+
"serviceEmpty": "Brak. Agenci świadomi kodu w tej usłudze stosują swoje domyślne wytyczne.",
|
|
365
|
+
"manageBoard": "Zarządzaj biblioteką fragmentów tej tablicy…",
|
|
366
|
+
"manageAccount": "Zarządzaj fragmentami konta…"
|
|
365
367
|
},
|
|
366
368
|
"releaseHealth": {
|
|
367
369
|
"title": "Kondycja po wydaniu",
|
package/i18n/locales/uk.json
CHANGED
|
@@ -361,7 +361,9 @@
|
|
|
361
361
|
},
|
|
362
362
|
"fragments": {
|
|
363
363
|
"serviceTitle": "Найкращі практики сервісу",
|
|
364
|
-
"serviceEmpty": "Немає. Агенти, що працюють з кодом цього сервісу, дотримуються типових інструкцій."
|
|
364
|
+
"serviceEmpty": "Немає. Агенти, що працюють з кодом цього сервісу, дотримуються типових інструкцій.",
|
|
365
|
+
"manageBoard": "Керувати бібліотекою фрагментів цієї дошки…",
|
|
366
|
+
"manageAccount": "Керувати фрагментами облікового запису…"
|
|
365
367
|
},
|
|
366
368
|
"releaseHealth": {
|
|
367
369
|
"title": "Стан після релізу",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cat-factory/app",
|
|
3
|
-
"version": "0.50.
|
|
3
|
+
"version": "0.50.1",
|
|
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",
|