@diy-accounting-uk/diya-gl 1.0.4 → 1.1.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 (145) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +42 -0
  3. package/README.md +23 -5
  4. package/bin/diya-gl-mcp.js +2 -2
  5. package/bin/diya-gl-read-workbook.js +2 -2
  6. package/bin/diya-gl-recalc.js +2 -2
  7. package/bin/diya-gl-write-workbook.js +2 -2
  8. package/bin/diya-gl.js +16 -3
  9. package/bin/run-dist-bin.js +2 -2
  10. package/dist/app/bin/diya-gl-mcp.js +2 -2
  11. package/dist/app/bin/export.js +2 -2
  12. package/dist/app/bin/report.js +2 -2
  13. package/dist/app/bin/write-workbook.js +2 -2
  14. package/dist/app/data/filing/ct-computation-v1.1.toml +2 -0
  15. package/dist/app/data/filing/ct600-v3.toml +2 -0
  16. package/dist/app/data/filing/frs105-formats.toml +2 -0
  17. package/dist/app/data/hmrc/SOURCE.md +2 -0
  18. package/dist/app/data/judge-rubric.md +2 -0
  19. package/dist/app/data/ltd-2020.toml +2 -0
  20. package/dist/app/data/ltd-2021.toml +2 -0
  21. package/dist/app/data/ltd-2022.toml +2 -0
  22. package/dist/app/data/ltd-2023.toml +2 -0
  23. package/dist/app/data/ltd-2024.toml +2 -0
  24. package/dist/app/data/ltd-2025.toml +2 -0
  25. package/dist/app/data/ltd-2026.toml +2 -0
  26. package/dist/app/data/ltd-2027.toml +2 -0
  27. package/dist/app/data/releases.json +52 -0
  28. package/dist/app/data/se-2020-2021.toml +2 -0
  29. package/dist/app/data/se-2021-2022.toml +2 -0
  30. package/dist/app/data/se-2022-2023.toml +2 -0
  31. package/dist/app/data/se-2023-2024.toml +2 -0
  32. package/dist/app/data/se-2024-2025.toml +2 -0
  33. package/dist/app/data/se-2025-2026.toml +2 -0
  34. package/dist/app/data/se-2026-2027.toml +2 -0
  35. package/dist/app/lib/anchors/bst.js +2 -2
  36. package/dist/app/lib/anchors/ltd.js +2 -2
  37. package/dist/app/lib/anchors/run.js +2 -2
  38. package/dist/app/lib/anchors/se.js +2 -2
  39. package/dist/app/lib/anchors/taxi.js +2 -2
  40. package/dist/app/lib/app-resources.js +72 -3
  41. package/dist/app/lib/book-checks/ltd.js +2 -2
  42. package/dist/app/lib/book-checks/se.js +2 -2
  43. package/dist/app/lib/book-checks/taxi.js +2 -2
  44. package/dist/app/lib/book-checks.js +2 -2
  45. package/dist/app/lib/books-interchange.js +2 -2
  46. package/dist/app/lib/calculators/bst.js +2 -2
  47. package/dist/app/lib/calculators/ltd.js +2 -2
  48. package/dist/app/lib/calculators/se.js +2 -2
  49. package/dist/app/lib/calculators/shared.js +2 -2
  50. package/dist/app/lib/calculators/taxi.js +2 -2
  51. package/dist/app/lib/canonical-report-value.js +2 -2
  52. package/dist/app/lib/diya-gl-calculator.js +2 -2
  53. package/dist/app/lib/diya-gl-canonical.js +2 -2
  54. package/dist/app/lib/diya-gl-edits-ltd.js +2 -2
  55. package/dist/app/lib/diya-gl-edits.js +2 -2
  56. package/dist/app/lib/diya-gl-loader.js +2 -2
  57. package/dist/app/lib/diya-gl-schema.js +2 -2
  58. package/dist/app/lib/generator.js +90 -2
  59. package/dist/app/lib/link-caches.js +2 -2
  60. package/dist/app/lib/ltd-layout.js +2 -2
  61. package/dist/app/lib/mcp/diya-gl-tools.js +2 -2
  62. package/dist/app/lib/mcp/jsonrpc-stdio.js +2 -2
  63. package/dist/app/lib/mcp/server.js +39 -3
  64. package/dist/app/lib/overtype-sidecar.js +14 -4
  65. package/dist/app/lib/payslips-date-chain.js +2 -2
  66. package/dist/app/lib/payslips-layout.js +2 -2
  67. package/dist/app/lib/period-shift.js +2 -2
  68. package/dist/app/lib/product-workbook.js +5 -3
  69. package/dist/app/lib/products.js +2 -2
  70. package/dist/app/lib/provenance-data.js +8 -8
  71. package/dist/app/lib/provenance.js +2 -2
  72. package/dist/app/lib/report-generator.js +2 -2
  73. package/dist/app/lib/report-serializer.js +2 -2
  74. package/dist/app/lib/scenario-extractor.js +2 -2
  75. package/dist/app/lib/scenario-loader.js +2 -2
  76. package/dist/app/lib/spreadsheet-runner.js +2 -2
  77. package/dist/app/lib/tax/capital-allowances.js +2 -2
  78. package/dist/app/lib/tax/corporation-tax.js +2 -2
  79. package/dist/app/lib/tax/income-tax.js +2 -2
  80. package/dist/app/lib/tax/mileage.js +2 -2
  81. package/dist/app/lib/tax/national-insurance.js +2 -2
  82. package/dist/app/lib/tax/vat.js +2 -2
  83. package/dist/app/lib/tax-year.js +2 -2
  84. package/dist/app/lib/template-formula-map.js +2 -2
  85. package/dist/app/lib/workbook-set.js +2 -2
  86. package/dist/app/lib/xlsx-exporter.js +2 -2
  87. package/dist/app/lib/xlsx-parts.js +2 -2
  88. package/dist/app/lib/xlsx-reader.js +2 -2
  89. package/dist/app/products/bst.js +2 -2
  90. package/dist/app/products/ltd.js +2 -2
  91. package/dist/app/products/se.js +2 -2
  92. package/dist/app/products/taxi.js +2 -2
  93. package/dist/web/spreadsheets.diyaccounting.co.uk/public/schema/diya-gl-book-v2.schema.json +1 -0
  94. package/dist/web/spreadsheets.diyaccounting.co.uk/public/schema/diya-gl-docs.md +2 -0
  95. package/dist/web/spreadsheets.diyaccounting.co.uk/public/schema/diya-gl-lines-v2.schema.json +1 -0
  96. package/package.json +3 -3
  97. package/dist/app/bin/build-diya-gl-spec.js +0 -687
  98. package/dist/app/bin/build-packages.js +0 -149
  99. package/dist/app/bin/build-reconciliation-pages.js +0 -1052
  100. package/dist/app/bin/build-sitemaps.js +0 -51
  101. package/dist/app/bin/compliance-report.js +0 -125
  102. package/dist/app/bin/cross-package-reconciliation.js +0 -92
  103. package/dist/app/bin/extract-scenarios.js +0 -1348
  104. package/dist/app/bin/generate.js +0 -353
  105. package/dist/app/bin/judge-reconciliation.js +0 -649
  106. package/dist/app/bin/reconcile.js +0 -247
  107. package/dist/app/bin/verify-roundtrip.js +0 -941
  108. package/dist/app/bin/verify-stability.js +0 -429
  109. package/dist/app/lib/books-engine.js +0 -197
  110. package/dist/app/lib/compliance-report.js +0 -341
  111. package/dist/app/lib/guide.js +0 -33
  112. package/dist/app/lib/headlines.js +0 -293
  113. package/dist/app/lib/package-builder.js +0 -202
  114. package/dist/app/lib/report-indicators.js +0 -468
  115. package/dist/app/lib/sitemap-builder.js +0 -59
  116. package/dist/app/templates/bst/bst-excel.xlsx +0 -0
  117. package/dist/app/templates/bst/meta.toml +0 -27
  118. package/dist/app/templates/ltd/Cashaccount.xlsx +0 -0
  119. package/dist/app/templates/ltd/Companysecretary.xlsx +0 -0
  120. package/dist/app/templates/ltd/Creditcardaccount.xlsx +0 -0
  121. package/dist/app/templates/ltd/Currentaccount.xlsx +0 -0
  122. package/dist/app/templates/ltd/Dividend Voucher.docx +0 -0
  123. package/dist/app/templates/ltd/Financialaccounts.xlsx +0 -0
  124. package/dist/app/templates/ltd/Fixedassets.xlsx +0 -0
  125. package/dist/app/templates/ltd/Payslips.xlsx +0 -0
  126. package/dist/app/templates/ltd/Purchases.xlsx +0 -0
  127. package/dist/app/templates/ltd/Sales.xlsx +0 -0
  128. package/dist/app/templates/ltd/Salesinvoice.xlsx +0 -0
  129. package/dist/app/templates/ltd/Savingaccount.xlsx +0 -0
  130. package/dist/app/templates/ltd/Vatreturns.xlsx +0 -0
  131. package/dist/app/templates/ltd/expensesform.xlsx +0 -0
  132. package/dist/app/templates/ltd/meta.toml +0 -54
  133. package/dist/app/templates/meta.toml +0 -12
  134. package/dist/app/templates/se/Bank.xlsx +0 -0
  135. package/dist/app/templates/se/Cash.xlsx +0 -0
  136. package/dist/app/templates/se/Financialaccounts.xlsx +0 -0
  137. package/dist/app/templates/se/Fixedassets.xlsx +0 -0
  138. package/dist/app/templates/se/Payslips.xlsx +0 -0
  139. package/dist/app/templates/se/Purchases.xlsx +0 -0
  140. package/dist/app/templates/se/Sales.xlsx +0 -0
  141. package/dist/app/templates/se/Salesinvoice.xlsx +0 -0
  142. package/dist/app/templates/se/Vat.xlsx +0 -0
  143. package/dist/app/templates/se/meta.toml +0 -43
  144. package/dist/app/templates/taxi/meta.toml +0 -43
  145. package/dist/app/templates/taxi/taxi-excel.xlsx +0 -0
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,42 @@
1
+ DIYA-GL
2
+ Copyright (C) 2006-2026 DIY Accounting Limited
3
+
4
+ Licensed under the Apache License, Version 2.0. See LICENSE.
5
+
6
+ Source: https://github.com/diy-accounting-uk/spreadsheets.diyaccounting.co.uk
7
+
8
+ Third-party material
9
+ --------------------
10
+
11
+ XBRL Global Ledger Taxonomy Framework 2015, (c) XBRL International Inc., licensed
12
+ for derivative works with attribution (Section 1.0 of the GL Framework). The
13
+ diya-gl field names use its semantics in a JSON and TOML surface syntax; no
14
+ taxonomy XSD file is reproduced. Reference:
15
+ http://www.xbrl.org/int/gl/2015-03-25/gl-framework-REC-2015-03-25.html
16
+
17
+ JSZip. Copyright (c) 2009-2016 Stuart Knightley, David Duponchel, Franz Buchinger and
18
+ Antonio Afonso. Taken under the MIT licence of its dual MIT or GPLv3 offer.
19
+
20
+ smol-toml. Copyright (c) Squirrel Chat et al. BSD-3-Clause.
21
+
22
+ Ajv and ajv-formats. Copyright (c) 2015-2021 Evgeny Poberezkin. MIT.
23
+
24
+ HMRC-derived data. The tax rates, thresholds, form layouts and box mappings under
25
+ dist/app/data/ are derived from HM Revenue & Customs publications. Crown copyright,
26
+ used under the Open Government Licence v3.0:
27
+ https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/
28
+
29
+ Workbook templates are not part of this package. The package fetches them from
30
+ https://spreadsheets.diyaccounting.co.uk when it first needs one, under the
31
+ PolyForm Internal Use License 1.0.0 with an additional grant:
32
+ https://github.com/diy-accounting-uk/spreadsheets.diyaccounting.co.uk/blob/main/LICENSE
33
+
34
+ Runtime dependencies
35
+ ---------------------
36
+
37
+ From this package's package.json:
38
+
39
+ ajv ^8.20.0 MIT
40
+ ajv-formats ^3.0.1 MIT
41
+ jszip ^3.10.1 MIT (dual MIT or GPL-3.0-or-later; taken under MIT)
42
+ smol-toml ^1.8.0 BSD-3-Clause
package/README.md CHANGED
@@ -1,10 +1,12 @@
1
+ <!-- SPDX-License-Identifier: Apache-2.0 -->
2
+ <!-- Copyright (C) 2006-2026 DIY Accounting Limited -->
1
3
  # @diy-accounting-uk/diya-gl
