arkaos 3.45.0 → 3.47.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.
- package/VERSION +1 -1
- package/core/personas/__pycache__/archetypes.cpython-313.pyc +0 -0
- package/dashboard/app/components/NotificationsBell.vue +137 -0
- package/dashboard/app/composables/useActivityFeed.ts +101 -0
- package/dashboard/app/layouts/default.vue +4 -1
- package/dashboard/app/pages/agents/index.vue +7 -0
- package/package.json +1 -1
- package/pyproject.toml +1 -1
- package/scripts/__pycache__/dashboard-api.cpython-313.pyc +0 -0
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.
|
|
1
|
+
3.47.0
|
|
Binary file
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// PR93d v3.46.0 — bell-icon notifications popover.
|
|
3
|
+
|
|
4
|
+
const feed = useActivityFeed()
|
|
5
|
+
onMounted(() => feed.load())
|
|
6
|
+
|
|
7
|
+
function formatRelative(iso: string): string {
|
|
8
|
+
const ts = Date.parse(iso)
|
|
9
|
+
if (Number.isNaN(ts)) return iso
|
|
10
|
+
const diff = Date.now() - ts
|
|
11
|
+
const m = Math.floor(diff / 60_000)
|
|
12
|
+
if (m < 1) return 'just now'
|
|
13
|
+
if (m < 60) return `${m}m ago`
|
|
14
|
+
const h = Math.floor(m / 60)
|
|
15
|
+
if (h < 24) return `${h}h ago`
|
|
16
|
+
return `${Math.floor(h / 24)}d ago`
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function kindIcon(kind: string): string {
|
|
20
|
+
return {
|
|
21
|
+
success: 'i-lucide-check-circle',
|
|
22
|
+
warning: 'i-lucide-alert-triangle',
|
|
23
|
+
error: 'i-lucide-x-circle',
|
|
24
|
+
info: 'i-lucide-info',
|
|
25
|
+
}[kind] ?? 'i-lucide-circle'
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function kindColor(kind: string): string {
|
|
29
|
+
return {
|
|
30
|
+
success: 'text-emerald-500',
|
|
31
|
+
warning: 'text-amber-500',
|
|
32
|
+
error: 'text-rose-500',
|
|
33
|
+
info: 'text-blue-500',
|
|
34
|
+
}[kind] ?? 'text-muted'
|
|
35
|
+
}
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<template>
|
|
39
|
+
<UPopover :ui="{ content: 'w-80' }">
|
|
40
|
+
<UButton
|
|
41
|
+
icon="i-lucide-bell"
|
|
42
|
+
variant="ghost"
|
|
43
|
+
size="sm"
|
|
44
|
+
aria-label="Notifications"
|
|
45
|
+
:ui="{ base: 'relative' }"
|
|
46
|
+
>
|
|
47
|
+
<UBadge
|
|
48
|
+
v-if="feed.unreadCount.value > 0"
|
|
49
|
+
:label="String(Math.min(feed.unreadCount.value, 99))"
|
|
50
|
+
color="primary"
|
|
51
|
+
size="xs"
|
|
52
|
+
class="absolute -top-1 -right-1 min-w-4"
|
|
53
|
+
/>
|
|
54
|
+
</UButton>
|
|
55
|
+
|
|
56
|
+
<template #content>
|
|
57
|
+
<div class="p-2 border-b border-default flex items-center justify-between gap-2">
|
|
58
|
+
<div>
|
|
59
|
+
<p class="text-sm font-semibold">Recent activity</p>
|
|
60
|
+
<p class="text-xs text-muted">
|
|
61
|
+
{{ feed.unreadCount.value }} unread ·
|
|
62
|
+
{{ feed.events.value.length }} total
|
|
63
|
+
</p>
|
|
64
|
+
</div>
|
|
65
|
+
<div class="flex items-center gap-1">
|
|
66
|
+
<UButton
|
|
67
|
+
v-if="feed.unreadCount.value > 0"
|
|
68
|
+
label="Mark all read"
|
|
69
|
+
variant="ghost"
|
|
70
|
+
size="xs"
|
|
71
|
+
@click="feed.markAllRead()"
|
|
72
|
+
/>
|
|
73
|
+
<UButton
|
|
74
|
+
v-if="feed.events.value.length > 0"
|
|
75
|
+
label="Clear"
|
|
76
|
+
variant="ghost"
|
|
77
|
+
size="xs"
|
|
78
|
+
@click="feed.clear()"
|
|
79
|
+
/>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
<div class="max-h-80 overflow-y-auto">
|
|
83
|
+
<p
|
|
84
|
+
v-if="feed.events.value.length === 0"
|
|
85
|
+
class="p-6 text-center text-sm text-muted"
|
|
86
|
+
>
|
|
87
|
+
<UIcon name="i-lucide-bell-off" class="size-6 inline mb-1" /><br>
|
|
88
|
+
Nothing here yet.
|
|
89
|
+
</p>
|
|
90
|
+
<ul v-else class="divide-y divide-default">
|
|
91
|
+
<li
|
|
92
|
+
v-for="ev in feed.events.value"
|
|
93
|
+
:key="ev.id"
|
|
94
|
+
class="px-3 py-2 hover:bg-elevated/40 transition-colors group cursor-pointer"
|
|
95
|
+
:class="{ 'bg-primary/5': !ev.read }"
|
|
96
|
+
@click="feed.markRead(ev.id)"
|
|
97
|
+
>
|
|
98
|
+
<component
|
|
99
|
+
:is="ev.to ? 'NuxtLink' : 'div'"
|
|
100
|
+
:to="ev.to"
|
|
101
|
+
class="flex items-start gap-2"
|
|
102
|
+
>
|
|
103
|
+
<UIcon
|
|
104
|
+
:name="kindIcon(ev.kind)"
|
|
105
|
+
:class="['size-4 shrink-0 mt-0.5', kindColor(ev.kind)]"
|
|
106
|
+
/>
|
|
107
|
+
<div class="flex-1 min-w-0">
|
|
108
|
+
<p class="text-sm flex items-center gap-1.5">
|
|
109
|
+
<span
|
|
110
|
+
v-if="!ev.read"
|
|
111
|
+
class="inline-block size-1.5 rounded-full bg-primary shrink-0"
|
|
112
|
+
aria-label="unread"
|
|
113
|
+
/>
|
|
114
|
+
<span :class="ev.read ? 'font-normal text-muted' : 'font-medium'" class="truncate">
|
|
115
|
+
{{ ev.title }}
|
|
116
|
+
</span>
|
|
117
|
+
</p>
|
|
118
|
+
<p v-if="ev.description" class="text-xs text-muted truncate">
|
|
119
|
+
{{ ev.description }}
|
|
120
|
+
</p>
|
|
121
|
+
<p class="text-xs text-muted/70 mt-0.5">{{ formatRelative(ev.ts) }}</p>
|
|
122
|
+
</div>
|
|
123
|
+
<UButton
|
|
124
|
+
icon="i-lucide-x"
|
|
125
|
+
variant="ghost"
|
|
126
|
+
size="xs"
|
|
127
|
+
aria-label="Dismiss"
|
|
128
|
+
class="opacity-0 group-hover:opacity-100 transition-opacity"
|
|
129
|
+
@click.stop.prevent="feed.remove(ev.id)"
|
|
130
|
+
/>
|
|
131
|
+
</component>
|
|
132
|
+
</li>
|
|
133
|
+
</ul>
|
|
134
|
+
</div>
|
|
135
|
+
</template>
|
|
136
|
+
</UPopover>
|
|
137
|
+
</template>
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// PR93d v3.46.0 — client-side activity feed.
|
|
2
|
+
//
|
|
3
|
+
// Persistence: localStorage `arkaos_activity_feed` (last 50 events).
|
|
4
|
+
// Events are pushed by `push()` from anywhere in the app. The
|
|
5
|
+
// NotificationsBell component reads + clears.
|
|
6
|
+
|
|
7
|
+
import { createSharedComposable } from '@vueuse/core'
|
|
8
|
+
|
|
9
|
+
export interface ActivityEvent {
|
|
10
|
+
id: string
|
|
11
|
+
ts: string // ISO
|
|
12
|
+
kind: 'success' | 'warning' | 'error' | 'info'
|
|
13
|
+
title: string
|
|
14
|
+
description?: string
|
|
15
|
+
to?: string
|
|
16
|
+
read?: boolean
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const STORAGE_KEY = 'arkaos_activity_feed'
|
|
20
|
+
const MAX_EVENTS = 50
|
|
21
|
+
|
|
22
|
+
const _useActivityFeed = () => {
|
|
23
|
+
const events = useState<ActivityEvent[]>('activityFeed', () => [])
|
|
24
|
+
const loaded = useState<boolean>('activityFeedLoaded', () => false)
|
|
25
|
+
// PR94a v3.47.0 — unread count is now derived from `read: false`.
|
|
26
|
+
const unreadCount = computed(
|
|
27
|
+
() => events.value.filter((e) => !e.read).length,
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
function _persist() {
|
|
31
|
+
if (typeof window === 'undefined') return
|
|
32
|
+
try {
|
|
33
|
+
window.localStorage.setItem(STORAGE_KEY, JSON.stringify(events.value))
|
|
34
|
+
} catch {
|
|
35
|
+
// Storage full or disabled — silently drop persistence.
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function load() {
|
|
40
|
+
if (loaded.value || typeof window === 'undefined') return
|
|
41
|
+
try {
|
|
42
|
+
const raw = window.localStorage.getItem(STORAGE_KEY)
|
|
43
|
+
if (raw) {
|
|
44
|
+
const parsed = JSON.parse(raw)
|
|
45
|
+
if (Array.isArray(parsed)) {
|
|
46
|
+
events.value = parsed.slice(0, MAX_EVENTS)
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
} catch {
|
|
50
|
+
events.value = []
|
|
51
|
+
}
|
|
52
|
+
loaded.value = true
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function push(entry: Omit<ActivityEvent, 'id' | 'ts' | 'read'>) {
|
|
56
|
+
load()
|
|
57
|
+
const id = `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`
|
|
58
|
+
const ts = new Date().toISOString()
|
|
59
|
+
// PR94a — every new event starts unread.
|
|
60
|
+
events.value = [{ id, ts, read: false, ...entry }, ...events.value].slice(0, MAX_EVENTS)
|
|
61
|
+
_persist()
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function markRead(id: string) {
|
|
65
|
+
let changed = false
|
|
66
|
+
events.value = events.value.map((e) => {
|
|
67
|
+
if (e.id === id && !e.read) {
|
|
68
|
+
changed = true
|
|
69
|
+
return { ...e, read: true }
|
|
70
|
+
}
|
|
71
|
+
return e
|
|
72
|
+
})
|
|
73
|
+
if (changed) _persist()
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function markAllRead() {
|
|
77
|
+
let changed = false
|
|
78
|
+
events.value = events.value.map((e) => {
|
|
79
|
+
if (!e.read) {
|
|
80
|
+
changed = true
|
|
81
|
+
return { ...e, read: true }
|
|
82
|
+
}
|
|
83
|
+
return e
|
|
84
|
+
})
|
|
85
|
+
if (changed) _persist()
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function clear() {
|
|
89
|
+
events.value = []
|
|
90
|
+
_persist()
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function remove(id: string) {
|
|
94
|
+
events.value = events.value.filter((e) => e.id !== id)
|
|
95
|
+
_persist()
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return { events, unreadCount, load, push, clear, remove, markRead, markAllRead }
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export const useActivityFeed = createSharedComposable(_useActivityFeed)
|
|
@@ -133,7 +133,10 @@ const links = [[{
|
|
|
133
133
|
<span class="text-xl font-bold text-primary">A</span>
|
|
134
134
|
<span v-if="!collapsed" class="font-semibold">ArkaOS</span>
|
|
135
135
|
</div>
|
|
136
|
-
<
|
|
136
|
+
<div v-if="!collapsed" class="flex items-center gap-1">
|
|
137
|
+
<NotificationsBell />
|
|
138
|
+
<UColorModeButton size="xs" />
|
|
139
|
+
</div>
|
|
137
140
|
</div>
|
|
138
141
|
</template>
|
|
139
142
|
|
|
@@ -360,6 +360,13 @@ async function bulkDelete() {
|
|
|
360
360
|
? [{ label: 'Undo', icon: 'i-lucide-rotate-ccw', onClick: () => undoTrashIds(trashIds) }]
|
|
361
361
|
: undefined,
|
|
362
362
|
})
|
|
363
|
+
// PR93d v3.46.0 — also surface in the notifications bell.
|
|
364
|
+
useActivityFeed().push({
|
|
365
|
+
kind: failures > 0 ? 'warning' : 'success',
|
|
366
|
+
title: `Deleted ${successes.length} agent${successes.length === 1 ? '' : 's'}`,
|
|
367
|
+
description: failures > 0 ? `${failures} skipped` : 'Undo via /trash',
|
|
368
|
+
to: '/trash',
|
|
369
|
+
})
|
|
363
370
|
} else {
|
|
364
371
|
toast.add({
|
|
365
372
|
title: 'Nothing deleted',
|
package/package.json
CHANGED
package/pyproject.toml
CHANGED
|
Binary file
|