trackops 2.0.4 → 2.0.6

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 (92) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +660 -575
  3. package/bin/trackops.js +127 -106
  4. package/lib/cli-format.js +118 -0
  5. package/lib/config.js +352 -326
  6. package/lib/control.js +408 -246
  7. package/lib/env.js +234 -222
  8. package/lib/i18n.js +5 -4
  9. package/lib/init.js +390 -282
  10. package/lib/locale.js +41 -41
  11. package/lib/opera-bootstrap.js +1066 -880
  12. package/lib/opera.js +615 -444
  13. package/lib/preferences.js +74 -74
  14. package/lib/registry.js +214 -214
  15. package/lib/release.js +56 -56
  16. package/lib/runtime-state.js +144 -144
  17. package/lib/skills.js +114 -89
  18. package/lib/workspace.js +259 -248
  19. package/locales/en.json +311 -167
  20. package/locales/es.json +314 -170
  21. package/package.json +61 -58
  22. package/scripts/postinstall-locale.js +21 -21
  23. package/scripts/skills-marketplace-smoke.js +124 -124
  24. package/scripts/smoke-tests.js +563 -517
  25. package/scripts/sync-skill-version.js +21 -21
  26. package/scripts/validate-skill.js +103 -103
  27. package/skills/trackops/SKILL.md +126 -122
  28. package/skills/trackops/agents/openai.yaml +7 -7
  29. package/skills/trackops/locales/en/SKILL.md +126 -122
  30. package/skills/trackops/locales/en/references/activation.md +94 -90
  31. package/skills/trackops/locales/en/references/troubleshooting.md +73 -67
  32. package/skills/trackops/locales/en/references/workflow.md +55 -32
  33. package/skills/trackops/references/activation.md +94 -90
  34. package/skills/trackops/references/troubleshooting.md +73 -67
  35. package/skills/trackops/references/workflow.md +55 -32
  36. package/skills/trackops/skill.json +29 -29
  37. package/templates/hooks/post-checkout +2 -2
  38. package/templates/hooks/post-commit +2 -2
  39. package/templates/hooks/post-merge +2 -2
  40. package/templates/opera/agent.md +28 -27
  41. package/templates/opera/architecture/dependency-graph.md +24 -24
  42. package/templates/opera/architecture/runtime-automation.md +24 -24
  43. package/templates/opera/architecture/runtime-operations.md +34 -34
  44. package/templates/opera/en/agent.md +22 -21
  45. package/templates/opera/en/architecture/dependency-graph.md +24 -24
  46. package/templates/opera/en/architecture/runtime-automation.md +24 -24
  47. package/templates/opera/en/architecture/runtime-operations.md +34 -34
  48. package/templates/opera/en/reviews/delivery-audit.md +18 -18
  49. package/templates/opera/en/reviews/integration-audit.md +18 -18
  50. package/templates/opera/en/router.md +24 -19
  51. package/templates/opera/references/autonomy-and-recovery.md +117 -117
  52. package/templates/opera/references/opera-cycle.md +193 -193
  53. package/templates/opera/registry.md +28 -28
  54. package/templates/opera/reviews/delivery-audit.md +18 -18
  55. package/templates/opera/reviews/integration-audit.md +18 -18
  56. package/templates/opera/router.md +54 -49
  57. package/templates/skills/changelog-updater/SKILL.md +69 -69
  58. package/templates/skills/commiter/SKILL.md +99 -99
  59. package/templates/skills/opera-contract-auditor/SKILL.md +38 -38
  60. package/templates/skills/opera-contract-auditor/locales/en/SKILL.md +38 -38
  61. package/templates/skills/opera-policy-guard/SKILL.md +26 -26
  62. package/templates/skills/opera-policy-guard/locales/en/SKILL.md +26 -26
  63. package/templates/skills/opera-skill/SKILL.md +279 -0
  64. package/templates/skills/opera-skill/locales/en/SKILL.md +279 -0
  65. package/templates/skills/opera-skill/locales/en/references/phase-dod.md +138 -0
  66. package/templates/skills/opera-skill/references/phase-dod.md +138 -0
  67. package/templates/skills/project-starter-skill/SKILL.md +150 -131
  68. package/templates/skills/project-starter-skill/locales/en/SKILL.md +143 -105
  69. package/templates/skills/project-starter-skill/references/opera-cycle.md +195 -193
  70. package/ui/css/base.css +284 -284
  71. package/ui/css/charts.css +425 -425
  72. package/ui/css/components.css +1107 -1107
  73. package/ui/css/onboarding.css +133 -133
  74. package/ui/css/terminal.css +125 -125
  75. package/ui/css/timeline.css +58 -58
  76. package/ui/css/tokens.css +284 -284
  77. package/ui/favicon.svg +5 -5
  78. package/ui/index.html +99 -99
  79. package/ui/js/charts.js +526 -526
  80. package/ui/js/console-logger.js +172 -172
  81. package/ui/js/filters.js +247 -247
  82. package/ui/js/icons.js +129 -129
  83. package/ui/js/keyboard.js +229 -229
  84. package/ui/js/router.js +142 -142
  85. package/ui/js/theme.js +100 -100
  86. package/ui/js/time-tracker.js +248 -248
  87. package/ui/js/views/dashboard.js +870 -870
  88. package/ui/js/views/flash.js +47 -47
  89. package/ui/js/views/projects.js +745 -745
  90. package/ui/js/views/scrum.js +476 -476
  91. package/ui/js/views/settings.js +331 -331
  92. package/ui/js/views/timeline.js +265 -265