2
4
 
3
- Run a UK sole trader's or company's accounts from the command line. A diya-gl book is a
5
+ Run a UK sole trader's or company's accounts from the command line. A DIYA-GL™ book is a
4
6
  book.toml and a lines.jsonl file, usually a few kilobytes, that hold a year of transactions
5
7
  and the chart of accounts they post to. This package recalculates one, reads one out of an
6
8
  Excel workbook, writes one back into a workbook, and serves one over MCP, all through the
7
- same engine the [DIY Accounting spreadsheets site](https://spreadsheets.diyaccounting.co.uk)
9
+ same engine the [DIY Accounting Spreadsheets™ site](https://spreadsheets.diyaccounting.co.uk)
8
10
  reconciles in CI.
9
11
 
10
12
  Four products: Basic Sole Trader, Taxi Driver, Self Employed, Limited Company.
@@ -18,7 +20,8 @@ npm install -g @diy-accounting-uk/diya-gl
18
20
  With Homebrew:
19
21
 
20
22
  ```
21
- brew install diy-accounting-uk/tap/diya-gl
23
+ brew tap diy-accounting-uk/diya-gl
24
+ brew install diy-accounting-uk/diya-gl/diya-gl
22
25
  ```
23
26
 
24
27
  Or run the image straight from GHCR, no install:
@@ -71,6 +74,21 @@ byte for byte or names the stamp that differs. Every published release is cut fr
71
74
  whose reconciliation checks passed; the scorecards are on the
72
75
  [reconciled releases page](https://spreadsheets.diyaccounting.co.uk/reconciliation/releases.html).
73
76
 
74
- ## License
77
+ ## Licence
75
78
 
76
- AGPL-3.0-only. Copyright (C) 2026 DIY Accounting Ltd.
79
+ This package is licensed under the Apache License 2.0. Embed it, ship it, change it. See `LICENSE`
80
+ and `NOTICE`.
81
+
82
+ The diya-gl format itself is an open specification. The two JSON Schemas are Apache-2.0 and the
83
+ format text is CC BY 4.0, so you can implement the format in anything with attribution.
84
+
85
+ The workbook templates are not part of this package. `write-workbook` and the MCP `save_workbook`
86
+ tool fetch the template they need from
87
+ [spreadsheets.diyaccounting.co.uk](https://spreadsheets.diyaccounting.co.uk) the first time they run,
88
+ print the terms, and cache it for later runs. The templates are the company's own work, under the
89
+ PolyForm Internal Use License 1.0.0 with an additional grant: use them for your own accounts, or for
90
+ your clients' accounts if you are an accountant or a bookkeeper, and do not redistribute them.
91
+
92
+ This repository does not accept contributions.
93
+
94
+ Copyright (C) 2006-2026 DIY Accounting Limited.
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- // SPDX-License-Identifier: AGPL-3.0-only
3
- // Copyright (C) 2026 DIY Accounting Ltd
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ // Copyright (C) 2006-2026 DIY Accounting Limited
4
4
  //
5
5
  // diya-gl-mcp.js — the stdio MCP server, four tools over a loaded diya-gl
6
6
  // book: extract_book, report, edit_lines, save_workbook. See
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- // SPDX-License-Identifier: AGPL-3.0-only
3
- // Copyright (C) 2026 DIY Accounting Ltd
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ // Copyright (C) 2006-2026 DIY Accounting Limited
4
4
  //
5
5
  // diya-gl-read-workbook.js — reads an .xlsx, a package zip, or any of the
6
6
  // diya-gl formats, and extracts book.toml, lines.jsonl, report.json and
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- // SPDX-License-Identifier: AGPL-3.0-only
3
- // Copyright (C) 2026 DIY Accounting Ltd
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ // Copyright (C) 2006-2026 DIY Accounting Limited
4
4
  //
5
5
  // diya-gl-recalc.js — report.json and bookchecks.json from a diya-gl book
6
6
  // or a populated Excel package. See `diya-gl recalc --help` for usage, or
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- // SPDX-License-Identifier: AGPL-3.0-only
3
- // Copyright (C) 2026 DIY Accounting Ltd
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ // Copyright (C) 2006-2026 DIY Accounting Limited
4
4
  //
5
5
  // diya-gl-write-workbook.js — writes the Excel package a diya-gl book
6
6
  // composes onto its product's template, with no LibreOffice: the same
package/bin/diya-gl.js CHANGED
@@ -1,11 +1,15 @@
1
1
  #!/usr/bin/env node
2
- // SPDX-License-Identifier: AGPL-3.0-only
3
- // Copyright (C) 2026 DIY Accounting Ltd
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ // Copyright (C) 2006-2026 DIY Accounting Limited
4
4
  //
5
5
  // diya-gl.js — the dispatcher: diya-gl <recalc|read-workbook|write-workbook|mcp> [args].
6
6
  // Each subcommand is also its own bin (diya-gl-recalc, and so on), for a
7
7
  // caller that wants one command on its PATH without the others.
8
8
 
9
+ import { readFileSync } from "fs";
10
+ import { dirname, resolve } from "path";
11
+ import { fileURLToPath } from "url";
12
+
9
13
  import { runDistBin } from "./run-dist-bin.js";
10
14
 
11
15
  const SUBCOMMANDS = {
@@ -16,9 +20,18 @@ const SUBCOMMANDS = {
16
20
  };
17
21
 
18
22
  const [subcommand, ...rest] = process.argv.slice(2);
23
+
24
+ if (subcommand === "--version" || subcommand === "-v") {
25
+ const manifest = resolve(dirname(fileURLToPath(import.meta.url)), "..", "package.json");
26
+ console.log(JSON.parse(readFileSync(manifest, "utf8")).version);
27
+ console.log("Apache-2.0");
28
+ console.log("Copyright (C) 2006-2026 DIY Accounting Limited");
29
+ process.exit(0);
30
+ }
31
+
19
32
  const target = SUBCOMMANDS[subcommand];
20
33
  if (!target) {
21
- console.error(`Usage: diya-gl <${Object.keys(SUBCOMMANDS).join("|")}> [args]`);
34
+ console.error(`Usage: diya-gl <${Object.keys(SUBCOMMANDS).join("|")}> [args], or diya-gl --version`);
22
35
  process.exit(1);
23
36
  }
24
37
  runDistBin(target, rest);
@@ -1,5 +1,5 @@
1
- // SPDX-License-Identifier: AGPL-3.0-only
2
- // Copyright (C) 2026 DIY Accounting Ltd
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ // Copyright (C) 2006-2026 DIY Accounting Limited
3
3
  //
4
4
  // run-dist-bin.js — every wrapper below spawns the real entry point under
5
5
  // dist/ as a child process rather than importing it, so each one runs the
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- // SPDX-License-Identifier: AGPL-3.0-only
3
- // Copyright (C) 2026 DIY Accounting Ltd
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ // Copyright (C) 2006-2026 DIY Accounting Limited
4
4
  //
5
5
  // diya-gl-mcp.js — a stdio MCP server exposing the diya-gl pipeline as
6
6
  // four tools: extract_book, report, edit_lines, save_workbook, over any of
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- // SPDX-License-Identifier: AGPL-3.0-only
3
- // Copyright (C) 2026 DIY Accounting Ltd
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ // Copyright (C) 2006-2026 DIY Accounting Limited
4
4
  //
5
5
  // export.js — Extract diya-gl data from a populated Excel package.
6
6
  //
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- // SPDX-License-Identifier: AGPL-3.0-only
3
- // Copyright (C) 2026 DIY Accounting Ltd
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ // Copyright (C) 2006-2026 DIY Accounting Limited
4
4
  //
5
5
  // report.js — Extract financial reports from a populated Excel package.
6
6
  //
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- // SPDX-License-Identifier: AGPL-3.0-only
3
- // Copyright (C) 2026 DIY Accounting Ltd
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ // Copyright (C) 2006-2026 DIY Accounting Limited
4
4
  //
5
5
  // write-workbook.js — diya-gl data in, an Excel package out. The other
6
6
  // direction from export.js: this takes a book.toml + lines.jsonl (or any of
@@ -1,3 +1,5 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # Copyright (C) 2006-2026 DIY Accounting Limited
1
3
  # HMRC Prescription of Computations (CT Computations Format), version 1.1, 20 November 2025.
2
4
  #
3
5
  # Sources:
@@ -1,3 +1,5 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # Copyright (C) 2006-2026 DIY Accounting Limited
1
3
  # CT600 (2026) Version 3 -- full box list, HMRC form.
2
4
  #
3
5
  # Sources:
@@ -1,3 +1,5 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # Copyright (C) 2006-2026 DIY Accounting Limited
1
3
  # FRS 105 micro-entity accounts formats, Companies House / Schedule 1 Section C.
2
4
  #
3
5
  # Sources:
@@ -1,3 +1,5 @@
1
+ <!-- SPDX-License-Identifier: Apache-2.0 -->
2
+ <!-- Copyright (C) 2006-2026 DIY Accounting Limited -->
1
3
  # HMRC source files
2
4
 
3
5
  ## sa103f_mapping_v3.csv
@@ -1,3 +1,5 @@
1
+ <!-- SPDX-License-Identifier: Apache-2.0 -->
2
+ <!-- Copyright (C) 2006-2026 DIY Accounting Limited -->
1
3
  # Reconciliation judge rubric
2
4
 
3
5
  ## What you are reviewing
@@ -1,3 +1,5 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # Copyright (C) 2006-2026 DIY Accounting Limited
1
3
  # UK Limited Company tax rates and thresholds for Financial Year 2020
2
4
  # (1 April 2020 - 31 March 2021)
3
5
  # Source: HMRC - https://www.gov.uk/government/publications/rates-and-allowances-corporation-tax/rates-and-allowances-corporation-tax
@@ -1,3 +1,5 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # Copyright (C) 2006-2026 DIY Accounting Limited
1
3
  # UK Limited Company tax rates and thresholds for Financial Year 2021
2
4
  # (1 April 2021 - 31 March 2022)
3
5
  # Source: HMRC - https://www.gov.uk/government/publications/rates-and-allowances-corporation-tax/rates-and-allowances-corporation-tax
@@ -1,3 +1,5 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # Copyright (C) 2006-2026 DIY Accounting Limited
1
3
  # UK Limited Company tax rates and thresholds for Financial Year 2022
2
4
  # (1 April 2022 - 31 March 2023)
3
5
  # Source: HMRC - https://www.gov.uk/government/publications/rates-and-allowances-corporation-tax/rates-and-allowances-corporation-tax
@@ -1,3 +1,5 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # Copyright (C) 2006-2026 DIY Accounting Limited
1
3
  # UK Limited Company tax rates and thresholds for Financial Year 2023
2
4
  # (1 April 2023 - 31 March 2024)
3
5
  # Source: HMRC - https://www.gov.uk/government/publications/rates-and-allowances-corporation-tax/rates-and-allowances-corporation-tax
@@ -1,3 +1,5 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # Copyright (C) 2006-2026 DIY Accounting Limited
1
3
  # UK Limited Company tax rates and thresholds for Financial Year 2024
2
4
  # (1 April 2024 - 31 March 2025)
3
5
  # Source: HMRC - https://www.gov.uk/government/publications/rates-and-allowances-corporation-tax/rates-and-allowances-corporation-tax
@@ -1,3 +1,5 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # Copyright (C) 2006-2026 DIY Accounting Limited
1
3
  # UK Limited Company tax rates and thresholds for Financial Year 2025
2
4
  # (1 April 2025 – 31 March 2026)
3
5
  # Source: HMRC — https://www.gov.uk/government/publications/rates-and-allowances-corporation-tax/rates-and-allowances-corporation-tax
@@ -1,3 +1,5 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # Copyright (C) 2006-2026 DIY Accounting Limited
1
3
  # UK Limited Company tax rates and thresholds for Financial Year 2026
2
4
  # (1 April 2026 – 31 March 2027)
3
5
  # Source: HMRC — https://www.gov.uk/government/publications/rates-and-allowances-corporation-tax/rates-and-allowances-corporation-tax
@@ -1,3 +1,5 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # Copyright (C) 2006-2026 DIY Accounting Limited
1
3
  # UK Limited Company tax rates and thresholds for Financial Year 2027
2
4
  # (1 April 2027 – 31 March 2028)
3
5
  # Source: Rates carried forward from FY2026. HMRC has not yet published FY2027 rates.
@@ -103,6 +103,58 @@
103
103
  "scorecard": "101279 passed, 0 warnings, 0 failed"
104
104
  }
105
105
  }
106
+ },
107
+ {
108
+ "tag": "diya-gl-v1.0.4",
109
+ "date": "2026-09-09",
110
+ "formatVersion": "diya-gl-books/1",
111
+ "engineVersion": "1.0.4+84b060175f5b",
112
+ "taxDataHash": "942a6388a226",
113
+ "reconciledCommit": "",
114
+ "templates": {
115
+ "bst": {
116
+ "hash": "06fdcd072930",
117
+ "scorecard": "810 passed, 0 warnings, 0 failed"
118
+ },
119
+ "taxi": {
120
+ "hash": "6c36b3785a83",
121
+ "scorecard": "686 passed, 0 warnings, 0 failed"
122
+ },
123
+ "se": {
124
+ "hash": "aaf63ff852c5",
125
+ "scorecard": "7679 passed, 0 warnings, 0 failed"
126
+ },
127
+ "ltd": {
128
+ "hash": "c3da60838497",
129
+ "scorecard": "101279 passed, 0 warnings, 0 failed"
130
+ }
131
+ }
132
+ },
133
+ {
134
+ "tag": "diya-gl-v1.0.5",
135
+ "date": "2026-09-09",
136
+ "formatVersion": "diya-gl-books/1",
137
+ "engineVersion": "1.0.5+29e09e8602d2",
138
+ "taxDataHash": "942a6388a226",
139
+ "reconciledCommit": "",
140
+ "templates": {
141
+ "bst": {
142
+ "hash": "06fdcd072930",
143
+ "scorecard": "810 passed, 0 warnings, 0 failed"
144
+ },
145
+ "taxi": {
146
+ "hash": "6c36b3785a83",
147
+ "scorecard": "686 passed, 0 warnings, 0 failed"
148
+ },
149
+ "se": {
150
+ "hash": "aaf63ff852c5",
151
+ "scorecard": "7679 passed, 0 warnings, 0 failed"
152
+ },
153
+ "ltd": {
154
+ "hash": "c3da60838497",
155
+ "scorecard": "101279 passed, 0 warnings, 0 failed"
156
+ }
157
+ }
106
158
  }
107
159
  ]
108
160
  }
