orca-multiagent-kit 1.5.0 → 1.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.
Files changed (110) hide show
  1. package/AI_INSTALL.md +4 -3
  2. package/CHANGELOG.md +70 -1
  3. package/GUIA.html +11 -9
  4. package/README.md +23 -23
  5. package/VERSION +1 -1
  6. package/bin/backup.js +44 -0
  7. package/bin/fetch.js +243 -0
  8. package/bin/hooks.js +187 -0
  9. package/bin/omk.js +134 -51
  10. package/bin/run/cleanup.js +402 -0
  11. package/bin/run/git.js +641 -0
  12. package/bin/run/glob.js +193 -0
  13. package/bin/run/ledger.js +243 -0
  14. package/bin/run/plan.js +328 -0
  15. package/bin/run/units.js +101 -0
  16. package/bin/run/util.js +116 -0
  17. package/bin/run.js +224 -0
  18. package/bin/setup.js +81 -8
  19. package/bin/sync.js +222 -0
  20. package/bin/team.js +353 -0
  21. package/bin/ui.js +8 -4
  22. package/bin/update.js +169 -0
  23. package/core/AGENTS.md +7 -7
  24. package/docs/EJECUTABLE.md +5 -4
  25. package/docs/MANUAL.md +16 -3
  26. package/docs/ORQUESTADOR.md +59 -1
  27. package/docs/PLUGIN-ORCA.md +131 -24
  28. package/hooks/orca-gate.cjs +402 -0
  29. package/install.sh +26 -13
  30. package/orca-plugin/README.md +7 -1
  31. package/orca-plugin/assets/logos/README.md +10 -0
  32. package/orca-plugin/assets/logos/agent.png +0 -0
  33. package/orca-plugin/assets/logos/aider.png +0 -0
  34. package/orca-plugin/assets/logos/amp.png +0 -0
  35. package/orca-plugin/assets/logos/antigravity.png +0 -0
  36. package/orca-plugin/assets/logos/claude.png +0 -0
  37. package/orca-plugin/assets/logos/cline.png +0 -0
  38. package/orca-plugin/assets/logos/codex.png +0 -0
  39. package/orca-plugin/assets/logos/copilot.png +0 -0
  40. package/orca-plugin/assets/logos/cursor.png +0 -0
  41. package/orca-plugin/assets/logos/devin.png +0 -0
  42. package/orca-plugin/assets/logos/droid.png +0 -0
  43. package/orca-plugin/assets/logos/gemini.png +0 -0
  44. package/orca-plugin/assets/logos/goose.png +0 -0
  45. package/orca-plugin/assets/logos/grok.png +0 -0
  46. package/orca-plugin/assets/logos/kimi.png +0 -0
  47. package/orca-plugin/assets/logos/kiro.png +0 -0
  48. package/orca-plugin/assets/logos/opencode.png +0 -0
  49. package/orca-plugin/assets/logos/qwen-code.png +0 -0
  50. package/orca-plugin/orca-plugin.json +25 -7
  51. package/orca-plugin/src/icons.test.ts +14 -0
  52. package/orca-plugin/src/icons.ts +30 -0
  53. package/orca-plugin/src/kit.test.ts +491 -22
  54. package/orca-plugin/src/kit.ts +687 -37
  55. package/orca-plugin/src/models.test.ts +28 -0
  56. package/orca-plugin/src/models.ts +29 -0
  57. package/orca-plugin/src/node.d.ts +40 -0
  58. package/orca-plugin/src/panel-state.ts +36 -0
  59. package/orca-plugin/src/panel.check.ts +71 -0
  60. package/orca-plugin/src/panel.test.tsx +296 -33
  61. package/orca-plugin/src/panel.tsx +501 -81
  62. package/orca-plugin/src/plan-card.test.ts +99 -0
  63. package/orca-plugin/src/plan-card.ts +107 -0
  64. package/orca-plugin/src/protocol.ts +205 -5
  65. package/orca-plugin/src/tabs/autonomy.tsx +72 -0
  66. package/orca-plugin/src/tabs/history.test.tsx +79 -0
  67. package/orca-plugin/src/tabs/history.tsx +119 -0
  68. package/orca-plugin/src/tabs/notices.test.tsx +184 -0
  69. package/orca-plugin/src/tabs/notices.tsx +274 -0
  70. package/orca-plugin/src/tabs/worktrees.test.tsx +131 -0
  71. package/orca-plugin/src/tabs/worktrees.tsx +138 -0
  72. package/orca-plugin/src/ui/action-card.tsx +112 -0
  73. package/orca-plugin/src/ui/agent-icon.tsx +13 -0
  74. package/orca-plugin/src/worker/actions.test.ts +288 -0
  75. package/orca-plugin/src/worker/actions.ts +292 -0
  76. package/orca-plugin/src/worker/context.test.ts +32 -0
  77. package/orca-plugin/src/worker/context.ts +95 -0
  78. package/orca-plugin/src/worker/history.test.ts +149 -0
  79. package/orca-plugin/src/worker/history.ts +181 -0
  80. package/orca-plugin/src/worker/notices.test.ts +356 -0
  81. package/orca-plugin/src/worker/notices.ts +288 -0
  82. package/orca-plugin/src/worker/system.test.ts +58 -0
  83. package/orca-plugin/src/worker/system.ts +122 -0
  84. package/orca-plugin/src/worker/worktrees.test.ts +177 -0
  85. package/orca-plugin/src/worker/worktrees.ts +188 -0
  86. package/orca-plugin/src/worker.test.ts +285 -24
  87. package/orca-plugin/src/worker.ts +344 -64
  88. package/output-styles/csr-minimal.md +1 -0
  89. package/package.json +3 -3
  90. package/rules/50-done-gate.md +1 -1
  91. package/rules/95-multi-agent.md +13 -3
  92. package/skills/kit-init/SKILL.md +16 -4
  93. package/skills/orca/SKILL.md +28 -5
  94. package/skills/orca/references/adapters/artifact.md +2 -0
  95. package/skills/orca/references/adapters/chat.md +2 -0
  96. package/skills/orca/references/adapters/native-plan.md +6 -0
  97. package/skills/orca/references/adapters/plan-file.md +2 -0
  98. package/skills/orca/references/engine-manual.md +7 -5
  99. package/skills/orca/references/engine-orca.md +1 -0
  100. package/skills/orca/references/engine-subagents.md +4 -4
  101. package/skills/orca/references/integrate.md +14 -2
  102. package/skills/orca/references/ledger.md +1 -1
  103. package/skills/orca/references/olimpo.md +2 -1
  104. package/skills/orca/references/plan-card.md +45 -0
  105. package/skills/orca/references/plan.md +2 -1
  106. package/skills/orca/references/units.md +1 -1
  107. package/skills/orca/references/worker-contract.md +2 -2
  108. package/templates/AGENTS.md +2 -2
  109. package/templates/CLAUDE.md +1 -1
  110. package/templates/claude-settings.json +25 -0
