arkaos 3.6.0 → 3.7.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
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.
|
|
1
|
+
3.7.0
|
|
@@ -115,6 +115,81 @@ function csvToList(value: string): string[] {
|
|
|
115
115
|
type SuggestField = 'mental_models_primary' | 'frameworks' | 'expertise_domains' | 'communication_avoid'
|
|
116
116
|
const suggestingField = ref<SuggestField | null>(null)
|
|
117
117
|
|
|
118
|
+
// PR84a v3.7.0 — AI Rewrite from description.
|
|
119
|
+
const rewriteOpen = ref(false)
|
|
120
|
+
const rewriteDescription = ref('')
|
|
121
|
+
const rewriting = ref(false)
|
|
122
|
+
|
|
123
|
+
async function rewriteFromDescription() {
|
|
124
|
+
if (!draft.value || !props.agent) return
|
|
125
|
+
const desc = rewriteDescription.value.trim()
|
|
126
|
+
if (desc.length < 20) {
|
|
127
|
+
toast.add({
|
|
128
|
+
title: 'Add more detail',
|
|
129
|
+
description: 'Describe the agent in at least a sentence or two.',
|
|
130
|
+
color: 'warning',
|
|
131
|
+
})
|
|
132
|
+
return
|
|
133
|
+
}
|
|
134
|
+
rewriting.value = true
|
|
135
|
+
try {
|
|
136
|
+
const res = await $fetch<{
|
|
137
|
+
draft: any
|
|
138
|
+
provider_name: string
|
|
139
|
+
error?: string
|
|
140
|
+
}>(`${apiBase}/api/agents/draft`, {
|
|
141
|
+
method: 'POST',
|
|
142
|
+
body: {
|
|
143
|
+
description: desc,
|
|
144
|
+
name: draft.value.name,
|
|
145
|
+
role: draft.value.role,
|
|
146
|
+
department: props.agent.department,
|
|
147
|
+
tier: draft.value.tier,
|
|
148
|
+
},
|
|
149
|
+
})
|
|
150
|
+
if (res.error) throw new Error(res.error)
|
|
151
|
+
applyRewrite(res.draft)
|
|
152
|
+
markDirty()
|
|
153
|
+
toast.add({
|
|
154
|
+
title: 'Rewritten',
|
|
155
|
+
description: `via ${res.provider_name} — review and Save when ready.`,
|
|
156
|
+
color: 'success',
|
|
157
|
+
icon: 'i-lucide-sparkles',
|
|
158
|
+
})
|
|
159
|
+
rewriteOpen.value = false
|
|
160
|
+
rewriteDescription.value = ''
|
|
161
|
+
} catch (err) {
|
|
162
|
+
toast.add({
|
|
163
|
+
title: 'Rewrite failed',
|
|
164
|
+
description: err instanceof Error ? err.message : 'unknown error',
|
|
165
|
+
color: 'error',
|
|
166
|
+
})
|
|
167
|
+
} finally {
|
|
168
|
+
rewriting.value = false
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function applyRewrite(d: any) {
|
|
173
|
+
if (!draft.value) return
|
|
174
|
+
// NOTE: identity (id, department) stays. Behavioural DNA is intentionally
|
|
175
|
+
// not editable here, so we do not touch it. We rewrite the SAFE fields
|
|
176
|
+
// operators edit through this drawer.
|
|
177
|
+
const exp = d?.expertise ?? {}
|
|
178
|
+
if (Array.isArray(exp.domains)) draft.value.expertise_domains = exp.domains.map(String)
|
|
179
|
+
if (Array.isArray(exp.frameworks)) draft.value.frameworks = exp.frameworks.map(String)
|
|
180
|
+
if (exp.depth) draft.value.expertise_depth = String(exp.depth)
|
|
181
|
+
if (typeof exp.years_equivalent === 'number') draft.value.expertise_years = exp.years_equivalent
|
|
182
|
+
const mm = d?.mental_models ?? {}
|
|
183
|
+
if (Array.isArray(mm.primary)) draft.value.mental_models.primary = mm.primary.map(String)
|
|
184
|
+
if (Array.isArray(mm.secondary)) draft.value.mental_models.secondary = mm.secondary.map(String)
|
|
185
|
+
const comm = d?.communication ?? {}
|
|
186
|
+
if (comm.tone) draft.value.communication.tone = String(comm.tone)
|
|
187
|
+
if (comm.vocabulary_level) draft.value.communication.vocabulary_level = String(comm.vocabulary_level)
|
|
188
|
+
if (comm.preferred_format) draft.value.communication.preferred_format = String(comm.preferred_format)
|
|
189
|
+
if (comm.language) draft.value.communication.language = String(comm.language)
|
|
190
|
+
if (Array.isArray(comm.avoid)) draft.value.communication.avoid = comm.avoid.map(String)
|
|
191
|
+
}
|
|
192
|
+
|
|
118
193
|
// PR83c v3.5.0 — single-string suggester.
|
|
119
194
|
type StringField = 'tone' | 'preferred_format'
|
|
120
195
|
const suggestingString = ref<StringField | null>(null)
|
|
@@ -346,6 +421,52 @@ const vocabOptions = [
|
|
|
346
421
|
</template>
|
|
347
422
|
|
|
348
423
|
<div v-if="draft" class="space-y-6">
|
|
424
|
+
<!-- PR84a — AI Rewrite -->
|
|
425
|
+
<div class="rounded-xl border border-primary/30 bg-primary/5">
|
|
426
|
+
<button
|
|
427
|
+
type="button"
|
|
428
|
+
class="w-full flex items-center justify-between gap-3 p-3 text-left"
|
|
429
|
+
@click="rewriteOpen = !rewriteOpen"
|
|
430
|
+
>
|
|
431
|
+
<div class="flex items-center gap-2">
|
|
432
|
+
<UIcon name="i-lucide-sparkles" class="size-4 text-primary" />
|
|
433
|
+
<span class="text-sm font-semibold text-primary">Rewrite from description</span>
|
|
434
|
+
</div>
|
|
435
|
+
<UIcon
|
|
436
|
+
:name="rewriteOpen ? 'i-lucide-chevron-up' : 'i-lucide-chevron-down'"
|
|
437
|
+
class="size-4 text-muted"
|
|
438
|
+
/>
|
|
439
|
+
</button>
|
|
440
|
+
<div v-if="rewriteOpen" class="p-3 pt-0 space-y-3">
|
|
441
|
+
<p class="text-xs text-muted">
|
|
442
|
+
Paste a new description to regenerate expertise, mental models,
|
|
443
|
+
frameworks, and communication. Identity (name, role, department)
|
|
444
|
+
and behavioural DNA are preserved.
|
|
445
|
+
</p>
|
|
446
|
+
<UTextarea
|
|
447
|
+
v-model="rewriteDescription"
|
|
448
|
+
:rows="3"
|
|
449
|
+
placeholder="A senior strategist who decides fast and demands evidence. 10 years at McKinsey covering CPG..."
|
|
450
|
+
class="w-full"
|
|
451
|
+
/>
|
|
452
|
+
<div class="flex items-center justify-between">
|
|
453
|
+
<span class="text-xs text-muted">
|
|
454
|
+
{{ rewriteDescription.trim().length }} char{{ rewriteDescription.trim().length === 1 ? '' : 's' }}
|
|
455
|
+
· {{ rewriteDescription.trim().length >= 20 ? 'ready' : `${20 - rewriteDescription.trim().length} more needed` }}
|
|
456
|
+
</span>
|
|
457
|
+
<UButton
|
|
458
|
+
label="Rewrite"
|
|
459
|
+
icon="i-lucide-wand"
|
|
460
|
+
color="primary"
|
|
461
|
+
size="sm"
|
|
462
|
+
:loading="rewriting"
|
|
463
|
+
:disabled="rewriteDescription.trim().length < 20"
|
|
464
|
+
@click="rewriteFromDescription"
|
|
465
|
+
/>
|
|
466
|
+
</div>
|
|
467
|
+
</div>
|
|
468
|
+
</div>
|
|
469
|
+
|
|
349
470
|
<p class="rounded-lg border border-yellow-500/30 bg-yellow-500/5 p-3 text-xs text-muted">
|
|
350
471
|
<UIcon name="i-lucide-info" class="size-3.5 inline" />
|
|
351
472
|
Behavioural DNA (DISC, Enneagram, MBTI, Big Five) is locked here
|
|
@@ -289,7 +289,7 @@ async function bulkDelete() {
|
|
|
289
289
|
th: 'py-2 first:rounded-l-lg last:rounded-r-lg border-y border-default first:border-l last:border-r',
|
|
290
290
|
td: 'border-b border-default',
|
|
291
291
|
}"
|
|
292
|
-
@select="(row: Persona) => goToPersona(row.id)"
|
|
292
|
+
@select="(row: { original: Persona }) => goToPersona(row.original.id)"
|
|
293
293
|
>
|
|
294
294
|
<template #select-header>
|
|
295
295
|
<UCheckbox
|
package/package.json
CHANGED
package/pyproject.toml
CHANGED
|
Binary file
|