@@ -1,3 +1,5 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # Copyright (C) 2006-2026 DIY Accounting Limited
1
3
  # UK self-employment tax rates and thresholds for the 2020-21 tax year
2
4
  # Period: 6 April 2020 – 5 April 2021
3
5
  # Source: HMRC
@@ -1,3 +1,5 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # Copyright (C) 2006-2026 DIY Accounting Limited
1
3
  # UK self-employment tax rates and thresholds for the 2021-22 tax year
2
4
  # Period: 6 April 2021 – 5 April 2022
3
5
  # Source: HMRC
@@ -1,3 +1,5 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # Copyright (C) 2006-2026 DIY Accounting Limited
1
3
  # UK self-employment tax rates and thresholds for the 2022-23 tax year
2
4
  # Period: 6 April 2022 – 5 April 2023
3
5
  # Source: HMRC
@@ -1,3 +1,5 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # Copyright (C) 2006-2026 DIY Accounting Limited
1
3
  # UK self-employment tax rates and thresholds for the 2023-24 tax year
2
4
  # Period: 6 April 2023 – 5 April 2024
3
5
  # Source: HMRC
@@ -1,3 +1,5 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # Copyright (C) 2006-2026 DIY Accounting Limited
1
3
  # UK self-employment tax rates and thresholds for the 2024-25 tax year
