@otea/cli 0.0.0-stage → 0.1.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/LICENSE +661 -0
- package/README.es.md +151 -0
- package/README.md +252 -2
- package/THIRD_PARTY_NOTICES.md +114 -0
- package/bin/otea.mjs +28 -0
- package/dist/app/agent-detail.js +26 -0
- package/dist/app/agent-draft.js +429 -0
- package/dist/app/agent-prompts.js +52 -0
- package/dist/app/agents.js +77 -0
- package/dist/app/asking.js +43 -0
- package/dist/app/board-archive.js +243 -0
- package/dist/app/board-migration.js +272 -0
- package/dist/app/boards.js +870 -0
- package/dist/app/branch-owner.js +48 -0
- package/dist/app/brief.js +53 -0
- package/dist/app/choices.js +61 -0
- package/dist/app/collections.js +101 -0
- package/dist/app/context.js +1 -0
- package/dist/app/crop.js +56 -0
- package/dist/app/devices.js +62 -0
- package/dist/app/draft-request.js +82 -0
- package/dist/app/events.js +12 -0
- package/dist/app/evidence.js +287 -0
- package/dist/app/gates.js +610 -0
- package/dist/app/guide.js +37 -0
- package/dist/app/home.js +145 -0
- package/dist/app/init-boards.js +36 -0
- package/dist/app/intake.js +25 -0
- package/dist/app/item-search.js +141 -0
- package/dist/app/items.js +318 -0
- package/dist/app/keep-waiting.js +44 -0
- package/dist/app/land-order.js +107 -0
- package/dist/app/language.js +52 -0
- package/dist/app/launcher.js +56 -0
- package/dist/app/lease-take.js +54 -0
- package/dist/app/leases.js +86 -0
- package/dist/app/machine.js +39 -0
- package/dist/app/merged.js +89 -0
- package/dist/app/migrate.js +171 -0
- package/dist/app/next.js +1637 -0
- package/dist/app/notes.js +319 -0
- package/dist/app/notify-targets.js +113 -0
- package/dist/app/opened.js +25 -0
- package/dist/app/owner-only.js +34 -0
- package/dist/app/performance.js +28 -0
- package/dist/app/phone.js +97 -0
- package/dist/app/presence.js +596 -0
- package/dist/app/preset-views.js +25 -0
- package/dist/app/presets.js +129 -0
- package/dist/app/priority.js +156 -0
- package/dist/app/profile.js +86 -0
- package/dist/app/project.js +247 -0
- package/dist/app/proofs.js +179 -0
- package/dist/app/questions.js +215 -0
- package/dist/app/reader-filter.js +58 -0
- package/dist/app/relations.js +164 -0
- package/dist/app/relay.js +98 -0
- package/dist/app/repos.js +176 -0
- package/dist/app/restart.js +92 -0
- package/dist/app/set-aside.js +64 -0
- package/dist/app/system-locale.js +6 -0
- package/dist/app/tailscale-cli.js +77 -0
- package/dist/app/tailscale-testing.js +41 -0
- package/dist/app/tailscale.js +177 -0
- package/dist/app/tips.js +30 -0
- package/dist/app/topics-everywhere.js +53 -0
- package/dist/app/topics.js +453 -0
- package/dist/app/undo.js +52 -0
- package/dist/app/validate.js +131 -0
- package/dist/app/watch.js +48 -0
- package/dist/cli/command.js +44 -0
- package/dist/cli/commands.js +3303 -0
- package/dist/cli/exit-codes.js +70 -0
- package/dist/cli/forge.js +176 -0
- package/dist/cli/format.js +340 -0
- package/dist/cli/gh.js +17 -0
- package/dist/cli/gitrepo.js +489 -0
- package/dist/cli/help.js +101 -0
- package/dist/cli/hooks.js +232 -0
- package/dist/cli/main.js +37 -0
- package/dist/cli/merged-outside.js +58 -0
- package/dist/cli/names.js +154 -0
- package/dist/cli/opener.js +21 -0
- package/dist/cli/owner.js +154 -0
- package/dist/cli/phone.js +221 -0
- package/dist/cli/ports.js +24 -0
- package/dist/cli/probe.js +18 -0
- package/dist/cli/run.js +246 -0
- package/dist/cli/serve-file.js +21 -0
- package/dist/cli/stats.js +55 -0
- package/dist/cli/version.js +3 -0
- package/dist/core/agent-guide.js +31 -0
- package/dist/core/agent-prompts.js +139 -0
- package/dist/core/authority.js +94 -0
- package/dist/core/board/analysis.js +86 -0
- package/dist/core/board/choices.js +100 -0
- package/dist/core/board/compile.js +362 -0
- package/dist/core/board/engine.js +523 -0
- package/dist/core/board/hints.js +46 -0
- package/dist/core/board/history.js +146 -0
- package/dist/core/board/ids.js +87 -0
- package/dist/core/board/joins.js +30 -0
- package/dist/core/board/mentions.js +68 -0
- package/dist/core/board/merged.js +18 -0
- package/dist/core/board/model.js +135 -0
- package/dist/core/board/next.js +1116 -0
- package/dist/core/board/notes.js +298 -0
- package/dist/core/board/performance.js +218 -0
- package/dist/core/board/plan.js +299 -0
- package/dist/core/board/problems.js +232 -0
- package/dist/core/board/proofs.js +84 -0
- package/dist/core/board/questions.js +114 -0
- package/dist/core/board/reading.js +220 -0
- package/dist/core/board/readings.js +534 -0
- package/dist/core/board/schema.js +335 -0
- package/dist/core/board/shape-words.js +179 -0
- package/dist/core/board/template-words.js +23 -0
- package/dist/core/board/templates-catalogue.js +965 -0
- package/dist/core/board/templates-coverage.js +261 -0
- package/dist/core/board/templates-flows.js +779 -0
- package/dist/core/board/templates.js +586 -0
- package/dist/core/brief.js +93 -0
- package/dist/core/diagram.js +80 -0
- package/dist/core/errors.js +12 -0
- package/dist/core/evidence.js +33 -0
- package/dist/core/fields.js +129 -0
- package/dist/core/hierarchy.js +30 -0
- package/dist/core/icons.js +181 -0
- package/dist/core/image-crop.js +166 -0
- package/dist/core/item.js +49 -0
- package/dist/core/lease.js +31 -0
- package/dist/core/modules.js +318 -0
- package/dist/core/notify/planner.js +117 -0
- package/dist/core/notify/signals.js +66 -0
- package/dist/core/notify/text.js +60 -0
- package/dist/core/path-key.js +22 -0
- package/dist/core/placement.js +161 -0
- package/dist/core/preset-labels.js +66 -0
- package/dist/core/preset-notes.js +109 -0
- package/dist/core/preset.js +541 -0
- package/dist/core/profile.js +55 -0
- package/dist/core/project-id.js +20 -0
- package/dist/core/refusal.js +1 -0
- package/dist/core/relations.js +208 -0
- package/dist/core/repo.js +54 -0
- package/dist/core/samples.js +161 -0
- package/dist/core/search-words.js +68 -0
- package/dist/core/test-report.js +120 -0
- package/dist/core/time.js +8 -0
- package/dist/core/validation.js +60 -0
- package/dist/core/views.js +171 -0
- package/dist/core/workflow.js +51 -0
- package/dist/mcp/commands.js +101 -0
- package/dist/mcp/server.js +239 -0
- package/dist/mcp/words.js +95 -0
- package/dist/server/boards.js +232 -0
- package/dist/server/changes.js +42 -0
- package/dist/server/diff-tip.js +83 -0
- package/dist/server/drift.js +87 -0
- package/dist/server/errors.js +87 -0
- package/dist/server/evidence.js +82 -0
- package/dist/server/hosts.js +6 -0
- package/dist/server/hub.js +98 -0
- package/dist/server/lan-access.js +62 -0
- package/dist/server/lan.js +164 -0
- package/dist/server/listen.js +70 -0
- package/dist/server/notifier.js +156 -0
- package/dist/server/notify-api.js +151 -0
- package/dist/server/pairing.js +124 -0
- package/dist/server/projects.js +191 -0
- package/dist/server/push.js +199 -0
- package/dist/server/server.js +960 -0
- package/dist/server/session.js +43 -0
- package/dist/server/stream.js +36 -0
- package/dist/server/test-push.js +38 -0
- package/dist/server/token.js +37 -0
- package/dist/server/transports.js +54 -0
- package/dist/server/ui.js +44 -0
- package/dist/server/writes.js +361 -0
- package/dist/server/wrong-address.js +36 -0
- package/dist/store/boards.js +111 -0
- package/dist/store/database.js +45 -0
- package/dist/store/machine.js +77 -0
- package/dist/store/migrations.js +493 -0
- package/dist/store/queries.js +585 -0
- package/dist/store/registry.js +72 -0
- package/package.json +73 -4
- package/presets/architecture/playbook.md +69 -0
- package/presets/architecture/preset.yaml +80 -0
- package/presets/architecture/samples.yaml +23 -0
- package/presets/bug-triage/playbook.md +129 -0
- package/presets/bug-triage/preset.yaml +127 -0
- package/presets/bug-triage/samples/wall-slide-after.png +0 -0
- package/presets/bug-triage/samples/wall-slide-before.png +0 -0
- package/presets/bug-triage/samples.yaml +72 -0
- package/presets/change/playbook.md +115 -0
- package/presets/change/preset.yaml +141 -0
- package/presets/change/samples.yaml +62 -0
- package/presets/review/playbook.md +51 -0
- package/presets/review/preset.yaml +62 -0
- package/presets/review/samples.yaml +27 -0
- package/presets/tasks/playbook.md +78 -0
- package/presets/tasks/preset.yaml +61 -0
- package/presets/tasks/samples.yaml +46 -0
- package/schemas/board.schema.json +764 -0
- package/ui/dist/THIRD_PARTY_NOTICES.md +114 -0
- package/ui/dist/assets/dm-mono-latin-400-normal--0xN8mdc.woff +0 -0
- package/ui/dist/assets/dm-mono-latin-400-normal-4GdczIuU.woff2 +0 -0
- package/ui/dist/assets/dm-mono-latin-500-normal-CN8Miw6E.woff +0 -0
- package/ui/dist/assets/dm-mono-latin-500-normal-DRMDZjhP.woff2 +0 -0
- package/ui/dist/assets/dm-mono-latin-ext-400-normal-1aZr6b2b.woff +0 -0
- package/ui/dist/assets/dm-mono-latin-ext-400-normal-C2zvOubV.woff2 +0 -0
- package/ui/dist/assets/dm-mono-latin-ext-500-normal-BtRyHRi6.woff2 +0 -0
- package/ui/dist/assets/dm-mono-latin-ext-500-normal-Dw3M13d8.woff +0 -0
- package/ui/dist/assets/index-C3OzJope.js +103 -0
- package/ui/dist/assets/index-COdEjckQ.css +1 -0
- package/ui/dist/assets/newsreader-latin-ext-opsz-italic-CSPGnFdO.woff2 +0 -0
- package/ui/dist/assets/newsreader-latin-ext-opsz-normal-BQn1nviT.woff2 +0 -0
- package/ui/dist/assets/newsreader-latin-opsz-italic-kJKFiXvB.woff2 +0 -0
- package/ui/dist/assets/newsreader-latin-opsz-normal-s-izfB6B.woff2 +0 -0
- package/ui/dist/assets/newsreader-vietnamese-opsz-italic-DTr-ymY4.woff2 +0 -0
- package/ui/dist/assets/newsreader-vietnamese-opsz-normal-BjhtXyW2.woff2 +0 -0
- package/ui/dist/assets/pdf-YwugTw7Y.js +54 -0
- package/ui/dist/assets/pdf-engine-CkBopwck.js +1 -0
- package/ui/dist/assets/pdf-rELvHkft.js +56 -0
- package/ui/dist/assets/pdf.worker.min-B5Yc7dP4.mjs +27 -0
- package/ui/dist/assets/pdf.worker.min-B7U8ptvh.js +1 -0
- package/ui/dist/assets/pdf.worker.min-CIqJB0yW.mjs +28 -0
- package/ui/dist/assets/pdf.worker.min-UqOn5EDC.js +1 -0
- package/ui/dist/assets/schibsted-grotesk-latin-ext-wght-normal-hsMS0n0O.woff2 +0 -0
- package/ui/dist/assets/schibsted-grotesk-latin-wght-normal-Bb8VGrTG.woff2 +0 -0
- package/ui/dist/icons/apple-touch-icon.png +0 -0
- package/ui/dist/icons/otea-192.png +0 -0
- package/ui/dist/icons/otea-512.png +0 -0
- package/ui/dist/icons/otea-badge.png +0 -0
- package/ui/dist/icons/otea-maskable-512.png +0 -0
- package/ui/dist/index.html +25 -0
- package/ui/dist/manifest.webmanifest +24 -0
- package/ui/dist/otea-idle.svg +5 -0
- package/ui/dist/otea-working.svg +5 -0
- package/ui/dist/otea-yours-working.svg +5 -0
- package/ui/dist/otea-yours.svg +5 -0
- package/ui/dist/sw.js +1 -0
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
import { newId } from './ids.js';
|
|
2
|
+
import { boardDefaults, DONE, DROPPED, stepDefaults, } from './model.js';
|
|
3
|
+
import { EMPTY, w } from './template-words.js';
|
|
4
|
+
import { instantiate, TITLE_NAME } from './templates.js';
|
|
5
|
+
const ANY = 'any';
|
|
6
|
+
const YOU = 'you';
|
|
7
|
+
const TASKS = {
|
|
8
|
+
key: 'preset-tasks',
|
|
9
|
+
hidden: true,
|
|
10
|
+
icon: 'checklist',
|
|
11
|
+
name: w('Tasks', 'Tareas'),
|
|
12
|
+
description: EMPTY,
|
|
13
|
+
board: w('Tasks', 'Tareas'),
|
|
14
|
+
item: w('Task', 'Tarea'),
|
|
15
|
+
about: w('Tasks for any agent. Each one needs a Description before the work starts: complete it first.', 'Tareas para cualquier agente. Cada una necesita una Descripción antes de empezar: complétala primero.'),
|
|
16
|
+
idle: EMPTY,
|
|
17
|
+
parts: [
|
|
18
|
+
{
|
|
19
|
+
key: 'description',
|
|
20
|
+
kind: 'long',
|
|
21
|
+
name: w('Description', 'Descripción'),
|
|
22
|
+
hint: w('what has to be done, and how to know it is done', 'qué hay que hacer y cómo saber que está hecho'),
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
key: 'priority',
|
|
26
|
+
kind: 'choice',
|
|
27
|
+
name: w('Priority', 'Prioridad'),
|
|
28
|
+
hint: EMPTY,
|
|
29
|
+
options: [w('Low', 'Baja'), w('Medium', 'Media'), w('High', 'Alta')],
|
|
30
|
+
optionKeys: ['low', 'medium', 'high'],
|
|
31
|
+
initial: 'medium',
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
form: [['description', false]],
|
|
35
|
+
steps: [
|
|
36
|
+
{
|
|
37
|
+
key: 'incomplete',
|
|
38
|
+
name: w('Complete', 'Completar'),
|
|
39
|
+
doer: ANY,
|
|
40
|
+
reviewer: 'none',
|
|
41
|
+
hand: [['description', 'always']],
|
|
42
|
+
skip: true,
|
|
43
|
+
drop: true,
|
|
44
|
+
},
|
|
45
|
+
{ key: 'todo', name: w('Do it', 'Hacerlo'), doer: ANY, reviewer: YOU, hand: [] },
|
|
46
|
+
],
|
|
47
|
+
anytime: ['priority'],
|
|
48
|
+
samples: { en: [], es: [] },
|
|
49
|
+
};
|
|
50
|
+
const BUGS = {
|
|
51
|
+
key: 'preset-bug-triage',
|
|
52
|
+
hidden: true,
|
|
53
|
+
icon: 'bug',
|
|
54
|
+
name: w('Bugs', 'Errores'),
|
|
55
|
+
description: EMPTY,
|
|
56
|
+
board: w('Bugs', 'Errores'),
|
|
57
|
+
item: w('Bug', 'Bug'),
|
|
58
|
+
about: w('Bugs: an agent completes each one, the person sorts it and an agent fixes it, leaving the proof in the note. Nothing is fixed before it is reproduced.', 'Bugs: un agente completa cada uno, la persona lo clasifica y un agente lo arregla, con la prueba en la nota. Nada se arregla sin reproducirlo primero.'),
|
|
59
|
+
idle: EMPTY,
|
|
60
|
+
parts: [
|
|
61
|
+
{
|
|
62
|
+
key: 'description',
|
|
63
|
+
kind: 'long',
|
|
64
|
+
name: w('Description', 'Descripción'),
|
|
65
|
+
hint: w('what happened, in the words of whoever saw it', 'qué pasó, en palabras de quien lo vio'),
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
key: 'steps',
|
|
69
|
+
kind: 'long',
|
|
70
|
+
name: w('Steps', 'Pasos'),
|
|
71
|
+
hint: w('how to reproduce it, in order', 'cómo reproducirlo, en orden'),
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
key: 'expected',
|
|
75
|
+
kind: 'long',
|
|
76
|
+
name: w('Expected', 'Lo esperado'),
|
|
77
|
+
hint: w('what should happen', 'qué tendría que pasar'),
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
key: 'actual',
|
|
81
|
+
kind: 'long',
|
|
82
|
+
name: w('Actual', 'Lo que pasa'),
|
|
83
|
+
hint: w('what happens instead', 'qué pasa en cambio'),
|
|
84
|
+
},
|
|
85
|
+
{ key: 'environment', kind: 'text', name: w('Environment', 'Entorno'), hint: EMPTY },
|
|
86
|
+
{
|
|
87
|
+
key: 'severity',
|
|
88
|
+
kind: 'level',
|
|
89
|
+
name: w('Severity', 'Severidad'),
|
|
90
|
+
hint: w('how much it hurts', 'cuánto duele'),
|
|
91
|
+
initial: 'medium',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
key: 'category',
|
|
95
|
+
kind: 'choice',
|
|
96
|
+
name: w('Category', 'Categoría'),
|
|
97
|
+
hint: EMPTY,
|
|
98
|
+
options: [
|
|
99
|
+
w('crash', 'cierre inesperado'),
|
|
100
|
+
w('visual', 'visual'),
|
|
101
|
+
w('gameplay', 'jugabilidad'),
|
|
102
|
+
w('physics', 'física'),
|
|
103
|
+
w('audio', 'audio'),
|
|
104
|
+
w('performance', 'rendimiento'),
|
|
105
|
+
w('UI', 'interfaz'),
|
|
106
|
+
],
|
|
107
|
+
optionKeys: ['crash', 'visual', 'gameplay', 'physics', 'audio', 'performance', 'ui'],
|
|
108
|
+
},
|
|
109
|
+
{ key: 'area', kind: 'text', name: w('Area', 'Área'), hint: EMPTY },
|
|
110
|
+
],
|
|
111
|
+
form: [['description', false]],
|
|
112
|
+
steps: [
|
|
113
|
+
{
|
|
114
|
+
key: 'incomplete',
|
|
115
|
+
name: w('Complete', 'Completar'),
|
|
116
|
+
doer: ANY,
|
|
117
|
+
reviewer: 'none',
|
|
118
|
+
hand: [
|
|
119
|
+
['description', 'always'],
|
|
120
|
+
['steps', 'always'],
|
|
121
|
+
['expected', 'always'],
|
|
122
|
+
['actual', 'always'],
|
|
123
|
+
['severity', 'always'],
|
|
124
|
+
],
|
|
125
|
+
skip: true,
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
key: 'reported',
|
|
129
|
+
name: w('Sort', 'Triar'),
|
|
130
|
+
doer: YOU,
|
|
131
|
+
reviewer: 'none',
|
|
132
|
+
hand: [],
|
|
133
|
+
ways: ['incomplete'],
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
key: 'accepted',
|
|
137
|
+
name: w('Fix', 'Arreglar'),
|
|
138
|
+
doer: ANY,
|
|
139
|
+
reviewer: YOU,
|
|
140
|
+
hand: [],
|
|
141
|
+
ways: ['reported'],
|
|
142
|
+
note: w('the test you ran and what you saw', 'la prueba que hiciste y qué viste'),
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
anytime: ['environment', 'category', 'area'],
|
|
146
|
+
motives: [
|
|
147
|
+
['rejected', w('Rejected', 'Rechazado')],
|
|
148
|
+
['duplicate', w('Duplicate', 'Duplicado')],
|
|
149
|
+
['wont_fix', w("Won't fix", 'No se arreglará')],
|
|
150
|
+
],
|
|
151
|
+
dropBy: 'page',
|
|
152
|
+
list: { as: 'table', group: 'severity' },
|
|
153
|
+
row: ['severity', 'category', 'area'],
|
|
154
|
+
samples: { en: [], es: [] },
|
|
155
|
+
};
|
|
156
|
+
const REVIEW = {
|
|
157
|
+
key: 'preset-review',
|
|
158
|
+
hidden: true,
|
|
159
|
+
icon: 'compare',
|
|
160
|
+
name: w('Review', 'Revisiones'),
|
|
161
|
+
description: EMPTY,
|
|
162
|
+
board: w('Review', 'Revisiones'),
|
|
163
|
+
item: w('Piece', 'Pieza'),
|
|
164
|
+
about: w('Pieces reviewed by rounds: each handoff carries the note of what changed in that round.', 'Piezas revisadas por rondas: cada entrega lleva la nota de qué cambió en esa ronda.'),
|
|
165
|
+
idle: EMPTY,
|
|
166
|
+
parts: [
|
|
167
|
+
{ key: 'brief', kind: 'long', name: w('Brief', 'Encargo'), hint: EMPTY },
|
|
168
|
+
{ key: 'target', kind: 'text', name: w('Target', 'Objetivo'), hint: EMPTY },
|
|
169
|
+
{
|
|
170
|
+
key: 'recording',
|
|
171
|
+
kind: 'video',
|
|
172
|
+
name: w('Recording', 'Grabación'),
|
|
173
|
+
hint: EMPTY,
|
|
174
|
+
show: 'player',
|
|
175
|
+
},
|
|
176
|
+
{ key: 'images', kind: 'images', name: w('Images', 'Imágenes'), hint: EMPTY, show: 'gallery' },
|
|
177
|
+
],
|
|
178
|
+
form: [
|
|
179
|
+
['brief', false],
|
|
180
|
+
['target', false],
|
|
181
|
+
],
|
|
182
|
+
steps: [
|
|
183
|
+
{
|
|
184
|
+
key: 'queued',
|
|
185
|
+
name: w('Do it', 'Hacerlo'),
|
|
186
|
+
doer: ANY,
|
|
187
|
+
reviewer: YOU,
|
|
188
|
+
hand: [
|
|
189
|
+
['recording', 'no'],
|
|
190
|
+
['images', 'no'],
|
|
191
|
+
],
|
|
192
|
+
note: w('what changed in this round', 'qué cambió en esta ronda'),
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
anytime: [],
|
|
196
|
+
row: ['target'],
|
|
197
|
+
samples: { en: [], es: [] },
|
|
198
|
+
};
|
|
199
|
+
const ARCHITECTURE = {
|
|
200
|
+
key: 'preset-architecture',
|
|
201
|
+
hidden: true,
|
|
202
|
+
icon: 'diagram',
|
|
203
|
+
name: w('Architecture', 'Arquitectura'),
|
|
204
|
+
description: EMPTY,
|
|
205
|
+
board: w('Architecture', 'Arquitectura'),
|
|
206
|
+
item: w('Decision', 'Decisión'),
|
|
207
|
+
about: w('Architecture decisions, each with its options side by side. When a decision replaces an accepted one, link them with relates and say there that it replaces DEC-n.', 'Decisiones de arquitectura, cada una con sus opciones lado a lado. Si una decisión reemplaza a otra aceptada, enlázalas con relates y di ahí que reemplaza a DEC-n.'),
|
|
208
|
+
idle: EMPTY,
|
|
209
|
+
parts: [
|
|
210
|
+
{ key: 'context', kind: 'long', name: w('Context', 'Contexto'), hint: EMPTY },
|
|
211
|
+
{
|
|
212
|
+
key: 'options',
|
|
213
|
+
kind: 'long',
|
|
214
|
+
name: w('Options', 'Opciones'),
|
|
215
|
+
hint: w('each one starts with a heading ### A · Name', 'cada una empieza con un título ### A · Nombre'),
|
|
216
|
+
show: 'options',
|
|
217
|
+
},
|
|
218
|
+
{ key: 'decision', kind: 'long', name: w('Decision', 'Decisión'), hint: EMPTY },
|
|
219
|
+
{ key: 'consequences', kind: 'long', name: w('Consequences', 'Consecuencias'), hint: EMPTY },
|
|
220
|
+
{ key: 'area', kind: 'text', name: w('Area', 'Área'), hint: EMPTY },
|
|
221
|
+
{ key: 'diagram', kind: 'diagram', name: w('Diagram', 'Diagrama'), hint: EMPTY },
|
|
222
|
+
],
|
|
223
|
+
form: [['context', false]],
|
|
224
|
+
steps: [
|
|
225
|
+
{
|
|
226
|
+
key: 'drafting',
|
|
227
|
+
name: w('Draft', 'Redactar'),
|
|
228
|
+
doer: ANY,
|
|
229
|
+
reviewer: YOU,
|
|
230
|
+
hand: [
|
|
231
|
+
['options', 'always'],
|
|
232
|
+
['decision', 'always'],
|
|
233
|
+
['consequences', 'always'],
|
|
234
|
+
['diagram', 'no'],
|
|
235
|
+
],
|
|
236
|
+
},
|
|
237
|
+
],
|
|
238
|
+
anytime: ['area'],
|
|
239
|
+
row: ['area'],
|
|
240
|
+
samples: { en: [], es: [] },
|
|
241
|
+
};
|
|
242
|
+
const CHANGES = {
|
|
243
|
+
key: 'preset-change',
|
|
244
|
+
hidden: true,
|
|
245
|
+
icon: 'layers',
|
|
246
|
+
name: w('Changes', 'Cambios'),
|
|
247
|
+
description: EMPTY,
|
|
248
|
+
board: w('Changes', 'Cambios'),
|
|
249
|
+
item: w('Change', 'Cambio'),
|
|
250
|
+
about: w('Changes that touch several repositories. Each one divides into a Repo task per repository; it is handed off once all of them are finished.', 'Cambios que tocan varios repositorios. Cada uno se divide en una Tarea de repo por repositorio; se entrega cuando todas terminaron.'),
|
|
251
|
+
idle: EMPTY,
|
|
252
|
+
parts: [
|
|
253
|
+
{ key: 'description', kind: 'long', name: w('Description', 'Descripción'), hint: EMPTY },
|
|
254
|
+
{ key: 'plan', kind: 'long', name: w('Plan', 'Plan'), hint: EMPTY },
|
|
255
|
+
],
|
|
256
|
+
form: [['description', false]],
|
|
257
|
+
steps: [
|
|
258
|
+
{
|
|
259
|
+
key: 'analysing',
|
|
260
|
+
name: w('Analyse', 'Analizar'),
|
|
261
|
+
doer: ANY,
|
|
262
|
+
reviewer: YOU,
|
|
263
|
+
hand: [['plan', 'always']],
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
key: 'executing',
|
|
267
|
+
name: w('Execute', 'Ejecutar'),
|
|
268
|
+
doer: ANY,
|
|
269
|
+
reviewer: YOU,
|
|
270
|
+
hand: [],
|
|
271
|
+
waits: ['parts'],
|
|
272
|
+
},
|
|
273
|
+
],
|
|
274
|
+
anytime: [],
|
|
275
|
+
layout: { parts: 'main' },
|
|
276
|
+
samples: { en: [], es: [] },
|
|
277
|
+
};
|
|
278
|
+
const REPO_TASKS = {
|
|
279
|
+
key: 'preset-repo-tasks',
|
|
280
|
+
hidden: true,
|
|
281
|
+
icon: 'git-branch',
|
|
282
|
+
name: w('Repo tasks', 'Tareas de repo'),
|
|
283
|
+
description: EMPTY,
|
|
284
|
+
board: w('Repo tasks', 'Tareas de repo'),
|
|
285
|
+
item: w('Repo task', 'Tarea de repo'),
|
|
286
|
+
about: w('One task per repository, always part of a Change. Push only to its branch, only while Implement is being done.', 'Una tarea por repositorio, siempre parte de un Cambio. Sube solo a su rama, y solo mientras se hace Implementar.'),
|
|
287
|
+
idle: EMPTY,
|
|
288
|
+
parts: [
|
|
289
|
+
{ key: 'repo', kind: 'text', name: w('Repo', 'Repo'), hint: EMPTY },
|
|
290
|
+
{
|
|
291
|
+
key: 'branch',
|
|
292
|
+
kind: 'branch',
|
|
293
|
+
name: w('Branch', 'Rama'),
|
|
294
|
+
hint: EMPTY,
|
|
295
|
+
guard: { push: ['implementing'], repo: 'repo' },
|
|
296
|
+
},
|
|
297
|
+
{ key: 'pr', kind: 'url', name: w('PR', 'PR'), hint: EMPTY },
|
|
298
|
+
{ key: 'description', kind: 'long', name: w('Description', 'Descripción'), hint: EMPTY },
|
|
299
|
+
],
|
|
300
|
+
form: [
|
|
301
|
+
['repo', true],
|
|
302
|
+
['branch', true],
|
|
303
|
+
['description', false],
|
|
304
|
+
],
|
|
305
|
+
steps: [
|
|
306
|
+
{ key: 'proposed', name: w('Proposal', 'Propuesta'), doer: YOU, reviewer: 'none', hand: [] },
|
|
307
|
+
{
|
|
308
|
+
key: 'implementing',
|
|
309
|
+
name: w('Implement', 'Implementar'),
|
|
310
|
+
doer: ANY,
|
|
311
|
+
reviewer: YOU,
|
|
312
|
+
hand: [],
|
|
313
|
+
ways: ['proposed'],
|
|
314
|
+
},
|
|
315
|
+
],
|
|
316
|
+
anytime: ['pr'],
|
|
317
|
+
row: ['repo'],
|
|
318
|
+
samples: { en: [], es: [] },
|
|
319
|
+
};
|
|
320
|
+
const same = (...states) => Object.fromEntries(states.map((state) => [state, state]));
|
|
321
|
+
export const READINGS = [
|
|
322
|
+
{
|
|
323
|
+
preset: 'tasks',
|
|
324
|
+
boards: [{ template: TASKS }],
|
|
325
|
+
states: [
|
|
326
|
+
{
|
|
327
|
+
...same('incomplete', 'todo', 'todo__review', DONE, DROPPED),
|
|
328
|
+
in_progress: 'todo',
|
|
329
|
+
review: 'todo__review',
|
|
330
|
+
discarded: DROPPED,
|
|
331
|
+
},
|
|
332
|
+
],
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
preset: 'bug-triage',
|
|
336
|
+
boards: [{ template: BUGS }],
|
|
337
|
+
states: [
|
|
338
|
+
{
|
|
339
|
+
...same('incomplete', 'reported', 'accepted', 'accepted__review', DONE, DROPPED),
|
|
340
|
+
needs_info: 'incomplete',
|
|
341
|
+
fixing: 'accepted',
|
|
342
|
+
verify: 'accepted__review',
|
|
343
|
+
fixed: DONE,
|
|
344
|
+
rejected: 'dropped__rejected',
|
|
345
|
+
duplicate: 'dropped__duplicate',
|
|
346
|
+
wont_fix: 'dropped__wont_fix',
|
|
347
|
+
},
|
|
348
|
+
],
|
|
349
|
+
asked: ['needs_info'],
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
preset: 'review',
|
|
353
|
+
boards: [{ template: REVIEW }],
|
|
354
|
+
states: [
|
|
355
|
+
{
|
|
356
|
+
...same('queued', 'queued__review', DONE, DROPPED),
|
|
357
|
+
in_progress: 'queued',
|
|
358
|
+
review: 'queued__review',
|
|
359
|
+
approved: DONE,
|
|
360
|
+
},
|
|
361
|
+
],
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
preset: 'architecture',
|
|
365
|
+
boards: [{ template: ARCHITECTURE }],
|
|
366
|
+
states: [
|
|
367
|
+
{
|
|
368
|
+
...same('drafting', 'drafting__review', DONE, DROPPED),
|
|
369
|
+
review: 'drafting__review',
|
|
370
|
+
revising: 'drafting',
|
|
371
|
+
accepted: DONE,
|
|
372
|
+
rejected: DROPPED,
|
|
373
|
+
},
|
|
374
|
+
],
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
preset: 'change',
|
|
378
|
+
boards: [{ template: CHANGES }, { template: REPO_TASKS, types: ['repo_task'] }],
|
|
379
|
+
states: [
|
|
380
|
+
{
|
|
381
|
+
...same('analysing', 'analysing__review', 'executing', 'executing__review', DONE, DROPPED),
|
|
382
|
+
plan_review: 'analysing__review',
|
|
383
|
+
verify: 'executing__review',
|
|
384
|
+
discarded: DROPPED,
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
...same('proposed', 'implementing', 'implementing__review', DONE, DROPPED),
|
|
388
|
+
ready: 'implementing',
|
|
389
|
+
pr_review: 'implementing__review',
|
|
390
|
+
revising: 'implementing',
|
|
391
|
+
approved: DONE,
|
|
392
|
+
},
|
|
393
|
+
],
|
|
394
|
+
split: { parent: 0, child: 1, always: true },
|
|
395
|
+
},
|
|
396
|
+
];
|
|
397
|
+
export function readingOf(preset) {
|
|
398
|
+
return READINGS.find((reading) => reading.preset === preset);
|
|
399
|
+
}
|
|
400
|
+
// The boards a collection reads as, keys kept: the first named after the collection, the others
|
|
401
|
+
// after their template (or as the caller names them). `boardIds` are the boards' hidden ids, in
|
|
402
|
+
// order, for the split to name.
|
|
403
|
+
export function readBoards(reading, lang, names, boardIds) {
|
|
404
|
+
const defs = reading.boards.map(({ template }, index) => {
|
|
405
|
+
const name = names[index];
|
|
406
|
+
const def = instantiate(template, lang, name ? { name } : {}, newId, { keep: true });
|
|
407
|
+
def.template = template.key;
|
|
408
|
+
def.samples = [];
|
|
409
|
+
return def;
|
|
410
|
+
});
|
|
411
|
+
const split = reading.split;
|
|
412
|
+
const parent = split ? defs[split.parent] : undefined;
|
|
413
|
+
const child = split ? boardIds[split.child] : undefined;
|
|
414
|
+
if (split && parent && child)
|
|
415
|
+
parent.split = { board: child, always: split.always };
|
|
416
|
+
return defs;
|
|
417
|
+
}
|
|
418
|
+
// Where an item of the collection goes: which board (by position), in which state, and whether
|
|
419
|
+
// the reason it entered its old state becomes the note of the round it starts now. `migratedFrom`
|
|
420
|
+
// is the preset state an earlier reading moved it out of (its last migrate event's `from`), which
|
|
421
|
+
// recovers a discard's motive the earlier reading lost.
|
|
422
|
+
export function routeItem(reading, item) {
|
|
423
|
+
const typed = reading.boards.findIndex(({ types }) => types?.includes(item.type));
|
|
424
|
+
const board = typed >= 0 ? typed : 0;
|
|
425
|
+
const states = reading.states[board] ?? {};
|
|
426
|
+
let state = states[item.state];
|
|
427
|
+
if (state === DROPPED && item.migratedFrom !== undefined) {
|
|
428
|
+
const before = states[item.migratedFrom];
|
|
429
|
+
if (before?.startsWith(`${DROPPED}__`))
|
|
430
|
+
state = before;
|
|
431
|
+
}
|
|
432
|
+
const first = reading.boards[board]?.template.steps[0]?.key ?? DONE;
|
|
433
|
+
return {
|
|
434
|
+
board,
|
|
435
|
+
state: state ?? first,
|
|
436
|
+
note: reading.asked?.includes(item.state) === true,
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
// Whether a board an earlier reading made (version 1, published by Otea, from a shipped preset)
|
|
440
|
+
// may be read again: the person never published it themselves.
|
|
441
|
+
export function rereadable(board) {
|
|
442
|
+
return (board.liveVersion === 1 &&
|
|
443
|
+
board.publishedBy === 'otea' &&
|
|
444
|
+
board.template !== undefined &&
|
|
445
|
+
readingOf(board.template) !== undefined);
|
|
446
|
+
}
|
|
447
|
+
// The words of a closed state that read as Hecho when a collection on an unknown preset is read.
|
|
448
|
+
const DONE_WORDS = ['done', 'fixed', 'approved', 'accepted', 'completed', 'closed', 'merged'];
|
|
449
|
+
const EVIDENCE_KIND = {
|
|
450
|
+
images: 'images',
|
|
451
|
+
recording: 'video',
|
|
452
|
+
diff: 'code',
|
|
453
|
+
log: 'log',
|
|
454
|
+
diagram: 'diagram',
|
|
455
|
+
files: 'file',
|
|
456
|
+
};
|
|
457
|
+
// A collection on a preset Otea never shipped reads as a board of one step, Hacerlo (any agent,
|
|
458
|
+
// you review), with every field its items carry at any time and every evidence module they hold
|
|
459
|
+
// as optional evidence; open items go there, closed ones to Hecho or Descartado by their state.
|
|
460
|
+
// `branch`: the field a preset's git gates matched on, kept as the protected branch (pushed while
|
|
461
|
+
// the step is done, merged at Hecho), its repository read from `repo` when the items carry one.
|
|
462
|
+
// `about`: the preset's playbooks, which become the board's words for agents.
|
|
463
|
+
export function genericBoard(name, lang, fields, evidence, ids = newId, branch, about = '') {
|
|
464
|
+
const parts = {};
|
|
465
|
+
const humanize = (key) => {
|
|
466
|
+
const words = key.replaceAll(/[_-]/g, ' ');
|
|
467
|
+
return words.charAt(0).toUpperCase() + words.slice(1);
|
|
468
|
+
};
|
|
469
|
+
for (const key of fields) {
|
|
470
|
+
if (key === 'title')
|
|
471
|
+
continue;
|
|
472
|
+
parts[key] = { id: key, name: humanize(key), kind: 'long', hint: '', options: [] };
|
|
473
|
+
}
|
|
474
|
+
for (const { id, module } of evidence) {
|
|
475
|
+
if (parts[id])
|
|
476
|
+
continue;
|
|
477
|
+
parts[id] = {
|
|
478
|
+
id,
|
|
479
|
+
name: humanize(id),
|
|
480
|
+
kind: EVIDENCE_KIND[module] ?? 'file',
|
|
481
|
+
hint: '',
|
|
482
|
+
options: [],
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
const evidenceIds = evidence.map(({ id }) => id).filter((id) => parts[id]);
|
|
486
|
+
const step = ids('s');
|
|
487
|
+
if (branch) {
|
|
488
|
+
const repo = branch.repo !== undefined && parts[branch.repo] ? branch.repo : undefined;
|
|
489
|
+
parts[branch.field] = {
|
|
490
|
+
id: branch.field,
|
|
491
|
+
name: humanize(branch.field),
|
|
492
|
+
kind: 'branch',
|
|
493
|
+
hint: '',
|
|
494
|
+
options: [],
|
|
495
|
+
guard: { push: [step], ...(repo === undefined ? {} : { repo }) },
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
return {
|
|
499
|
+
...boardDefaults(),
|
|
500
|
+
schema: 2,
|
|
501
|
+
name,
|
|
502
|
+
item: lang === 'es' ? 'Ítem' : 'Item',
|
|
503
|
+
icon: 'layers',
|
|
504
|
+
title: TITLE_NAME[lang],
|
|
505
|
+
parts,
|
|
506
|
+
form: [],
|
|
507
|
+
steps: [
|
|
508
|
+
{
|
|
509
|
+
id: step,
|
|
510
|
+
name: lang === 'es' ? 'Hacerlo' : 'Do it',
|
|
511
|
+
doer: 'any',
|
|
512
|
+
reviewer: 'you',
|
|
513
|
+
hand: evidenceIds.map((ref) => ({ ref, req: 'no', fresh: false })),
|
|
514
|
+
ways: [],
|
|
515
|
+
back: 'same',
|
|
516
|
+
instructions: { take: '', before: '', review: '' },
|
|
517
|
+
...stepDefaults(),
|
|
518
|
+
},
|
|
519
|
+
],
|
|
520
|
+
anytime: Object.keys(parts).filter((id) => !evidenceIds.includes(id)),
|
|
521
|
+
layout: { rounds: 'main' },
|
|
522
|
+
row: [],
|
|
523
|
+
about,
|
|
524
|
+
idle: '',
|
|
525
|
+
cap: { on: false, n: 3 },
|
|
526
|
+
samples: [],
|
|
527
|
+
};
|
|
528
|
+
}
|
|
529
|
+
// Where an item on a generic board goes: open items to its one step, closed ones by their state.
|
|
530
|
+
export function genericState(def, item) {
|
|
531
|
+
if (item.open)
|
|
532
|
+
return def.steps[0]?.id ?? DONE;
|
|
533
|
+
return DONE_WORDS.includes(item.state) ? DONE : DROPPED;
|
|
534
|
+
}
|