package/bin/trackops.js CHANGED
@@ -1,40 +1,61 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
+
3
+ const nodeVersion = parseInt(process.versions.node, 10);
4
+ if (nodeVersion < 18) {
5
+ console.error(`TrackOps requiere Node.js 18 o superior. Version actual: ${process.versions.node}`);
6
+ process.exit(1);
7
+ }
2
8
 
3
9
  const path = require("path");
4
10
  const config = require("../lib/config");
5
11
  const runtimeState = require("../lib/runtime-state");
6
12
  const { setLocale, t } = require("../lib/i18n");
13
+ const fmt = require("../lib/cli-format");
7
14
  const pkg = require("../package.json");
8
15
 
9
- const command = process.argv[2];
10
- const args = process.argv.slice(3);
11
-
12
- function initCliLocale() {
13
- let projectLocale = null;
14
- try {
15
- const context = config.resolveWorkspaceContext();
16
- if (context) {
17
- projectLocale = config.getLocale(config.loadControl(context));
18
- }
19
- } catch (_error) {
20
- projectLocale = null;
21
- }
22
- const doctor = runtimeState.doctorLocale(projectLocale);
23
- setLocale(doctor.effectiveLocale);
16
+ function parseCliTokens(argv) {
17
+ const plain = argv.includes("--plain") || argv.includes("--a11y");
18
+ const tokens = argv.filter((token) => !["--plain", "--a11y"].includes(token));
19
+ return {
20
+ plain,
21
+ command: tokens[0],
22
+ args: tokens.slice(1),
23
+ };
24
24
  }
25
25
 
26
- function resolveRoot() {
27
- const context = config.resolveWorkspaceContext();
28
- if (!context) {
29
- console.error(t("cli.error.noWorkspace"));
30
- process.exit(1);
31
- }
32
- return context.workspaceRoot;
33
- }
26
+ const parsed = parseCliTokens(process.argv.slice(2));
27
+ fmt.configure({ plain: parsed.plain });
34
28
 
35
- async function run() {
36
- initCliLocale();
37
- try {
29
+ const command = parsed.command;
30
+ const args = parsed.args;
31
+
32
+ function initCliLocale() {
33
+ let projectLocale = null;
34
+ try {
35
+ const context = config.resolveWorkspaceContext();
36
+ if (context) {
37
+ projectLocale = config.getLocale(config.loadControl(context));
38
+ }
39
+ } catch (_error) {
40
+ projectLocale = null;
41
+ }
42
+ const doctor = runtimeState.doctorLocale(projectLocale);
43
+ setLocale(doctor.effectiveLocale);
44
+ }
45
+
46
+ function resolveRoot() {
47
+ const context = config.resolveWorkspaceContext();
48
+ if (!context) {
49
+ console.error(t("cli.error.noWorkspace"));
50
+ console.error(t("cli.help.initFirst"));
51
+ process.exit(1);
52
+ }
53
+ return context.workspaceRoot;
54
+ }
55
+
56
+ async function run() {
57
+ initCliLocale();
58
+ try {
38
59
  switch (command) {
39
60
  case "init":
40
61
  await require("../lib/init").cmdInit(args);
@@ -68,90 +89,90 @@ async function run() {
68
89
  require("../lib/control").cmdTask(resolveRoot(), args);
69
90
  break;
70
91
 
71
- case "register":
72
- require("../lib/registry").cmdRegister(config.resolveProjectRoot() || process.cwd());
73
- break;
92
+ case "register":
93
+ require("../lib/registry").cmdRegister(config.resolveProjectRoot() || process.cwd());
94
+ break;
74
95
 
75
96
  case "projects":
76
97
  require("../lib/registry").cmdList();
77
98
  break;
78
99
 
79
- case "workspace": {
80
- const workspace = require("../lib/workspace");
81
- const sub = args[0];
82
- const root = config.resolveProjectRoot() || process.cwd();
83
- if (sub === "status") workspace.cmdStatus(root);
84
- else if (sub === "migrate") workspace.cmdMigrate(root, args.slice(1));
85
- else console.log(t("cli.usage.workspace"));
86
- break;
87
- }
88
-
89
- case "env": {
90
- const env = require("../lib/env");
91
- const sub = args[0];
92
- const root = config.resolveProjectRoot() || process.cwd();
93
- if (sub === "status") env.cmdStatus(root);
94
- else if (sub === "sync") env.cmdSync(root);
95
- else console.log(t("cli.usage.env"));
96
- break;
97
- }
98
-
99
- case "release":
100
- require("../lib/release").cmdRelease(config.resolveProjectRoot() || process.cwd(), args);
101
- break;
102
-
103
- case "locale":
104
- require("../lib/preferences").cmdLocale(args, config.resolveProjectRoot() || process.cwd());
105
- break;
106
-
107
- case "doctor":
108
- require("../lib/preferences").cmdDoctor(args, config.resolveProjectRoot() || process.cwd());
109
- break;
110
-
111
- case "opera": {
112
- const opera = require("../lib/opera");
113
- const sub = args[0];
114
- const root = config.resolveProjectRoot() || process.cwd();
115
- if (sub === "install") await opera.cmdInstall(root, args.slice(1));
116
- else if (sub === "bootstrap") await opera.cmdBootstrap(root, args.slice(1));
117
- else if (sub === "handoff") opera.cmdHandoff(root, args.slice(1));
118
- else if (sub === "status") opera.cmdStatus(root);
119
- else if (sub === "configure") opera.cmdConfigure(root, args.slice(1));
120
- else if (sub === "upgrade") opera.cmdUpgrade(root, args.slice(1));
121
- else { console.log(t("cli.usage.opera")); }
122
- break;
123
- }
124
-
125
- case "skill": {
126
- const skills = require("../lib/skills");
127
- const sub = args[0];
128
- const root = config.resolveProjectRoot() || process.cwd();
129
- if (sub === "install") skills.cmdInstall(root, args[1]);
130
- else if (sub === "list") skills.cmdList(root);
131
- else if (sub === "remove") skills.cmdRemove(root, args[1]);
132
- else if (sub === "catalog") skills.cmdCatalog();
133
- else { console.log(t("cli.usage.skill")); }
134
- break;
135
- }
136
-
137
- case "version":
138
- case "--version":
139
- case "-v":
140
- console.log(pkg.version);
141
- break;
142
-
143
- case "help":
144
- case "--help":
145
- case "-h":
146
- case undefined:
147
- require("../lib/control").cmdHelp();
148
- break;
149
-
150
- default:
151
- console.error(t("cli.error.unknownCommand", { command }));
152
- console.error(t("cli.error.runHelp"));
153
- process.exit(1);
154
- }
100
+ case "workspace": {
101
+ const workspace = require("../lib/workspace");
102
+ const sub = args[0];
103
+ const root = config.resolveProjectRoot() || process.cwd();
104
+ if (sub === "status") workspace.cmdStatus(root);
105
+ else if (sub === "migrate") workspace.cmdMigrate(root, args.slice(1));
106
+ else console.log(t("cli.usage.workspace"));
107
+ break;
108
+ }
109
+
110
+ case "env": {
111
+ const env = require("../lib/env");
112
+ const sub = args[0];
113
+ const root = config.resolveProjectRoot() || process.cwd();
114
+ if (sub === "status") env.cmdStatus(root);
115
+ else if (sub === "sync") env.cmdSync(root);
116
+ else console.log(t("cli.usage.env"));
117
+ break;
118
+ }
119
+
120
+ case "release":
121
+ require("../lib/release").cmdRelease(config.resolveProjectRoot() || process.cwd(), args);
122
+ break;
123
+
124
+ case "locale":
125
+ require("../lib/preferences").cmdLocale(args, config.resolveProjectRoot() || process.cwd());
126
+ break;
127
+
128
+ case "doctor":
129
+ require("../lib/preferences").cmdDoctor(args, config.resolveProjectRoot() || process.cwd());
130
+ break;
131
+
132
+ case "opera": {
133
+ const opera = require("../lib/opera");
134
+ const sub = args[0];
135
+ const root = config.resolveProjectRoot() || process.cwd();
136
+ if (sub === "install") await opera.cmdInstall(root, args.slice(1));
137
+ else if (sub === "bootstrap") await opera.cmdBootstrap(root, args.slice(1));
138
+ else if (sub === "handoff") opera.cmdHandoff(root, args.slice(1));
139
+ else if (sub === "status") opera.cmdStatus(root);
140
+ else if (sub === "configure") opera.cmdConfigure(root, args.slice(1));
141
+ else if (sub === "upgrade") opera.cmdUpgrade(root, args.slice(1));
142
+ else { console.log(t("cli.usage.opera")); }
143
+ break;
144
+ }
145
+
146
+ case "skill": {
147
+ const skills = require("../lib/skills");
148
+ const sub = args[0];
149
+ const root = config.resolveProjectRoot() || process.cwd();
150
+ if (sub === "install") skills.cmdInstall(root, args[1]);
151
+ else if (sub === "list") skills.cmdList(root);
152
+ else if (sub === "remove") skills.cmdRemove(root, args[1]);
153
+ else if (sub === "catalog") skills.cmdCatalog();
154
+ else { console.log(t("cli.usage.skill")); }
155
+ break;
156
+ }
157
+
158
+ case "version":
159
+ case "--version":
160
+ case "-v":
161
+ console.log(pkg.version);
162
+ break;
163
+
164
+ case "help":
165
+ case "--help":
166
+ case "-h":
167
+ case undefined:
168
+ require("../lib/control").cmdHelp();
169
+ break;
170
+
171
+ default:
172
+ console.error(t("cli.error.unknownCommand", { command }));
173
+ console.error(t("cli.error.runHelp"));
174
+ process.exit(1);
175
+ }
155
176
  } catch (error) {
156
177
  console.error(error.message);
157
178
  process.exit(1);
@@ -0,0 +1,118 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * CLI output formatting helpers for accessible, scannable terminal output.
5
+ * Supports a plain mode for screen readers, logs, and limited terminals.
6
+ */
7
+
8
+ const state = {
9
+ plain: false,
10
+ };
11
+
12
+ const UNICODE_SEP = "\u2500".repeat(48);
13
+ const PLAIN_SEP = "-".repeat(48);
14
+
15
+ const STATUS_TOKENS = {
16
+ pending: ["\u23F3", "PENDING"],
17
+ in_progress: ["\uD83D\uDEA7", "IN PROGRESS"],
18
+ in_review: ["\uD83D\uDC40", "IN REVIEW"],
19
+ blocked: ["\u26D4", "BLOCKED"],
20
+ completed: ["\u2705", "DONE"],
21
+ cancelled: ["\uD83D\uDDD1\uFE0F", "CANCELLED"],
22
+ };
23
+
24
+ const CHECK_TOKENS = {
25
+ pass: ["\u2705", "PASS"],
26
+ warn: ["\u26A0\uFE0F", "WARN"],
27
+ fail: ["\u274C", "FAIL"],
28
+ pending: ["\u23F3", "PENDING"],
29
+ };
30
+
31
+ function configure(options = {}) {
32
+ if (Object.prototype.hasOwnProperty.call(options, "plain")) {
33
+ state.plain = Boolean(options.plain);
34
+ }
35
+ }
36
+
37
+ function isPlain() {
38
+ return state.plain;
39
+ }
40
+
41
+ function pick(unicodeValue, plainValue) {
42
+ return state.plain ? plainValue : unicodeValue;
43
+ }
44
+
45
+ function sep() {
46
+ console.log(pick(UNICODE_SEP, PLAIN_SEP));
47
+ }
48
+
49
+ function blank() {
50
+ console.log("");
51
+ }
52
+
53
+ function header(text) {
54
+ console.log("");
55
+ console.log(pick(UNICODE_SEP, PLAIN_SEP));
56
+ console.log(` ${text}`);
57
+ console.log(pick(UNICODE_SEP, PLAIN_SEP));
58
+ }
59
+
60
+ function success(text) {
61
+ console.log(` ${pick("\u2713", "OK")} ${text}`);
62
+ }
63
+
64
+ function info(text) {
65
+ console.log(` ${text}`);
66
+ }
67
+
68
+ function step(label, value) {
69
+ if (value !== undefined) {
70
+ console.log(` ${pick("\u2192", "->")} ${label}: ${value}`);
71
+ } else {
72
+ console.log(` ${pick("\u2192", "->")} ${label}`);
73
+ }
74
+ }
75
+
76
+ function hint(text) {
77
+ console.log(` ${text}`);
78
+ }
79
+
80
+ function warn(text) {
81
+ console.log(` ${pick("\u26A0", "WARN")} ${text}`);
82
+ }
83
+
84
+ function bullet(text) {
85
+ console.log(` - ${text}`);
86
+ }
87
+
88
+ function statusToken(status) {
89
+ const pair = STATUS_TOKENS[status] || [status, String(status || "").toUpperCase()];
90
+ return pick(pair[0], `[${pair[1]}]`);
91
+ }
92
+
93
+ function checkToken(status) {
94
+ const pair = CHECK_TOKENS[status] || [status, String(status || "").toUpperCase()];
95
+ return pick(pair[0], `[${pair[1]}]`);
96
+ }
97
+
98
+ function boolToken(value) {
99
+ return value ? pick("\u2705", "[YES]") : pick("\u274C", "[NO]");
100
+ }
101
+
102
+ module.exports = {
103
+ configure,
104
+ isPlain,
105
+ pick,
106
+ sep,
107
+ blank,
108
+ header,
109
+ success,
110
+ info,
111
+ step,
112
+ hint,
113
+ warn,
114
+ bullet,
115
+ statusToken,
116
+ checkToken,
117
+ boolToken,
118
+ };