zcode-app-cli 3.3.5-1

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 (169) hide show
  1. package/LICENSE +24 -0
  2. package/README.md +642 -0
  3. package/bin/zcode.js +848 -0
  4. package/config.example.json +110 -0
  5. package/package.json +81 -0
  6. package/vendor/.node-bundle-meta.json +6 -0
  7. package/vendor/extraction.json +11 -0
  8. package/vendor/node_modules/@zcode/tui/dist/index.js +161875 -0
  9. package/vendor/node_modules/@zcode/tui/package.json +14 -0
  10. package/vendor/packages/android-emulator-plugin/.mcp.json +19 -0
  11. package/vendor/packages/android-emulator-plugin/.zcode-plugin/plugin.json +63 -0
  12. package/vendor/packages/android-emulator-plugin/README.md +134 -0
  13. package/vendor/packages/android-emulator-plugin/commands/android-dev.md +11 -0
  14. package/vendor/packages/android-emulator-plugin/dist/lib/path.d.ts +4 -0
  15. package/vendor/packages/android-emulator-plugin/dist/lib/path.js +17 -0
  16. package/vendor/packages/android-emulator-plugin/dist/lib/result.d.ts +5 -0
  17. package/vendor/packages/android-emulator-plugin/dist/lib/result.js +22 -0
  18. package/vendor/packages/android-emulator-plugin/dist/lib/run.d.ts +18 -0
  19. package/vendor/packages/android-emulator-plugin/dist/lib/run.js +99 -0
  20. package/vendor/packages/android-emulator-plugin/dist/mcp/server.d.ts +3 -0
  21. package/vendor/packages/android-emulator-plugin/dist/mcp/server.js +47607 -0
  22. package/vendor/packages/android-emulator-plugin/dist/providers/app.d.ts +39 -0
  23. package/vendor/packages/android-emulator-plugin/dist/providers/app.js +50 -0
  24. package/vendor/packages/android-emulator-plugin/dist/providers/avd.d.ts +37 -0
  25. package/vendor/packages/android-emulator-plugin/dist/providers/avd.js +185 -0
  26. package/vendor/packages/android-emulator-plugin/dist/providers/build.d.ts +68 -0
  27. package/vendor/packages/android-emulator-plugin/dist/providers/build.js +131 -0
  28. package/vendor/packages/android-emulator-plugin/dist/providers/config.d.ts +7 -0
  29. package/vendor/packages/android-emulator-plugin/dist/providers/config.js +29 -0
  30. package/vendor/packages/android-emulator-plugin/dist/providers/device.d.ts +20 -0
  31. package/vendor/packages/android-emulator-plugin/dist/providers/device.js +91 -0
  32. package/vendor/packages/android-emulator-plugin/dist/providers/logs.d.ts +15 -0
  33. package/vendor/packages/android-emulator-plugin/dist/providers/logs.js +31 -0
  34. package/vendor/packages/android-emulator-plugin/dist/providers/preflight.d.ts +15 -0
  35. package/vendor/packages/android-emulator-plugin/dist/providers/preflight.js +123 -0
  36. package/vendor/packages/android-emulator-plugin/dist/providers/project-template.d.ts +13 -0
  37. package/vendor/packages/android-emulator-plugin/dist/providers/project-template.js +211 -0
  38. package/vendor/packages/android-emulator-plugin/dist/providers/project.d.ts +33 -0
  39. package/vendor/packages/android-emulator-plugin/dist/providers/project.js +195 -0
  40. package/vendor/packages/android-emulator-plugin/dist/providers/screenshot.d.ts +14 -0
  41. package/vendor/packages/android-emulator-plugin/dist/providers/screenshot.js +73 -0
  42. package/vendor/packages/android-emulator-plugin/dist/providers/sdk.d.ts +14 -0
  43. package/vendor/packages/android-emulator-plugin/dist/providers/sdk.js +185 -0
  44. package/vendor/packages/android-emulator-plugin/dist/providers/ui.d.ts +92 -0
  45. package/vendor/packages/android-emulator-plugin/dist/providers/ui.js +146 -0
  46. package/vendor/packages/android-emulator-plugin/hooks/hooks.json +3 -0
  47. package/vendor/packages/android-emulator-plugin/package.json +35 -0
  48. package/vendor/packages/android-emulator-plugin/skills/android-dev/INSTALL_ENVIRONMENT.md +357 -0
  49. package/vendor/packages/android-emulator-plugin/skills/android-dev/SKILL.md +73 -0
  50. package/vendor/packages/android-emulator-plugin/templates/compose-app/README.md +5 -0
  51. package/vendor/packages/document-skills-plugin/.zcode-plugin/plugin.json +8 -0
  52. package/vendor/packages/document-skills-plugin/package.json +8 -0
  53. package/vendor/packages/document-skills-plugin/skills/docx/LICENSE.txt +13 -0
  54. package/vendor/packages/document-skills-plugin/skills/docx/SKILL.md +201 -0
  55. package/vendor/packages/document-skills-plugin/skills/docx/references/chart-templates.md +386 -0
  56. package/vendor/packages/document-skills-plugin/skills/docx/references/common-rules.md +419 -0
  57. package/vendor/packages/document-skills-plugin/skills/docx/references/decorations.md +537 -0
  58. package/vendor/packages/document-skills-plugin/skills/docx/references/design-system.md +1797 -0
  59. package/vendor/packages/document-skills-plugin/skills/docx/references/docx-js-advanced.md +257 -0
  60. package/vendor/packages/document-skills-plugin/skills/docx/references/docx-js-core.md +332 -0
  61. package/vendor/packages/document-skills-plugin/skills/docx/references/faq.md +323 -0
  62. package/vendor/packages/document-skills-plugin/skills/docx/references/math-formulas.md +276 -0
  63. package/vendor/packages/document-skills-plugin/skills/docx/references/ooxml.md +222 -0
  64. package/vendor/packages/document-skills-plugin/skills/docx/references/toc.md +264 -0
  65. package/vendor/packages/document-skills-plugin/skills/docx/routes/comment.md +88 -0
  66. package/vendor/packages/document-skills-plugin/skills/docx/routes/create.md +207 -0
  67. package/vendor/packages/document-skills-plugin/skills/docx/routes/edit.md +115 -0
  68. package/vendor/packages/document-skills-plugin/skills/docx/routes/format.md +120 -0
  69. package/vendor/packages/document-skills-plugin/skills/docx/routes/read.md +114 -0
  70. package/vendor/packages/document-skills-plugin/skills/docx/scenes/academic.md +783 -0
  71. package/vendor/packages/document-skills-plugin/skills/docx/scenes/contract.md +463 -0
  72. package/vendor/packages/document-skills-plugin/skills/docx/scenes/copywriting.md +139 -0
  73. package/vendor/packages/document-skills-plugin/skills/docx/scenes/exam.md +698 -0
  74. package/vendor/packages/document-skills-plugin/skills/docx/scenes/official-doc.md +411 -0
  75. package/vendor/packages/document-skills-plugin/skills/docx/scenes/report.md +340 -0
  76. package/vendor/packages/document-skills-plugin/skills/docx/scenes/resume.md +534 -0
  77. package/vendor/packages/document-skills-plugin/skills/docx/scripts/__init__.py +1 -0
  78. package/vendor/packages/document-skills-plugin/skills/docx/scripts/add_toc_placeholders.py +749 -0
  79. package/vendor/packages/document-skills-plugin/skills/docx/scripts/document.py +1333 -0
  80. package/vendor/packages/document-skills-plugin/skills/docx/scripts/postcheck.py +807 -0
  81. package/vendor/packages/document-skills-plugin/skills/docx/scripts/templates/comments.xml +3 -0
  82. package/vendor/packages/document-skills-plugin/skills/docx/scripts/templates/commentsExtended.xml +3 -0
  83. package/vendor/packages/document-skills-plugin/skills/docx/scripts/templates/commentsExtensible.xml +3 -0
  84. package/vendor/packages/document-skills-plugin/skills/docx/scripts/templates/commentsIds.xml +3 -0
  85. package/vendor/packages/document-skills-plugin/skills/docx/scripts/templates/people.xml +3 -0
  86. package/vendor/packages/document-skills-plugin/skills/docx/scripts/utilities.py +374 -0
  87. package/vendor/packages/document-skills-plugin/skills/docx/setup.sh +177 -0
  88. package/vendor/packages/document-skills-plugin/skills/pdf/LICENSE.txt +13 -0
  89. package/vendor/packages/document-skills-plugin/skills/pdf/SKILL.md +919 -0
  90. package/vendor/packages/document-skills-plugin/skills/pdf/briefs/academic.md +1058 -0
  91. package/vendor/packages/document-skills-plugin/skills/pdf/briefs/creative.md +770 -0
  92. package/vendor/packages/document-skills-plugin/skills/pdf/briefs/poster.md +702 -0
  93. package/vendor/packages/document-skills-plugin/skills/pdf/briefs/process-advanced.md +284 -0
  94. package/vendor/packages/document-skills-plugin/skills/pdf/briefs/process.md +319 -0
  95. package/vendor/packages/document-skills-plugin/skills/pdf/briefs/report.md +1659 -0
  96. package/vendor/packages/document-skills-plugin/skills/pdf/configs/components.md +153 -0
  97. package/vendor/packages/document-skills-plugin/skills/pdf/configs/fonts.md +93 -0
  98. package/vendor/packages/document-skills-plugin/skills/pdf/configs/visual_framework.md +263 -0
  99. package/vendor/packages/document-skills-plugin/skills/pdf/references/resume-academic.tex +130 -0
  100. package/vendor/packages/document-skills-plugin/skills/pdf/references/resume-altacv.tex +190 -0
  101. package/vendor/packages/document-skills-plugin/skills/pdf/scripts/cover_validate.js +367 -0
  102. package/vendor/packages/document-skills-plugin/skills/pdf/scripts/design_engine.py +2816 -0
  103. package/vendor/packages/document-skills-plugin/skills/pdf/scripts/html2pdf-next.js +754 -0
  104. package/vendor/packages/document-skills-plugin/skills/pdf/scripts/html2poster.js +256 -0
  105. package/vendor/packages/document-skills-plugin/skills/pdf/scripts/pdf.py +2959 -0
  106. package/vendor/packages/document-skills-plugin/skills/pdf/scripts/pdf_qa.py +901 -0
  107. package/vendor/packages/document-skills-plugin/skills/pdf/scripts/poster_validate.py +1337 -0
  108. package/vendor/packages/document-skills-plugin/skills/pdf/scripts/setup.sh +269 -0
  109. package/vendor/packages/document-skills-plugin/skills/pdf/scripts/toc_validate.py +2075 -0
  110. package/vendor/packages/document-skills-plugin/skills/pdf/typesetting/charts.md +320 -0
  111. package/vendor/packages/document-skills-plugin/skills/pdf/typesetting/cover-backgrounds.md +384 -0
  112. package/vendor/packages/document-skills-plugin/skills/pdf/typesetting/cover.md +1442 -0
  113. package/vendor/packages/document-skills-plugin/skills/pdf/typesetting/fill-engine.md +527 -0
  114. package/vendor/packages/document-skills-plugin/skills/pdf/typesetting/geometry.md +142 -0
  115. package/vendor/packages/document-skills-plugin/skills/pdf/typesetting/overflow.md +630 -0
  116. package/vendor/packages/document-skills-plugin/skills/pdf/typesetting/pagination.md +367 -0
  117. package/vendor/packages/document-skills-plugin/skills/pdf/typesetting/palette.md +217 -0
  118. package/vendor/packages/document-skills-plugin/skills/pdf/typesetting/typography.md +20 -0
  119. package/vendor/packages/ios-simulator-plugin/.mcp.json +15 -0
  120. package/vendor/packages/ios-simulator-plugin/.zcode-plugin/plugin.json +34 -0
  121. package/vendor/packages/ios-simulator-plugin/README.md +111 -0
  122. package/vendor/packages/ios-simulator-plugin/commands/ios-dev.md +11 -0
  123. package/vendor/packages/ios-simulator-plugin/dist/lib/path.d.ts +4 -0
  124. package/vendor/packages/ios-simulator-plugin/dist/lib/path.js +18 -0
  125. package/vendor/packages/ios-simulator-plugin/dist/lib/result.d.ts +5 -0
  126. package/vendor/packages/ios-simulator-plugin/dist/lib/result.js +20 -0
  127. package/vendor/packages/ios-simulator-plugin/dist/lib/run.d.ts +17 -0
  128. package/vendor/packages/ios-simulator-plugin/dist/lib/run.js +83 -0
  129. package/vendor/packages/ios-simulator-plugin/dist/mcp/server.d.ts +3 -0
  130. package/vendor/packages/ios-simulator-plugin/dist/mcp/server.js +46833 -0
  131. package/vendor/packages/ios-simulator-plugin/dist/providers/build.d.ts +112 -0
  132. package/vendor/packages/ios-simulator-plugin/dist/providers/build.js +99 -0
  133. package/vendor/packages/ios-simulator-plugin/dist/providers/logs.d.ts +21 -0
  134. package/vendor/packages/ios-simulator-plugin/dist/providers/logs.js +26 -0
  135. package/vendor/packages/ios-simulator-plugin/dist/providers/preflight.d.ts +12 -0
  136. package/vendor/packages/ios-simulator-plugin/dist/providers/preflight.js +62 -0
  137. package/vendor/packages/ios-simulator-plugin/dist/providers/project.d.ts +35 -0
  138. package/vendor/packages/ios-simulator-plugin/dist/providers/project.js +288 -0
  139. package/vendor/packages/ios-simulator-plugin/dist/providers/screenshot.d.ts +22 -0
  140. package/vendor/packages/ios-simulator-plugin/dist/providers/screenshot.js +30 -0
  141. package/vendor/packages/ios-simulator-plugin/dist/providers/sim.d.ts +60 -0
  142. package/vendor/packages/ios-simulator-plugin/dist/providers/sim.js +116 -0
  143. package/vendor/packages/ios-simulator-plugin/dist/providers/ui.d.ts +57 -0
  144. package/vendor/packages/ios-simulator-plugin/dist/providers/ui.js +67 -0
  145. package/vendor/packages/ios-simulator-plugin/hooks/hooks.json +3 -0
  146. package/vendor/packages/ios-simulator-plugin/package.json +35 -0
  147. package/vendor/packages/ios-simulator-plugin/skills/ios-dev/SKILL.md +45 -0
  148. package/vendor/packages/ios-simulator-plugin/templates/swiftui-app/README.md +5 -0
  149. package/vendor/packages/restore-legacy-sessions-plugin/.zcode-plugin/plugin.json +9 -0
  150. package/vendor/packages/restore-legacy-sessions-plugin/README.md +35 -0
  151. package/vendor/packages/restore-legacy-sessions-plugin/commands/restore-legacy-sessions.md +11 -0
  152. package/vendor/packages/restore-legacy-sessions-plugin/package.json +8 -0
  153. package/vendor/packages/restore-legacy-sessions-plugin/skills/restore-legacy-sessions/SKILL.md +92 -0
  154. package/vendor/packages/restore-legacy-sessions-plugin/skills/restore-legacy-sessions/scripts/restore-conversation.mjs +648 -0
  155. package/vendor/packages/restore-legacy-sessions-plugin/skills/restore-legacy-sessions/scripts/scan-legacy-sessions.mjs +422 -0
  156. package/vendor/packages/skill-creator-plugin/.zcode-plugin/plugin.json +8 -0
  157. package/vendor/packages/skill-creator-plugin/package.json +8 -0
  158. package/vendor/packages/skill-creator-plugin/skills/skill-creator/SKILL.md +159 -0
  159. package/vendor/packages/zcode-guide-plugin/.zcode-plugin/plugin.json +8 -0
  160. package/vendor/packages/zcode-guide-plugin/README.md +22 -0
  161. package/vendor/packages/zcode-guide-plugin/package.json +8 -0
  162. package/vendor/packages/zcode-guide-plugin/skills/diagnosing-commands/SKILL.md +66 -0
  163. package/vendor/packages/zcode-guide-plugin/skills/diagnosing-hooks/SKILL.md +66 -0
  164. package/vendor/packages/zcode-guide-plugin/skills/diagnosing-mcp/SKILL.md +97 -0
  165. package/vendor/packages/zcode-guide-plugin/skills/diagnosing-plugins/SKILL.md +59 -0
  166. package/vendor/packages/zcode-guide-plugin/skills/diagnosing-skills/SKILL.md +61 -0
  167. package/vendor/packages/zcode-guide-plugin/skills/zcode-configuration-guide/SKILL.md +99 -0
  168. package/vendor/zcode.cjs +2926 -0
  169. package/zcode-runtime.lock.json +8 -0
