@bash0816/claude-code 2.1.159-9 → 2.1.161-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/LICENSE +198 -0
- package/README.md +63 -14
- package/bin/claude +2 -2
- package/config/claude-native-audited-versions.json +67 -22
- package/config/claude-termux-release-manifest.json +3 -8
- package/lib/check-updates.js +13 -123
- package/lib/native-update-guard.js +257 -0
- package/lib/native-update-guard.test.js +310 -0
- package/lib/postinstall.js +1 -2
- package/lib/preinstall.js +0 -6
- package/lib/prepare-native.js +79 -9
- package/lib/termux-run-claude-native.sh +638 -511
- package/lib/version-utils.js +24 -0
- package/lib/version-utils.test.js +25 -0
- package/package.json +18 -7
package/LICENSE
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable by
|
|
79
|
+
such Contributor that are necessarily infringed by their Contribution(s)
|
|
80
|
+
alone or by combination of their Contribution(s) with the Work to
|
|
81
|
+
which such Contribution(s) was submitted. If You institute patent
|
|
82
|
+
litigation against any entity (including a cross-claim or counterclaim
|
|
83
|
+
in a lawsuit) alleging that the Work or a Contribution incorporated
|
|
84
|
+
within the Work constitutes direct or contributory patent infringement,
|
|
85
|
+
then any patent licenses granted to You under this License for that
|
|
86
|
+
Work shall terminate as of the date such litigation is filed.
|
|
87
|
+
|
|
88
|
+
4. Redistribution. You may reproduce and distribute copies of the Work
|
|
89
|
+
or Derivative Works thereof in any medium, with or without
|
|
90
|
+
modifications, and in Source or Object form, provided that You meet
|
|
91
|
+
the following conditions:
|
|
92
|
+
|
|
93
|
+
(a) You must give any other recipients of the Work or Derivative Works
|
|
94
|
+
a copy of this License; and
|
|
95
|
+
|
|
96
|
+
(b) You must cause any modified files to carry prominent notices stating
|
|
97
|
+
that You changed the files; and
|
|
98
|
+
|
|
99
|
+
(c) You must retain, in the Source form of any Derivative Works that
|
|
100
|
+
You distribute, all copyright, patent, trademark, and attribution
|
|
101
|
+
notices from the Source form of the Work, excluding those notices
|
|
102
|
+
that do not pertain to any part of the Derivative Works; and
|
|
103
|
+
|
|
104
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
105
|
+
distribution, then any Derivative Works that You distribute must
|
|
106
|
+
include a readable copy of the attribution notices contained
|
|
107
|
+
within such NOTICE file, excluding those notices that do not
|
|
108
|
+
pertain to any part of the Derivative Works, in at least one of
|
|
109
|
+
the following places: within a NOTICE text file distributed as part
|
|
110
|
+
of the Derivative Works; within the Source form or documentation,
|
|
111
|
+
if provided along with the Derivative Works; or, within a display
|
|
112
|
+
generated by the Derivative Works, if and wherever such third-party
|
|
113
|
+
notices normally appear. The contents of the NOTICE file are for
|
|
114
|
+
informational purposes only and do not modify the License. You may
|
|
115
|
+
add Your own attribution notices within Derivative Works that You
|
|
116
|
+
distribute, alongside or as an addendum to the NOTICE text from the
|
|
117
|
+
Work, provided that such additional attribution notices cannot be
|
|
118
|
+
construed as modifying the License.
|
|
119
|
+
|
|
120
|
+
You may add Your own copyright statement to Your modifications and may
|
|
121
|
+
provide additional or different license terms and conditions for use,
|
|
122
|
+
reproduction, or distribution of your modifications, or for any such
|
|
123
|
+
Derivative Works as a whole, provided Your use, reproduction, and
|
|
124
|
+
distribution of the Work otherwise complies with the conditions stated
|
|
125
|
+
in this License.
|
|
126
|
+
|
|
127
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
128
|
+
any Contribution intentionally submitted for inclusion in the Work by
|
|
129
|
+
You to the Licensor shall be under the terms and conditions of this
|
|
130
|
+
License, without any additional terms or conditions. Notwithstanding
|
|
131
|
+
the above, nothing herein shall supersede or modify the terms of any
|
|
132
|
+
separate license agreement you may have executed with Licensor
|
|
133
|
+
regarding such Contributions.
|
|
134
|
+
|
|
135
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
136
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
137
|
+
except as required for reasonable and customary use in describing the
|
|
138
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
139
|
+
|
|
140
|
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to
|
|
141
|
+
in writing, Licensor provides the Work (and each Contributor provides
|
|
142
|
+
its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
143
|
+
CONDITIONS OF ANY KIND, either express or implied, including, without
|
|
144
|
+
limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT,
|
|
145
|
+
MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely
|
|
146
|
+
responsible for determining the appropriateness of using or
|
|
147
|
+
redistributing the Work and assume any risks associated with Your
|
|
148
|
+
exercise of permissions under this License.
|
|
149
|
+
|
|
150
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
151
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
152
|
+
unless required by applicable law (such as deliberate and grossly
|
|
153
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
154
|
+
liable to You for damages, including any direct, indirect, special,
|
|
155
|
+
incidental, or consequential damages of any character arising as a
|
|
156
|
+
result of this License or out of the use or inability to use the
|
|
157
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
158
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
159
|
+
other commercial damages or losses), even if such Contributor
|
|
160
|
+
has been advised of the possibility of such damages.
|
|
161
|
+
|
|
162
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
163
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
164
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
165
|
+
or other liability obligations and/or rights consistent with this
|
|
166
|
+
License. However, in accepting such obligations, You may act only
|
|
167
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
168
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
169
|
+
defend, and hold each Contributor harmless for any liability
|
|
170
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
171
|
+
of your accepting any such warranty or additional liability.
|
|
172
|
+
|
|
173
|
+
END OF TERMS AND CONDITIONS
|
|
174
|
+
|
|
175
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
176
|
+
|
|
177
|
+
To apply the Apache License to your work, attach the following
|
|
178
|
+
boilerplate notice, with the fields enclosed by brackets "{}"
|
|
179
|
+
replaced with your own identifying information. (Don't include
|
|
180
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
181
|
+
comment syntax for the file format. We also recommend that a
|
|
182
|
+
file or class name and description of purpose be included on the
|
|
183
|
+
same "printed page" as the copyright notice for easier
|
|
184
|
+
identification within third-party archives.
|
|
185
|
+
|
|
186
|
+
Copyright {yyyy} {name of copyright owner}
|
|
187
|
+
|
|
188
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
189
|
+
you may not use this file except in compliance with the License.
|
|
190
|
+
You may obtain a copy of the License at
|
|
191
|
+
|
|
192
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
193
|
+
|
|
194
|
+
Unless required by applicable law or agreed to in writing, software
|
|
195
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
196
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
197
|
+
See the License for the specific language governing permissions and
|
|
198
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,31 +1,80 @@
|
|
|
1
|
-
# @bash0816/
|
|
1
|
+
# @bash0816/claude-code
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
> Please migrate to the canonical package: [@bash0816/claude-code](https://www.npmjs.com/package/@bash0816/claude-code)
|
|
3
|
+
Termux-native Claude Code wrapper package.
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
Termux 向け Claude Code native wrapper package です。
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
This package is the current Termux wrapper package line.
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
この package は現行の Termux wrapper package 系です。
|
|
10
|
+
|
|
11
|
+
## Install / インストール
|
|
11
12
|
|
|
12
13
|
```sh
|
|
13
|
-
npm uninstall -g @bash0816/cluade-code
|
|
14
14
|
npm install -g @bash0816/claude-code@latest
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
If an older audited launcher from this repository already exists at `$PREFIX/bin/claude`, migrate through the updated launcher.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
この repository の古い監査済み launcher が `$PREFIX/bin/claude` にある場合は、更新済み launcher 経由で移行します。
|
|
20
20
|
|
|
21
21
|
```sh
|
|
22
22
|
claude update
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
If npm reports `EEXIST` before package scripts run, use a one-time forced migration.
|
|
26
|
+
|
|
27
|
+
package script 実行前に npm が `EEXIST` を返す場合は、初回だけ forced migration を使います。
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
npm install -g --force @bash0816/claude-code@latest
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
After npm owns the `claude` bin link, normal `npm install -g` updates work.
|
|
34
|
+
|
|
35
|
+
npm が `claude` bin link を管理する状態になれば、通常の `npm install -g` 更新が使えます。
|
|
36
|
+
|
|
37
|
+
Latest audited version / 最新監査済み版:
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
npm install -g @bash0816/claude-code@2.1.161-1
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Update / 更新
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
claude update
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
`claude update` installs the latest audited package version.
|
|
50
|
+
|
|
51
|
+
`claude update` は最新の監査済み package version を install します。
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
npm install -g @bash0816/claude-code@<latest_audited_version>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
If you already have the repo's `2.1.161` release or the official upstream
|
|
58
|
+
`2.1.165` installed, install `2.1.161-1` explicitly. `claude update` will not
|
|
59
|
+
roll a newer installed terminal back to this repo's current audited release.
|
|
60
|
+
|
|
61
|
+
この repo の `2.1.161` release または official upstream の `2.1.165` を
|
|
62
|
+
すでに入れている端末では、`2.1.161-1` を明示 install してください。
|
|
63
|
+
`claude update` だけでは、より新しい端末をこの repo の現在の audited release に戻しません。
|
|
64
|
+
|
|
65
|
+
Normal launch also checks the same manifest with a short timeout and prints a notice when a newer audited version is available.
|
|
66
|
+
|
|
67
|
+
通常起動時も、同じ manifest を短い timeout で確認し、新しい監査済み version があれば通知します。
|
|
26
68
|
|
|
27
|
-
|
|
28
|
-
All new releases are published under [@bash0816/claude-code](https://www.npmjs.com/package/@bash0816/claude-code).
|
|
69
|
+
## Policy / 方針
|
|
29
70
|
|
|
30
|
-
|
|
31
|
-
|
|
71
|
+
- Only audited versions in `config/claude-native-audited-versions.json` can run.
|
|
72
|
+
- `config/claude-native-audited-versions.json` にある監査済み version だけを実行できます。
|
|
73
|
+
- See `config/claude-native-audited-versions.json` for the full list of included versions.
|
|
74
|
+
- 含まれるバージョンの全リストは `config/claude-native-audited-versions.json` を参照してください。
|
|
75
|
+
- The metadata file is the source of truth for the currently audited set.
|
|
76
|
+
- 現在の監査済み version 集合の source of truth は metadata file です。
|
|
77
|
+
- Native artifacts are cached under `${HOME}/.claude-termux-native-package`.
|
|
78
|
+
- native artifact は `${HOME}/.claude-termux-native-package` に cache します。
|
|
79
|
+
- If native preparation fails, the command exits with an error.
|
|
80
|
+
- native preparation に失敗した場合、command は error で終了します。
|
package/bin/claude
CHANGED
|
@@ -14,8 +14,7 @@ done
|
|
|
14
14
|
PACKAGE_DIR=$(CDPATH= cd -- "$(dirname -- "${SELF}")/.." && pwd)
|
|
15
15
|
CONFIG_FILE="${PACKAGE_DIR}/config/claude-native-audited-versions.json"
|
|
16
16
|
PACKAGE_VERSION=$(node -e 'const fs=require("fs"); const path=require("path"); const p=JSON.parse(fs.readFileSync(path.join(process.argv[1],"package.json"),"utf8")); process.stdout.write(p.version)' "${PACKAGE_DIR}")
|
|
17
|
-
|
|
18
|
-
CLAUDE_VERSION="${CLAUDE_TERMUX_CLAUDE_VERSION:-${DEFAULT_NATIVE_VERSION:-${PACKAGE_VERSION}}}"
|
|
17
|
+
CLAUDE_VERSION="${CLAUDE_TERMUX_CLAUDE_VERSION:-${PACKAGE_VERSION}}"
|
|
19
18
|
UPDATE_HELPER="${PACKAGE_DIR}/lib/check-updates.js"
|
|
20
19
|
|
|
21
20
|
if [ "${1:-}" = "update" ]; then
|
|
@@ -58,5 +57,6 @@ WORKDIR="${CACHE_DIR}/launcher-workdir" \
|
|
|
58
57
|
ENTRY_JS_OFFSET="${ENTRY_JS_OFFSET}" \
|
|
59
58
|
ENTRY_END_OFFSET="${ENTRY_END_OFFSET}" \
|
|
60
59
|
CURRENT_CLAUDE_VERSION="${CLAUDE_VERSION}" \
|
|
60
|
+
CLAUDE_TERMUX_PACKAGE_DIR="${PACKAGE_DIR}" \
|
|
61
61
|
CLAUDE_NATIVE_UPDATE_CHECK=0 \
|
|
62
62
|
exec sh "${PACKAGE_DIR}/lib/termux-run-claude-native.sh" "$@"
|
|
@@ -175,20 +175,6 @@
|
|
|
175
175
|
"entry_end_offset": 237958345,
|
|
176
176
|
"status": "termux_verified"
|
|
177
177
|
},
|
|
178
|
-
"2.1.154": {
|
|
179
|
-
"wrapper_spec": "@anthropic-ai/claude-code@2.1.154",
|
|
180
|
-
"native_spec": "@anthropic-ai/claude-code-linux-arm64@2.1.154",
|
|
181
|
-
"entry_js_offset": 222957396,
|
|
182
|
-
"entry_end_offset": 238482842,
|
|
183
|
-
"status": "termux_verified"
|
|
184
|
-
},
|
|
185
|
-
"2.1.156": {
|
|
186
|
-
"wrapper_spec": "@anthropic-ai/claude-code@2.1.156",
|
|
187
|
-
"native_spec": "@anthropic-ai/claude-code-linux-arm64@2.1.156",
|
|
188
|
-
"entry_js_offset": 222957812,
|
|
189
|
-
"entry_end_offset": 238483519,
|
|
190
|
-
"status": "termux_verified"
|
|
191
|
-
},
|
|
192
178
|
"2.1.157": {
|
|
193
179
|
"wrapper_spec": "@anthropic-ai/claude-code@2.1.157",
|
|
194
180
|
"native_spec": "@anthropic-ai/claude-code-linux-arm64@2.1.157",
|
|
@@ -196,21 +182,80 @@
|
|
|
196
182
|
"entry_end_offset": 238725072,
|
|
197
183
|
"status": "termux_verified"
|
|
198
184
|
},
|
|
199
|
-
"2.1.159-
|
|
185
|
+
"2.1.159-2": {
|
|
200
186
|
"wrapper_spec": "@anthropic-ai/claude-code@2.1.159",
|
|
201
187
|
"native_spec": "@anthropic-ai/claude-code-linux-arm64@2.1.159",
|
|
202
188
|
"entry_js_offset": 223232708,
|
|
203
189
|
"entry_end_offset": 238749397,
|
|
204
190
|
"tarball_integrity": "sha512-c8dXbuQdrotGWll46GlnXm5IPpORK2VrBSosCmI6f8t7Snc/3F58fX0MbIjJ/ycXpY0aaKuOnufCuxf7wi1Xqw==",
|
|
205
191
|
"tarball_sha256": "0b551634f11742310ba3b6344fb7912ba1ed8ee0ef4702eab0099d31b4eeb070",
|
|
206
|
-
"status": "
|
|
192
|
+
"status": "offset_discovered"
|
|
207
193
|
},
|
|
208
|
-
"2.1.
|
|
209
|
-
"wrapper_spec": "@anthropic-ai/claude-code@2.1.
|
|
210
|
-
"native_spec": "@anthropic-ai/claude-code-linux-arm64@2.1.
|
|
211
|
-
"entry_js_offset":
|
|
212
|
-
"entry_end_offset":
|
|
213
|
-
"
|
|
194
|
+
"2.1.159-4": {
|
|
195
|
+
"wrapper_spec": "@anthropic-ai/claude-code@2.1.159",
|
|
196
|
+
"native_spec": "@anthropic-ai/claude-code-linux-arm64@2.1.159",
|
|
197
|
+
"entry_js_offset": 223232708,
|
|
198
|
+
"entry_end_offset": 238749397,
|
|
199
|
+
"tarball_integrity": "sha512-c8dXbuQdrotGWll46GlnXm5IPpORK2VrBSosCmI6f8t7Snc/3F58fX0MbIjJ/ycXpY0aaKuOnufCuxf7wi1Xqw==",
|
|
200
|
+
"tarball_sha256": "0b551634f11742310ba3b6344fb7912ba1ed8ee0ef4702eab0099d31b4eeb070",
|
|
201
|
+
"status": "termux_verified"
|
|
202
|
+
},
|
|
203
|
+
"2.1.159-5": {
|
|
204
|
+
"wrapper_spec": "@anthropic-ai/claude-code@2.1.159",
|
|
205
|
+
"native_spec": "@anthropic-ai/claude-code-linux-arm64@2.1.159",
|
|
206
|
+
"entry_js_offset": 223232708,
|
|
207
|
+
"entry_end_offset": 238749397,
|
|
208
|
+
"tarball_integrity": "sha512-c8dXbuQdrotGWll46GlnXm5IPpORK2VrBSosCmI6f8t7Snc/3F58fX0MbIjJ/ycXpY0aaKuOnufCuxf7wi1Xqw==",
|
|
209
|
+
"tarball_sha256": "0b551634f11742310ba3b6344fb7912ba1ed8ee0ef4702eab0099d31b4eeb070",
|
|
210
|
+
"status": "offset_discovered"
|
|
211
|
+
},
|
|
212
|
+
"2.1.159-8": {
|
|
213
|
+
"wrapper_spec": "@anthropic-ai/claude-code@2.1.159",
|
|
214
|
+
"native_spec": "@anthropic-ai/claude-code-linux-arm64@2.1.159",
|
|
215
|
+
"entry_js_offset": 223232708,
|
|
216
|
+
"entry_end_offset": 238749397,
|
|
217
|
+
"tarball_integrity": "sha512-c8dXbuQdrotGWll46GlnXm5IPpORK2VrBSosCmI6f8t7Snc/3F58fX0MbIjJ/ycXpY0aaKuOnufCuxf7wi1Xqw==",
|
|
218
|
+
"tarball_sha256": "0b551634f11742310ba3b6344fb7912ba1ed8ee0ef4702eab0099d31b4eeb070",
|
|
219
|
+
"status": "termux_verified"
|
|
220
|
+
},
|
|
221
|
+
"2.1.159-13": {
|
|
222
|
+
"wrapper_spec": "@anthropic-ai/claude-code@2.1.159",
|
|
223
|
+
"native_spec": "@anthropic-ai/claude-code-linux-arm64@2.1.159",
|
|
224
|
+
"entry_js_offset": 223232708,
|
|
225
|
+
"entry_end_offset": 238749397,
|
|
226
|
+
"tarball_integrity": "sha512-P6fld9U2MQWZfdEskwjWar4r/wXPQRiYXnwn/TVN2rURHiII0xJuWS/PeTICXMiOZYTbjEGXvPWj/N/FK9YnHA==",
|
|
227
|
+
"tarball_sha256": "634d412b07f04cd43ceefacd8f13166d30d8b47adb8dc2e25a7786eebc598d70",
|
|
228
|
+
"tarball_size": 14768,
|
|
229
|
+
"status": "termux_verified"
|
|
230
|
+
},
|
|
231
|
+
"2.1.161": {
|
|
232
|
+
"wrapper_spec": "@anthropic-ai/claude-code@2.1.161",
|
|
233
|
+
"native_spec": "@anthropic-ai/claude-code-linux-arm64@2.1.161",
|
|
234
|
+
"entry_js_offset": 225551924,
|
|
235
|
+
"entry_end_offset": 241503454,
|
|
236
|
+
"tarball_integrity": "sha512-rLEzd8/q4UnTLDSAd3eYgog+G0iZ8y6K8yh0gSxf82d7uOkypYaBUkbmFENuHuzIzCIf9Yy/utCJfp6kQFjUow==",
|
|
237
|
+
"tarball_sha256": "e87d973bbe58593e06c101196f6417f7d950bf777cb9f1a8ff002ebf987ea066",
|
|
238
|
+
"tarball_size": 74314760,
|
|
239
|
+
"status": "offset_discovered"
|
|
240
|
+
},
|
|
241
|
+
"2.1.161-1": {
|
|
242
|
+
"wrapper_spec": "@anthropic-ai/claude-code@2.1.161",
|
|
243
|
+
"native_spec": "@anthropic-ai/claude-code-linux-arm64@2.1.161",
|
|
244
|
+
"entry_js_offset": 225551924,
|
|
245
|
+
"entry_end_offset": 241503454,
|
|
246
|
+
"tarball_integrity": "sha512-rLEzd8/q4UnTLDSAd3eYgog+G0iZ8y6K8yh0gSxf82d7uOkypYaBUkbmFENuHuzIzCIf9Yy/utCJfp6kQFjUow==",
|
|
247
|
+
"tarball_sha256": "e87d973bbe58593e06c101196f6417f7d950bf777cb9f1a8ff002ebf987ea066",
|
|
248
|
+
"tarball_size": 74314760,
|
|
249
|
+
"status": "termux_verified"
|
|
250
|
+
},
|
|
251
|
+
"2.1.165": {
|
|
252
|
+
"wrapper_spec": "@anthropic-ai/claude-code@2.1.165",
|
|
253
|
+
"native_spec": "@anthropic-ai/claude-code-linux-arm64@2.1.165",
|
|
254
|
+
"entry_js_offset": 226798932,
|
|
255
|
+
"entry_end_offset": 242980856,
|
|
256
|
+
"tarball_integrity": "sha512-uGwKxRQGTxh3BZGnX096CLf/2us5lUFnk4KerWhG4WCpRiEUSu4TUDojp/S3SUzA//FpM57fViUW07XL3T19lw==",
|
|
257
|
+
"tarball_sha256": "6dc6d84624bedaf5ff0948b178fdfc9c2724d8051cb00e70559e292055f7155e",
|
|
258
|
+
"status": "offset_discovered"
|
|
214
259
|
}
|
|
215
260
|
}
|
|
216
261
|
}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest_version": 1,
|
|
3
3
|
"package_name": "@bash0816/claude-code",
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"bridge_package_version": "2.1.159-9",
|
|
8
|
-
"default_native_version": "2.1.159-9",
|
|
9
|
-
"latest_audited_version": "2.1.157",
|
|
10
|
-
"latest_candidate_version": "2.1.159-9",
|
|
11
|
-
"previous_stable_version": "2.1.157-1",
|
|
4
|
+
"latest_audited_version": "2.1.161-1",
|
|
5
|
+
"latest_candidate_version": "2.1.165",
|
|
6
|
+
"previous_stable_version": "2.1.159-13",
|
|
12
7
|
"manifest_url": "https://raw.githubusercontent.com/bash0816/ClaudeCode-Termux/main/config/claude-termux-release-manifest.json"
|
|
13
8
|
}
|
package/lib/check-updates.js
CHANGED
|
@@ -10,6 +10,7 @@ const path = require('path');
|
|
|
10
10
|
const packageDir = path.resolve(__dirname, '..');
|
|
11
11
|
const pkg = require(path.join(packageDir, 'package.json'));
|
|
12
12
|
const localManifest = require(path.join(packageDir, 'config', 'claude-termux-release-manifest.json'));
|
|
13
|
+
const { compareVersions } = require('./version-utils');
|
|
13
14
|
const mode = process.argv[2] || 'notify';
|
|
14
15
|
const currentVersion = process.argv[3] || pkg.version;
|
|
15
16
|
const dryRun = process.argv.includes('--dry-run');
|
|
@@ -19,26 +20,6 @@ const timeoutMs = Number(process.env.CLAUDE_TERMUX_UPDATE_TIMEOUT_MS || '1200');
|
|
|
19
20
|
const ttlMs = Number(process.env.CLAUDE_TERMUX_UPDATE_CACHE_TTL_MS || String(24 * 60 * 60 * 1000));
|
|
20
21
|
const skipCheck = process.env.CLAUDE_TERMUX_SKIP_UPDATE_CHECK === '1';
|
|
21
22
|
const manifestUrl = process.env.CLAUDE_TERMUX_MANIFEST_URL || localManifest.manifest_url;
|
|
22
|
-
const canonicalManifestUrl = process.env.CLAUDE_TERMUX_CANONICAL_MANIFEST_URL || localManifest.canonical_manifest_url || '';
|
|
23
|
-
const canonicalPackageName = process.env.CLAUDE_TERMUX_CANONICAL_PACKAGE_NAME || localManifest.canonical_package_name || '';
|
|
24
|
-
const canonicalRepositoryUrl = process.env.CLAUDE_TERMUX_CANONICAL_REPOSITORY_URL || localManifest.canonical_repository_url || '';
|
|
25
|
-
|
|
26
|
-
function compareVersions(a, b) {
|
|
27
|
-
const parse = v => {
|
|
28
|
-
const [main, patch] = String(v).split('-');
|
|
29
|
-
const parts = main.split('.').map(Number);
|
|
30
|
-
parts.push(patch !== undefined ? Number(patch) : 0);
|
|
31
|
-
return parts;
|
|
32
|
-
};
|
|
33
|
-
const aParts = parse(a);
|
|
34
|
-
const bParts = parse(b);
|
|
35
|
-
const len = Math.max(aParts.length, bParts.length);
|
|
36
|
-
for (let index = 0; index < len; index += 1) {
|
|
37
|
-
const diff = (aParts[index] || 0) - (bParts[index] || 0);
|
|
38
|
-
if (diff !== 0) return diff;
|
|
39
|
-
}
|
|
40
|
-
return 0;
|
|
41
|
-
}
|
|
42
23
|
|
|
43
24
|
function readCache() {
|
|
44
25
|
try {
|
|
@@ -111,64 +92,10 @@ async function resolveManifest(forceRefresh) {
|
|
|
111
92
|
}
|
|
112
93
|
}
|
|
113
94
|
|
|
114
|
-
|
|
115
|
-
if (!canonicalManifestUrl || !canonicalPackageName || canonicalPackageName === pkg.name) {
|
|
116
|
-
return null;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
if (skipCheck) {
|
|
120
|
-
return {
|
|
121
|
-
packageName: canonicalPackageName,
|
|
122
|
-
latestVersion: localManifest.latest_audited_version || pkg.version,
|
|
123
|
-
repositoryUrl: canonicalRepositoryUrl,
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
try {
|
|
128
|
-
const manifest = await fetchManifest(canonicalManifestUrl);
|
|
129
|
-
return {
|
|
130
|
-
packageName: manifest.package_name || canonicalPackageName,
|
|
131
|
-
latestVersion: manifest.latest_audited_version || localManifest.latest_audited_version || pkg.version,
|
|
132
|
-
repositoryUrl: canonicalRepositoryUrl,
|
|
133
|
-
};
|
|
134
|
-
} catch {
|
|
135
|
-
return {
|
|
136
|
-
packageName: canonicalPackageName,
|
|
137
|
-
latestVersion: localManifest.latest_audited_version || pkg.version,
|
|
138
|
-
repositoryUrl: canonicalRepositoryUrl,
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
async function resolveTarget(forceRefresh) {
|
|
144
|
-
const base = await resolveManifest(forceRefresh);
|
|
145
|
-
const canonical = await resolveCanonicalManifest();
|
|
146
|
-
if (!canonical) {
|
|
147
|
-
return {
|
|
148
|
-
manifest: base.manifest,
|
|
149
|
-
cache: base.cache,
|
|
150
|
-
packageName: base.manifest.package_name || pkg.name,
|
|
151
|
-
targetVersion: base.manifest.latest_audited_version || localManifest.latest_audited_version || pkg.version,
|
|
152
|
-
repositoryUrl: '',
|
|
153
|
-
migration: false,
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
return {
|
|
158
|
-
manifest: base.manifest,
|
|
159
|
-
cache: base.cache,
|
|
160
|
-
packageName: canonical.packageName,
|
|
161
|
-
targetVersion: canonical.latestVersion,
|
|
162
|
-
repositoryUrl: canonical.repositoryUrl,
|
|
163
|
-
migration: canonical.packageName !== pkg.name,
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
function updateNoticeCache(cache, packageName, latestVersion) {
|
|
95
|
+
function updateNoticeCache(cache, latestVersion) {
|
|
168
96
|
const nextCache = {
|
|
169
97
|
...cache,
|
|
170
98
|
last_notice: {
|
|
171
|
-
package_name: packageName,
|
|
172
99
|
current_version: currentVersion,
|
|
173
100
|
latest_audited_version: latestVersion,
|
|
174
101
|
notified_at: Date.now(),
|
|
@@ -177,10 +104,9 @@ function updateNoticeCache(cache, packageName, latestVersion) {
|
|
|
177
104
|
writeCache(nextCache);
|
|
178
105
|
}
|
|
179
106
|
|
|
180
|
-
function shouldNotify(cache,
|
|
107
|
+
function shouldNotify(cache, latestVersion) {
|
|
181
108
|
const lastNotice = cache.last_notice;
|
|
182
109
|
if (!lastNotice) return true;
|
|
183
|
-
if (lastNotice.package_name !== packageName) return true;
|
|
184
110
|
if (lastNotice.current_version !== currentVersion) return true;
|
|
185
111
|
if (lastNotice.latest_audited_version !== latestVersion) return true;
|
|
186
112
|
return Date.now() - Number(lastNotice.notified_at || 0) >= ttlMs;
|
|
@@ -204,62 +130,26 @@ function installTarget(packageName, targetVersion) {
|
|
|
204
130
|
}
|
|
205
131
|
|
|
206
132
|
async function runNotify() {
|
|
207
|
-
const
|
|
208
|
-
const latest =
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
if (!migration && compareVersions(currentVersion, latest) >= 0) return 0;
|
|
212
|
-
if (!shouldNotify(target.cache, packageName, latest)) return 0;
|
|
213
|
-
|
|
214
|
-
if (migration) {
|
|
215
|
-
console.error(`Legacy package detected: ${pkg.name}`);
|
|
216
|
-
console.error(`Canonical package available: ${packageName}@${latest}`);
|
|
217
|
-
if (target.repositoryUrl) {
|
|
218
|
-
console.error(`Canonical repository: ${target.repositoryUrl}`);
|
|
219
|
-
}
|
|
220
|
-
console.error('Run: claude update');
|
|
221
|
-
updateNoticeCache(target.cache, packageName, latest);
|
|
222
|
-
return 0;
|
|
223
|
-
}
|
|
133
|
+
const { manifest, cache } = await resolveManifest(false);
|
|
134
|
+
const latest = manifest.latest_audited_version || localManifest.latest_audited_version || pkg.version;
|
|
135
|
+
if (compareVersions(currentVersion, latest) >= 0) return 0;
|
|
136
|
+
if (!shouldNotify(cache, latest)) return 0;
|
|
224
137
|
|
|
225
138
|
console.error(`Audited update available: ${currentVersion} -> ${latest}`);
|
|
226
139
|
console.error('Run: claude update');
|
|
227
|
-
updateNoticeCache(
|
|
140
|
+
updateNoticeCache(cache, latest);
|
|
228
141
|
return 0;
|
|
229
142
|
}
|
|
230
143
|
|
|
231
144
|
async function runUpdate() {
|
|
232
|
-
const
|
|
233
|
-
|
|
145
|
+
const { manifest } = await resolveManifest(true);
|
|
146
|
+
const packageName = manifest.package_name || localManifest.package_name;
|
|
147
|
+
const target = manifest.latest_audited_version || localManifest.latest_audited_version || pkg.version;
|
|
148
|
+
if (compareVersions(currentVersion, target) >= 0) {
|
|
234
149
|
console.error(`Already on latest audited version: ${currentVersion}`);
|
|
235
150
|
return 0;
|
|
236
151
|
}
|
|
237
|
-
|
|
238
|
-
console.error(`Migrating from ${pkg.name} to ${target.packageName}@${target.targetVersion}`);
|
|
239
|
-
if (dryRun) {
|
|
240
|
-
console.log(`npm uninstall -g ${pkg.name}`);
|
|
241
|
-
console.log(`npm install -g ${target.packageName}@${target.targetVersion}`);
|
|
242
|
-
return 0;
|
|
243
|
-
}
|
|
244
|
-
console.error(`Step 1: Uninstalling ${pkg.name}...`);
|
|
245
|
-
const uninstall = cp.spawnSync('npm', ['uninstall', '-g', pkg.name], { stdio: 'inherit', env: process.env });
|
|
246
|
-
if (uninstall.status !== 0) {
|
|
247
|
-
console.error(`Uninstall failed (exit ${uninstall.status}). Cannot safely continue migration.`);
|
|
248
|
-
console.error(`Run manually:`);
|
|
249
|
-
console.error(` npm uninstall -g ${pkg.name}`);
|
|
250
|
-
console.error(` npm install -g ${target.packageName}@${target.targetVersion}`);
|
|
251
|
-
return 1;
|
|
252
|
-
}
|
|
253
|
-
console.error(`Step 2: Installing ${target.packageName}@${target.targetVersion}...`);
|
|
254
|
-
const result = cp.spawnSync('npm', ['install', '-g', `${target.packageName}@${target.targetVersion}`], { stdio: 'inherit', env: process.env });
|
|
255
|
-
if (result.status !== 0) {
|
|
256
|
-
console.error(`Install failed. To restore, run:`);
|
|
257
|
-
console.error(` npm install -g ${target.packageName}@${target.targetVersion}`);
|
|
258
|
-
console.error(` # or to restore legacy: npm install -g ${pkg.name}@${pkg.version}`);
|
|
259
|
-
}
|
|
260
|
-
return result.status === null ? 1 : result.status;
|
|
261
|
-
}
|
|
262
|
-
return installTarget(target.packageName, target.targetVersion);
|
|
152
|
+
return installTarget(packageName, target);
|
|
263
153
|
}
|
|
264
154
|
|
|
265
155
|
async function main() {
|