trackops 2.0.4 → 2.0.5

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 (90) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +695 -640
  3. package/bin/trackops.js +116 -116
  4. package/lib/config.js +326 -326
  5. package/lib/control.js +208 -208
  6. package/lib/env.js +244 -244
  7. package/lib/init.js +325 -325
  8. package/lib/locale.js +41 -41
  9. package/lib/opera-bootstrap.js +942 -936
  10. package/lib/opera.js +495 -486
  11. package/lib/preferences.js +74 -74
  12. package/lib/registry.js +214 -214
  13. package/lib/release.js +56 -56
  14. package/lib/runtime-state.js +144 -144
  15. package/lib/skills.js +74 -57
  16. package/lib/workspace.js +260 -260
  17. package/locales/en.json +192 -170
  18. package/locales/es.json +192 -170
  19. package/package.json +61 -58
  20. package/scripts/postinstall-locale.js +21 -21
  21. package/scripts/skills-marketplace-smoke.js +124 -124
  22. package/scripts/smoke-tests.js +558 -554
  23. package/scripts/sync-skill-version.js +21 -21
  24. package/scripts/validate-skill.js +103 -103
  25. package/skills/trackops/SKILL.md +126 -122
  26. package/skills/trackops/agents/openai.yaml +7 -7
  27. package/skills/trackops/locales/en/SKILL.md +126 -122
  28. package/skills/trackops/locales/en/references/activation.md +94 -90
  29. package/skills/trackops/locales/en/references/troubleshooting.md +73 -67
  30. package/skills/trackops/locales/en/references/workflow.md +55 -32
  31. package/skills/trackops/references/activation.md +94 -90
  32. package/skills/trackops/references/troubleshooting.md +73 -67
  33. package/skills/trackops/references/workflow.md +55 -32
  34. package/skills/trackops/skill.json +29 -29
  35. package/templates/hooks/post-checkout +2 -2
  36. package/templates/hooks/post-commit +2 -2
  37. package/templates/hooks/post-merge +2 -2
  38. package/templates/opera/agent.md +28 -27
  39. package/templates/opera/architecture/dependency-graph.md +24 -24
  40. package/templates/opera/architecture/runtime-automation.md +24 -24
  41. package/templates/opera/architecture/runtime-operations.md +34 -34
  42. package/templates/opera/en/agent.md +22 -21
  43. package/templates/opera/en/architecture/dependency-graph.md +24 -24
  44. package/templates/opera/en/architecture/runtime-automation.md +24 -24
  45. package/templates/opera/en/architecture/runtime-operations.md +34 -34
  46. package/templates/opera/en/reviews/delivery-audit.md +18 -18
  47. package/templates/opera/en/reviews/integration-audit.md +18 -18
  48. package/templates/opera/en/router.md +24 -19
  49. package/templates/opera/references/autonomy-and-recovery.md +117 -117
  50. package/templates/opera/references/opera-cycle.md +193 -193
  51. package/templates/opera/registry.md +28 -28
  52. package/templates/opera/reviews/delivery-audit.md +18 -18
  53. package/templates/opera/reviews/integration-audit.md +18 -18
  54. package/templates/opera/router.md +54 -49
  55. package/templates/skills/changelog-updater/SKILL.md +69 -69
  56. package/templates/skills/commiter/SKILL.md +99 -99
  57. package/templates/skills/opera-contract-auditor/SKILL.md +38 -38
  58. package/templates/skills/opera-contract-auditor/locales/en/SKILL.md +38 -38
  59. package/templates/skills/opera-policy-guard/SKILL.md +26 -26
  60. package/templates/skills/opera-policy-guard/locales/en/SKILL.md +26 -26
  61. package/templates/skills/opera-skill/SKILL.md +279 -0
  62. package/templates/skills/opera-skill/locales/en/SKILL.md +279 -0
  63. package/templates/skills/opera-skill/locales/en/references/phase-dod.md +138 -0
  64. package/templates/skills/opera-skill/references/phase-dod.md +138 -0
  65. package/templates/skills/project-starter-skill/SKILL.md +150 -131
  66. package/templates/skills/project-starter-skill/locales/en/SKILL.md +143 -105
  67. package/templates/skills/project-starter-skill/references/opera-cycle.md +195 -193
  68. package/ui/css/base.css +284 -284
  69. package/ui/css/charts.css +425 -425
  70. package/ui/css/components.css +1107 -1107
  71. package/ui/css/onboarding.css +133 -133
  72. package/ui/css/terminal.css +125 -125
  73. package/ui/css/timeline.css +58 -58
  74. package/ui/css/tokens.css +284 -284
  75. package/ui/favicon.svg +5 -5
  76. package/ui/index.html +99 -99
  77. package/ui/js/charts.js +526 -526
  78. package/ui/js/console-logger.js +172 -172
  79. package/ui/js/filters.js +247 -247
  80. package/ui/js/icons.js +129 -129
  81. package/ui/js/keyboard.js +229 -229
  82. package/ui/js/router.js +142 -142
  83. package/ui/js/theme.js +100 -100
  84. package/ui/js/time-tracker.js +248 -248
  85. package/ui/js/views/dashboard.js +870 -870
  86. package/ui/js/views/flash.js +47 -47
  87. package/ui/js/views/projects.js +745 -745
  88. package/ui/js/views/scrum.js +476 -476
  89. package/ui/js/views/settings.js +331 -331
  90. package/ui/js/views/timeline.js +265 -265