2
4
  # Period: 6 April 2024 – 5 April 2025
3
5
  # Source: HMRC
@@ -1,3 +1,5 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # Copyright (C) 2006-2026 DIY Accounting Limited
1
3
  # UK self-employment tax rates and thresholds for the 2025-26 tax year
2
4
  # Period: 6 April 2025 – 5 April 2026
3
5
  # Source: HMRC
@@ -1,3 +1,5 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # Copyright (C) 2006-2026 DIY Accounting Limited
1
3
  # UK self-employment tax rates and thresholds for the 2026-27 tax year
2
4
  # Period: 6 April 2026 – 5 April 2027
3
5
  # Source: HMRC
@@ -1,5 +1,5 @@
1
- // SPDX-License-Identifier: AGPL-3.0-only
2
- // Copyright (C) 2026 DIY Accounting Ltd
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ // Copyright (C) 2006-2026 DIY Accounting Limited
3
3
  //
4
4
  // anchors/bst.js — the Basic Sole Trader anchor table.
5
5
  //
@@ -1,5 +1,5 @@
1
- // SPDX-License-Identifier: AGPL-3.0-only
2
- // Copyright (C) 2026 DIY Accounting Ltd
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ // Copyright (C) 2006-2026 DIY Accounting Limited
3
3
  //
4
4
  // anchors/ltd.js -- the Limited Company anchor table and input-cell
5
5
  // predicate.