@coderook/cli 0.31.13 → 0.32.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.
- package/.claude-plugin/plugin.json +2 -2
- package/LICENSE +202 -0
- package/NOTICE +8 -0
- package/README.md +53 -1
- package/dist/cbx/LICENSE +202 -0
- package/dist/cbx/NOTICE +8 -0
- package/dist/{desktop-app/src/main → cbx/src/core}/cbx.js +31 -0
- package/dist/{desktop-app/src/main → cbx/src/core}/download.js +62 -1
- package/dist/{desktop-app/src/main → cbx/src/core}/rules.js +2 -0
- package/dist/cbx/src/local/errors.js +23 -0
- package/dist/cbx/src/local/history.js +522 -0
- package/dist/cbx/src/local/merge.js +277 -0
- package/dist/cbx/src/local/merge_text.js +148 -0
- package/dist/cbx/src/local/remote.js +437 -0
- package/dist/cbx/src/local/repository.js +324 -0
- package/dist/cbx/src/local/snapshot.js +338 -0
- package/dist/cbx/src/local/store.js +258 -0
- package/dist/{desktop-app → cbx}/src/shared/safe_path.js +12 -0
- package/dist/cli/src/api.js +1 -1
- package/dist/cli/src/cli.js +166 -24
- package/dist/cli/src/diff_command.js +2 -2
- package/dist/cli/src/git_remote.js +6 -6
- package/dist/cli/src/licence_commands.js +3 -3
- package/dist/cli/src/local_commands.js +506 -0
- package/dist/cli/src/mcp.js +2 -2
- package/dist/cli/src/pages_command.js +2 -2
- package/dist/cli/src/registry.js +1 -0
- package/dist/cli/src/runner.js +2 -2
- package/dist/cli/src/track_commands.js +1 -1
- package/package.json +11 -5
- package/skills/coderook/SKILL.md +24 -0
- package/LICENSE.txt +0 -46
- /package/dist/{desktop-app/src/main → cbx/src/core}/compress.js +0 -0
- /package/dist/{desktop-app/src/main → cbx/src/core}/credentials.js +0 -0
- /package/dist/{desktop-app/src/main → cbx/src/core}/detect.js +0 -0
- /package/dist/{desktop-app/src/main → cbx/src/core}/faults.js +0 -0
- /package/dist/{desktop-app/src/main → cbx/src/core}/identify.js +0 -0
- /package/dist/{desktop-app/src/main → cbx/src/core}/ignore_templates.js +0 -0
- /package/dist/{desktop-app/src/main → cbx/src/core}/licence_texts.js +0 -0
- /package/dist/{desktop-app/src/main → cbx/src/core}/licences.js +0 -0
- /package/dist/{desktop-app/src/main → cbx/src/core}/profile.js +0 -0
- /package/dist/{desktop-app/src/main → cbx/src/core}/publish_name.js +0 -0
- /package/dist/{desktop-app/src/main → cbx/src/core}/retry.js +0 -0
- /package/dist/{desktop-app/src/main → cbx/src/core}/secret_patterns.js +0 -0
- /package/dist/{desktop-app/src/main → cbx/src/core}/solid.js +0 -0
- /package/dist/{desktop-app/src/main → cbx/src/core}/staging.js +0 -0
- /package/dist/{desktop-app/src/main → cbx/src/core}/tracks.js +0 -0
- /package/dist/{desktop-app/src/main → cbx/src/core}/transfer_progress.js +0 -0
- /package/dist/{desktop-app/src/main → cbx/src/core}/upload.js +0 -0
- /package/dist/{desktop-app/src/main → cbx/src/core}/worktree.js +0 -0
- /package/dist/{desktop-app → cbx}/src/shared/chunking.js +0 -0
- /package/dist/{desktop-app → cbx}/src/shared/compression_policy.js +0 -0
- /package/dist/{desktop-app → cbx}/src/shared/delta.js +0 -0
- /package/dist/{desktop-app → cbx}/src/shared/format.js +0 -0
- /package/dist/{desktop-app → cbx}/src/shared/merge_diff.js +0 -0
- /package/dist/{desktop-app → cbx}/src/shared/publication.js +0 -0
- /package/dist/{desktop-app → cbx}/src/shared/telemetry.js +0 -0
- /package/dist/{desktop-app → cbx}/src/shared/types.js +0 -0
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
"name": "coderook",
|
|
3
3
|
"displayName": "CodeRook",
|
|
4
4
|
"description": "Save, browse and restore whole-snapshot versions of a project on CodeRook, from Claude Code.",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.32.1",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "ACCA Gaming Productions",
|
|
8
8
|
"url": "https://coderook.com"
|
|
9
9
|
},
|
|
10
10
|
"homepage": "https://coderook.com/docs#assistants",
|
|
11
|
-
"license": "
|
|
11
|
+
"license": "Apache-2.0",
|
|
12
12
|
"keywords": [
|
|
13
13
|
"coderook",
|
|
14
14
|
"versioning",
|
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,8 @@
|
|
|
1
|
+
cbx command line
|
|
2
|
+
Copyright 2026 ACCA Gaming Productions
|
|
3
|
+
|
|
4
|
+
This product includes software developed by ACCA Gaming Productions
|
|
5
|
+
for CodeRook (https://coderook.com), including the CBX engine.
|
|
6
|
+
|
|
7
|
+
"CodeRook" is a name of ACCA Gaming Productions. The Apache License
|
|
8
|
+
grants no rights to use it; see section 6 of the licence.
|
package/README.md
CHANGED
|
@@ -118,6 +118,46 @@ on a decision. `cbx merges` lists them and `cbx merge <ref>` walks
|
|
|
118
118
|
through it; `cbx tracks` shows them beside the ordinary lines, because
|
|
119
119
|
somebody looking for where they can save needs to see the one they cannot.
|
|
120
120
|
|
|
121
|
+
## A history on this machine
|
|
122
|
+
|
|
123
|
+
A folder can keep its own history, with no account and no connection:
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
cbx init start one; it lives in .cbx/
|
|
127
|
+
cbx save -m "First playable build"
|
|
128
|
+
cbx status what changed since the last save
|
|
129
|
+
cbx diff the same, line by line
|
|
130
|
+
cbx log the saves on this line
|
|
131
|
+
cbx switch -c new-movement start a line here; no files change
|
|
132
|
+
cbx switch main go back; only files that differ are rewritten
|
|
133
|
+
cbx merge new-movement bring that line's work into this one
|
|
134
|
+
cbx restore --from main~2 put the folder back two saves
|
|
135
|
+
cbx restore src/player.ts --force throw away unsaved changes to one file
|
|
136
|
+
cbx push send this line's new saves to CodeRook
|
|
137
|
+
cbx pull bring CodeRook's new saves here
|
|
138
|
+
cbx pull my-project start from a project already on CodeRook
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Nothing in `.cbx/` is sent anywhere until you push. Each save becomes a
|
|
142
|
+
CodeRook save of its own, and the first push creates the project, private,
|
|
143
|
+
unless the folder is already linked to one. If somebody saved to that line on
|
|
144
|
+
CodeRook since your last push, nothing is sent and you are told to pull
|
|
145
|
+
first. If you both saved, pull merges their saves with yours; push then sends
|
|
146
|
+
the merge.
|
|
147
|
+
|
|
148
|
+
A merge takes whatever only one side changed, merges text files both changed
|
|
149
|
+
line by line, and marks only what is left. Fix the marked files and
|
|
150
|
+
`cbx save`, or take one side with `cbx merge --mine` / `--theirs`
|
|
151
|
+
(`--path <file>` for one file), or `cbx merge --cancel` to put everything
|
|
152
|
+
back.
|
|
153
|
+
|
|
154
|
+
Once a folder has a history, `status`, `diff`, `log`, `switch`, `merge`,
|
|
155
|
+
`push` and `pull` answer from it. Everywhere else they mean what they always meant.
|
|
156
|
+
|
|
157
|
+
`restore` and `switch` stop and list the files if they would overwrite an
|
|
158
|
+
unsaved change. `--force` discards those changes. Files the history has never
|
|
159
|
+
held are never touched.
|
|
160
|
+
|
|
121
161
|
## Proposals
|
|
122
162
|
|
|
123
163
|
A line gets back to main by being proposed. The proposal is checked and
|
|
@@ -324,7 +364,9 @@ cbx checkout cbx merge cbx tag
|
|
|
324
364
|
Each is the CodeRook command it always was, reachable by the name a git user
|
|
325
365
|
would reach for: `push` is `submit`, `pull` is `get`, `log` is `versions`,
|
|
326
366
|
`branch` is `tracks`, `checkout` is `track`, `tag` is `release`. The original
|
|
327
|
-
names still work and mean the same thing.
|
|
367
|
+
names still work and mean the same thing. The one exception is a folder with
|
|
368
|
+
a history of its own (`cbx init`): there `log`, `switch`, `merge`, `push`
|
|
369
|
+
and `pull` work on that history.
|
|
328
370
|
|
|
329
371
|
That is also what the git remote does. `git push` performs the operation
|
|
330
372
|
`cbx push` performs — the same code decides what changed, the same code
|
|
@@ -483,3 +525,13 @@ is reachable, and who this machine is signed in as.
|
|
|
483
525
|
|
|
484
526
|
`0` on success, `1` on failure. Every command prints why it failed on standard
|
|
485
527
|
error, so a script can branch on the status and log the reason.
|
|
528
|
+
|
|
529
|
+
## Source and licence
|
|
530
|
+
|
|
531
|
+
The `cbx` command line and the CBX engine it is built on are open source under
|
|
532
|
+
the Apache License 2.0: <https://github.com/AlexC1991/cbx>. The storage format
|
|
533
|
+
and the sync protocol are specified there too, so other tools can read and
|
|
534
|
+
write the same histories.
|
|
535
|
+
|
|
536
|
+
Copyright 2026 ACCA Gaming Productions. "CodeRook" is a name of ACCA Gaming
|
|
537
|
+
Productions, and the licence grants no right to use it.
|
package/dist/cbx/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/dist/cbx/NOTICE
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
CBX
|
|
2
|
+
Copyright 2026 ACCA Gaming Productions
|
|
3
|
+
|
|
4
|
+
This product includes software developed by ACCA Gaming Productions
|
|
5
|
+
for CodeRook (https://coderook.com).
|
|
6
|
+
|
|
7
|
+
"CodeRook" is a name of ACCA Gaming Productions. The Apache License
|
|
8
|
+
grants no rights to use it; see section 6 of the licence.
|
|
@@ -4,6 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.FOOTER_MAGIC = exports.MANIFEST_MAGIC = exports.CHUNK_MAGIC = exports.HEADER_MAGIC = exports.cutPoints = void 0;
|
|
7
|
+
exports.chunkFrame = chunkFrame;
|
|
8
|
+
exports.openChunkFrame = openChunkFrame;
|
|
7
9
|
exports.packBundle = packBundle;
|
|
8
10
|
exports.readManifest = readManifest;
|
|
9
11
|
exports.unpackBundle = unpackBundle;
|
|
@@ -95,6 +97,35 @@ function chunkFrame(raw) {
|
|
|
95
97
|
},
|
|
96
98
|
};
|
|
97
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* The original bytes of a whole chunk frame, checked against `expected`.
|
|
102
|
+
*
|
|
103
|
+
* A frame carries both digests, so damage to the stored bytes is caught
|
|
104
|
+
* before anything is decompressed, and a frame filed under the wrong name is
|
|
105
|
+
* caught after. The local store keeps each chunk as one of these, which is
|
|
106
|
+
* why a chunk looks the same inside a bundle and on its own.
|
|
107
|
+
*/
|
|
108
|
+
function openChunkFrame(frame, expected) {
|
|
109
|
+
if (frame.length < CHUNK_HEADER_BYTES || frame.toString("latin1", 0, 4) !== exports.CHUNK_MAGIC) {
|
|
110
|
+
throw new Error(`Chunk ${expected.slice(0, 12)} is not a chunk frame`);
|
|
111
|
+
}
|
|
112
|
+
const codec = frame.readUInt8(4);
|
|
113
|
+
const rawSize = Number(frame.readBigUInt64LE(8));
|
|
114
|
+
const storedSize = Number(frame.readBigUInt64LE(16));
|
|
115
|
+
const stored = frame.subarray(CHUNK_HEADER_BYTES);
|
|
116
|
+
if (stored.length !== storedSize ||
|
|
117
|
+
sha256(stored) !== frame.subarray(56, 88).toString("hex")) {
|
|
118
|
+
throw new Error(`Chunk ${expected.slice(0, 12)} is damaged`);
|
|
119
|
+
}
|
|
120
|
+
if (codec !== CODEC_NONE && codec !== CODEC_ZSTD) {
|
|
121
|
+
throw new Error(`Chunk ${expected.slice(0, 12)} uses an unknown codec (${codec})`);
|
|
122
|
+
}
|
|
123
|
+
const raw = codec === CODEC_ZSTD ? (0, node_zlib_1.zstdDecompressSync)(stored) : stored;
|
|
124
|
+
if (raw.length !== rawSize || sha256(raw) !== expected) {
|
|
125
|
+
throw new Error(`Chunk ${expected.slice(0, 12)} does not match its identity`);
|
|
126
|
+
}
|
|
127
|
+
return raw;
|
|
128
|
+
}
|
|
98
129
|
/**
|
|
99
130
|
* Write a bundle. Frames stream out as files are read, and the completed
|
|
100
131
|
* file is renamed into place only at the end, so an interrupted pack leaves
|
|
@@ -255,7 +255,11 @@ class Downloader {
|
|
|
255
255
|
fileCount: Number(row.fileCount ?? 0),
|
|
256
256
|
sourceSize: Number(row.sourceSize ?? 0),
|
|
257
257
|
createdAt: String(row.createdAt ?? ""),
|
|
258
|
-
|
|
258
|
+
/* The service sends `author.displayName`; `authorName` was never filled. */
|
|
259
|
+
authorName: String(row.authorName ?? row.author?.displayName ?? ""),
|
|
260
|
+
...(Array.isArray(row.parentVersionIds)
|
|
261
|
+
? { parentVersionIds: row.parentVersionIds.map((id) => String(id)) }
|
|
262
|
+
: {}),
|
|
259
263
|
}));
|
|
260
264
|
}
|
|
261
265
|
/**
|
|
@@ -428,6 +432,63 @@ class Downloader {
|
|
|
428
432
|
await (0, promises_1.rm)(scratch, { recursive: true, force: true });
|
|
429
433
|
}
|
|
430
434
|
}
|
|
435
|
+
/**
|
|
436
|
+
* Hand each of `files` to `visit`, verified, without writing a folder.
|
|
437
|
+
*
|
|
438
|
+
* For a caller that keeps files somewhere of its own: the local history
|
|
439
|
+
* stores them as objects. A solid pack is fetched once and its members
|
|
440
|
+
* handed over as bytes; anything else arrives at `scratch` first, so a
|
|
441
|
+
* large file is never held in memory, and is gone before the next one.
|
|
442
|
+
*/
|
|
443
|
+
async collect(repositoryId, versionId, files, scratch, visit) {
|
|
444
|
+
await (0, promises_1.mkdir)(scratch, { recursive: true });
|
|
445
|
+
const temporary = node_path_1.default.join(scratch, "arriving.partial");
|
|
446
|
+
const packs = new Map();
|
|
447
|
+
const single = [];
|
|
448
|
+
for (const file of files) {
|
|
449
|
+
const id = file.sealed ? undefined : file.pack?.objectId;
|
|
450
|
+
if (!id) {
|
|
451
|
+
single.push(file);
|
|
452
|
+
continue;
|
|
453
|
+
}
|
|
454
|
+
const group = packs.get(id) ?? [];
|
|
455
|
+
group.push(file);
|
|
456
|
+
packs.set(id, group);
|
|
457
|
+
}
|
|
458
|
+
try {
|
|
459
|
+
for (const [packId, members] of packs) {
|
|
460
|
+
this.check();
|
|
461
|
+
const reply = await this.request(`/v1/repositories/${repositoryId}/objects/${packId}`);
|
|
462
|
+
const body = Buffer.from(await reply.arrayBuffer());
|
|
463
|
+
const expected = reply.headers.get("x-coderook-sha256");
|
|
464
|
+
if (expected && (0, node_crypto_1.createHash)("sha256").update(body).digest("hex") !== expected) {
|
|
465
|
+
throw new Error("A solid pack did not arrive intact");
|
|
466
|
+
}
|
|
467
|
+
for (const member of members) {
|
|
468
|
+
const { offset, length } = member.pack;
|
|
469
|
+
if (offset < 0 || length < 0 || offset + length > body.byteLength) {
|
|
470
|
+
throw new Error(`${member.path} points outside its solid pack`);
|
|
471
|
+
}
|
|
472
|
+
const bytes = Buffer.from(body.subarray(offset, offset + length));
|
|
473
|
+
if ((0, node_crypto_1.createHash)("sha256").update(bytes).digest("hex") !== member.sha256) {
|
|
474
|
+
throw new Error(`${member.path} did not arrive intact`);
|
|
475
|
+
}
|
|
476
|
+
await visit(member, { bytes });
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
for (const file of single) {
|
|
480
|
+
this.check();
|
|
481
|
+
const digest = await this.fetchInto(repositoryId, versionId, file, temporary);
|
|
482
|
+
if (digest !== file.sha256)
|
|
483
|
+
throw new Error(`${file.path} did not arrive intact`);
|
|
484
|
+
await visit(file, { path: temporary });
|
|
485
|
+
await (0, promises_1.rm)(temporary, { force: true });
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
finally {
|
|
489
|
+
await (0, promises_1.rm)(temporary, { force: true });
|
|
490
|
+
}
|
|
491
|
+
}
|
|
431
492
|
async fetchInto(repositoryId, versionId, file, target) {
|
|
432
493
|
const whole = (0, node_crypto_1.createHash)("sha256");
|
|
433
494
|
/*
|
|
@@ -17,6 +17,8 @@ exports.UNCOUNTED_DIRECTORIES = new Set([
|
|
|
17
17
|
".hg",
|
|
18
18
|
".svn",
|
|
19
19
|
".coderook",
|
|
20
|
+
/* The local history `cbx init` keeps; saving it into itself would never end. */
|
|
21
|
+
".cbx",
|
|
20
22
|
]);
|
|
21
23
|
/**
|
|
22
24
|
* Whether an entry is version-control plumbing rather than project content.
|