arkaos 2.95.0 → 2.97.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.
@@ -0,0 +1,296 @@
1
+ <script setup lang="ts">
2
+ // PR78 v2.96.0 — Personas list rebuilt as a TABLE.
3
+ //
4
+ // Mirrors agents/index.vue structure. Click a row → navigates to
5
+ // /personas/{id} (dedicated detail page, not a drawer). Replaces the
6
+ // card grid + slide-over drawer that PR74/77 shipped.
7
+
8
+ import type { TableColumn } from '@nuxt/ui'
9
+ import type { Persona } from '~/types'
10
+
11
+ const { fetchApi } = useApi()
12
+
13
+ const { data, status, error, refresh } = await fetchApi<{
14
+ personas: Persona[]
15
+ total: number
16
+ obsidian_available: boolean
17
+ }>('/api/personas')
18
+
19
+ const { data: usageData, refresh: refreshUsage } = fetchApi<{
20
+ by_persona: Record<string, { agent_count: number, agent_ids: string[] }>
21
+ }>('/api/personas/usage')
22
+
23
+ const personas = computed<Persona[]>(() => data.value?.personas ?? [])
24
+
25
+ async function refreshAll() {
26
+ await Promise.all([refresh(), refreshUsage()])
27
+ }
28
+
29
+ // ─── Filters ─────────────────────────────────────────────────────────────
30
+
31
+ const search = ref('')
32
+ const mbtiGroupFilter = ref<'all' | 'analysts' | 'diplomats' | 'sentinels' | 'explorers'>('all')
33
+ const sourceFilter = ref<'all' | 'obsidian' | 'json'>('all')
34
+ const page = ref(1)
35
+ const pageSize = 20
36
+
37
+ const MBTI_GROUPS: Record<string, string> = {
38
+ INTJ: 'analysts', INTP: 'analysts', ENTJ: 'analysts', ENTP: 'analysts',
39
+ INFJ: 'diplomats', INFP: 'diplomats', ENFJ: 'diplomats', ENFP: 'diplomats',
40
+ ISTJ: 'sentinels', ISFJ: 'sentinels', ESTJ: 'sentinels', ESFJ: 'sentinels',
41
+ ISTP: 'explorers', ISFP: 'explorers', ESTP: 'explorers', ESFP: 'explorers',
42
+ }
43
+
44
+ const mbtiGroupOptions = [
45
+ { label: 'All Groups', value: 'all' },
46
+ { label: 'Analysts (NT)', value: 'analysts' },
47
+ { label: 'Diplomats (NF)', value: 'diplomats' },
48
+ { label: 'Sentinels (S__J)', value: 'sentinels' },
49
+ { label: 'Explorers (S__P)', value: 'explorers' },
50
+ ]
51
+
52
+ const sourceOptions = [
53
+ { label: 'All sources', value: 'all' },
54
+ { label: 'From Obsidian', value: 'obsidian' },
55
+ { label: 'JSON store', value: 'json' },
56
+ ]
57
+
58
+ const filteredPersonas = computed<Persona[]>(() => {
59
+ let result = personas.value
60
+ const q = search.value.toLowerCase().trim()
61
+ if (q) {
62
+ result = result.filter((p) =>
63
+ p.name.toLowerCase().includes(q)
64
+ || (p.title?.toLowerCase().includes(q) ?? false)
65
+ || (p.source?.toLowerCase().includes(q) ?? false)
66
+ || (p.expertise_domains ?? []).some((d) => d.toLowerCase().includes(q)),
67
+ )
68
+ }
69
+ if (mbtiGroupFilter.value !== 'all') {
70
+ result = result.filter(
71
+ (p) => MBTI_GROUPS[(p.mbti ?? '').toUpperCase()] === mbtiGroupFilter.value,
72
+ )
73
+ }
74
+ if (sourceFilter.value !== 'all') {
75
+ result = result.filter((p) => {
76
+ const src = (p as Persona & { _source_store?: string })._source_store
77
+ return src === sourceFilter.value
78
+ })
79
+ }
80
+ return result
81
+ })
82
+
83
+ const totalFiltered = computed(() => filteredPersonas.value.length)
84
+
85
+ const paginatedPersonas = computed(() =>
86
+ filteredPersonas.value.slice(
87
+ (page.value - 1) * pageSize,
88
+ page.value * pageSize,
89
+ ),
90
+ )
91
+
92
+ const totalPages = computed(() =>
93
+ Math.max(1, Math.ceil(totalFiltered.value / pageSize)),
94
+ )
95
+
96
+ watch([search, mbtiGroupFilter, sourceFilter], () => {
97
+ page.value = 1
98
+ })
99
+
100
+ // ─── Render helpers ──────────────────────────────────────────────────────
101
+
102
+ function mbtiGroup(mbti: string | undefined): string {
103
+ if (!mbti) return ''
104
+ return MBTI_GROUPS[mbti.toUpperCase()] ?? ''
105
+ }
106
+
107
+ function mbtiColor(mbti: string | undefined): 'primary' | 'success' | 'warning' | 'error' | 'neutral' {
108
+ const group = mbtiGroup(mbti)
109
+ if (group === 'analysts') return 'primary'
110
+ if (group === 'diplomats') return 'success'
111
+ if (group === 'sentinels') return 'warning'
112
+ if (group === 'explorers') return 'error'
113
+ return 'neutral'
114
+ }
115
+
116
+ function agentCount(personaId: string): number {
117
+ return usageData.value?.by_persona?.[personaId]?.agent_count ?? 0
118
+ }
119
+
120
+ const columns: TableColumn<Persona>[] = [
121
+ { accessorKey: 'name', header: 'Name' },
122
+ { accessorKey: 'title', header: 'Title' },
123
+ { accessorKey: 'source', header: 'Source' },
124
+ { accessorKey: 'mbti', header: 'MBTI' },
125
+ { id: 'disc', header: 'DISC' },
126
+ { id: 'expertise', header: 'Expertise' },
127
+ { id: 'agents', header: 'Agents' },
128
+ { id: 'actions', header: '' },
129
+ ]
130
+
131
+ function goToPersona(id: string) {
132
+ navigateTo(`/personas/${id}`)
133
+ }
134
+ </script>
135
+
136
+ <template>
137
+ <UDashboardPanel id="personas">
138
+ <template #header>
139
+ <UDashboardNavbar title="Personas">
140
+ <template #leading>
141
+ <UDashboardSidebarCollapse />
142
+ </template>
143
+ <template #trailing>
144
+ <UBadge v-if="data?.total" :label="data.total" variant="subtle" />
145
+ <UBadge
146
+ v-if="data?.obsidian_available"
147
+ label="Obsidian"
148
+ icon="i-lucide-file-text"
149
+ variant="soft"
150
+ color="primary"
151
+ size="xs"
152
+ class="ml-2"
153
+ />
154
+ </template>
155
+ <template #right>
156
+ <UButton
157
+ label="New Persona"
158
+ icon="i-lucide-plus"
159
+ size="sm"
160
+ to="/personas/new"
161
+ />
162
+ </template>
163
+ </UDashboardNavbar>
164
+ </template>
165
+
166
+ <template #body>
167
+ <DashboardState
168
+ :status="status"
169
+ :error="error"
170
+ :empty="!personas.length"
171
+ empty-title="No personas yet"
172
+ empty-description="Create your first persona — use the AI builder or fill the form manually."
173
+ empty-icon="i-lucide-user-plus"
174
+ loading-label="Loading personas"
175
+ :on-retry="() => refreshAll()"
176
+ >
177
+ <div class="flex flex-wrap items-center gap-3 mb-4">
178
+ <UInput
179
+ v-model="search"
180
+ class="max-w-sm"
181
+ icon="i-lucide-search"
182
+ placeholder="Search by name, title, source, or expertise…"
183
+ aria-label="Search personas"
184
+ />
185
+
186
+ <USelect
187
+ v-model="mbtiGroupFilter"
188
+ :items="mbtiGroupOptions"
189
+ placeholder="MBTI group"
190
+ class="min-w-44"
191
+ aria-label="Filter by MBTI group"
192
+ />
193
+
194
+ <USelect
195
+ v-model="sourceFilter"
196
+ :items="sourceOptions"
197
+ placeholder="Source"
198
+ class="min-w-40"
199
+ aria-label="Filter by source store"
200
+ />
201
+
202
+ <span class="ml-auto text-xs text-muted">
203
+ {{ totalFiltered }} persona{{ totalFiltered !== 1 ? 's' : '' }}
204
+ </span>
205
+ </div>
206
+
207
+ <UTable
208
+ :data="paginatedPersonas"
209
+ :columns="columns"
210
+ :loading="status === 'pending'"
211
+ class="shrink-0"
212
+ :ui="{
213
+ base: 'table-fixed border-separate border-spacing-0',
214
+ thead: '[&>tr]:bg-elevated/50 [&>tr]:after:content-none',
215
+ tbody: '[&>tr]:last:[&>td]:border-b-0 [&>tr]:cursor-pointer [&>tr]:hover:bg-elevated/50 [&>tr]:transition-colors',
216
+ th: 'py-2 first:rounded-l-lg last:rounded-r-lg border-y border-default first:border-l last:border-r',
217
+ td: 'border-b border-default',
218
+ }"
219
+ @select="(row: Persona) => goToPersona(row.id)"
220
+ >
221
+ <template #name-cell="{ row }">
222
+ <span class="font-medium">{{ row.original.name }}</span>
223
+ </template>
224
+ <template #title-cell="{ row }">
225
+ <span class="text-sm text-muted truncate">{{ row.original.title || '—' }}</span>
226
+ </template>
227
+ <template #source-cell="{ row }">
228
+ <span class="text-xs text-muted font-mono truncate" :title="row.original.source">
229
+ {{ row.original.source || '—' }}
230
+ </span>
231
+ </template>
232
+ <template #mbti-cell="{ row }">
233
+ <UBadge
234
+ v-if="row.original.mbti"
235
+ :label="row.original.mbti"
236
+ :color="mbtiColor(row.original.mbti)"
237
+ variant="subtle"
238
+ size="xs"
239
+ />
240
+ <span v-else class="text-xs text-muted">—</span>
241
+ </template>
242
+ <template #disc-cell="{ row }">
243
+ <span class="font-mono text-xs">
244
+ {{ row.original.disc?.primary || '—' }}{{ row.original.disc?.secondary ? `/${row.original.disc.secondary}` : '' }}
245
+ </span>
246
+ </template>
247
+ <template #expertise-cell="{ row }">
248
+ <div class="flex flex-wrap gap-1">
249
+ <UBadge
250
+ v-for="e in (row.original.expertise_domains ?? []).slice(0, 2)"
251
+ :key="e"
252
+ :label="e"
253
+ variant="soft"
254
+ size="xs"
255
+ />
256
+ <UBadge
257
+ v-if="(row.original.expertise_domains ?? []).length > 2"
258
+ :label="`+${(row.original.expertise_domains ?? []).length - 2}`"
259
+ variant="outline"
260
+ size="xs"
261
+ />
262
+ </div>
263
+ </template>
264
+ <template #agents-cell="{ row }">
265
+ <UBadge
266
+ v-if="agentCount(row.original.id) > 0"
267
+ :label="`${agentCount(row.original.id)}`"
268
+ color="primary"
269
+ variant="subtle"
270
+ size="xs"
271
+ />
272
+ <span v-else class="text-xs text-muted">0</span>
273
+ </template>
274
+ <template #actions-cell="{ row }">
275
+ <UButton
276
+ size="xs"
277
+ variant="ghost"
278
+ icon="i-lucide-arrow-right"
279
+ aria-label="Open persona detail"
280
+ @click.stop="goToPersona(row.original.id)"
281
+ />
282
+ </template>
283
+ </UTable>
284
+
285
+ <div v-if="totalPages > 1" class="flex items-center justify-center mt-6">
286
+ <UPagination
287
+ :page="page"
288
+ :total="totalFiltered"
289
+ :items-per-page="pageSize"
290
+ @update:page="(val) => page = val"
291
+ />
292
+ </div>
293
+ </DashboardState>
294
+ </template>
295
+ </UDashboardPanel>
296
+ </template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arkaos",
3
- "version": "2.95.0",
3
+ "version": "2.97.0",
4
4
  "description": "The Operating System for AI Agent Teams",
5
5
  "type": "module",
6
6
  "bin": {
package/pyproject.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "arkaos-core"
3
- version = "2.95.0"
3
+ version = "2.97.0"
4
4
  description = "Core engine for ArkaOS — The Operating System for AI Agent Teams"
5
5
  readme = "README.md"
6
6
  license = {text = "MIT"}