docrev 0.10.1 → 0.11.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.
Files changed (167) hide show
  1. package/.gitattributes +1 -1
  2. package/CHANGELOG.md +184 -173
  3. package/PLAN-tables-and-postprocess.md +850 -850
  4. package/README.md +431 -431
  5. package/bin/rev.js +11 -11
  6. package/bin/rev.ts +145 -145
  7. package/completions/rev.bash +127 -127
  8. package/completions/rev.ps1 +210 -210
  9. package/completions/rev.zsh +207 -207
  10. package/dist/lib/anchor-match.d.ts +4 -2
  11. package/dist/lib/anchor-match.d.ts.map +1 -1
  12. package/dist/lib/anchor-match.js +52 -24
  13. package/dist/lib/anchor-match.js.map +1 -1
  14. package/dist/lib/annotations.d.ts +0 -6
  15. package/dist/lib/annotations.d.ts.map +1 -1
  16. package/dist/lib/annotations.js +26 -8
  17. package/dist/lib/annotations.js.map +1 -1
  18. package/dist/lib/build.d.ts.map +1 -1
  19. package/dist/lib/build.js +13 -10
  20. package/dist/lib/build.js.map +1 -1
  21. package/dist/lib/commands/build.d.ts.map +1 -1
  22. package/dist/lib/commands/build.js +5 -0
  23. package/dist/lib/commands/build.js.map +1 -1
  24. package/dist/lib/commands/doi.d.ts.map +1 -1
  25. package/dist/lib/commands/doi.js +14 -2
  26. package/dist/lib/commands/doi.js.map +1 -1
  27. package/dist/lib/commands/sync.d.ts.map +1 -1
  28. package/dist/lib/commands/sync.js +98 -107
  29. package/dist/lib/commands/sync.js.map +1 -1
  30. package/dist/lib/commands/utilities.js +164 -164
  31. package/dist/lib/commands/word-tools.js +8 -8
  32. package/dist/lib/comment-realign.d.ts +12 -21
  33. package/dist/lib/comment-realign.d.ts.map +1 -1
  34. package/dist/lib/comment-realign.js +40 -348
  35. package/dist/lib/comment-realign.js.map +1 -1
  36. package/dist/lib/dependencies.d.ts +10 -0
  37. package/dist/lib/dependencies.d.ts.map +1 -1
  38. package/dist/lib/dependencies.js +41 -9
  39. package/dist/lib/dependencies.js.map +1 -1
  40. package/dist/lib/doi.d.ts.map +1 -1
  41. package/dist/lib/doi.js +68 -80
  42. package/dist/lib/doi.js.map +1 -1
  43. package/dist/lib/errors.d.ts.map +1 -1
  44. package/dist/lib/errors.js +3 -1
  45. package/dist/lib/errors.js.map +1 -1
  46. package/dist/lib/grammar.js +3 -3
  47. package/dist/lib/import.d.ts +7 -4
  48. package/dist/lib/import.d.ts.map +1 -1
  49. package/dist/lib/import.js +58 -62
  50. package/dist/lib/import.js.map +1 -1
  51. package/dist/lib/macro-filter.lua +201 -201
  52. package/dist/lib/ooxml.d.ts +207 -0
  53. package/dist/lib/ooxml.d.ts.map +1 -0
  54. package/dist/lib/ooxml.js +634 -0
  55. package/dist/lib/ooxml.js.map +1 -0
  56. package/dist/lib/pdf-comments.js +44 -44
  57. package/dist/lib/plugins.js +57 -57
  58. package/dist/lib/pptx-color-filter.lua +37 -37
  59. package/dist/lib/pptx-themes.js +115 -115
  60. package/dist/lib/rate-limiter.d.ts +8 -0
  61. package/dist/lib/rate-limiter.d.ts.map +1 -1
  62. package/dist/lib/rate-limiter.js +41 -4
  63. package/dist/lib/rate-limiter.js.map +1 -1
  64. package/dist/lib/sections.d.ts.map +1 -1
  65. package/dist/lib/sections.js +5 -2
  66. package/dist/lib/sections.js.map +1 -1
  67. package/dist/lib/spelling.js +2 -2
  68. package/dist/lib/templates.js +387 -387
  69. package/dist/lib/themes.js +51 -51
  70. package/dist/lib/types.d.ts +9 -1
  71. package/dist/lib/types.d.ts.map +1 -1
  72. package/dist/lib/word-extraction.d.ts.map +1 -1
  73. package/dist/lib/word-extraction.js +48 -307
  74. package/dist/lib/word-extraction.js.map +1 -1
  75. package/dist/lib/word.d.ts.map +1 -1
  76. package/dist/lib/word.js +80 -175
  77. package/dist/lib/word.js.map +1 -1
  78. package/dist/lib/wordcomments.d.ts.map +1 -1
  79. package/dist/lib/wordcomments.js +53 -92
  80. package/dist/lib/wordcomments.js.map +1 -1
  81. package/docs-src/build.py +113 -113
  82. package/docs-src/extra.css +208 -208
  83. package/docs-src/md-to-html.lua +6 -6
  84. package/docs-src/template.html +116 -116
  85. package/eslint.config.js +27 -27
  86. package/lib/anchor-match.ts +307 -276
  87. package/lib/annotations.ts +664 -644
  88. package/lib/build.ts +1770 -1766
  89. package/lib/citations.ts +160 -160
  90. package/lib/commands/build.ts +860 -855
  91. package/lib/commands/citations.ts +515 -515
  92. package/lib/commands/comments.ts +1050 -1050
  93. package/lib/commands/context.ts +176 -176
  94. package/lib/commands/core.ts +309 -309
  95. package/lib/commands/doi.ts +451 -435
  96. package/lib/commands/file-ops.ts +372 -372
  97. package/lib/commands/history.ts +320 -320
  98. package/lib/commands/index.ts +87 -87
  99. package/lib/commands/init.ts +259 -259
  100. package/lib/commands/merge-resolve.ts +378 -378
  101. package/lib/commands/preview.ts +178 -178
  102. package/lib/commands/project-info.ts +244 -244
  103. package/lib/commands/quality.ts +517 -517
  104. package/lib/commands/response.ts +454 -454
  105. package/lib/commands/section-boundaries.ts +82 -82
  106. package/lib/commands/sections.ts +451 -451
  107. package/lib/commands/sync.ts +689 -709
  108. package/lib/commands/text-ops.ts +449 -449
  109. package/lib/commands/utilities.ts +448 -448
  110. package/lib/commands/verify-anchors.ts +272 -272
  111. package/lib/commands/word-tools.ts +340 -340
  112. package/lib/comment-realign.ts +99 -517
  113. package/lib/config.ts +84 -84
  114. package/lib/crossref.ts +781 -781
  115. package/lib/csl.ts +191 -191
  116. package/lib/dependencies.ts +132 -98
  117. package/lib/diff-engine.ts +465 -465
  118. package/lib/doi-cache.ts +115 -115
  119. package/lib/doi.ts +879 -897
  120. package/lib/equations.ts +506 -506
  121. package/lib/errors.ts +350 -346
  122. package/lib/format.ts +541 -541
  123. package/lib/git.ts +326 -326
  124. package/lib/grammar.ts +303 -303
  125. package/lib/image-registry.ts +180 -180
  126. package/lib/import.ts +906 -911
  127. package/lib/journals.ts +543 -543
  128. package/lib/macro-filter.lua +201 -201
  129. package/lib/macros.ts +273 -273
  130. package/lib/merge.ts +633 -633
  131. package/lib/ooxml.ts +768 -0
  132. package/lib/orcid.ts +144 -144
  133. package/lib/pdf-comments.ts +263 -263
  134. package/lib/pdf-import.ts +524 -524
  135. package/lib/plugins.ts +362 -362
  136. package/lib/postprocess.ts +188 -188
  137. package/lib/pptx-color-filter.lua +37 -37
  138. package/lib/pptx-template.ts +469 -469
  139. package/lib/pptx-themes.ts +483 -483
  140. package/lib/protect-restore.ts +520 -520
  141. package/lib/rate-limiter.ts +127 -94
  142. package/lib/response.ts +197 -197
  143. package/lib/restore-references.ts +240 -240
  144. package/lib/review.ts +327 -327
  145. package/lib/schema.ts +488 -488
  146. package/lib/scientific-words.ts +73 -73
  147. package/lib/sections.ts +428 -425
  148. package/lib/slides.ts +756 -756
  149. package/lib/spelling.ts +334 -334
  150. package/lib/templates.ts +526 -526
  151. package/lib/themes.ts +742 -742
  152. package/lib/trackchanges.ts +247 -247
  153. package/lib/tui.ts +450 -450
  154. package/lib/types.ts +558 -550
  155. package/lib/undo.ts +250 -250
  156. package/lib/utils.ts +69 -69
  157. package/lib/variables.ts +179 -179
  158. package/lib/word-extraction.ts +525 -806
  159. package/lib/word.ts +526 -643
  160. package/lib/wordcomments.ts +789 -840
  161. package/mkdocs.yml +64 -64
  162. package/package.json +137 -137
  163. package/scripts/postbuild.js +47 -47
  164. package/skill/REFERENCE.md +539 -539
  165. package/skill/SKILL.md +295 -295
  166. package/tsconfig.json +26 -26
  167. package/types/index.d.ts +525 -525