package/ui/js/router.js CHANGED
@@ -1,142 +1,142 @@
1
- /**
2
- * router.js — Navegación entre vistas
3
- * Gestiona qué vista está activa en #view-container
4
- * y sincroniza el estado activo en el sidebar.
5
- */
6
-
7
- import * as state from './state.js';
8
-
9
- const _redirects = {
10
- overview: 'dashboard',
11
- insights: 'dashboard',
12
- board: 'tasks',
13
- skills: 'settings',
14
- execution: 'terminal',
15
- };
16
-
17
- /** @type {Map<string, function(): HTMLElement|string>} */
18
- const _registry = new Map();
19
- let _currentView = null;
20
- let _container = null;
21
-
22
- /**
23
- * Registra una vista
24
- * @param {string} id - identificador único de la vista
25
- * @param {function(): Promise<HTMLElement|string>} factory - función que devuelve el contenido
26
- */
27
- export function register(id, factory) {
28
- _registry.set(id, factory);
29
- }
30
-
31
- /**
32
- * Inicializa el router
33
- * @param {HTMLElement} container - #view-container
34
- */
35
- export function init(container) {
36
- _container = container;
37
-
38
- // Navegación por hash
39
- window.addEventListener('hashchange', _handleHash);
40
-
41
- // Clic en nav-items del sidebar (delegación)
42
- document.addEventListener('click', e => {
43
- const item = e.target.closest('[data-view]');
44
- if (!item || !item.dataset.view) return;
45
- e.preventDefault();
46
- navigate(item.dataset.view);
47
- });
48
- }
49
-
50
- /**
51
- * Navega a una vista
52
- * @param {string} viewId
53
- * @param {boolean} [updateHash=true]
54
- */
55
- export async function navigate(viewId, updateHash = true) {
56
- if (!_registry.has(viewId)) {
57
- console.warn(`[router] Vista desconocida: "${viewId}"`);
58
- return;
59
- }
60
-
61
- _currentView = viewId;
62
- state.update('activeView', viewId);
63
-
64
- // Actualizar hash sin trigger de hashchange
65
- if (updateHash && window.location.hash !== `#${viewId}`) {
66
- history.replaceState(null, '', `#${viewId}`);
67
- }
68
-
69
- // Actualizar clases activas en sidebar
70
- document.querySelectorAll('[data-view]').forEach(item => {
71
- item.classList.toggle('is-active', item.dataset.view === viewId);
72
- });
73
-
74
- // Renderizar contenido
75
- if (_container) {
76
- _container.innerHTML = '<div style="padding:2rem"><div class="spinner"></div></div>';
77
- try {
78
- const factory = _registry.get(viewId);
79
- const content = await factory();
80
- if (typeof content === 'string') {
81
- _container.innerHTML = content;
82
- } else if (content instanceof HTMLElement) {
83
- _container.innerHTML = '';
84
- _container.appendChild(content);
85
- }
86
- // Scroll to top
87
- _container.scrollTop = 0;
88
- // Focus para a11y (skip-link target)
89
- _container.focus({ preventScroll: true });
90
- } catch (err) {
91
- console.error('[router] Error cargando vista:', err);
92
- _container.innerHTML = `
93
- <div class="empty-state" style="margin:2rem">
94
- <p>Error al cargar la vista <strong>${viewId}</strong></p>
95
- <p style="font-size:0.8rem;font-family:var(--font-mono)">${err.message}</p>
96
- </div>`;
97
- }
98
- }
99
- }
100
-
101
- /**
102
- * Refresca la vista actual (re-renderizado)
103
- */
104
- export async function refresh() {
105
- if (_currentView) {
106
- await navigate(_currentView, false);
107
- }
108
- }
109
-
110
- /**
111
- * Obtiene la vista activa
112
- */
113
- export function current() { return _currentView; }
114
-
115
- /**
116
- * Handler de hashchange
117
- */
118
- function _handleHash() {
119
- let hash = window.location.hash.slice(1);
120
- // Redirect old routes
121
- if (_redirects[hash]) {
122
- hash = _redirects[hash];
123
- history.replaceState(null, '', `#${hash}`);
124
- }
125
- if (hash && _registry.has(hash) && hash !== _currentView) {
126
- navigate(hash, false);
127
- }
128
- }
129
-
130
- /**
131
- * Carga la vista inicial desde el hash o usa la vista por defecto
132
- * @param {string} [defaultView='overview']
133
- */
134
- export async function start(defaultView = 'dashboard') {
135
- let hash = window.location.hash.slice(1);
136
- if (_redirects[hash]) {
137
- hash = _redirects[hash];
138
- history.replaceState(null, '', `#${hash}`);
139
- }
140
- const initial = hash && _registry.has(hash) ? hash : defaultView;
141
- await navigate(initial, true);
142
- }
1
+ /**
2
+ * router.js — Navegación entre vistas
3
+ * Gestiona qué vista está activa en #view-container
4
+ * y sincroniza el estado activo en el sidebar.
5
+ */
6
+
7
+ import * as state from './state.js';
8
+
9
+ const _redirects = {
10
+ overview: 'dashboard',
11
+ insights: 'dashboard',
12
+ board: 'tasks',
13
+ skills: 'settings',
14
+ execution: 'terminal',
15
+ };
16
+
17
+ /** @type {Map<string, function(): HTMLElement|string>} */
18
+ const _registry = new Map();
19
+ let _currentView = null;
20
+ let _container = null;
21
+
22
+ /**
23
+ * Registra una vista
24
+ * @param {string} id - identificador único de la vista
25
+ * @param {function(): Promise<HTMLElement|string>} factory - función que devuelve el contenido
26
+ */
27
+ export function register(id, factory) {
28
+ _registry.set(id, factory);
29
+ }
30
+
31
+ /**
32
+ * Inicializa el router
33
+ * @param {HTMLElement} container - #view-container
34
+ */
35
+ export function init(container) {
36
+ _container = container;
37
+
38
+ // Navegación por hash
39
+ window.addEventListener('hashchange', _handleHash);
40
+
41
+ // Clic en nav-items del sidebar (delegación)
42
+ document.addEventListener('click', e => {
43
+ const item = e.target.closest('[data-view]');
44
+ if (!item || !item.dataset.view) return;
45
+ e.preventDefault();
46
+ navigate(item.dataset.view);
47
+ });
48
+ }
49
+
50
+ /**
51
+ * Navega a una vista
52
+ * @param {string} viewId
53
+ * @param {boolean} [updateHash=true]
54
+ */
55
+ export async function navigate(viewId, updateHash = true) {
56
+ if (!_registry.has(viewId)) {
57
+ console.warn(`[router] Vista desconocida: "${viewId}"`);
58
+ return;
59
+ }
60
+
61
+ _currentView = viewId;
62
+ state.update('activeView', viewId);
63
+
64
+ // Actualizar hash sin trigger de hashchange
65
+ if (updateHash && window.location.hash !== `#${viewId}`) {
66
+ history.replaceState(null, '', `#${viewId}`);
67
+ }
68
+
69
+ // Actualizar clases activas en sidebar
70
+ document.querySelectorAll('[data-view]').forEach(item => {
71
+ item.classList.toggle('is-active', item.dataset.view === viewId);
72
+ });
73
+
74
+ // Renderizar contenido
75
+ if (_container) {
76
+ _container.innerHTML = '<div style="padding:2rem"><div class="spinner"></div></div>';
77
+ try {
78
+ const factory = _registry.get(viewId);
79
+ const content = await factory();
80
+ if (typeof content === 'string') {
81
+ _container.innerHTML = content;
82
+ } else if (content instanceof HTMLElement) {
83
+ _container.innerHTML = '';
84
+ _container.appendChild(content);
85
+ }
86
+ // Scroll to top
87
+ _container.scrollTop = 0;
88
+ // Focus para a11y (skip-link target)
89
+ _container.focus({ preventScroll: true });
90
+ } catch (err) {
91
+ console.error('[router] Error cargando vista:', err);
92
+ _container.innerHTML = `
93
+ <div class="empty-state" style="margin:2rem">
94
+ <p>Error al cargar la vista <strong>${viewId}</strong></p>
95
+ <p style="font-size:0.8rem;font-family:var(--font-mono)">${err.message}</p>
96
+ </div>`;
97
+ }
98
+ }
99
+ }
100
+
101
+ /**
102
+ * Refresca la vista actual (re-renderizado)
103
+ */
104
+ export async function refresh() {
105
+ if (_currentView) {
106
+ await navigate(_currentView, false);
107
+ }
108
+ }
109
+
110
+ /**
111
+ * Obtiene la vista activa
112
+ */
113
+ export function current() { return _currentView; }
114
+
115
+ /**
116
+ * Handler de hashchange
117
+ */
118
+ function _handleHash() {
119
+ let hash = window.location.hash.slice(1);
120
+ // Redirect old routes
121
+ if (_redirects[hash]) {
122
+ hash = _redirects[hash];
123
+ history.replaceState(null, '', `#${hash}`);
124
+ }
125
+ if (hash && _registry.has(hash) && hash !== _currentView) {
126
+ navigate(hash, false);
127
+ }
128
+ }
129
+
130
+ /**
131
+ * Carga la vista inicial desde el hash o usa la vista por defecto
132
+ * @param {string} [defaultView='overview']
133
+ */
134
+ export async function start(defaultView = 'dashboard') {
135
+ let hash = window.location.hash.slice(1);
136
+ if (_redirects[hash]) {
137
+ hash = _redirects[hash];
138
+ history.replaceState(null, '', `#${hash}`);
139
+ }
140
+ const initial = hash && _registry.has(hash) ? hash : defaultView;
141
+ await navigate(initial, true);
142
+ }
package/ui/js/theme.js CHANGED
@@ -1,100 +1,100 @@
1
- /**
2
- * theme.js — Gestor de tema claro / oscuro
3
- * Persiste en localStorage. Si no hay preferencia guardada, usa tema claro.
4
- */
5
-
6
- const STORAGE_KEY = 'trackops-theme';
7
- const THEMES = { dark: 'dark', light: 'light' };
8
-
9
- /** Inicializa el tema aplicando el guardado o el preferido por el sistema */
10
- export function init() {
11
- const saved = localStorage.getItem(STORAGE_KEY);
12
- apply(saved || THEMES.light, false);
13
- }
14
-
15
- /** Aplica un tema
16
- * @param {'dark'|'light'} theme
17
- * @param {boolean} [save=true] - persistir en localStorage
18
- */
19
- export function apply(theme, save = true) {
20
- const root = document.documentElement;
21
-
22
- if (theme === THEMES.light) {
23
- root.setAttribute('data-theme', 'light');
24
- } else {
25
- root.removeAttribute('data-theme');
26
- }
27
-
28
- if (save) {
29
- localStorage.setItem(STORAGE_KEY, theme);
30
- }
31
-
32
- // Actualizar icono del botón del topbar
33
- _updateButton(theme);
34
- }
35
-
36
- /** Alterna entre claro y oscuro */
37
- export function toggle() {
38
- const current = document.documentElement.getAttribute('data-theme') === 'light'
39
- ? THEMES.light
40
- : THEMES.dark;
41
- apply(current === THEMES.light ? THEMES.dark : THEMES.light);
42
- }
43
-
44
- /** Obtiene el tema activo */
45
- export function current() {
46
- return document.documentElement.getAttribute('data-theme') === 'light' ? 'light' : 'dark';
47
- }
48
-
49
- /** Renderiza el botón toggle para el topbar */
50
- export function renderButton() {
51
- const isDark = current() === 'dark';
52
- return `
53
- <button
54
- class="btn btn-ghost btn-sm btn-icon theme-toggle"
55
- id="theme-toggle-btn"
56
- type="button"
57
- aria-label="${isDark ? 'Cambiar a tema claro' : 'Cambiar a tema oscuro'}"
58
- title="${isDark ? 'Tema claro' : 'Tema oscuro'}"
59
- >
60
- ${isDark ? _iconSun() : _iconMoon()}
61
- </button>
62
- `;
63
- }
64
-
65
- /** Vincula el botón toggle (llamar tras renderizar el topbar) */
66
- export function bindButton() {
67
- const btn = document.getElementById('theme-toggle-btn');
68
- btn?.addEventListener('click', toggle);
69
- }
70
-
71
- // ─────────────────────────────── PRIVADO ────────────────────────────────────
72
-
73
- function _updateButton(theme) {
74
- const btn = document.getElementById('theme-toggle-btn');
75
- if (!btn) return;
76
- const isDark = theme === 'dark';
77
- btn.setAttribute('aria-label', isDark ? 'Cambiar a tema claro' : 'Cambiar a tema oscuro');
78
- btn.setAttribute('title', isDark ? 'Tema claro' : 'Tema oscuro');
79
- btn.innerHTML = isDark ? _iconSun() : _iconMoon();
80
- }
81
-
82
- function _iconSun() {
83
- return `<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
84
- <circle cx="12" cy="12" r="5"/>
85
- <line x1="12" y1="1" x2="12" y2="3"/>
86
- <line x1="12" y1="21" x2="12" y2="23"/>
87
- <line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/>
88
- <line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/>
89
- <line x1="1" y1="12" x2="3" y2="12"/>
90
- <line x1="21" y1="12" x2="23" y2="12"/>
91
- <line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/>
92
- <line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/>
93
- </svg>`;
94
- }
95
-
96
- function _iconMoon() {
97
- return `<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
98
- <path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/>
99
- </svg>`;
100
- }
1
+ /**
2
+ * theme.js — Gestor de tema claro / oscuro
3
+ * Persiste en localStorage. Si no hay preferencia guardada, usa tema claro.
4
+ */
5
+
6
+ const STORAGE_KEY = 'trackops-theme';
7
+ const THEMES = { dark: 'dark', light: 'light' };
8
+
9
+ /** Inicializa el tema aplicando el guardado o el preferido por el sistema */
10
+ export function init() {
11
+ const saved = localStorage.getItem(STORAGE_KEY);
12
+ apply(saved || THEMES.light, false);
13
+ }
14
+
15
+ /** Aplica un tema
16
+ * @param {'dark'|'light'} theme
17
+ * @param {boolean} [save=true] - persistir en localStorage
18
+ */
19
+ export function apply(theme, save = true) {
20
+ const root = document.documentElement;
21
+
22
+ if (theme === THEMES.light) {
23
+ root.setAttribute('data-theme', 'light');
24
+ } else {
25
+ root.removeAttribute('data-theme');
26
+ }
27
+
28
+ if (save) {
29
+ localStorage.setItem(STORAGE_KEY, theme);
30
+ }
31
+
32
+ // Actualizar icono del botón del topbar
33
+ _updateButton(theme);
34
+ }
35
+
36
+ /** Alterna entre claro y oscuro */
37
+ export function toggle() {
38
+ const current = document.documentElement.getAttribute('data-theme') === 'light'
39
+ ? THEMES.light
40
+ : THEMES.dark;
41
+ apply(current === THEMES.light ? THEMES.dark : THEMES.light);
42
+ }
43
+
44
+ /** Obtiene el tema activo */
45
+ export function current() {
46
+ return document.documentElement.getAttribute('data-theme') === 'light' ? 'light' : 'dark';
47
+ }
48
+
49
+ /** Renderiza el botón toggle para el topbar */
50
+ export function renderButton() {
51
+ const isDark = current() === 'dark';
52
+ return `
53
+ <button
54
+ class="btn btn-ghost btn-sm btn-icon theme-toggle"
55
+ id="theme-toggle-btn"
56
+ type="button"
57
+ aria-label="${isDark ? 'Cambiar a tema claro' : 'Cambiar a tema oscuro'}"
58
+ title="${isDark ? 'Tema claro' : 'Tema oscuro'}"
59
+ >
60
+ ${isDark ? _iconSun() : _iconMoon()}
61
+ </button>
62
+ `;
63
+ }
64
+
65
+ /** Vincula el botón toggle (llamar tras renderizar el topbar) */
66
+ export function bindButton() {
67
+ const btn = document.getElementById('theme-toggle-btn');
68
+ btn?.addEventListener('click', toggle);
69
+ }
70
+
71
+ // ─────────────────────────────── PRIVADO ────────────────────────────────────
72
+
73
+ function _updateButton(theme) {
74
+ const btn = document.getElementById('theme-toggle-btn');
75
+ if (!btn) return;
76
+ const isDark = theme === 'dark';
77
+ btn.setAttribute('aria-label', isDark ? 'Cambiar a tema claro' : 'Cambiar a tema oscuro');
78
+ btn.setAttribute('title', isDark ? 'Tema claro' : 'Tema oscuro');
79
+ btn.innerHTML = isDark ? _iconSun() : _iconMoon();
80
+ }
81
+
82
+ function _iconSun() {
83
+ return `<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
84
+ <circle cx="12" cy="12" r="5"/>
85
+ <line x1="12" y1="1" x2="12" y2="3"/>
86
+ <line x1="12" y1="21" x2="12" y2="23"/>
87
+ <line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/>
88
+ <line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/>
89
+ <line x1="1" y1="12" x2="3" y2="12"/>
90
+ <line x1="21" y1="12" x2="23" y2="12"/>
91
+ <line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/>
92
+ <line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/>
93
+ </svg>`;
94
+ }
95
+
96
+ function _iconMoon() {
97
+ return `<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
98
+ <path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/>
99
+ </svg>`;
100
+ }