@@ -0,0 +1,131 @@
1
+ // La pestaña Worktrees tal como la dibuja Orca, con el worker sustituido por respuestas fijas.
2
+ import { afterEach, assert, mockHost, mount, test, type TestPanel } from 'orca/testing'
3
+ import type { AgentsView, WorktreeGroup } from '../protocol.ts'
4
+ import * as panel from '../panel.tsx'
5
+
6
+ const NO_AGENTS: AgentsView = { text: 'MAW', tone: 'neutral', tooltip: 'ninguno', groups: [] }
7
+
8
+ const GROUPS: WorktreeGroup[] = [
9
+ {
10
+ run: '20261112-auth',
11
+ title: 'RUN 20261112-auth',
12
+ worktrees: [
13
+ {
14
+ workspaceId: 'w2',
15
+ name: 'u1-login',
16
+ branch: 'feat/u1-login',
17
+ unit: 'U1 — Login',
18
+ agents: [
19
+ { id: 't:t1', agent: 'claude', title: 'U1 · Proteo — Login', state: 'esperando', blocked: false, model: 'sonnet', canSetModel: true }
20
+ ]
21
+ },
22
+ {
23
+ workspaceId: 'w3',
24
+ name: 'u2-pagos',
25
+ branch: 'feat/u2-pagos',
26
+ unit: 'U2 — Pagos',
27
+ agents: [
28
+ { id: 't:t2', agent: 'claude', title: 'U2 · Proteo — Pagos', state: 'trabajando', blocked: false, model: null, canSetModel: true },
29
+ { id: 'p:chat', agent: 'claude', title: 'claude', state: 'bloqueado', blocked: true, model: null, canSetModel: false }
30
+ ]
31
+ }
32
+ ]
33
+ },
34
+ {
35
+ run: null,
36
+ title: 'Otros worktrees con agentes',
37
+ worktrees: [{ workspaceId: 'w4', name: 'otro', branch: null, unit: null, agents: [] }]
38
+ }
39
+ ]
40
+
41
+ let view: TestPanel | undefined
42
+ afterEach(async () => {
43
+ await view?.unmount()
44
+ view = undefined
45
+ })
46
+
47
+ const open = async (groups: WorktreeGroup[] = GROUPS) => {
48
+ const calls: { name: string; input: unknown }[] = []
49
+ const host = mockHost({
50
+ settings: {},
51
+ requests: {
52
+ 'agents.summary': () => NO_AGENTS,
53
+ 'kit.action': () => ({ action: null }),
54
+ // Las demás pestañas también piden su lista al montar el panel.
55
+ 'notices.list': () => ({ items: [] }),
56
+ 'history.list': () => ({ items: [] }),
57
+ 'worktrees.list': () => ({ groups }),
58
+ 'worktrees.open': (input: { workspaceId: string }) => {
59
+ calls.push({ name: 'worktrees.open', input })
60
+ return { message: 'Abierto.' }
61
+ },
62
+ 'worktrees.model': (input: { id: string; model: string }) => {
63
+ calls.push({ name: 'worktrees.model', input })
64
+ return { message: 'Pedido.' }
65
+ }
66
+ }
67
+ })
68
+ view = await mount(panel, { host })
69
+ await view.select({ label: 'Secciones' }, 'worktrees')
70
+ return { view, calls }
71
+ }
72
+
73
+ const clean = (v: TestPanel) => {
74
+ assert.deepEqual(v.errors, [])
75
+ assert.deepEqual(v.warnings, [])
76
+ assert.deepEqual(v.refusals, [])
77
+ }
78
+
79
+ test('una tarjeta por run con sus worktrees, agentes, estado y modelo', async () => {
80
+ const { view } = await open()
81
+ const text = JSON.stringify(view.tree())
82
+ assert.match(text, /RUN 20261112-auth/)
83
+ assert.match(text, /Otros worktrees con agentes/)
84
+ assert.match(text, /feat\/u1-login · U1 — Login/)
85
+ // El bloqueado sale abierto: se ve su fila sin pulsar nada.
86
+ assert.match(text, /bloqueado/)
87
+ assert.match(text, /modelo no informado/)
88
+ clean(view)
89
+ })
90
+
91
+ test('abrir un worktree pide su id al worker', async () => {
92
+ const { view, calls } = await open()
93
+ await view.press({ text: 'Abrir worktree' })
94
+ assert.equal(calls[0]?.name, 'worktrees.open')
95
+ clean(view)
96
+ })
97
+
98
+ test('cambiar el modelo de quien espera manda el elegido', async () => {
99
+ const { view, calls } = await open()
100
+ await view.toggle({ label: 'u1-login' })
101
+ assert.equal(view.valueOf({ label: 'Modelo de U1 · Proteo — Login' }), 'sonnet')
102
+ await view.select({ label: 'Modelo de U1 · Proteo — Login' }, 'opus')
103
+ await view.press({ text: 'Cambiar modelo' })
104
+ assert.deepEqual(calls.filter((c) => c.name === 'worktrees.model'), [
105
+ { name: 'worktrees.model', input: { id: 't:t1', model: 'opus' } }
106
+ ])
107
+ clean(view)
108
+ })
109
+
110
+ test('trabajando no se puede cambiar el modelo y lo explica; un chat de Orca, tampoco', async () => {
111
+ const { view } = await open()
112
+ const text = JSON.stringify(view.tree())
113
+ assert.match(text, /Espera a que termine su turno/)
114
+ assert.match(text, /Es un chat de Orca: cambia el modelo desde su chat/)
115
+ const buttons = view.findAll({ type: 'Button', text: /Cambiar modelo/ })
116
+ assert.equal(buttons.length, 1)
117
+ assert.equal(buttons[0]?.props.disabled, true)
118
+ clean(view)
119
+ })
120
+
121
+ test('sin worktrees enseña el vacío', async () => {
122
+ const { view } = await open([])
123
+ assert.match(view.summary().join(' '), /Ningún worktree/)
124
+ clean(view)
125
+ })
126
+
127
+ test('se actualiza cuando el worker envía otros worktrees', async () => {
128
+ const { view } = await open([])
129
+ await view.post('worktrees.changed', { groups: GROUPS })
130
+ assert.match(JSON.stringify(view.tree()), /RUN 20261112-auth/)
131
+ })
@@ -0,0 +1,138 @@
1
+ // Pestaña Worktrees: los worktrees de la orquestación por run, sus agentes y su modelo.
2
+ import { atom, Badge, Box, Button, Card, Collapsible, EmptyState, plugin, read, Row, Select, set, Stack, Text, type PanelContext } from 'orca'
3
+ import { CLAUDE_MODELS } from '../models.ts'
4
+ import { ask, busy, describeError } from '../panel-state.ts'
5
+ import type { WorktreeAgent, WorktreeGroup, WorktreeItem } from '../protocol.ts'
6
+ import { AgentIcon } from '../ui/agent-icon.tsx'
7
+
8
+ // El estado en español que da el worker (los de kit.ts): solo entonces se le puede escribir.
9
+ const WAITING = 'esperando'
10
+
11
+ const groups = atom<WorktreeGroup[] | null>(null)
12
+ // Por qué no se pudo leer la lista, para decirlo en la propia pestaña en vez de en el aviso de arriba.
13
+ const loadError = atom<string | null>(null)
14
+ // El modelo elegido en cada Select, por agente, hasta que se pulsa «Cambiar modelo».
15
+ const chosen = atom<Record<string, string>>({})
16
+
17
+ export function setupWorktrees(ctx: PanelContext): void {
18
+ ctx.subscriptions.push(plugin.on('worktrees.changed', (view) => set(groups, view.groups)))
19
+ void plugin
20
+ .request('worktrees.list')
21
+ .then((view) => set(groups, view.groups))
22
+ .catch((error: unknown) => set(loadError, describeError(error)))
23
+ }
24
+
25
+ const openWorktree = (workspaceId: string) => ask('open-worktree', () => plugin.request('worktrees.open', { workspaceId }))
26
+
27
+ const modelOf = (agent: WorktreeAgent) =>
28
+ read(chosen)[agent.id] ?? (CLAUDE_MODELS.some(({ value }) => value === agent.model) ? agent.model : null) ?? CLAUDE_MODELS[0]?.value ?? ''
29
+
30
+ const setModel = (agent: WorktreeAgent) =>
31
+ ask('model', () => plugin.request('worktrees.model', { id: agent.id, model: modelOf(agent) }))
32
+
33
+ function noModelChange(agent: WorktreeAgent): string | null {
34
+ if (!agent.canSetModel) return 'Es un chat de Orca: cambia el modelo desde su chat.'
35
+ if (agent.state !== WAITING) return 'Espera a que termine su turno para cambiarle el modelo.'
36
+ return null
37
+ }
38
+
39
+ function AgentRow({ agent }: { agent: WorktreeAgent }) {
40
+ const working = read(busy) !== null
41
+ const why = noModelChange(agent)
42
+ return (
43
+ <Stack gap="xs">
44
+ <Row gap="xs" align="center" wrap>
45
+ <AgentIcon agent={agent.agent} />
46
+ <Text weight="semibold" size="sm">
47
+ {agent.title}
48
+ </Text>
49
+ <Badge tone={agent.blocked ? 'warning' : 'neutral'}>{agent.state}</Badge>
50
+ <Badge tone="neutral">{agent.model ?? 'modelo no informado'}</Badge>
51
+ </Row>
52
+ {agent.agent === 'claude' ? (
53
+ <Row gap="xs" align="end" wrap>
54
+ {agent.canSetModel ? (
55
+ <Select
56
+ label={`Modelo de ${agent.title}`}
57
+ value={modelOf(agent)}
58
+ options={CLAUDE_MODELS}
59
+ onChange={(value) => set(chosen, { ...read(chosen), [agent.id]: value })}
60
+ />
61
+ ) : null}
62
+ {agent.canSetModel ? (
63
+ <Button variant="outline" size="sm" disabled={working || why !== null} onPress={() => setModel(agent)}>
64
+ Cambiar modelo
65
+ </Button>
66
+ ) : null}
67
+ {why === null ? null : (
68
+ <Text muted size="xs">
69
+ {why}
70
+ </Text>
71
+ )}
72
+ </Row>
73
+ ) : null}
74
+ </Stack>
75
+ )
76
+ }
77
+
78
+ function Worktree({ item }: { item: WorktreeItem }) {
79
+ const working = read(busy) !== null
80
+ // Como en la lista de worktrees de Orca: el logo del agente delante del nombre.
81
+ return (
82
+ <Row gap="xs" align="start">
83
+ <Box paddingY="sm">
84
+ <AgentIcon agent={item.agents[0]?.agent ?? null} />
85
+ </Box>
86
+ <Box grow>
87
+ <Collapsible
88
+ title={item.name}
89
+ description={[item.branch, item.unit].filter((part): part is string => Boolean(part)).join(' · ')}
90
+ defaultOpen={item.agents.some((agent) => agent.blocked)}
91
+ >
92
+ <Stack gap="sm">
93
+ <Row gap="xs">
94
+ <Button variant="outline" size="sm" icon="open-external" disabled={working} onPress={() => openWorktree(item.workspaceId)}>
95
+ Abrir worktree
96
+ </Button>
97
+ </Row>
98
+ {item.agents.map((agent) => (
99
+ <AgentRow agent={agent} />
100
+ ))}
101
+ </Stack>
102
+ </Collapsible>
103
+ </Box>
104
+ </Row>
105
+ )
106
+ }
107
+
108
+ export function Worktrees() {
109
+ const view = read(groups)
110
+ const failure = read(loadError)
111
+ if (view === null || view.length === 0) {
112
+ return (
113
+ <Card title="Worktrees" description="Los que crea la orquestación, por run.">
114
+ <Stack gap="xs">
115
+ <EmptyState icon="branch" title="Ningún worktree" description="Aparecen en cuanto el coordinador lanza unidades." />
116
+ {failure === null ? null : (
117
+ <Text muted size="xs">
118
+ No pude leer los worktrees: {failure}
119
+ </Text>
120
+ )}
121
+ </Stack>
122
+ </Card>
123
+ )
124
+ }
125
+ return (
126
+ <Stack gap="md">
127
+ {view.map((group) => (
128
+ <Card title={group.title} description={`${group.worktrees.length} worktree${group.worktrees.length === 1 ? '' : 's'}`}>
129
+ <Stack gap="xs">
130
+ {group.worktrees.map((item) => (
131
+ <Worktree item={item} />
132
+ ))}
133
+ </Stack>
134
+ </Card>
135
+ ))}
136
+ </Stack>
137
+ )
138
+ }
@@ -0,0 +1,112 @@
1
+ // La acción en curso, encima de las pestañas: el comando `omk` o el agente que se acaba de lanzar
2
+ // desde el panel o la paleta, con su estado, lo último de su terminal y, si `omk` pregunta antes
3
+ // de seguir, los botones para contestarle (`kit.action`, `kit.answer` y `kit.dismiss` en
4
+ // src/protocol.ts; el worker lo sigue en src/worker/actions.ts).
5
+ import {
6
+ atom,
7
+ Badge,
8
+ Button,
9
+ Card,
10
+ CodeView,
11
+ Collapsible,
12
+ plugin,
13
+ read,
14
+ RelativeTime,
15
+ Row,
16
+ set,
17
+ Spinner,
18
+ Stack,
19
+ Text,
20
+ type PanelContext
21
+ } from 'orca'
22
+ import { ask, busy, describeError, outcome } from '../panel-state.ts'
23
+ import type { ActionState, ActionView, Tone } from '../protocol.ts'
24
+
25
+ // Las líneas que se ven sin desplegar nada: el final de la salida, que es donde está el resultado.
26
+ const TAIL_LINES = 14
27
+ // Cuando `omk` pregunta, más: lo que pide aprobar (el acceso del plugin) va justo antes de la pregunta.
28
+ const ASKING_LINES = 30
29
+
30
+ const STATE: Record<ActionState, { tone: Tone; text: string }> = {
31
+ running: { tone: 'accent', text: 'en curso' },
32
+ asking: { tone: 'warning', text: 'espera tu respuesta' },
33
+ done: { tone: 'success', text: 'terminado' },
34
+ failed: { tone: 'danger', text: 'falló' },
35
+ lost: { tone: 'neutral', text: 'sin seguimiento' }
36
+ }
37
+
38
+ const WHERE: Record<ActionView['kind'], string> = {
39
+ omk: 'Se ejecuta en un terminal del workspace activo; aquí va su salida.',
40
+ agent: 'El agente trabaja en su terminal del workspace activo; aquí va lo último que pinta.'
41
+ }
42
+
43
+ const action = atom<ActionView | null>(null)
44
+
45
+ export function setupAction(ctx: PanelContext): void {
46
+ set(action, null)
47
+ ctx.subscriptions.push(plugin.on('action.changed', ({ action: next }) => set(action, next)))
48
+ void plugin
49
+ .request('kit.action')
50
+ .then(({ action: current }) => set(action, current))
51
+ .catch((error: unknown) => set(outcome, { tone: 'danger', text: `Acción en curso no leída: ${describeError(error)}` }))
52
+ }
53
+
54
+ const answer = (id: string, approve: boolean) =>
55
+ ask('answer', () => plugin.request('kit.answer', { id, approve }), { tracked: true })
56
+
57
+ const dismiss = (id: string) => ask('dismiss', () => plugin.request('kit.dismiss', { id }), { tracked: true })
58
+
59
+ export function ActionCard() {
60
+ const view = read(action)
61
+ if (view === null) return null
62
+ const working = read(busy) !== null
63
+ const badge = STATE[view.state]
64
+ const ended = view.endedAt !== null
65
+ const tail = view.lines.slice(view.canAnswer ? -ASKING_LINES : -TAIL_LINES)
66
+ return (
67
+ <Card title={view.title} description={WHERE[view.kind]}>
68
+ <Stack gap="sm">
69
+ <Row gap="xs" align="center" wrap>
70
+ {view.state === 'running' ? <Spinner label="En curso" labelHidden /> : null}
71
+ <Badge tone={badge.tone}>{badge.text}</Badge>
72
+ <Text muted size="xs">
73
+ {ended ? 'acabó ' : 'empezó '}
74
+ <RelativeTime at={view.endedAt ?? view.startedAt} />
75
+ </Text>
76
+ </Row>
77
+ {view.detail === null ? null : (
78
+ <Text size="sm" tone={view.state === 'failed' ? 'danger' : undefined}>
79
+ {view.detail}
80
+ </Text>
81
+ )}
82
+ {tail.length === 0 ? (
83
+ <Text muted size="sm">
84
+ Sin salida todavía.
85
+ </Text>
86
+ ) : (
87
+ <CodeView label={`Salida de ${view.title}`} code={tail.join('\n')} wrap maxHeight="none" />
88
+ )}
89
+ {view.lines.length > tail.length ? (
90
+ <Collapsible title="Salida completa" description={`${view.lines.length} líneas`}>
91
+ <CodeView label={`Salida completa de ${view.title}`} code={view.lines.join('\n')} wrap maxHeight="lg" />
92
+ </Collapsible>
93
+ ) : null}
94
+ <Row gap="xs" wrap>
95
+ {view.canAnswer ? (
96
+ <Button icon="check" disabled={working} onPress={() => answer(view.id, true)}>
97
+ Aprobar
98
+ </Button>
99
+ ) : null}
100
+ {view.canAnswer ? (
101
+ <Button variant="outline" tone="danger" icon="close" disabled={working} onPress={() => answer(view.id, false)}>
102
+ Rechazar
103
+ </Button>
104
+ ) : null}
105
+ <Button variant="ghost" size="sm" icon="close" disabled={working} onPress={() => dismiss(view.id)}>
106
+ {ended ? 'Quitar' : 'Dejar de seguir'}
107
+ </Button>
108
+ </Row>
109
+ </Stack>
110
+ </Card>
111
+ )
112
+ }
@@ -0,0 +1,13 @@
1
+ // El logo del agente (Claude, Codex…) delante de su nombre, del tamaño con que lo pinta Orca.
2
+ // `Image` solo tiene tamaños de 48 px para arriba: con Markdown la imagen sale a su tamaño.
3
+ import { Markdown } from 'orca'
4
+ import { agentIcon } from '../icons.ts'
5
+ import { agentLabel } from '../kit.ts'
6
+
7
+ const SIZE = 16
8
+
9
+ export function AgentIcon({ agent }: { agent: string | null | undefined }) {
10
+ // `agentLabel` sale de una lista cerrada o de un id validado; aun así, nada de `<>"` en el alt.
11
+ const alt = (agent ? agentLabel(agent) : 'Agente').replace(/[<>"&]/g, '')
12
+ return <Markdown content={`<img src="${agentIcon(agent)}" alt="${alt}" width="${SIZE}" height="${SIZE}">`} />
13
+ }