@@ -8,42 +8,42 @@ import { escapeLatex } from './utils.js';
8
8
  * LaTeX preamble for margin comments
9
9
  * Uses todonotes package with custom styling
10
10
  */
11
- export const MARGIN_NOTES_PREAMBLE = `
12
- % Margin notes for comments
13
- \\usepackage[colorinlistoftodos,textsize=scriptsize]{todonotes}
14
- \\usepackage{xcolor}
15
-
16
- % Define comment colors by author
17
- \\definecolor{commentblue}{RGB}{59, 130, 246}
18
- \\definecolor{commentgreen}{RGB}{34, 197, 94}
19
- \\definecolor{commentorange}{RGB}{249, 115, 22}
20
- \\definecolor{commentpurple}{RGB}{168, 85, 247}
21
- \\definecolor{commentgray}{RGB}{107, 114, 128}
22
-
23
- % Custom margin note command
24
- \\newcommand{\\margincomment}[2][]{%
25
- \\todo[linecolor=commentblue,backgroundcolor=commentblue!10,bordercolor=commentblue,size=\\scriptsize,#1]{#2}%
26
- }
27
-
28
- % Author-specific commands
29
- \\newcommand{\\reviewercomment}[2]{%
30
- \\todo[linecolor=commentgreen,backgroundcolor=commentgreen!10,bordercolor=commentgreen,size=\\scriptsize]{\\textbf{#1:} #2}%
31
- }
32
-
33
- % Increase margin for notes (if needed)
34
- % \\setlength{\\marginparwidth}{2.5cm}
11
+ export const MARGIN_NOTES_PREAMBLE = `
12
+ % Margin notes for comments
13
+ \\usepackage[colorinlistoftodos,textsize=scriptsize]{todonotes}
14
+ \\usepackage{xcolor}
15
+
16
+ % Define comment colors by author
17
+ \\definecolor{commentblue}{RGB}{59, 130, 246}
18
+ \\definecolor{commentgreen}{RGB}{34, 197, 94}
19
+ \\definecolor{commentorange}{RGB}{249, 115, 22}
20
+ \\definecolor{commentpurple}{RGB}{168, 85, 247}
21
+ \\definecolor{commentgray}{RGB}{107, 114, 128}
22
+
23
+ % Custom margin note command
24
+ \\newcommand{\\margincomment}[2][]{%
25
+ \\todo[linecolor=commentblue,backgroundcolor=commentblue!10,bordercolor=commentblue,size=\\scriptsize,#1]{#2}%
26
+ }
27
+
28
+ % Author-specific commands
29
+ \\newcommand{\\reviewercomment}[2]{%
30
+ \\todo[linecolor=commentgreen,backgroundcolor=commentgreen!10,bordercolor=commentgreen,size=\\scriptsize]{\\textbf{#1:} #2}%
31
+ }
32
+
33
+ % Increase margin for notes (if needed)
34
+ % \\setlength{\\marginparwidth}{2.5cm}
35
35
  `;
36
36
  /**
37
37
  * Simpler preamble using marginpar (no extra packages needed)
38
38
  */
39
- export const SIMPLE_MARGIN_PREAMBLE = `
40
- % Simple margin notes for comments
41
- \\usepackage{xcolor}
42
- \\definecolor{commentcolor}{RGB}{59, 130, 246}
43
-
44
- \\newcommand{\\margincomment}[1]{%
45
- \\marginpar{\\raggedright\\scriptsize\\textcolor{commentcolor}{#1}}%
46
- }
39
+ export const SIMPLE_MARGIN_PREAMBLE = `
40
+ % Simple margin notes for comments
41
+ \\usepackage{xcolor}
42
+ \\definecolor{commentcolor}{RGB}{59, 130, 246}
43
+
44
+ \\newcommand{\\margincomment}[1]{%
45
+ \\marginpar{\\raggedright\\scriptsize\\textcolor{commentcolor}{#1}}%
46
+ }
47
47
  `;
48
48
  /**
49
49
  * Convert CriticMarkup comments to LaTeX margin notes
@@ -110,12 +110,12 @@ export function convertTrackChangesToLatex(markdown) {
110
110
  result = result.replace(/\{~~([^~]+)~>([^~]+)~~\}/g, (match, oldText, newText) => {
111
111
  return `\\textcolor{red}{\\sout{${escapeLatex(oldText)}}}\\textcolor{green}{${escapeLatex(newText)}}`;
112
112
  });
113
- const preamble = `
114
- % Track changes visualization
115
- \\usepackage{xcolor}
116
- \\usepackage[normalem]{ulem}
117
- \\definecolor{green}{RGB}{34, 197, 94}
118
- \\definecolor{red}{RGB}{239, 68, 68}
113
+ const preamble = `
114
+ % Track changes visualization
115
+ \\usepackage{xcolor}
116
+ \\usepackage[normalem]{ulem}
117
+ \\definecolor{green}{RGB}{34, 197, 94}
118
+ \\definecolor{red}{RGB}{239, 68, 68}
119
119
  `;
120
120
  return { markdown: result, preamble };
121
121
  }
@@ -131,16 +131,16 @@ export function getCombinedPreamble(options = {}) {
131
131
  preamble += useTodonotes ? MARGIN_NOTES_PREAMBLE : SIMPLE_MARGIN_PREAMBLE;
132
132
  }
133
133
  if (trackChanges) {
134
- preamble += `
135
- % Track changes visualization
136
- \\usepackage[normalem]{ulem}
134
+ preamble += `
135
+ % Track changes visualization
136
+ \\usepackage[normalem]{ulem}
137
137
  `;
138
138
  if (!comments) {
139
139
  preamble += `\\usepackage{xcolor}\n`;
140
140
  }
141
- preamble += `
142
- \\definecolor{insertgreen}{RGB}{34, 197, 94}
143
- \\definecolor{deletered}{RGB}{239, 68, 68}
141
+ preamble += `
142
+ \\definecolor{insertgreen}{RGB}{34, 197, 94}
143
+ \\definecolor{deletered}{RGB}{239, 68, 68}
144
144
  `;
145
145
  }
146
146
  return preamble;
@@ -128,63 +128,63 @@ export function getPluginDirs() {
128
128
  */
129
129
  export function createProfileTemplate(journalName) {
130
130
  const id = journalName.toLowerCase().replace(/\s+/g, '-');
131
- return `# Custom journal profile for ${journalName}
132
- # Save as: ~/.rev/profiles/${id}.yaml (user-wide)
133
- # Or: .rev/profiles/${id}.yaml (project-specific)
134
-
135
- id: ${id}
136
- name: "${journalName}"
137
- url: "https://journal-website.com/author-guidelines"
138
-
139
- # Word count limits
140
- wordLimit:
141
- main: 8000 # null for no limit
142
- abstract: 300
143
- title: null # characters
144
-
145
- # Reference requirements
146
- references:
147
- max: null # null for no limit
148
- doiRequired: true
149
-
150
- # Figure/table limits
151
- figures:
152
- max: 8
153
- combinedWithTables: false
154
-
155
- # Required sections
156
- sections:
157
- required:
158
- - Abstract
159
- - Introduction
160
- - Methods
161
- - Results
162
- - Discussion
163
- methodsPosition: null # 'end' or 'before-results'
164
-
165
- # Keywords
166
- keywords:
167
- min: 4
168
- max: 8
169
-
170
- # Other requirements
171
- dataAvailability: true
172
- highlights: false
173
- graphicalAbstract: false
174
-
175
- # Build formatting defaults (applied via rev build -j ${id})
176
- # formatting:
177
- # csl: "${id}" # CSL style name or path
178
- # pdf:
179
- # fontsize: 12pt
180
- # geometry: margin=1in
181
- # linestretch: 1.5
182
- # numbersections: false
183
- # docx:
184
- # reference: null # Path to reference .docx template
185
- # crossref:
186
- # figPrefix: [Fig., Figs.]
187
- # tblPrefix: [Table, Tables]
131
+ return `# Custom journal profile for ${journalName}
132
+ # Save as: ~/.rev/profiles/${id}.yaml (user-wide)
133
+ # Or: .rev/profiles/${id}.yaml (project-specific)
134
+
135
+ id: ${id}
136
+ name: "${journalName}"
137
+ url: "https://journal-website.com/author-guidelines"
138
+
139
+ # Word count limits
140
+ wordLimit:
141
+ main: 8000 # null for no limit
142
+ abstract: 300
143
+ title: null # characters
144
+
145
+ # Reference requirements
146
+ references:
147
+ max: null # null for no limit
148
+ doiRequired: true
149
+
150
+ # Figure/table limits
151
+ figures:
152
+ max: 8
153
+ combinedWithTables: false
154
+
155
+ # Required sections
156
+ sections:
157
+ required:
158
+ - Abstract
159
+ - Introduction
160
+ - Methods
161
+ - Results
162
+ - Discussion
163
+ methodsPosition: null # 'end' or 'before-results'
164
+
165
+ # Keywords
166
+ keywords:
167
+ min: 4
168
+ max: 8
169
+
170
+ # Other requirements
171
+ dataAvailability: true
172
+ highlights: false
173
+ graphicalAbstract: false
174
+
175
+ # Build formatting defaults (applied via rev build -j ${id})
176
+ # formatting:
177
+ # csl: "${id}" # CSL style name or path
178
+ # pdf:
179
+ # fontsize: 12pt
180
+ # geometry: margin=1in
181
+ # linestretch: 1.5
182
+ # numbersections: false
183
+ # docx:
184
+ # reference: null # Path to reference .docx template
185
+ # crossref:
186
+ # figPrefix: [Fig., Figs.]
187
+ # tblPrefix: [Table, Tables]
188
188
  `;
189
189
  }
190
190
  /**
@@ -1,37 +1,37 @@
1
- -- Pandoc Lua filter to add color support for PPTX
2
- -- Handles [text]{color=#RRGGBB} syntax
3
-
4
- function Span(elem)
5
- local color = elem.attributes['color']
6
- if color then
7
- -- Remove # if present
8
- color = color:gsub('^#', '')
9
-
10
- -- Create raw OpenXML for colored text
11
- local content_text = pandoc.utils.stringify(elem.content)
12
-
13
- -- Check if content has bold
14
- local is_bold = false
15
- for _, item in ipairs(elem.content) do
16
- if item.t == 'Strong' then
17
- is_bold = true
18
- content_text = pandoc.utils.stringify(item.content)
19
- break
20
- end
21
- end
22
-
23
- local bold_attr = ''
24
- if is_bold then
25
- bold_attr = ' b="1"'
26
- end
27
-
28
- -- Return raw OOXML span with color
29
- local ooxml = string.format(
30
- '<a:r><a:rPr%s><a:solidFill><a:srgbClr val="%s"/></a:solidFill></a:rPr><a:t>%s</a:t></a:r>',
31
- bold_attr, color, content_text
32
- )
33
-
34
- return pandoc.RawInline('openxml', ooxml)
35
- end
36
- return elem
37
- end
1
+ -- Pandoc Lua filter to add color support for PPTX
2
+ -- Handles [text]{color=#RRGGBB} syntax
3
+
4
+ function Span(elem)
5
+ local color = elem.attributes['color']
6
+ if color then
7
+ -- Remove # if present
8
+ color = color:gsub('^#', '')
9
+
10
+ -- Create raw OpenXML for colored text
11
+ local content_text = pandoc.utils.stringify(elem.content)
12
+
13
+ -- Check if content has bold
14
+ local is_bold = false
15
+ for _, item in ipairs(elem.content) do
16
+ if item.t == 'Strong' then
17
+ is_bold = true
18
+ content_text = pandoc.utils.stringify(item.content)
19
+ break
20
+ end
21
+ end
22
+
23
+ local bold_attr = ''
24
+ if is_bold then
25
+ bold_attr = ' b="1"'
26
+ end
27
+
28
+ -- Return raw OOXML span with color
29
+ local ooxml = string.format(
30
+ '<a:r><a:rPr%s><a:solidFill><a:srgbClr val="%s"/></a:solidFill></a:rPr><a:t>%s</a:t></a:r>',
31
+ bold_attr, color, content_text
32
+ )
33
+
34
+ return pandoc.RawInline('openxml', ooxml)
35
+ end
36
+ return elem
37
+ end
@@ -175,58 +175,58 @@ export function getTheme(name) {
175
175
  * Generate [Content_Types].xml
176
176
  */
177
177
  function generateContentTypes() {
178
- return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
179
- <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
180
- <Default Extension="jpeg" ContentType="image/jpeg"/>
181
- <Default Extension="png" ContentType="image/png"/>
182
- <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
183
- <Default Extension="xml" ContentType="application/xml"/>
184
- <Override PartName="/ppt/presentation.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml"/>
185
- <Override PartName="/ppt/slideMasters/slideMaster1.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml"/>
186
- <Override PartName="/ppt/slideLayouts/slideLayout1.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"/>
187
- <Override PartName="/ppt/slideLayouts/slideLayout2.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"/>
188
- <Override PartName="/ppt/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/>
189
- <Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/>
190
- <Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/>
178
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
179
+ <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
180
+ <Default Extension="jpeg" ContentType="image/jpeg"/>
181
+ <Default Extension="png" ContentType="image/png"/>
182
+ <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
183
+ <Default Extension="xml" ContentType="application/xml"/>
184
+ <Override PartName="/ppt/presentation.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml"/>
185
+ <Override PartName="/ppt/slideMasters/slideMaster1.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml"/>
186
+ <Override PartName="/ppt/slideLayouts/slideLayout1.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"/>
187
+ <Override PartName="/ppt/slideLayouts/slideLayout2.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"/>
188
+ <Override PartName="/ppt/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/>
189
+ <Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/>
190
+ <Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/>
191
191
  </Types>`;
192
192
  }
193
193
  /**
194
194
  * Generate _rels/.rels
195
195
  */
196
196
  function generateRels() {
197
- return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
198
- <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
199
- <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="ppt/presentation.xml"/>
200
- <Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/>
201
- <Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/>
197
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
198
+ <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
199
+ <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="ppt/presentation.xml"/>
200
+ <Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/>
201
+ <Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/>
202
202
  </Relationships>`;
203
203
  }
204
204
  /**
205
205
  * Generate ppt/_rels/presentation.xml.rels
206
206
  */
207
207
  function generatePresentationRels() {
208
- return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
209
- <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
210
- <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster" Target="slideMasters/slideMaster1.xml"/>
211
- <Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Target="theme/theme1.xml"/>
208
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
209
+ <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
210
+ <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster" Target="slideMasters/slideMaster1.xml"/>
211
+ <Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Target="theme/theme1.xml"/>
212
212
  </Relationships>`;
213
213
  }
214
214
  /**
215
215
  * Generate ppt/presentation.xml
216
216
  */
217
217
  function generatePresentation() {
218
- return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
219
- <p:presentation xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" saveSubsetFonts="1">
220
- <p:sldMasterIdLst>
221
- <p:sldMasterId id="2147483648" r:id="rId1"/>
222
- </p:sldMasterIdLst>
223
- <p:sldSz cx="12192000" cy="6858000"/>
224
- <p:notesSz cx="6858000" cy="9144000"/>
225
- <p:defaultTextStyle>
226
- <a:defPPr>
227
- <a:defRPr lang="en-US"/>
228
- </a:defPPr>
229
- </p:defaultTextStyle>
218
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
219
+ <p:presentation xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" saveSubsetFonts="1">
220
+ <p:sldMasterIdLst>
221
+ <p:sldMasterId id="2147483648" r:id="rId1"/>
222
+ </p:sldMasterIdLst>
223
+ <p:sldSz cx="12192000" cy="6858000"/>
224
+ <p:notesSz cx="6858000" cy="9144000"/>
225
+ <p:defaultTextStyle>
226
+ <a:defPPr>
227
+ <a:defRPr lang="en-US"/>
228
+ </a:defPPr>
229
+ </p:defaultTextStyle>
230
230
  </p:presentation>`;
231
231
  }
232
232
  /**
@@ -235,87 +235,87 @@ function generatePresentation() {
235
235
  function generateTheme(theme) {
236
236
  const c = theme.colors;
237
237
  const f = theme.fonts;
238
- return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
239
- <a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="${theme.name}">
240
- <a:themeElements>
241
- <a:clrScheme name="${theme.name}">
242
- <a:dk1><a:srgbClr val="${c.dk1}"/></a:dk1>
243
- <a:lt1><a:srgbClr val="${c.lt1}"/></a:lt1>
244
- <a:dk2><a:srgbClr val="${c.dk2}"/></a:dk2>
245
- <a:lt2><a:srgbClr val="${c.lt2}"/></a:lt2>
246
- <a:accent1><a:srgbClr val="${c.accent1}"/></a:accent1>
247
- <a:accent2><a:srgbClr val="${c.accent2}"/></a:accent2>
248
- <a:accent3><a:srgbClr val="${c.accent3}"/></a:accent3>
249
- <a:accent4><a:srgbClr val="${c.accent4}"/></a:accent4>
250
- <a:accent5><a:srgbClr val="${c.accent5}"/></a:accent5>
251
- <a:accent6><a:srgbClr val="${c.accent6}"/></a:accent6>
252
- <a:hlink><a:srgbClr val="${c.hlink}"/></a:hlink>
253
- <a:folHlink><a:srgbClr val="${c.folHlink}"/></a:folHlink>
254
- </a:clrScheme>
255
- <a:fontScheme name="${theme.name}">
256
- <a:majorFont>
257
- <a:latin typeface="${f.major}"/>
258
- <a:ea typeface=""/>
259
- <a:cs typeface=""/>
260
- </a:majorFont>
261
- <a:minorFont>
262
- <a:latin typeface="${f.minor}"/>
263
- <a:ea typeface=""/>
264
- <a:cs typeface=""/>
265
- </a:minorFont>
266
- </a:fontScheme>
267
- <a:fmtScheme name="${theme.name}">
268
- <a:fillStyleLst>
269
- <a:solidFill><a:schemeClr val="phClr"/></a:solidFill>
270
- <a:gradFill rotWithShape="1">
271
- <a:gsLst>
272
- <a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs>
273
- <a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs>
274
- <a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs>
275
- </a:gsLst>
276
- <a:lin ang="16200000" scaled="1"/>
277
- </a:gradFill>
278
- <a:gradFill rotWithShape="1">
279
- <a:gsLst>
280
- <a:gs pos="0"><a:schemeClr val="phClr"><a:shade val="51000"/><a:satMod val="130000"/></a:schemeClr></a:gs>
281
- <a:gs pos="80000"><a:schemeClr val="phClr"><a:shade val="93000"/><a:satMod val="130000"/></a:schemeClr></a:gs>
282
- <a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="94000"/><a:satMod val="135000"/></a:schemeClr></a:gs>
283
- </a:gsLst>
284
- <a:lin ang="16200000" scaled="0"/>
285
- </a:gradFill>
286
- </a:fillStyleLst>
287
- <a:lnStyleLst>
288
- <a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln>
289
- <a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>
290
- <a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>
291
- </a:lnStyleLst>
292
- <a:effectStyleLst>
293
- <a:effectStyle><a:effectLst/></a:effectStyle>
294
- <a:effectStyle><a:effectLst/></a:effectStyle>
295
- <a:effectStyle><a:effectLst><a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle>
296
- </a:effectStyleLst>
297
- <a:bgFillStyleLst>
298
- <a:solidFill><a:schemeClr val="phClr"/></a:solidFill>
299
- <a:gradFill rotWithShape="1">
300
- <a:gsLst>
301
- <a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs>
302
- <a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs>
303
- <a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs>
304
- </a:gsLst>
305
- <a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path>
306
- </a:gradFill>
307
- <a:gradFill rotWithShape="1">
308
- <a:gsLst>
309
- <a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs>
310
- <a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs>
311
- </a:gsLst>
312
- <a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path>
313
- </a:gradFill>
314
- </a:bgFillStyleLst>
315
- </a:fmtScheme>
316
- </a:themeElements>
317
- <a:objectDefaults/>
318
- <a:extraClrSchemeLst/>
238
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
239
+ <a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="${theme.name}">
240
+ <a:themeElements>
241
+ <a:clrScheme name="${theme.name}">
242
+ <a:dk1><a:srgbClr val="${c.dk1}"/></a:dk1>
243
+ <a:lt1><a:srgbClr val="${c.lt1}"/></a:lt1>
244
+ <a:dk2><a:srgbClr val="${c.dk2}"/></a:dk2>
245
+ <a:lt2><a:srgbClr val="${c.lt2}"/></a:lt2>
246
+ <a:accent1><a:srgbClr val="${c.accent1}"/></a:accent1>
247
+ <a:accent2><a:srgbClr val="${c.accent2}"/></a:accent2>
248
+ <a:accent3><a:srgbClr val="${c.accent3}"/></a:accent3>
249
+ <a:accent4><a:srgbClr val="${c.accent4}"/></a:accent4>
250
+ <a:accent5><a:srgbClr val="${c.accent5}"/></a:accent5>
251
+ <a:accent6><a:srgbClr val="${c.accent6}"/></a:accent6>
252
+ <a:hlink><a:srgbClr val="${c.hlink}"/></a:hlink>
253
+ <a:folHlink><a:srgbClr val="${c.folHlink}"/></a:folHlink>
254
+ </a:clrScheme>
255
+ <a:fontScheme name="${theme.name}">
256
+ <a:majorFont>
257
+ <a:latin typeface="${f.major}"/>
258
+ <a:ea typeface=""/>
259
+ <a:cs typeface=""/>
260
+ </a:majorFont>
261
+ <a:minorFont>
262
+ <a:latin typeface="${f.minor}"/>
263
+ <a:ea typeface=""/>
264
+ <a:cs typeface=""/>
265
+ </a:minorFont>
266
+ </a:fontScheme>
267
+ <a:fmtScheme name="${theme.name}">
268
+ <a:fillStyleLst>
269
+ <a:solidFill><a:schemeClr val="phClr"/></a:solidFill>
270
+ <a:gradFill rotWithShape="1">
271
+ <a:gsLst>
272
+ <a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs>
273
+ <a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs>
274
+ <a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs>
275
+ </a:gsLst>
276
+ <a:lin ang="16200000" scaled="1"/>
277
+ </a:gradFill>
278
+ <a:gradFill rotWithShape="1">
279
+ <a:gsLst>
280
+ <a:gs pos="0"><a:schemeClr val="phClr"><a:shade val="51000"/><a:satMod val="130000"/></a:schemeClr></a:gs>
281
+ <a:gs pos="80000"><a:schemeClr val="phClr"><a:shade val="93000"/><a:satMod val="130000"/></a:schemeClr></a:gs>
282
+ <a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="94000"/><a:satMod val="135000"/></a:schemeClr></a:gs>
283
+ </a:gsLst>
284
+ <a:lin ang="16200000" scaled="0"/>
285
+ </a:gradFill>
286
+ </a:fillStyleLst>
287
+ <a:lnStyleLst>
288
+ <a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln>
289
+ <a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>
290
+ <a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>
291
+ </a:lnStyleLst>
292
+ <a:effectStyleLst>
293
+ <a:effectStyle><a:effectLst/></a:effectStyle>
294
+ <a:effectStyle><a:effectLst/></a:effectStyle>
295
+ <a:effectStyle><a:effectLst><a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle>
296
+ </a:effectStyleLst>
297
+ <a:bgFillStyleLst>
298
+ <a:solidFill><a:schemeClr val="phClr"/></a:solidFill>
299
+ <a:gradFill rotWithShape="1">
300
+ <a:gsLst>
301
+ <a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs>
302
+ <a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs>
303
+ <a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs>
304
+ </a:gsLst>
305
+ <a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path>
306
+ </a:gradFill>
307
+ <a:gradFill rotWithShape="1">
308
+ <a:gsLst>
309
+ <a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs>
310
+ <a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs>
311
+ </a:gsLst>
312
+ <a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path>
313
+ </a:gradFill>
314
+ </a:bgFillStyleLst>
315
+ </a:fmtScheme>
316
+ </a:themeElements>
317
+ <a:objectDefaults/>
318
+ <a:extraClrSchemeLst/>
319
319
  </a:theme>`;
320
320
  }
321
321
  /**
@@ -6,12 +6,20 @@ export interface RateLimiterOptions {
6
6
  maxDelay?: number;
7
7
  maxRetries?: number;
8
8
  backoffFactor?: number;
9
+ /** Per-request timeout in ms; a stalled connection aborts instead of hanging. */
10
+ requestTimeout?: number;
9
11
  }
12
+ /**
13
+ * Parse an HTTP `Retry-After` header, which may be a delay in seconds or an
14
+ * HTTP-date. Returns the delay in milliseconds, or null when unparseable.
15
+ */
16
+ export declare function parseRetryAfter(value: string | null, now?: number): number | null;
10
17
  export declare class RateLimiter {
11
18
  private minDelay;
12
19
  private maxDelay;
13
20
  private maxRetries;
14
21
  private backoffFactor;
22
+ private requestTimeout;
15
23
  private lastRequestTime;
16
24
  private currentDelay;
17
25
  private consecutiveErrors;
@@ -1 +1 @@
1
- {"version":3,"file":"rate-limiter.d.ts","sourceRoot":"","sources":["../../lib/rate-limiter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,iBAAiB,CAAS;gBAEtB,OAAO,GAAE,kBAAuB;IAUtC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAS3B,SAAS,IAAI,IAAI;IAMjB,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAS9B,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC;CAkChF;AAGD,eAAO,MAAM,eAAe,aAAsD,CAAC;AACnF,eAAO,MAAM,eAAe,aAAsD,CAAC;AACnF,eAAO,MAAM,aAAa,aAAsD,CAAC"}
1
+ {"version":3,"file":"rate-limiter.d.ts","sourceRoot":"","sources":["../../lib/rate-limiter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iFAAiF;IACjF,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,GAAE,MAAmB,GAAG,MAAM,GAAG,IAAI,CAO7F;AAED,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,iBAAiB,CAAS;gBAEtB,OAAO,GAAE,kBAAuB;IAWtC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAS3B,SAAS,IAAI,IAAI;IAMjB,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAS9B,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC;CAkDhF;AAGD,eAAO,MAAM,eAAe,aAAsD,CAAC;AACnF,eAAO,MAAM,eAAe,aAAsD,CAAC;AACnF,eAAO,MAAM,aAAa,aAAsD,CAAC"}