@tech-leads-club/harness-toolkit 0.3.4 → 0.3.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.
@@ -1,39 +1,4 @@
1
- // tools/help-topic.ts
2
- import { existsSync, readFileSync } from "node:fs";
3
- import { join as join2 } from "node:path";
4
-
5
- // src/platform/paths.ts
6
- import { homedir } from "node:os";
7
- import { join } from "node:path";
8
- function conventionalRuntimeHome() {
9
- return join(homedir(), ".tlc", "harness");
10
- }
11
- function runtimeHome(env = process.env) {
12
- return env.TLC_HOME ?? conventionalRuntimeHome();
13
- }
14
-
15
- // tools/help-topic.ts
16
- var docsDir = join2(runtimeHome(), "docs");
17
- var topic = (process.argv[2] ?? "").toLowerCase();
18
- var TOPICS = {
19
- architecture: "architecture.md",
20
- concepts: "concepts.md",
21
- measure: "measure.md",
22
- metrics: "measure.md",
23
- prices: "measure.md",
24
- price: "measure.md",
25
- cost: "measure.md",
26
- costs: "measure.md",
27
- diagnose: "diagnose.md",
28
- doctor: "diagnose.md",
29
- debug: "diagnose.md",
30
- init: "init.md",
31
- setup: "init.md",
32
- lessons: "lessons.md",
33
- lesson: "lessons.md"
34
- };
35
- function printIndex() {
36
- console.log(`tlc harness help
1
+ import{existsSync as f,readFileSync as u}from"node:fs";import{join as h}from"node:path";import{homedir as n}from"node:os";import{join as r}from"node:path";function x(){return r(n(),".tlc","harness")}function m(p=process.env){return p.TLC_HOME??x()}var P=h(m(),"docs"),s=(process.argv[2]??"").toLowerCase(),g={architecture:"architecture.md",concepts:"concepts.md",measure:"measure.md",metrics:"measure.md",prices:"measure.md",price:"measure.md",cost:"measure.md",costs:"measure.md",diagnose:"diagnose.md",doctor:"diagnose.md",debug:"diagnose.md",init:"init.md",setup:"init.md",lessons:"lessons.md",lesson:"lessons.md"};function d(){console.log(`tlc harness help
37
2
 
38
3
  TOPICS
39
4
  tlc harness help architecture
@@ -50,33 +15,8 @@ PRICES
50
15
 
51
16
  ALSO
52
17
  tlc harness status | doctor | grind | mode | obs | lessons
53
- `);
54
- }
55
- if (!topic || topic === "help" || topic === "-h" || topic === "--help") {
56
- printIndex();
57
- process.exit(0);
58
- }
59
- var file = TOPICS[topic];
60
- if (!file) {
61
- console.error(`unknown topic: ${topic}`);
62
- printIndex();
63
- process.exit(1);
64
- }
65
- var path = join2(docsDir, file);
66
- if (!existsSync(path)) {
67
- console.error(`missing doc: ${path}`);
68
- process.exit(1);
69
- }
70
- var body = readFileSync(path, "utf8");
71
- if (topic === "prices" || topic === "price" || topic === "cost" || topic === "costs") {
72
- const marker = "## Prices";
73
- const idx = body.indexOf(marker);
74
- if (idx >= 0) {
75
- body = `# Prices
18
+ `)}if(!s||s==="help"||s==="-h"||s==="--help")d(),process.exit(0);var a=g[s];if(!a)console.error(`unknown topic: ${s}`),d(),process.exit(1);var c=h(P,a);if(!f(c))console.error(`missing doc: ${c}`),process.exit(1);var e=u(c,"utf8");if(s==="prices"||s==="price"||s==="cost"||s==="costs"){let l=e.indexOf("## Prices");if(l>=0)e=`# Prices
76
19
 
77
- ${body.slice(idx)}`;
78
- }
79
- }
80
- process.stdout.write(body.endsWith(`
81
- `) ? body : `${body}
20
+ ${e.slice(l)}`}process.stdout.write(e.endsWith(`
21
+ `)?e:`${e}
82
22
  `);