@@ -0,0 +1,190 @@
1
+ % ═══════════════════════════════════════════════════════════
2
+ % AltaCV-Style Creative Resume Template
3
+ % Based on AltaCV by LianTze Lim, adapted for Tectonic
4
+ % ═══════════════════════════════════════════════════════════
5
+ \documentclass[10pt,a4paper]{article}
6
+
7
+ % ── Packages ──
8
+ \usepackage[margin=1.25cm,columnsep=1.2cm]{geometry}
9
+ \usepackage{paracol} % dual-column that breaks across pages
10
+ \usepackage[fixed]{fontawesome5}
11
+ \usepackage{tikz}
12
+ \usepackage{xcolor}
13
+ \usepackage{enumitem}
14
+ \usepackage{graphicx}
15
+ \usepackage{dashrule}
16
+ \usepackage[colorlinks=true,urlcolor=accent,linkcolor=accent,bookmarks=false]{hyperref}
17
+
18
+ % ── Colour System (change these to retheme) ──
19
+ \definecolor{accent}{HTML}{3B82F6} % blue — primary accent
20
+ \definecolor{emphasis}{HTML}{2E2E2E} % near-black — job titles, strong text
21
+ \definecolor{heading}{HTML}{1E293B} % dark slate — section headings
22
+ \definecolor{headingrule}{HTML}{3B82F6} % matches accent
23
+ \definecolor{body}{HTML}{4B5563} % gray-600 — body text
24
+ \definecolor{tagbg}{HTML}{EFF6FF} % light blue — tag background
25
+ \definecolor{subheading}{HTML}{3B82F6} % matches accent
26
+
27
+ % ── Fonts ──
28
+ \usepackage[rm]{roboto}
29
+ \usepackage[defaultsans]{lato}
30
+ \renewcommand{\familydefault}{\sfdefault}
31
+
32
+ % ── List Settings ──
33
+ \setlist{leftmargin=*,labelsep=0.5em,nosep,itemsep=0.25\baselineskip,after=\vspace{0.25\baselineskip}}
34
+ \setlist[itemize]{label={\small\textbullet}}
35
+
36
+ \setlength{\parindent}{0pt}
37
+
38
+ % ── Custom Commands ──
39
+
40
+ % Divider (dashed line between entries)
41
+ \newcommand{\divider}{\textcolor{body!30}{\hdashrule{\linewidth}{0.6pt}{0.5ex}}\medskip}
42
+
43
+ % Section heading with rule
44
+ \newcommand{\cvsection}[1]{%
45
+ \nointerlineskip\bigskip%
46
+ {\color{heading}\Large\bfseries\MakeUppercase{#1}}\\[-1ex]%
47
+ {\color{headingrule}\rule{\linewidth}{2pt}\par}\medskip
48
+ }
49
+
50
+ % Experience entry: {title}{company}{dates}{location}
51
+ \newcommand{\cvevent}[4]{%
52
+ {\large\color{emphasis}\bfseries #1\par}%
53
+ \smallskip\normalsize
54
+ \ifx&#2&\else{\textbf{\color{accent}#2}\par\smallskip}\fi%
55
+ \ifx&#3&\else{%
56
+ \small\makebox[0.5\linewidth][l]{\faCalendar[regular]~#3}%
57
+ }\fi%
58
+ \ifx&#4&\else{%
59
+ \small\makebox[0.5\linewidth][l]{\faMapMarker~#4}%
60
+ }\fi\par%
61
+ \medskip\normalsize
62
+ }
63
+
64
+ % Skill rating dots: {name}{level 1-5, supports X.5}
65
+ \newcommand{\cvskill}[2]{%
66
+ \textcolor{emphasis}{\textbf{#1}}\hfill
67
+ \foreach \x in {1,...,5}{%
68
+ \ifdimgreater{\x pt}{#2 pt}{\color{body!30}}{\color{accent}}\faCircle
69
+ }\par%
70
+ }
71
+
72
+ % Tag label (rounded rectangle)
73
+ \newcommand{\cvtag}[1]{%
74
+ \tikz[baseline]\node[anchor=base,draw=body!30,rounded corners,inner xsep=1ex,inner ysep=0.75ex,text height=1.5ex,text depth=.25ex]{#1};%
75
+ }
76
+
77
+ % Achievement: {icon}{title}{description}
78
+ \newcommand{\cvachievement}[3]{%
79
+ \begin{tabular}{@{}p{2em} @{\hspace{1ex}} p{\dimexpr\linewidth-3em}@{}}
80
+ {\Large\color{accent}#1} & \textbf{\color{emphasis}#2}\\
81
+ & {\small #3}
82
+ \end{tabular}%
83
+ \smallskip
84
+ }
85
+
86
+ % ═══════════════════════════════════════════════════════════
87
+ \begin{document}
88
+
89
+ % ── Header ──
90
+ \begin{center}
91
+ {\Huge\bfseries\color{heading} YOUR NAME}\par\medskip
92
+ {\large\bfseries\color{accent} Full-Stack Engineer | Open Source Contributor}\par\medskip
93
+ {\footnotesize\bfseries
94
+ \faAt~\href{mailto:name@email.com}{name@email.com}\hspace{2em}
95
+ \faPhone~+86 138-0000-0000\hspace{2em}
96
+ \faGithub~\href{https://github.com/username}{username}\hspace{2em}
97
+ \faLinkedin~\href{https://linkedin.com/in/username}{username}\hspace{2em}
98
+ \faMapMarker~Shanghai, China
99
+ }\par
100
+ \end{center}
101
+
102
+ \medskip
103
+
104
+ % ── Two Columns ──
105
+ \columnratio{0.62}
106
+ \begin{paracol}{2}
107
+
108
+ % ════════ LEFT COLUMN (Experience + Projects) ════════
109
+ \cvsection{Experience}
110
+
111
+ \cvevent{Senior Software Engineer}{Zhipu AI}{Jan 2022 -- Present}{Beijing}
112
+ \begin{itemize}
113
+ \item Architected real-time inference pipeline serving 10M+ daily requests with p99 latency < 50ms
114
+ \item Led migration from monolith to microservices, reducing deployment cycle from weekly to hourly
115
+ \item Designed A/B testing framework enabling 30\% faster feature iteration across 5 product teams
116
+ \end{itemize}
117
+
118
+ \divider
119
+
120
+ \cvevent{Software Engineer}{ByteDance}{Jul 2019 -- Dec 2021}{Beijing}
121
+ \begin{itemize}
122
+ \item Built recommendation engine (collaborative filtering + deep learning) improving CTR by 25\%
123
+ \item Implemented distributed training pipeline on 64-GPU cluster, reducing training time by 60\%
124
+ \end{itemize}
125
+
126
+ \cvsection{Projects}
127
+
128
+ \cvevent{Open Source Project}{\href{https://github.com/user/project}{github.com/user/project}}{}{}
129
+ \begin{itemize}
130
+ \item High-performance async HTTP framework — 5,000+ GitHub stars
131
+ \item Featured in Awesome-Go and HackerNews front page
132
+ \end{itemize}
133
+
134
+ % ════════ RIGHT COLUMN (Education + Skills + Languages) ════════
135
+ \switchcolumn
136
+
137
+ \cvsection{Education}
138
+
139
+ \cvevent{M.Sc. Computer Science}{Tsinghua University}{2017 -- 2019}{}
140
+ Thesis: Distributed Graph Processing\\
141
+ GPA: 3.8/4.0
142
+
143
+ \divider
144
+
145
+ \cvevent{B.Eng. Software Engineering}{Zhejiang University}{2013 -- 2017}{}
146
+
147
+ \cvsection{Skills}
148
+
149
+ \cvskill{Python}{5}
150
+ \divider
151
+ \cvskill{Go / Rust}{4}
152
+ \divider
153
+ \cvskill{System Design}{4.5}
154
+ \divider
155
+ \cvskill{Machine Learning}{3.5}
156
+
157
+ \medskip
158
+
159
+ \cvtag{Kubernetes}
160
+ \cvtag{Docker}
161
+ \cvtag{Kafka}\\
162
+ \cvtag{PostgreSQL}
163
+ \cvtag{Redis}
164
+ \cvtag{gRPC}\\
165
+ \cvtag{React}
166
+ \cvtag{TypeScript}
167
+ \cvtag{Terraform}
168
+
169
+ \cvsection{Languages}
170
+
171
+ \cvskill{English}{4.5}
172
+ \divider
173
+ \cvskill{Chinese (Native)}{5}
174
+
175
+ \cvsection{Highlights}
176
+
177
+ \cvachievement{\faTrophy}{ACM ICPC Regional Gold}{2016 Asia Regional Contest}
178
+ \divider
179
+ \cvachievement{\faGithub}{5,000+ Stars OSS}{Maintainer of popular async framework}
180
+
181
+ \end{paracol}
182
+
183
+ % ── PDF Metadata ──
184
+ \hypersetup{
185
+ pdftitle={Resume - Your Name},
186
+ pdfauthor={Z.ai},
187
+ pdfsubject={Professional Resume},
188
+ }
189
+
190
+ \end{document}
@@ -0,0 +1,367 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * cover_validate.js — Cover page overlap detection via Playwright rendering
4
+ *
5
+ * Detects text-vs-decorative-line overlap on cover HTML pages by:
6
+ * 1. Rendering the HTML in Playwright
7
+ * 2. Waiting for fonts to load
8
+ * 3. Measuring bounding boxes of text elements and decorative line elements
9
+ * 4. Checking for Y-axis overlap (minimum spacing = 1U = 5% of page width ≈ 30pt)
10
+ *
11
+ * Usage:
12
+ * node cover_validate.js cover.html
13
+ * node cover_validate.js cover.html --width 210mm --height 297mm
14
+ * node cover_validate.js cover.html --min-gap 30 # custom min gap in px (default: auto = 5% of width)
15
+ *
16
+ * Exit codes:
17
+ * 0 = no overlap issues found
18
+ * 1 = overlap detected (prints details to stderr)
19
+ * 2 = script error (missing file, browser launch failure, etc.)
20
+ *
21
+ * This script is ONLY for cover pages. Do NOT use it on:
22
+ * - Multi-page documents (use html2pdf-next.js pre-render checks)
23
+ * - Posters (use html2poster.js which handles overflow automatically)
24
+ */
25
+
26
+ 'use strict';
27
+
28
+ const fs = require('fs');
29
+ const path = require('path');
30
+
31
+ // ── Playwright import ──
32
+
33
+ let playwright;
34
+ try {
35
+ playwright = require('playwright');
36
+ } catch {
37
+ try {
38
+ playwright = require('playwright-core');
39
+ } catch {
40
+ console.error('✗ Neither playwright nor playwright-core is installed.');
41
+ process.exit(2);
42
+ }
43
+ }
44
+
45
+ // ── Chromium resolution (shared logic with html2poster.js) ──
46
+
47
+ function resolveChromium(chromiumObj) {
48
+ let exe;
49
+ try { exe = chromiumObj.executablePath(); } catch (_) { exe = null; }
50
+ if (exe && fs.existsSync(exe)) return { status: 'ok', executablePath: exe };
51
+
52
+ const candidates = [
53
+ '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
54
+ '/Applications/Chromium.app/Contents/MacOS/Chromium',
55
+ '/usr/bin/chromium-browser', '/usr/bin/chromium', '/usr/bin/google-chrome',
56
+ ];
57
+ if (process.env.PLAYWRIGHT_CHROMIUM_PATH) candidates.unshift(process.env.PLAYWRIGHT_CHROMIUM_PATH);
58
+
59
+ for (const c of candidates) {
60
+ if (fs.existsSync(c)) return { status: 'fallback', executablePath: c };
61
+ }
62
+ return { status: 'missing', executablePath: exe || '' };
63
+ }
64
+
65
+ // ── CLI parsing ──
66
+
67
+ function parseArgs(argv) {
68
+ const tokens = argv.slice(2);
69
+ let input = null, width = '210mm', height = '297mm', minGap = null;
70
+
71
+ for (let i = 0; i < tokens.length; i++) {
72
+ const t = tokens[i];
73
+ if (t === '--width') width = tokens[++i];
74
+ else if (t === '--height') height = tokens[++i];
75
+ else if (t === '--min-gap') minGap = parseFloat(tokens[++i]);
76
+ else if (t === '--help' || t === '-h') {
77
+ console.log(`Usage: node cover_validate.js <cover.html> [options]
78
+
79
+ Options:
80
+ --width <val> Page width (default: 210mm)
81
+ --height <val> Page height (default: 297mm)
82
+ --min-gap <px> Minimum gap between text and decorative lines (default: 5% of width)
83
+ --help Show this help`);
84
+ process.exit(0);
85
+ } else if (!t.startsWith('-') && !input) {
86
+ input = t;
87
+ }
88
+ }
89
+ return { input, width, height, minGap };
90
+ }
91
+
92
+ // ── Convert CSS dimension string to px for viewport ──
93
+
94
+ function dimToPx(dim) {
95
+ if (!dim) return null;
96
+ const s = String(dim).trim();
97
+ const num = parseFloat(s);
98
+ if (s.endsWith('mm')) return Math.round(num * 3.7795); // 1mm ≈ 3.7795px at 96dpi
99
+ if (s.endsWith('cm')) return Math.round(num * 37.795);
100
+ if (s.endsWith('in')) return Math.round(num * 96);
101
+ if (s.endsWith('px') || !isNaN(num)) return Math.round(num);
102
+ return null;
103
+ }
104
+
105
+ // ── Decorative line detection heuristics ──
106
+ // A decorative line is an element that:
107
+ // - Is very thin in one dimension (height ≤ 5px or width ≤ 5px)
108
+ // - OR is an <hr> element
109
+ // - OR has a large aspect ratio (> 10:1 or < 1:10)
110
+ // - AND is not inside a text element
111
+
112
+ const DECORATIVE_LINE_DETECTION = `
113
+ (function detectOverlaps(minGapPx) {
114
+ // Collect all elements
115
+ const allElements = document.querySelectorAll('*');
116
+
117
+ const textElements = [];
118
+ const lineElements = [];
119
+
120
+ // Classify elements
121
+ for (const el of allElements) {
122
+ const rect = el.getBoundingClientRect();
123
+ if (rect.width === 0 || rect.height === 0) continue;
124
+
125
+ const tag = el.tagName.toLowerCase();
126
+ const style = getComputedStyle(el);
127
+
128
+ // Skip invisible elements
129
+ if (style.display === 'none' || style.visibility === 'hidden' || style.opacity === '0') continue;
130
+
131
+ // Detect decorative lines
132
+ const isHR = tag === 'hr';
133
+ const isThinH = rect.height <= 5 && rect.width > 20; // thin horizontal line
134
+ const isThinV = rect.width <= 5 && rect.height > 20; // thin vertical line
135
+ const aspectH = rect.width / rect.height;
136
+ const aspectV = rect.height / rect.width;
137
+ const isWideRatio = aspectH > 15 && rect.height <= 8; // very wide, very thin
138
+ const isTallRatio = aspectV > 15 && rect.width <= 8; // very tall, very thin
139
+
140
+ // Check if element has only border (no text content, no background image)
141
+ const hasOnlyBorder = (
142
+ el.textContent.trim() === '' &&
143
+ style.backgroundImage === 'none' &&
144
+ (style.borderTopWidth !== '0px' || style.borderBottomWidth !== '0px' ||
145
+ style.borderLeftWidth !== '0px' || style.borderRightWidth !== '0px')
146
+ );
147
+ const isBorderLine = hasOnlyBorder && (rect.height <= 8 || rect.width <= 8);
148
+
149
+ if (isHR || isThinH || isThinV || isWideRatio || isTallRatio || isBorderLine) {
150
+ lineElements.push({
151
+ tag: tag,
152
+ class: el.className || '',
153
+ rect: { x: rect.x, y: rect.y, width: rect.width, height: rect.height },
154
+ type: isThinH || isWideRatio ? 'horizontal' : (isThinV || isTallRatio ? 'vertical' : (rect.width >= rect.height ? 'horizontal' : 'vertical')),
155
+ });
156
+ continue;
157
+ }
158
+
159
+ // Detect text elements (has direct text content or is a heading/paragraph)
160
+ const textTags = ['h1','h2','h3','h4','h5','h6','p','span','a','li','td','th','label','summary'];
161
+ const hasDirectText = Array.from(el.childNodes).some(n => n.nodeType === 3 && n.textContent.trim());
162
+
163
+ if (textTags.includes(tag) || hasDirectText) {
164
+ // Skip if this is inside a decorative element
165
+ if (rect.height < 3) continue;
166
+
167
+ textElements.push({
168
+ tag: tag,
169
+ class: el.className || '',
170
+ text: el.textContent.trim().substring(0, 60),
171
+ rect: { x: rect.x, y: rect.y, width: rect.width, height: rect.height },
172
+ });
173
+ }
174
+ }
175
+
176
+ // De-duplicate: if a parent and child text element both overlap the same line,
177
+ // only keep the more specific (smaller) one to avoid duplicate reports.
178
+ // Sort text elements by area (smallest first) so we can skip parents.
179
+ textElements.sort((a, b) => (a.rect.width * a.rect.height) - (b.rect.width * b.rect.height));
180
+
181
+ // Check overlaps between text elements and line elements
182
+ const overlaps = [];
183
+ const reportedPairs = new Set(); // track "lineIndex:textContent" to deduplicate
184
+
185
+ for (const text of textElements) {
186
+ for (const line of lineElements) {
187
+ const tr = text.rect;
188
+ const lr = line.rect;
189
+
190
+ if (line.type === 'horizontal') {
191
+ // Check vertical overlap/proximity
192
+ const textTop = tr.y;
193
+ const textBottom = tr.y + tr.height;
194
+ const lineTop = lr.y;
195
+ const lineBottom = lr.y + lr.height;
196
+
197
+ // Check horizontal overlap (they must share some X range)
198
+ const xOverlap = !(tr.x + tr.width < lr.x || lr.x + lr.width < tr.x);
199
+ if (!xOverlap) continue;
200
+
201
+ // Calculate vertical gap
202
+ let vGap;
203
+ if (lineTop >= textBottom) {
204
+ vGap = lineTop - textBottom; // line is below text
205
+ } else if (textTop >= lineBottom) {
206
+ vGap = textTop - lineBottom; // line is above text
207
+ } else {
208
+ vGap = 0; // overlapping
209
+ }
210
+
211
+ if (vGap < minGapPx) {
212
+ // De-dup: same line region, only report the smallest (most specific) text element
213
+ const lineKey = 'h:' + Math.round(lr.x) + ',' + Math.round(lr.y);
214
+ if (!reportedPairs.has(lineKey)) {
215
+ reportedPairs.add(lineKey);
216
+ overlaps.push({
217
+ text: text.text,
218
+ textTag: text.tag,
219
+ textClass: text.class,
220
+ textRect: tr,
221
+ lineTag: line.tag,
222
+ lineClass: line.class,
223
+ lineRect: lr,
224
+ lineType: line.type,
225
+ gap: Math.round(vGap * 10) / 10,
226
+ required: minGapPx,
227
+ });
228
+ }
229
+ }
230
+ } else if (line.type === 'vertical') {
231
+ // Check horizontal overlap/proximity
232
+ const textLeft = tr.x;
233
+ const textRight = tr.x + tr.width;
234
+ const lineLeft = lr.x;
235
+ const lineRight = lr.x + lr.width;
236
+
237
+ // Check vertical overlap (they must share some Y range)
238
+ const yOverlap = !(tr.y + tr.height < lr.y || lr.y + lr.height < tr.y);
239
+ if (!yOverlap) continue;
240
+
241
+ // Calculate horizontal gap
242
+ let hGap;
243
+ if (lineLeft >= textRight) {
244
+ hGap = lineLeft - textRight;
245
+ } else if (textLeft >= lineRight) {
246
+ hGap = textLeft - lineRight;
247
+ } else {
248
+ hGap = 0;
249
+ }
250
+
251
+ if (hGap < minGapPx) {
252
+ const lineKey = 'v:' + Math.round(lr.x) + ',' + Math.round(lr.y);
253
+ if (!reportedPairs.has(lineKey)) {
254
+ reportedPairs.add(lineKey);
255
+ overlaps.push({
256
+ text: text.text,
257
+ textTag: text.tag,
258
+ textClass: text.class,
259
+ textRect: tr,
260
+ lineTag: line.tag,
261
+ lineClass: line.class,
262
+ lineRect: lr,
263
+ lineType: line.type,
264
+ gap: Math.round(hGap * 10) / 10,
265
+ required: minGapPx,
266
+ });
267
+ }
268
+ }
269
+ }
270
+ }
271
+ }
272
+
273
+ return {
274
+ textElements: textElements.length,
275
+ lineElements: lineElements.length,
276
+ overlaps: overlaps,
277
+ };
278
+ })
279
+ `;
280
+
281
+ // ── Main ──
282
+
283
+ async function main() {
284
+ const { input, width, height, minGap } = parseArgs(process.argv);
285
+
286
+ if (!input) {
287
+ console.error('✗ No input file specified. Usage: node cover_validate.js cover.html');
288
+ process.exit(2);
289
+ }
290
+
291
+ const absIn = path.resolve(input);
292
+ if (!fs.existsSync(absIn)) {
293
+ console.error(`✗ File not found: ${absIn}`);
294
+ process.exit(2);
295
+ }
296
+
297
+ const widthPx = dimToPx(width) || 794; // A4 width in px
298
+ const heightPx = dimToPx(height) || 1123; // A4 height in px
299
+ const gap = minGap || Math.round(widthPx * 0.05); // 1U = 5% of page width
300
+
301
+ console.log(`🔍 cover_validate — Cover overlap detection`);
302
+ console.log(` Input: ${absIn}`);
303
+ console.log(` Page: ${widthPx}×${heightPx}px`);
304
+ console.log(` Min gap: ${gap}px (1U)`);
305
+
306
+ const { chromium } = playwright;
307
+ const bInfo = resolveChromium(chromium);
308
+
309
+ if (bInfo.status === 'missing') {
310
+ console.error('✗ No Chromium found. Install via: npx playwright install chromium');
311
+ process.exit(2);
312
+ }
313
+
314
+ let browser;
315
+ try {
316
+ const opts = { headless: true };
317
+ if (bInfo.status === 'fallback') opts.executablePath = bInfo.executablePath;
318
+ browser = await chromium.launch(opts);
319
+ } catch (err) {
320
+ console.error(`✗ Browser launch failed: ${err.message}`);
321
+ process.exit(2);
322
+ }
323
+
324
+ try {
325
+ const page = await browser.newPage({ viewport: { width: widthPx, height: heightPx } });
326
+ await page.goto('file://' + absIn, { waitUntil: 'networkidle' });
327
+ console.log(` ✓ HTML loaded`);
328
+
329
+ // Wait for fonts
330
+ const fontsLoaded = await page.evaluate(() =>
331
+ document.fonts.ready.then(() => document.fonts.size)
332
+ ).catch(() => 0);
333
+ console.log(` ✓ Fonts: ${fontsLoaded} loaded`);
334
+
335
+ // Run overlap detection
336
+ const result = await page.evaluate(`(${DECORATIVE_LINE_DETECTION})(${gap})`);
337
+
338
+ console.log(` ✓ Found ${result.textElements} text elements, ${result.lineElements} decorative lines`);
339
+
340
+ if (result.overlaps.length === 0) {
341
+ console.log(`\n ✅ No overlap issues found`);
342
+ process.exit(0);
343
+ }
344
+
345
+ // Report overlaps
346
+ console.error(`\n ❌ Found ${result.overlaps.length} text-line overlap(s):\n`);
347
+
348
+ for (const o of result.overlaps) {
349
+ const direction = o.lineType === 'vertical' ? 'horizontal' : 'vertical';
350
+ console.error(` ERROR: ${direction} gap = ${o.gap}px (required ≥ ${o.required}px)`);
351
+ console.error(` Text: <${o.textTag}> "${o.text}" @ y=${Math.round(o.textRect.y)}-${Math.round(o.textRect.y + o.textRect.height)}`);
352
+ console.error(` Line: <${o.lineTag}${o.lineClass ? '.' + o.lineClass.split(' ')[0] : ''}> [${o.lineType}] @ y=${Math.round(o.lineRect.y)}-${Math.round(o.lineRect.y + o.lineRect.height)}`);
353
+ console.error(` Fix: Move the decorative line at least ${Math.ceil(o.required - o.gap)}px away from the text.`);
354
+ console.error('');
355
+ }
356
+
357
+ process.exit(1);
358
+
359
+ } finally {
360
+ await browser.close();
361
+ }
362
+ }
363
+
364
+ main().catch(err => {
365
+ console.error(`✗ Unexpected error: ${err.message}`);
366
+ process.exit(2);
367
+ });