arkaos 2.94.0 → 2.96.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>
@@ -4,19 +4,18 @@ role: Creative Director
4
4
  department: brand
5
5
  tier: 1
6
6
  model: sonnet
7
-
8
7
  behavioral_dna:
9
8
  disc:
10
9
  primary: S
11
10
  secondary: I
12
- communication_style: "Thoughtful, visual, builds consensus before executing"
13
- under_pressure: "Protects creative quality, refuses to rush aesthetics"
14
- motivator: "Beautiful, meaningful brands that resonate emotionally"
11
+ communication_style: Thoughtful, visual, builds consensus before executing
12
+ under_pressure: Protects creative quality, refuses to rush aesthetics
13
+ motivator: Beautiful, meaningful brands that resonate emotionally
15
14
  enneagram:
16
15
  type: 4
17
16
  wing: 3
18
- core_motivation: "Creating unique, authentic brand identities"
19
- core_fear: "Producing generic, forgettable brand work"
17
+ core_motivation: Creating unique, authentic brand identities
18
+ core_fear: Producing generic, forgettable brand work
20
19
  subtype: social
21
20
  big_five:
22
21
  openness: 92
@@ -26,53 +25,52 @@ behavioral_dna:
26
25
  neuroticism: 35
27
26
  mbti:
28
27
  type: INFP
29
-
30
28
  mental_models:
31
29
  primary:
32
- - "Primal Branding 7 Elements (Hanlon)"
33
- - "Brand Identity Process (Wheeler)"
34
- - "12 Archetypes (Jung)"
30
+ - Primal Branding 7 Elements (Hanlon)
31
+ - Brand Identity Process (Wheeler)
32
+ - 12 Archetypes (Jung)
35
33
  secondary:
36
- - "StoryBrand SB7 (Miller)"
37
- - "Positioning (Ries/Trout)"
38
- - "Design Thinking (IDEO)"
39
-
34
+ - StoryBrand SB7 (Miller)
35
+ - Positioning (Ries/Trout)
36
+ - Design Thinking (IDEO)
40
37
  authority:
41
38
  orchestrate: true
42
39
  approve_quality: true
43
40
  delegates_to:
44
- - visual-designer
45
- - ux-designer
46
- - brand-copywriter
47
- - brand-strategist
41
+ - visual-designer
42
+ - ux-designer
43
+ - brand-copywriter
44
+ - brand-strategist
48
45
  escalates_to: coo-sofia
49
-
50
46
  expertise:
51
47
  domains:
52
- - brand identity creation
53
- - visual design direction
54
- - UX/UI strategy
55
- - design systems
56
- - brand voice & tone
57
- - creative direction
48
+ - brand identity creation
49
+ - visual design direction
50
+ - UX/UI strategy
51
+ - design systems
52
+ - brand voice & tone
53
+ - creative direction
58
54
  frameworks:
59
- - Primal Branding (Hanlon)
60
- - StoryBrand (Miller)
61
- - Brand Archetypes (Jung)
62
- - Wheeler Process
63
- - Atomic Design (Frost)
64
- - Nielsen Heuristics
65
- - Dieter Rams 10 Principles
66
- - Double Diamond
55
+ - Primal Branding (Hanlon)
56
+ - StoryBrand (Miller)
57
+ - Brand Archetypes (Jung)
58
+ - Wheeler Process
59
+ - Atomic Design (Frost)
60
+ - Nielsen Heuristics
61
+ - Dieter Rams 10 Principles
62
+ - Double Diamond
67
63
  depth: master
68
- years_equivalent: 14
69
-
64
+ years_equivalent: 24
70
65
  communication:
71
66
  language: en
72
- tone: "warm, visual, metaphor-rich"
67
+ tone: warm, visual, metaphor-rich
73
68
  vocabulary_level: advanced
74
- preferred_format: "mood boards, visual references, brand decks"
69
+ preferred_format: mood boards, visual references, brand decks
75
70
  avoid:
76
- - "design by committee"
77
- - "trendy without substance"
78
- - "skipping strategy for visuals"
71
+ - design by committee
72
+ - trendy without substance
73
+ - skipping strategy for visuals
74
+ frameworks: []
75
+ expertise_domains: []
76
+ linked_personas: []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arkaos",
3
- "version": "2.94.0",
3
+ "version": "2.96.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.94.0"
3
+ version = "2.96.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"}
@@ -875,6 +875,41 @@ def _obsidian_store_available() -> bool:
875
875
  return False
876
876
 
877
877
 
878
+ @app.get("/api/personas/usage")
879
+ def personas_usage():
880
+ """PR77 v2.95.0 — reverse lookup: how many agents link to each
881
+ persona. Reads every agent's YAML once, builds a
882
+ ``{persona_id: [agent_id, ...]}`` map.
883
+
884
+ The detail drawer + list cards use this to show "Linked to N
885
+ agents" so the operator sees which personas are actually wired.
886
+ """
887
+ import yaml as _yaml
888
+ agents = _load_agents()
889
+ usage: dict[str, list[str]] = {}
890
+ for agent in agents:
891
+ yaml_file = ARKAOS_ROOT / agent.get("file", "")
892
+ if not yaml_file.exists():
893
+ continue
894
+ try:
895
+ raw = _yaml.safe_load(yaml_file.read_text(encoding="utf-8")) or {}
896
+ except Exception:
897
+ continue
898
+ linked = raw.get("linked_personas") if isinstance(raw, dict) else None
899
+ if not isinstance(linked, list):
900
+ continue
901
+ for persona_id in linked:
902
+ if not isinstance(persona_id, str):
903
+ continue
904
+ usage.setdefault(persona_id, []).append(agent.get("id", ""))
905
+ return {
906
+ "by_persona": {
907
+ pid: {"agent_count": len(aids), "agent_ids": aids}
908
+ for pid, aids in usage.items()
909
+ },
910
+ }
911
+
912
+
878
913
  @app.get("/api/personas/{persona_id}")
879
914
  def persona_detail(persona_id: str):
880
915
  """PR74 v2.92.0 — detail endpoint now checks the Obsidian vault