@claudinite/cli 1.61011.3 → 1.61012.2
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/THIRD_PARTY_LICENSES +64 -0
- package/launch +109 -152
- package/manifest.json +10 -10
- package/manifest.sig.json +1 -1
- package/npx-cn +55 -0
- package/package.json +3 -3
package/THIRD_PARTY_LICENSES
CHANGED
|
@@ -122,3 +122,67 @@ distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
122
122
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
123
123
|
See the License for the specific language governing permissions and
|
|
124
124
|
limitations under the License.
|
|
125
|
+
|
|
126
|
+
== golang.org/x/crypto v0.56.0 ==
|
|
127
|
+
|
|
128
|
+
--- LICENSE ---
|
|
129
|
+
|
|
130
|
+
Copyright 2009 The Go Authors.
|
|
131
|
+
|
|
132
|
+
Redistribution and use in source and binary forms, with or without
|
|
133
|
+
modification, are permitted provided that the following conditions are
|
|
134
|
+
met:
|
|
135
|
+
|
|
136
|
+
* Redistributions of source code must retain the above copyright
|
|
137
|
+
notice, this list of conditions and the following disclaimer.
|
|
138
|
+
* Redistributions in binary form must reproduce the above
|
|
139
|
+
copyright notice, this list of conditions and the following disclaimer
|
|
140
|
+
in the documentation and/or other materials provided with the
|
|
141
|
+
distribution.
|
|
142
|
+
* Neither the name of Google LLC nor the names of its
|
|
143
|
+
contributors may be used to endorse or promote products derived from
|
|
144
|
+
this software without specific prior written permission.
|
|
145
|
+
|
|
146
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
147
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
148
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
149
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
150
|
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
151
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
152
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
153
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
154
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
155
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
156
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
157
|
+
|
|
158
|
+
== golang.org/x/sys v0.47.0 ==
|
|
159
|
+
|
|
160
|
+
--- LICENSE ---
|
|
161
|
+
|
|
162
|
+
Copyright 2009 The Go Authors.
|
|
163
|
+
|
|
164
|
+
Redistribution and use in source and binary forms, with or without
|
|
165
|
+
modification, are permitted provided that the following conditions are
|
|
166
|
+
met:
|
|
167
|
+
|
|
168
|
+
* Redistributions of source code must retain the above copyright
|
|
169
|
+
notice, this list of conditions and the following disclaimer.
|
|
170
|
+
* Redistributions in binary form must reproduce the above
|
|
171
|
+
copyright notice, this list of conditions and the following disclaimer
|
|
172
|
+
in the documentation and/or other materials provided with the
|
|
173
|
+
distribution.
|
|
174
|
+
* Neither the name of Google LLC nor the names of its
|
|
175
|
+
contributors may be used to endorse or promote products derived from
|
|
176
|
+
this software without specific prior written permission.
|
|
177
|
+
|
|
178
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
179
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
180
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
181
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
182
|
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
183
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
184
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
185
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
186
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
187
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
188
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/launch
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
#!/bin/sh
|
|
2
|
-
# Claudinite
|
|
3
|
-
# unchanged; only the engine update replaces it.
|
|
2
|
+
# Claudinite engine setup. A member checks this file in as
|
|
3
|
+
# .claudinite/setup-cn.sh, unchanged; only the engine update replaces it.
|
|
4
4
|
#
|
|
5
|
-
# sh .claudinite/
|
|
6
|
-
# sh .claudinite/launch env install fetch, verify and cache only (environment pre-warm)
|
|
5
|
+
# sh .claudinite/setup-cn.sh fetch, verify and cache the pinned engine, and link .claudinite/bin/cn to it
|
|
7
6
|
#
|
|
8
7
|
# It reads engine.version and engine.manifest from .claudinite/settings.yaml,
|
|
9
|
-
#
|
|
8
|
+
# downloads that release's manifest.json and this platform's
|
|
10
9
|
# binary from the npm registry, or from the GitHub releases of the
|
|
11
10
|
# repository engine.releases names (owner/name, tag v<version>, assets named
|
|
12
11
|
# as npm's tarballs), checks the manifest against the pin and the
|
|
13
|
-
# binary against the manifest, caches the binary read-only
|
|
14
|
-
# .claudinite/bin/cn to it
|
|
12
|
+
# binary against the manifest, caches the binary read-only and links
|
|
13
|
+
# .claudinite/bin/cn to it. Nothing is trusted that the pin
|
|
15
14
|
# does not cover; the registry's identity is immaterial to integrity.
|
|
16
15
|
#
|
|
17
|
-
#
|
|
18
|
-
#
|
|
19
|
-
#
|
|
16
|
+
# It never runs cn: every caller runs .claudinite/bin/cn itself once this
|
|
17
|
+
# exits 0. On a failure it removes that link, so no other engine runs in
|
|
18
|
+
# its place, says why on stderr, prints a line telling the session to stop
|
|
19
|
+
# and ask the person on stdout, and exits 1.
|
|
20
20
|
#
|
|
21
|
-
#
|
|
22
|
-
#
|
|
23
|
-
#
|
|
24
|
-
#
|
|
25
|
-
#
|
|
26
|
-
#
|
|
27
|
-
#
|
|
28
|
-
#
|
|
29
|
-
#
|
|
30
|
-
#
|
|
21
|
+
# sh setup-cn.sh --from-package DIR
|
|
22
|
+
#
|
|
23
|
+
# The @claudinite/cli package carries this file as package/launch, beside
|
|
24
|
+
# its manifest.json and manifest.sig.json, for its npx bin to adopt a
|
|
25
|
+
# repository with: from DIR, the folder the package unpacked to, it takes
|
|
26
|
+
# the version and the binary's hash from the package's own manifest.json,
|
|
27
|
+
# fetches and checks the binary as above, caches it with the manifest and
|
|
28
|
+
# manifest.sig.json, which cn adopt verifies before it writes anything, and
|
|
29
|
+
# prints the binary's path instead of linking it. Windows is not covered:
|
|
30
|
+
# npm's shim for a sh script there is the desktop work.
|
|
31
31
|
#
|
|
32
32
|
# CLAUDINITE_REGISTRY overrides the registry, CLAUDINITE_GITHUB the GitHub
|
|
33
33
|
# host releases are read from and CLAUDINITE_MAX_DOWNLOAD_BYTES the download
|
|
@@ -38,17 +38,25 @@ registry=${CLAUDINITE_REGISTRY:-https://registry.npmjs.org}
|
|
|
38
38
|
github=${CLAUDINITE_GITHUB:-https://github.com}
|
|
39
39
|
max_bytes=${CLAUDINITE_MAX_DOWNLOAD_BYTES:-67108864}
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
# Run as .claudinite/launch, the name engines before the rename wrote it
|
|
42
|
+
# under and every caller they wired still names, it is that launcher: it
|
|
43
|
+
# runs cn with its arguments once the engine is in place, and a failure
|
|
44
|
+
# exits as each of those callers expects.
|
|
45
|
+
#
|
|
46
|
+
# @legacy-tolerance advisory:launcher-renamed retire:#224
|
|
47
|
+
legacy=
|
|
48
|
+
if [ "${0##*/}" = launch ] && [ "${1:-}" != --from-package ]; then
|
|
49
|
+
if [ "${1:-}" = hook ] && [ "${2:-}" = session-start ]; then
|
|
50
|
+
legacy=session-start
|
|
51
|
+
elif [ "${1:-}" = hook ]; then
|
|
52
|
+
legacy=guard
|
|
53
|
+
else
|
|
54
|
+
legacy='command'
|
|
55
|
+
fi
|
|
49
56
|
fi
|
|
50
57
|
|
|
51
58
|
tmp=
|
|
59
|
+
here=
|
|
52
60
|
cleanup() {
|
|
53
61
|
if [ -n "$tmp" ]; then
|
|
54
62
|
chmod -R u+w "$tmp" 2>/dev/null
|
|
@@ -60,40 +68,56 @@ trap cleanup EXIT
|
|
|
60
68
|
trap 'cleanup; exit 1' HUP INT TERM
|
|
61
69
|
|
|
62
70
|
say() {
|
|
63
|
-
printf 'claudinite
|
|
71
|
+
printf 'claudinite setup: %s\n' "$*" >&2
|
|
64
72
|
}
|
|
65
73
|
|
|
66
|
-
#
|
|
67
|
-
|
|
74
|
+
# fail_with CODE: the engine never runs, so the link to it goes.
|
|
75
|
+
fail_with() {
|
|
68
76
|
cleanup
|
|
77
|
+
if [ -n "$here" ] && [ -z "$from_package" ]; then
|
|
78
|
+
rm -f "$here/bin/cn" "$here/bin/cn.exe"
|
|
79
|
+
fi
|
|
80
|
+
exit "$1"
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
# A configuration or integrity failure.
|
|
84
|
+
refuse() {
|
|
69
85
|
say "$1"
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
guard) exit 2 ;;
|
|
75
|
-
*) exit 1 ;;
|
|
86
|
+
printf 'Claudinite refused to set up its engine: %s: stop and ask the person before continuing.\n' "$1"
|
|
87
|
+
case $legacy in
|
|
88
|
+
session-start) fail_with 0 ;;
|
|
89
|
+
guard) fail_with 2 ;;
|
|
76
90
|
esac
|
|
91
|
+
fail_with 1
|
|
77
92
|
}
|
|
78
93
|
|
|
79
94
|
# The registry could not be reached; nothing verified is cached.
|
|
80
95
|
unreachable() {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
printf 'Claudinite could not fetch its engine from %s: stop and ask the person before continuing.\n' "$1"
|
|
86
|
-
exit 0 ;;
|
|
87
|
-
guard)
|
|
88
|
-
say "could not fetch the engine from $1; continuing without it, and SessionStart will say so again"
|
|
89
|
-
exit 0 ;;
|
|
90
|
-
*)
|
|
91
|
-
say "could not fetch the engine from $1"
|
|
92
|
-
exit 1 ;;
|
|
96
|
+
say "could not fetch the engine from $1"
|
|
97
|
+
printf 'Claudinite could not fetch its engine from %s: stop and ask the person before continuing.\n' "$1"
|
|
98
|
+
case $legacy in
|
|
99
|
+
session-start | guard) fail_with 0 ;;
|
|
93
100
|
esac
|
|
101
|
+
fail_with 1
|
|
94
102
|
}
|
|
95
103
|
|
|
96
|
-
|
|
104
|
+
from_package=
|
|
105
|
+
if [ -z "$legacy" ]; then
|
|
106
|
+
while [ $# -gt 0 ]; do
|
|
107
|
+
case $1 in
|
|
108
|
+
--from-package)
|
|
109
|
+
[ $# -ge 2 ] || refuse "--from-package needs the package's folder"
|
|
110
|
+
from_package=$2
|
|
111
|
+
shift 2 ;;
|
|
112
|
+
--from-package=*)
|
|
113
|
+
from_package=${1#*=}
|
|
114
|
+
shift ;;
|
|
115
|
+
*) refuse "unknown argument $1: setup-cn.sh takes only --from-package DIR" ;;
|
|
116
|
+
esac
|
|
117
|
+
done
|
|
118
|
+
fi
|
|
119
|
+
|
|
120
|
+
# The shapes a value must have, by shell patterns alone: the script runs
|
|
97
121
|
# once per session and per workflow step, and each tool it starts costs a
|
|
98
122
|
# process.
|
|
99
123
|
digits() {
|
|
@@ -124,85 +148,41 @@ dir_of() {
|
|
|
124
148
|
esac
|
|
125
149
|
}
|
|
126
150
|
|
|
127
|
-
# Step 1: the pin, from
|
|
128
|
-
|
|
129
|
-
dir_of "$0"
|
|
130
|
-
here=$(cd "$dir" && pwd) || refuse "cannot locate the .claudinite folder"
|
|
151
|
+
# Step 1: the pin, from the settings file.
|
|
131
152
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
case $link in
|
|
137
|
-
/*) self=$link ;;
|
|
138
|
-
*) dir_of "$self"; self=$dir/$link ;;
|
|
139
|
-
esac
|
|
140
|
-
done
|
|
141
|
-
dir_of "$self"
|
|
142
|
-
pkgdir=$(cd "$dir" && pwd) || refuse "cannot locate the launcher's folder"
|
|
143
|
-
bootstrap=
|
|
144
|
-
if [ -f "$pkgdir/manifest.json" ] && [ -f "$pkgdir/package.json" ]; then
|
|
145
|
-
if [ "${1:-}" = init ]; then
|
|
146
|
-
bootstrap=1
|
|
147
|
-
else
|
|
148
|
-
repo=.
|
|
149
|
-
want=
|
|
150
|
-
for arg do
|
|
151
|
-
if [ -n "$want" ]; then
|
|
152
|
-
want=
|
|
153
|
-
[ -d "$arg" ] && repo=$arg
|
|
154
|
-
continue
|
|
155
|
-
fi
|
|
156
|
-
case $arg in
|
|
157
|
-
--) break ;;
|
|
158
|
-
--repo|-repo) want=1 ;;
|
|
159
|
-
--repo=*|-repo=*) [ -d "${arg#*=}" ] && repo=${arg#*=} ;;
|
|
160
|
-
esac
|
|
161
|
-
done
|
|
162
|
-
here=$(cd "$repo" && pwd)/.claudinite || refuse "cannot locate the repository $repo"
|
|
163
|
-
if [ "${1:-}" = adopt ] && [ ! -f "$here/settings.yaml" ] && [ ! -f "$here/settings.toml" ] && [ ! -f "$here/settings.json" ]; then
|
|
164
|
-
bootstrap=1
|
|
165
|
-
fi
|
|
166
|
-
fi
|
|
167
|
-
fi
|
|
168
|
-
|
|
169
|
-
format=
|
|
170
|
-
count=0
|
|
171
|
-
for ext in yaml toml json; do
|
|
172
|
-
if [ -f "$here/settings.$ext" ]; then
|
|
173
|
-
format=$ext
|
|
174
|
-
count=$((count + 1))
|
|
153
|
+
if [ -n "$from_package" ]; then
|
|
154
|
+
pkgdir=$(cd "$from_package" && pwd) || refuse "cannot locate the package folder $from_package"
|
|
155
|
+
if [ ! -f "$pkgdir/manifest.json" ] || [ ! -f "$pkgdir/package.json" ]; then
|
|
156
|
+
refuse "$pkgdir holds no manifest.json and package.json"
|
|
175
157
|
fi
|
|
176
|
-
done
|
|
177
|
-
|
|
178
|
-
if [ -n "$bootstrap" ]; then
|
|
179
158
|
settings=$pkgdir/manifest.json
|
|
180
159
|
[ -f "$pkgdir/manifest.sig.json" ] || refuse "$pkgdir holds no manifest.sig.json, and cn adopt never runs from an unsigned manifest"
|
|
181
160
|
else
|
|
182
|
-
|
|
183
|
-
|
|
161
|
+
dir_of "$0"
|
|
162
|
+
here=$(cd "$dir" && pwd) || refuse "cannot locate the .claudinite folder"
|
|
163
|
+
settings=$here/settings.yaml
|
|
164
|
+
[ -f "$settings" ] || refuse ".claudinite/settings.yaml does not exist in ${here%/.claudinite}"
|
|
184
165
|
fi
|
|
185
166
|
|
|
186
167
|
# The engine block's values, read in one pass. No parser: the values the
|
|
187
|
-
#
|
|
168
|
+
# script needs are plain quoted strings, read with a strict pattern. A key
|
|
188
169
|
# absent reads empty; a key present twice reads "duplicate", and one not
|
|
189
170
|
# holding a plain quoted string, or a releases value not naming a GitHub
|
|
190
|
-
# repository, "malformed". The pass also
|
|
191
|
-
#
|
|
171
|
+
# repository, "malformed". The pass also decodes the pin to the lowercase
|
|
172
|
+
# hex the hash tools print.
|
|
192
173
|
read_pin() {
|
|
193
|
-
awk -v
|
|
194
|
-
function value(key,
|
|
195
|
-
sep = (format == "toml") ? "=" : ":"
|
|
174
|
+
awk -v repo='[A-Za-z0-9-]+/[A-Za-z0-9_-][A-Za-z0-9._-]*' '
|
|
175
|
+
function value(key, n, i, line, v, found) {
|
|
196
176
|
n = 0
|
|
197
177
|
for (i = 1; i <= nlines; i++) {
|
|
198
178
|
line = lines[i]
|
|
199
|
-
if (line ~ ("^[ \t]*\"?" key "\"?[ \t]
|
|
179
|
+
if (line ~ ("^[ \t]*\"?" key "\"?[ \t]*:")) { n++; found = line }
|
|
200
180
|
}
|
|
201
181
|
if (n == 0) return ""
|
|
202
182
|
if (n > 1) return "duplicate"
|
|
203
|
-
if (found !~ ("^[ \t]*\"?" key "\"?[ \t]
|
|
183
|
+
if (found !~ ("^[ \t]*\"?" key "\"?[ \t]*:[ \t]*\"[^\"]*\"[ \t]*$")) return "malformed"
|
|
204
184
|
v = found
|
|
205
|
-
sub("^[ \t]*\"?" key "\"?[ \t]
|
|
185
|
+
sub("^[ \t]*\"?" key "\"?[ \t]*:[ \t]*\"", "", v)
|
|
206
186
|
sub("\"[ \t]*$", "", v)
|
|
207
187
|
return (v == "") ? "malformed" : v
|
|
208
188
|
}
|
|
@@ -223,28 +203,11 @@ read_pin() {
|
|
|
223
203
|
}
|
|
224
204
|
return out
|
|
225
205
|
}
|
|
226
|
-
{
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
format == "toml" && /^\[engine\][ \t]*$/ { inb = 1; next }
|
|
230
|
-
format == "toml" && inb && /^[ \t]*\[/ { inb = 0 }
|
|
231
|
-
format != "json" && inb { lines[++nlines] = $0 }
|
|
206
|
+
/^engine:[ \t]*$/ { inb = 1; next }
|
|
207
|
+
inb && /^[^ \t]/ { inb = 0 }
|
|
208
|
+
inb { lines[++nlines] = $0 }
|
|
232
209
|
END {
|
|
233
|
-
engines = 0
|
|
234
|
-
if (format == "json") {
|
|
235
|
-
gsub(/\r/, "", all)
|
|
236
|
-
rest = all
|
|
237
|
-
while (match(rest, /"engine"[ \t]*:/)) { engines++; rest = substr(rest, RSTART + RLENGTH) }
|
|
238
|
-
block = ""
|
|
239
|
-
rest = all
|
|
240
|
-
while (match(rest, /"engine"[ \t]*:[ \t]*\{[^{}]*\}/)) {
|
|
241
|
-
block = substr(rest, RSTART, RLENGTH); rest = substr(rest, RSTART + RLENGTH)
|
|
242
|
-
}
|
|
243
|
-
sub(/^"engine"[ \t]*:[ \t]*\{/, "", block); sub(/\}$/, "", block)
|
|
244
|
-
nlines = split(block, lines, ",")
|
|
245
|
-
}
|
|
246
210
|
pin = value("manifest")
|
|
247
|
-
print engines
|
|
248
211
|
print value("version")
|
|
249
212
|
print pin
|
|
250
213
|
print value("package")
|
|
@@ -255,7 +218,7 @@ read_pin() {
|
|
|
255
218
|
}' "$settings"
|
|
256
219
|
}
|
|
257
220
|
|
|
258
|
-
if [ -n "$
|
|
221
|
+
if [ -n "$from_package" ]; then
|
|
259
222
|
# The version and package as the package npx unpacked names them; the
|
|
260
223
|
# manifest's own hash stands in for the pin.
|
|
261
224
|
version=$(sed -n 's/^ *"version": *"\([0-9]*\.[0-9]*\.[0-9]*\)",\{0,1\}$/\1/p' "$pkgdir/manifest.json" | head -n 1)
|
|
@@ -265,13 +228,10 @@ if [ -n "$bootstrap" ]; then
|
|
|
265
228
|
|| refuse "$pkgdir/package.json must name \"@claudinite/cli\" or \"@claudinite/cli-rc\""
|
|
266
229
|
else
|
|
267
230
|
pinned=$(read_pin) || refuse "cannot read $settings"
|
|
268
|
-
|
|
269
|
-
{ read -r
|
|
231
|
+
version='' manifest_pin='' package='' releases='' pin_hex=''
|
|
232
|
+
{ read -r version; read -r manifest_pin; read -r package; read -r releases; read -r pin_hex; } <<EOF
|
|
270
233
|
$pinned
|
|
271
234
|
EOF
|
|
272
|
-
if [ "$format" = json ]; then
|
|
273
|
-
[ "$engines" -eq 1 ] || refuse "$settings must hold exactly one \"engine\" object, found $engines"
|
|
274
|
-
fi
|
|
275
235
|
[ -n "$package" ] || package=@claudinite/cli
|
|
276
236
|
|
|
277
237
|
is_version "$version" \
|
|
@@ -320,13 +280,13 @@ else
|
|
|
320
280
|
refuse "no SHA-256 tool found (sha256sum, shasum or openssl)"
|
|
321
281
|
fi
|
|
322
282
|
for tool in curl tar; do
|
|
323
|
-
command -v "$tool" >/dev/null 2>&1 || refuse "$tool is not installed; the
|
|
283
|
+
command -v "$tool" >/dev/null 2>&1 || refuse "$tool is not installed; the engine setup needs it to fetch the engine"
|
|
324
284
|
done
|
|
325
285
|
|
|
326
|
-
# The
|
|
286
|
+
# The package's pin is the hash of the manifest npx unpacked, as the
|
|
327
287
|
# lowercase hex the hash tools print; a settings file's pin was decoded to
|
|
328
288
|
# that hex as it was read.
|
|
329
|
-
if [ -n "$
|
|
289
|
+
if [ -n "$from_package" ]; then
|
|
330
290
|
pin_hex=$(sha512 "$pkgdir/manifest.json")
|
|
331
291
|
fi
|
|
332
292
|
|
|
@@ -349,7 +309,7 @@ private_dir() {
|
|
|
349
309
|
fi
|
|
350
310
|
[ -L "$1" ] && refuse "the cache directory $1 is a symbolic link"
|
|
351
311
|
[ "$os" = windows ] && return 0
|
|
352
|
-
# shellcheck disable=SC3067 # -O is in every sh the
|
|
312
|
+
# shellcheck disable=SC3067 # -O is in every sh the script runs under (dash, bash, busybox, zsh)
|
|
353
313
|
[ -O "$1" ] || private_refused "$1"
|
|
354
314
|
}
|
|
355
315
|
# private_refused names the mode and owner found on a cache folder that is
|
|
@@ -447,20 +407,17 @@ if ! cached_ok; then
|
|
|
447
407
|
cleanup
|
|
448
408
|
fi
|
|
449
409
|
|
|
450
|
-
if [
|
|
451
|
-
exit 0
|
|
452
|
-
fi
|
|
453
|
-
|
|
454
|
-
if [ -n "$bootstrap" ]; then
|
|
410
|
+
if [ -n "$from_package" ]; then
|
|
455
411
|
chmod u+w "$vdir/manifest.sig.json" 2>/dev/null
|
|
456
412
|
{ cp "$pkgdir/manifest.sig.json" "$vdir/.manifest.sig.json.$$" && chmod 0444 "$vdir/.manifest.sig.json.$$" \
|
|
457
413
|
&& mv -f "$vdir/.manifest.sig.json.$$" "$vdir/manifest.sig.json"; } || refuse "cannot place manifest.sig.json in $vdir"
|
|
458
|
-
|
|
414
|
+
printf '%s\n' "$vdir/$bin"
|
|
415
|
+
exit 0
|
|
459
416
|
fi
|
|
460
417
|
|
|
461
|
-
# Step 5: link
|
|
418
|
+
# Step 5: link.
|
|
462
419
|
|
|
463
|
-
# shellcheck disable=SC3013 # -ef is in every sh the
|
|
420
|
+
# shellcheck disable=SC3013 # -ef is in every sh the script runs under (dash, bash, busybox, zsh)
|
|
464
421
|
if [ ! "$here/bin/$bin" -ef "$vdir/$bin" ]; then
|
|
465
422
|
mkdir -p "$here/bin" || refuse "cannot create $here/bin"
|
|
466
423
|
if ! ln -sfn "$vdir/$bin" "$here/bin/$bin" 2>/dev/null; then
|
|
@@ -468,6 +425,6 @@ if [ ! "$here/bin/$bin" -ef "$vdir/$bin" ]; then
|
|
|
468
425
|
cp "$vdir/$bin" "$here/bin/$bin" || refuse "cannot link or copy the engine into $here/bin"
|
|
469
426
|
fi
|
|
470
427
|
fi
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
428
|
+
if [ -n "$legacy" ]; then
|
|
429
|
+
exec "$vdir/$bin" "$@"
|
|
430
|
+
fi
|
package/manifest.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"v": 1,
|
|
3
|
-
"version": "1.
|
|
4
|
-
"builtAt": "2026-10-
|
|
5
|
-
"commit": "
|
|
3
|
+
"version": "1.61012.2",
|
|
4
|
+
"builtAt": "2026-10-12T17:01:44Z",
|
|
5
|
+
"commit": "87b148f",
|
|
6
6
|
"goVersion": "go1.26.8",
|
|
7
|
-
"updaterDigest": "
|
|
7
|
+
"updaterDigest": "1d5239819358e78b434fdf348d950c83a78cd0f0fc5d245ced27294f4e5a90ae",
|
|
8
8
|
"binaries": {
|
|
9
|
-
"linux-x64": {"file": "cn", "sha256": "
|
|
10
|
-
"linux-arm64": {"file": "cn", "sha256": "
|
|
11
|
-
"darwin-x64": {"file": "cn", "sha256": "
|
|
12
|
-
"darwin-arm64": {"file": "cn", "sha256": "
|
|
13
|
-
"windows-x64": {"file": "cn.exe", "sha256": "
|
|
9
|
+
"linux-x64": {"file": "cn", "sha256": "36a87bfe4a7b42f980dbf4d198009565bd3ac41bf85690d54ef5419a7d321db6", "size": 14729378},
|
|
10
|
+
"linux-arm64": {"file": "cn", "sha256": "b0e9e9ed383b7bd320ed732b75f81a24eced482dd3911f53159ef785deb62798", "size": 13303970},
|
|
11
|
+
"darwin-x64": {"file": "cn", "sha256": "00ffd6385e5d4fe5f0d3bf4d1e46b89ee77e3d83399d7cc5acb3c46ead159a92", "size": 14955824},
|
|
12
|
+
"darwin-arm64": {"file": "cn", "sha256": "909445257ca0dcb7cb9f9e1f04ea7d3f543558ec24c9e6297c629a21c0e5bda3", "size": 13627362},
|
|
13
|
+
"windows-x64": {"file": "cn.exe", "sha256": "99e844659d58e584ce5d2191d5bd674c855a06347ceb31dd9b76be1d2670d938", "size": 15036416}
|
|
14
14
|
},
|
|
15
|
-
"launcher": "
|
|
15
|
+
"launcher": "c0259f07c6a875dbb03293d34cca199c8074f2238ec3c2bcff49fcf0657b6f7b",
|
|
16
16
|
"testedPacks": {}
|
|
17
17
|
}
|
package/manifest.sig.json
CHANGED
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
"payload": "eyJ2IjoxLCJrZXlJZCI6ImM3NzQwNWM2ZDA4NzExODYiLCJwdWJsaWNLZXkiOiI0UHlTQzRTbG5MakJ1cVY2Qll4eU9XWUtLOWkzV295NkZCQ1ZNckF6clRzIiwidXNlIjoibWFuaWZlc3QiLCJpc3N1ZXIiOiJlYTg1ZjM1NDIxZjM3NWZjIiwibm90QmVmb3JlIjoiMjAyNi0xMC0wM1QxNjozNjozN1oiLCJub3RBZnRlciI6IjIwMjctMTAtMDNUMTY6MzY6MzdaIn0",
|
|
4
4
|
"signature": "ex4GNEE3PIUj3Ue6X2TZnbB5E6G-DVrGNaYdvI13NuOauoJYilB_54TyAH490IS9-IZiu3BKVYpigm3uDTXSBw"
|
|
5
5
|
},
|
|
6
|
-
"signature": "
|
|
6
|
+
"signature": "yMeU6LRwF4xQyii6yrBLGtQs_12D9SSupvW70k0bEbsvMnElzBkBV__DMOsJkqn7spaXwlB2kWw23zMFYsVFAw"
|
|
7
7
|
}
|
package/npx-cn
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# The @claudinite/cli package's bin: `npx @claudinite/cli <cn arguments>`.
|
|
3
|
+
#
|
|
4
|
+
# adopt in a repository holding no .claudinite/settings.yaml sets up the
|
|
5
|
+
# engine this package names, from the package's own signed manifest, and
|
|
6
|
+
# runs its cn adopt. Any other command runs the member's own pinned engine,
|
|
7
|
+
# the member being the directory --repo names or else the working directory.
|
|
8
|
+
set -u
|
|
9
|
+
|
|
10
|
+
# npm links this file into node_modules/.bin; the package folder is where
|
|
11
|
+
# the link leads.
|
|
12
|
+
self=$0
|
|
13
|
+
while [ -L "$self" ]; do
|
|
14
|
+
link=$(readlink "$self") || break
|
|
15
|
+
case $link in
|
|
16
|
+
/*) self=$link ;;
|
|
17
|
+
*) case $self in */*) self=${self%/*}/$link ;; *) self=$link ;; esac ;;
|
|
18
|
+
esac
|
|
19
|
+
done
|
|
20
|
+
case $self in */*) pkg=${self%/*} ;; *) pkg=. ;; esac
|
|
21
|
+
pkg=$(cd "$pkg" && pwd) || exit 1
|
|
22
|
+
|
|
23
|
+
repo=.
|
|
24
|
+
want=
|
|
25
|
+
for arg do
|
|
26
|
+
if [ -n "$want" ]; then
|
|
27
|
+
want=
|
|
28
|
+
[ -d "$arg" ] && repo=$arg
|
|
29
|
+
continue
|
|
30
|
+
fi
|
|
31
|
+
case $arg in
|
|
32
|
+
--) break ;;
|
|
33
|
+
--repo|-repo) want=1 ;;
|
|
34
|
+
--repo=*|-repo=*) [ -d "${arg#*=}" ] && repo=${arg#*=} ;;
|
|
35
|
+
esac
|
|
36
|
+
done
|
|
37
|
+
repo=$(cd "$repo" && pwd) || exit 1
|
|
38
|
+
member=$repo/.claudinite
|
|
39
|
+
|
|
40
|
+
if [ "${1:-}" = adopt ] && [ ! -f "$member/settings.yaml" ]; then
|
|
41
|
+
bin=$(sh "$pkg/launch" --from-package "$pkg") || exit 1
|
|
42
|
+
exec "$bin" "$@"
|
|
43
|
+
fi
|
|
44
|
+
if [ -f "$member/setup-cn.sh" ]; then
|
|
45
|
+
sh "$member/setup-cn.sh" >&2 || exit 1
|
|
46
|
+
exec "$member/bin/cn" "$@"
|
|
47
|
+
fi
|
|
48
|
+
# A member an engine before the rename adopted holds only the old launcher.
|
|
49
|
+
#
|
|
50
|
+
# @legacy-tolerance advisory:launcher-renamed retire:#224
|
|
51
|
+
if [ -f "$member/launch" ]; then
|
|
52
|
+
exec sh "$member/launch" "$@"
|
|
53
|
+
fi
|
|
54
|
+
printf 'claudinite: %s holds no .claudinite/setup-cn.sh; adopt it first with npx @claudinite/cli adopt <packs>\n' "$repo" >&2
|
|
55
|
+
exit 1
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@claudinite/cli",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Claudinite engine release manifest and
|
|
3
|
+
"version": "1.61012.2",
|
|
4
|
+
"description": "Claudinite engine release manifest and engine setup",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {"type": "git", "url": "git+https://github.com/missingbulb/ClaudiniteEngine.git"},
|
|
7
|
-
"bin": {"cn": "
|
|
7
|
+
"bin": {"cn": "npx-cn"}
|
|
8
8
|
}
|