arkaos 3.30.0 → 3.31.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.30.0
1
+ 3.31.0
@@ -241,6 +241,41 @@ function markedHtml(src: string): string {
241
241
  }
242
242
  }
243
243
 
244
+ // PR90a v3.31.0 — download persona as Markdown.
245
+ const downloadingMd = ref(false)
246
+ async function downloadMarkdown() {
247
+ if (!detail.value) return
248
+ downloadingMd.value = true
249
+ try {
250
+ const blob = await $fetch<Blob>(
251
+ `${apiBase}/api/personas/${personaId}/markdown`,
252
+ { responseType: 'blob' },
253
+ )
254
+ const url = URL.createObjectURL(blob)
255
+ const a = document.createElement('a')
256
+ a.href = url
257
+ a.download = `${detail.value.name || personaId}.md`
258
+ document.body.appendChild(a)
259
+ a.click()
260
+ a.remove()
261
+ URL.revokeObjectURL(url)
262
+ toast.add({
263
+ title: 'Markdown downloaded',
264
+ description: `${detail.value.name || personaId}.md`,
265
+ color: 'success',
266
+ icon: 'i-lucide-download',
267
+ })
268
+ } catch (err) {
269
+ toast.add({
270
+ title: 'Download failed',
271
+ description: err instanceof Error ? err.message : 'unknown error',
272
+ color: 'error',
273
+ })
274
+ } finally {
275
+ downloadingMd.value = false
276
+ }
277
+ }
278
+
244
279
  // PR85a v3.11.0 — Clone to Agent dialog.
245
280
  const cloneOpen = ref(false)
246
281
  function onCloned(agentId: string) {
@@ -526,6 +561,14 @@ const vocabOptions = [
526
561
  size="sm"
527
562
  @click="cloneOpen = true"
528
563
  />
564
+ <UButton
565
+ label="MD"
566
+ icon="i-lucide-download"
567
+ variant="ghost"
568
+ size="sm"
569
+ :loading="downloadingMd"
570
+ @click="downloadMarkdown"
571
+ />
529
572
  <UButton label="Edit" icon="i-lucide-pencil" size="sm" @click="startEdit" />
530
573
  <UButton
531
574
  icon="i-lucide-trash-2"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arkaos",
3
- "version": "3.30.0",
3
+ "version": "3.31.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 = "3.30.0"
3
+ version = "3.31.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"}
@@ -322,6 +322,55 @@ def agent_activity_strip(agent_id: str, period: str = "month"):
322
322
  }
323
323
 
324
324
 
325
+ @app.get("/api/personas/{persona_id}/markdown")
326
+ def persona_download_markdown(persona_id: str):
327
+ """PR90a v3.31.0 — return the persona as a Markdown file.
328
+
329
+ Renders via ObsidianPersonaStore._render so the output matches
330
+ exactly what gets written when the operator clicks Save with a
331
+ configured vault. Responds with ``text/markdown`` and an
332
+ attachment Content-Disposition.
333
+ """
334
+ detail = persona_detail(persona_id)
335
+ if "error" in detail:
336
+ return detail
337
+ from core.personas.obsidian_store import ObsidianPersonaStore
338
+ from core.personas.schema import (
339
+ Persona, PersonaDISC, PersonaEnneagram, PersonaBigFive, PersonaCommunication,
340
+ )
341
+ try:
342
+ persona = Persona(
343
+ id=detail.get("id", ""),
344
+ name=detail.get("name", ""),
345
+ title=detail.get("title", ""),
346
+ tagline=detail.get("tagline", ""),
347
+ source=detail.get("source", ""),
348
+ disc=PersonaDISC(**(detail.get("disc") or {})),
349
+ enneagram=PersonaEnneagram(**(detail.get("enneagram") or {})),
350
+ big_five=PersonaBigFive(**(detail.get("big_five") or {})),
351
+ mbti=detail.get("mbti", "INTJ"),
352
+ mental_models=detail.get("mental_models") or [],
353
+ expertise_domains=detail.get("expertise_domains") or [],
354
+ frameworks=detail.get("frameworks") or [],
355
+ key_quotes=detail.get("key_quotes") or [],
356
+ communication=PersonaCommunication(**(detail.get("communication") or {})),
357
+ bio_md=detail.get("bio_md", "") or "",
358
+ created_at=detail.get("created_at", ""),
359
+ )
360
+ except (TypeError, ValueError) as exc:
361
+ return {"error": f"persona schema mismatch: {exc}"}
362
+ content = ObsidianPersonaStore._render(persona)
363
+ filename = f"{persona.name or persona.id}.md".replace("/", "-")
364
+ from fastapi import Response
365
+ return Response(
366
+ content=content,
367
+ media_type="text/markdown",
368
+ headers={
369
+ "Content-Disposition": f'attachment; filename="{filename}"',
370
+ },
371
+ )
372
+
373
+
325
374
  @app.get("/api/agents/{agent_id}/yaml")
326
375
  def agent_download_yaml(agent_id: str):
327
376
  """PR89d v3.30.0 — return the raw YAML for the agent.