opencode-skills-collection 4.0.34 → 4.0.36
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/bundled-skills/.antigravity-install-manifest.json +7 -1
- package/bundled-skills/agent-evaluation-reporting/SKILL.md +136 -0
- package/bundled-skills/anti-ui-slop/SKILL.md +115 -0
- package/bundled-skills/cross-platform-contract-propagation-audit/SKILL.md +159 -0
- package/bundled-skills/docs/integrations/jetski-cortex.md +3 -3
- package/bundled-skills/docs/integrations/jetski-gemini-loader/README.md +1 -1
- package/bundled-skills/docs/maintainers/repo-growth-seo.md +1 -1
- package/bundled-skills/docs/maintainers/skills-update-guide.md +1 -1
- package/bundled-skills/docs/users/aas-core.md +1 -1
- package/bundled-skills/docs/users/bundles.md +1 -1
- package/bundled-skills/docs/users/claude-code-skills.md +1 -1
- package/bundled-skills/docs/users/gemini-cli-skills.md +1 -1
- package/bundled-skills/docs/users/kiro-integration.md +1 -1
- package/bundled-skills/docs/users/usage.md +3 -3
- package/bundled-skills/docs/users/visual-guide.md +4 -4
- package/bundled-skills/dsh-deepread/SKILL.md +200 -0
- package/bundled-skills/liuguang-banlan-ui/SKILL.md +135 -0
- package/bundled-skills/liuguang-banlan-ui/assets/starter/favicon.svg +4 -0
- package/bundled-skills/liuguang-banlan-ui/assets/starter/index.html +32 -0
- package/bundled-skills/liuguang-banlan-ui/assets/starter/launcher.css +25 -0
- package/bundled-skills/liuguang-banlan-ui/assets/starter/obsidian/index.html +179 -0
- package/bundled-skills/liuguang-banlan-ui/assets/starter/obsidian/theme-config.js +105 -0
- package/bundled-skills/liuguang-banlan-ui/assets/starter/obsidian/theme.css +107 -0
- package/bundled-skills/liuguang-banlan-ui/assets/starter/opal/index.html +179 -0
- package/bundled-skills/liuguang-banlan-ui/assets/starter/opal/theme-config.js +105 -0
- package/bundled-skills/liuguang-banlan-ui/assets/starter/opal/theme.css +107 -0
- package/bundled-skills/liuguang-banlan-ui/assets/starter/shared/base.css +423 -0
- package/bundled-skills/liuguang-banlan-ui/assets/starter/shared/spectral-field.js +450 -0
- package/bundled-skills/liuguang-banlan-ui/assets/starter/shared/workbench.js +255 -0
- package/bundled-skills/liuguang-banlan-ui/references/style-contract.md +53 -0
- package/bundled-skills/liuguang-banlan-ui/references/verification.md +70 -0
- package/bundled-skills/liuguang-banlan-ui/scripts/measure_preview.py +144 -0
- package/bundled-skills/liuguang-banlan-ui/scripts/requirements.txt +2 -0
- package/bundled-skills/liuguang-banlan-ui/scripts/scaffold_template.py +43 -0
- package/bundled-skills/liuguang-banlan-ui/scripts/validate_manifest.py +173 -0
- package/bundled-skills/using-lwc/LICENSE +201 -0
- package/bundled-skills/using-lwc/README.md +926 -0
- package/bundled-skills/using-lwc/README.zh-CN.md +836 -0
- package/bundled-skills/using-lwc/SKILL.md +156 -0
- package/bundled-skills/using-lwc/agents/openai.yaml +4 -0
- package/bundled-skills/using-lwc/assets/global-purpose.md +17 -0
- package/bundled-skills/using-lwc/assets/global-schema.md +28 -0
- package/bundled-skills/using-lwc/references/active-memory.md +81 -0
- package/bundled-skills/using-lwc/references/agent-onboarding.md +84 -0
- package/bundled-skills/using-lwc/references/code-graph.md +60 -0
- package/bundled-skills/using-lwc/references/core-memory.md +51 -0
- package/bundled-skills/using-lwc/references/document-conversion.md +53 -0
- package/bundled-skills/using-lwc/references/document-graph.md +58 -0
- package/bundled-skills/using-lwc/references/llm-wiki.md +75 -0
- package/bundled-skills/using-lwc/references/memory-policy.md +551 -0
- package/bundled-skills/using-lwc/references/operations-manual.md +503 -0
- package/bundled-skills/using-lwc/references/recovery-maintenance.md +53 -0
- package/bundled-skills/using-lwc/references/strong-context.md +54 -0
- package/bundled-skills/using-lwc/references/trigger-playbook.md +53 -0
- package/bundled-skills/using-lwc/references/word-graph.md +45 -0
- package/bundled-skills/using-lwc/scripts/bootstrap.sh +359 -0
- package/bundled-skills/using-lwc/scripts/install-lwc.sh +172 -0
- package/package.json +1 -1
- package/skills_index.json +189 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# LWC Word Graph
|
|
2
|
+
|
|
3
|
+
## Use when
|
|
4
|
+
|
|
5
|
+
Use the Word Graph in `lwc view` to discover shared terms that connect a bounded
|
|
6
|
+
sample of Wiki pages and sources. It is useful when a query finds several
|
|
7
|
+
documents and you need to see the vocabulary that links them before choosing
|
|
8
|
+
which documents to open.
|
|
9
|
+
|
|
10
|
+
## Skip when
|
|
11
|
+
|
|
12
|
+
Skip it for a known page or source, an exhaustive corpus-wide term analysis, or
|
|
13
|
+
code structure. A displayed edge proves sampled term occurrence, not semantic
|
|
14
|
+
equivalence or causality.
|
|
15
|
+
|
|
16
|
+
## Minimum workflow
|
|
17
|
+
|
|
18
|
+
1. Run `lwc --scope project view` and open the Word Graph tab.
|
|
19
|
+
2. Search with a focused query of at most eight searchable terms. The graph does
|
|
20
|
+
not load until a query is submitted.
|
|
21
|
+
3. Inspect one result page at a time. The backend selects matching documents
|
|
22
|
+
through FTS first, then samples at most 25 documents, 30 terms, four passages
|
|
23
|
+
per document, 4 MiB of text, 200 nodes, and 500 edges. Larger requested limits
|
|
24
|
+
are clamped.
|
|
25
|
+
4. Use Previous/Next for another bounded 25-document sample. Open the relevant
|
|
26
|
+
pages or sources to verify meaning before drawing conclusions.
|
|
27
|
+
|
|
28
|
+
Never request or render the entire vocabulary. Treat `has_more`, `truncated`,
|
|
29
|
+
`truncation_reasons`, `limits`, and `diagnostics` as part of the result rather
|
|
30
|
+
than as errors to bypass.
|
|
31
|
+
|
|
32
|
+
## Consent boundaries
|
|
33
|
+
|
|
34
|
+
`lwc view` starts a local read-only HTTP server and normally opens a browser; use
|
|
35
|
+
`--no-open` when browser launch is unwanted. Word Graph queries do not enable a
|
|
36
|
+
graph engine, create a CodeGraph index, or mutate Wiki content.
|
|
37
|
+
|
|
38
|
+
## Completion evidence
|
|
39
|
+
|
|
40
|
+
- The response records the query, enforced limits, sample diagnostics, and any
|
|
41
|
+
truncation reason.
|
|
42
|
+
- The visible documents and terms remain within the fixed bounds and pagination
|
|
43
|
+
is used instead of an all-corpus load.
|
|
44
|
+
- Important relationships are verified against the full page or source; shared
|
|
45
|
+
sampled words alone are not promoted to durable facts.
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
set -eu
|
|
3
|
+
|
|
4
|
+
die() {
|
|
5
|
+
printf 'using-lwc bootstrap: %s\n' "$*" >&2
|
|
6
|
+
exit 1
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
need() {
|
|
10
|
+
command -v "$1" >/dev/null 2>&1 ||
|
|
11
|
+
die "required command not found: $1"
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
json_escape() {
|
|
15
|
+
printf '%s' "$1" |
|
|
16
|
+
awk 'BEGIN { first = 1 }
|
|
17
|
+
{
|
|
18
|
+
if (!first) printf "\\n"
|
|
19
|
+
first = 0
|
|
20
|
+
gsub(/\\/, "\\\\")
|
|
21
|
+
gsub(/"/, "\\\"")
|
|
22
|
+
gsub(/\t/, "\\t")
|
|
23
|
+
gsub(/\r/, "\\r")
|
|
24
|
+
gsub(/\f/, "\\f")
|
|
25
|
+
gsub(/\b/, "\\b")
|
|
26
|
+
printf "%s", $0
|
|
27
|
+
}'
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
supported_lwc_version() {
|
|
31
|
+
version_core="${1#lwc }"
|
|
32
|
+
version_core="${version_core%%[-+]*}"
|
|
33
|
+
old_ifs="$IFS"
|
|
34
|
+
IFS=.
|
|
35
|
+
set -- $version_core
|
|
36
|
+
IFS="$old_ifs"
|
|
37
|
+
[ "$#" -eq 3 ] || return 1
|
|
38
|
+
case "$1$2$3" in *[!0-9]*|'') return 1 ;; esac
|
|
39
|
+
|
|
40
|
+
[ "$1" -gt 0 ] || [ "$2" -ge 6 ]
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
# Version and capability probes prevent this Skill from driving an older CLI.
|
|
44
|
+
usable_lwc() {
|
|
45
|
+
candidate="$1"
|
|
46
|
+
candidate_version="$("$candidate" --version 2>/dev/null || true)"
|
|
47
|
+
printf '%s\n' "$candidate_version" |
|
|
48
|
+
grep -Eq '^lwc [0-9]+\.[0-9]+\.[0-9]+' || return 1
|
|
49
|
+
supported_lwc_version "$candidate_version" || return 1
|
|
50
|
+
"$candidate" init --help 2>&1 | grep -q -- '--scope' || return 1
|
|
51
|
+
"$candidate" --help 2>&1 | grep -q -- 'LWC_PROJECT_ROOT' || return 1
|
|
52
|
+
"$candidate" --help 2>&1 | grep -q -- '--changeset' || return 1
|
|
53
|
+
"$candidate" checkpoint --help >/dev/null 2>&1 || return 1
|
|
54
|
+
"$candidate" source add-manifest --help >/dev/null 2>&1 || return 1
|
|
55
|
+
"$candidate" source status --help >/dev/null 2>&1 || return 1
|
|
56
|
+
"$candidate" source diff --help >/dev/null 2>&1 || return 1
|
|
57
|
+
"$candidate" changeset --help >/dev/null 2>&1 || return 1
|
|
58
|
+
"$candidate" page put --help 2>&1 | grep -q -- '--provenance' || return 1
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
managed_lwc_path() {
|
|
62
|
+
for candidate in \
|
|
63
|
+
"$home_dir/.local/bin/lwc" \
|
|
64
|
+
"$home_dir/.local/bin/lwc.exe"; do
|
|
65
|
+
if [ -x "$candidate" ] && usable_lwc "$candidate"; then
|
|
66
|
+
printf '%s\n' "$candidate"
|
|
67
|
+
return 0
|
|
68
|
+
fi
|
|
69
|
+
done
|
|
70
|
+
return 1
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
add_evidence() {
|
|
74
|
+
if [ -n "$project_evidence" ]; then
|
|
75
|
+
project_evidence="${project_evidence},$1"
|
|
76
|
+
else
|
|
77
|
+
project_evidence="$1"
|
|
78
|
+
fi
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
is_excluded_root() {
|
|
82
|
+
if [ -n "${tmp_dir:-}" ]; then
|
|
83
|
+
case "$1" in
|
|
84
|
+
"$tmp_dir"|"$tmp_dir/"*) return 0 ;;
|
|
85
|
+
esac
|
|
86
|
+
fi
|
|
87
|
+
|
|
88
|
+
case "$1" in
|
|
89
|
+
/|/tmp|/tmp/*|/private/tmp|/private/tmp/*|\
|
|
90
|
+
/var/tmp|/var/tmp/*|/private/var/tmp|/private/var/tmp/*|\
|
|
91
|
+
"$home_dir"|\
|
|
92
|
+
"$home_dir/Downloads"|"$home_dir/Downloads/"*|\
|
|
93
|
+
"$home_dir/Desktop"|"$home_dir/Desktop/"*|\
|
|
94
|
+
"$home_dir/.cache"|"$home_dir/.cache/"*|\
|
|
95
|
+
"$home_dir/Library/Caches"|"$home_dir/Library/Caches/"*)
|
|
96
|
+
return 0
|
|
97
|
+
;;
|
|
98
|
+
*)
|
|
99
|
+
return 1
|
|
100
|
+
;;
|
|
101
|
+
esac
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
: "${HOME:?using-lwc bootstrap: HOME is not set}"
|
|
105
|
+
need dirname
|
|
106
|
+
need awk
|
|
107
|
+
need grep
|
|
108
|
+
|
|
109
|
+
skill_dir="$(
|
|
110
|
+
CDPATH= cd "$(dirname "$0")/.." >/dev/null 2>&1
|
|
111
|
+
pwd -P
|
|
112
|
+
)"
|
|
113
|
+
purpose_file="$skill_dir/assets/global-purpose.md"
|
|
114
|
+
schema_file="$skill_dir/assets/global-schema.md"
|
|
115
|
+
installer="$skill_dir/scripts/install-lwc.sh"
|
|
116
|
+
[ -f "$purpose_file" ] || die "missing $purpose_file"
|
|
117
|
+
[ -f "$schema_file" ] || die "missing $schema_file"
|
|
118
|
+
[ -f "$installer" ] || die "missing $installer"
|
|
119
|
+
|
|
120
|
+
home_dir="$(
|
|
121
|
+
CDPATH= cd "$HOME" >/dev/null 2>&1
|
|
122
|
+
pwd -P
|
|
123
|
+
)" || die "cannot resolve HOME"
|
|
124
|
+
cwd="$(pwd -P)"
|
|
125
|
+
project_boundary=""
|
|
126
|
+
if [ -n "${LWC_PROJECT_ROOT:-}" ]; then
|
|
127
|
+
[ -d "$LWC_PROJECT_ROOT" ] ||
|
|
128
|
+
die "LWC_PROJECT_ROOT is not a directory: $LWC_PROJECT_ROOT"
|
|
129
|
+
project_boundary="$(
|
|
130
|
+
CDPATH= cd "$LWC_PROJECT_ROOT" >/dev/null 2>&1
|
|
131
|
+
pwd -P
|
|
132
|
+
)" || die "cannot resolve LWC_PROJECT_ROOT"
|
|
133
|
+
case "$cwd" in
|
|
134
|
+
"$project_boundary"|"$project_boundary/"*) ;;
|
|
135
|
+
*) die "current directory is outside LWC_PROJECT_ROOT: $project_boundary" ;;
|
|
136
|
+
esac
|
|
137
|
+
fi
|
|
138
|
+
tmp_dir=""
|
|
139
|
+
if [ -d "${TMPDIR:-/tmp}" ]; then
|
|
140
|
+
tmp_dir="$(
|
|
141
|
+
CDPATH= cd "${TMPDIR:-/tmp}" >/dev/null 2>&1
|
|
142
|
+
pwd -P
|
|
143
|
+
)"
|
|
144
|
+
fi
|
|
145
|
+
if [ -n "$project_boundary" ] && is_excluded_root "$project_boundary"; then
|
|
146
|
+
die "LWC_PROJECT_ROOT is not a safe project root: $project_boundary"
|
|
147
|
+
fi
|
|
148
|
+
|
|
149
|
+
installed=false
|
|
150
|
+
global_initialized_now=false
|
|
151
|
+
suggest_global_init=false
|
|
152
|
+
|
|
153
|
+
case "${LWC_AUTO_INSTALL:-0}" in
|
|
154
|
+
0|1) ;;
|
|
155
|
+
*) die "LWC_AUTO_INSTALL must be 0 or 1" ;;
|
|
156
|
+
esac
|
|
157
|
+
case "${LWC_GLOBAL_INIT:-0}" in
|
|
158
|
+
0|1) ;;
|
|
159
|
+
*) die "LWC_GLOBAL_INIT must be 0 or 1" ;;
|
|
160
|
+
esac
|
|
161
|
+
|
|
162
|
+
lwc_path="$(command -v lwc 2>/dev/null || true)"
|
|
163
|
+
if [ -z "$lwc_path" ] || ! usable_lwc "$lwc_path"; then
|
|
164
|
+
managed_path="$(managed_lwc_path || true)"
|
|
165
|
+
if [ -n "$managed_path" ]; then
|
|
166
|
+
die "lwc is not on PATH; add $(dirname "$managed_path") to PATH and start a new Agent session"
|
|
167
|
+
fi
|
|
168
|
+
lwc_path=""
|
|
169
|
+
fi
|
|
170
|
+
if [ -z "$lwc_path" ]; then
|
|
171
|
+
[ "${LWC_AUTO_INSTALL:-0}" = 1 ] ||
|
|
172
|
+
die "compatible lwc not found; obtain explicit approval, then retry once with LWC_AUTO_INSTALL=1"
|
|
173
|
+
LWC_INSTALL_DIR="$home_dir/.local/bin" sh "$installer" >&2 ||
|
|
174
|
+
die "lwc installation failed"
|
|
175
|
+
lwc_path="$(command -v lwc 2>/dev/null || true)"
|
|
176
|
+
if [ -z "$lwc_path" ] || ! usable_lwc "$lwc_path"; then
|
|
177
|
+
managed_path="$(managed_lwc_path || true)"
|
|
178
|
+
[ -z "$managed_path" ] ||
|
|
179
|
+
die "lwc is not on PATH; add $(dirname "$managed_path") to PATH and start a new Agent session"
|
|
180
|
+
die "installed lwc failed its compatibility check"
|
|
181
|
+
fi
|
|
182
|
+
installed=true
|
|
183
|
+
fi
|
|
184
|
+
|
|
185
|
+
lwc_version="$("$lwc_path" --version)"
|
|
186
|
+
global_wiki="$home_dir/.lwc/wiki.db"
|
|
187
|
+
global_policy_state="$home_dir/.lwc/.using-lwc-bootstrap-v1"
|
|
188
|
+
apply_global_policy=false
|
|
189
|
+
if [ ! -f "$global_wiki" ]; then
|
|
190
|
+
if [ "${LWC_GLOBAL_INIT:-0}" = 1 ]; then
|
|
191
|
+
mkdir -p "$(dirname "$global_wiki")" ||
|
|
192
|
+
die "cannot create global memory directory"
|
|
193
|
+
printf 'pending\n' > "$global_policy_state" ||
|
|
194
|
+
die "cannot record global initialization state"
|
|
195
|
+
"$lwc_path" --scope global init >/dev/null ||
|
|
196
|
+
die "failed to initialize global memory"
|
|
197
|
+
[ -f "$global_wiki" ] || die "global initialization did not create $global_wiki"
|
|
198
|
+
apply_global_policy=true
|
|
199
|
+
else
|
|
200
|
+
suggest_global_init=true
|
|
201
|
+
fi
|
|
202
|
+
elif [ -f "$global_policy_state" ] &&
|
|
203
|
+
grep -qx 'pending' "$global_policy_state"; then
|
|
204
|
+
if [ "${LWC_GLOBAL_INIT:-0}" = 1 ]; then
|
|
205
|
+
apply_global_policy=true
|
|
206
|
+
else
|
|
207
|
+
suggest_global_init=true
|
|
208
|
+
fi
|
|
209
|
+
fi
|
|
210
|
+
|
|
211
|
+
if [ "$apply_global_policy" = true ]; then
|
|
212
|
+
"$lwc_path" --scope global purpose set "$purpose_file" >/dev/null ||
|
|
213
|
+
die "failed to set global memory purpose"
|
|
214
|
+
"$lwc_path" --scope global schema set "$schema_file" >/dev/null ||
|
|
215
|
+
die "failed to set global memory schema"
|
|
216
|
+
printf 'complete\n' > "$global_policy_state" ||
|
|
217
|
+
die "cannot complete global initialization state"
|
|
218
|
+
global_initialized_now=true
|
|
219
|
+
fi
|
|
220
|
+
global_initialized=false
|
|
221
|
+
[ -f "$global_wiki" ] && global_initialized=true
|
|
222
|
+
|
|
223
|
+
project_wiki=""
|
|
224
|
+
project_root=""
|
|
225
|
+
project_confidence="none"
|
|
226
|
+
project_evidence=""
|
|
227
|
+
suggest_project_init=false
|
|
228
|
+
scope_conflict=false
|
|
229
|
+
project_wiki_count=0
|
|
230
|
+
|
|
231
|
+
cursor="$cwd"
|
|
232
|
+
while :; do
|
|
233
|
+
if [ "$cursor" = "$home_dir" ]; then
|
|
234
|
+
break
|
|
235
|
+
fi
|
|
236
|
+
if [ -f "$cursor/.lwc/wiki.db" ]; then
|
|
237
|
+
project_wiki_count=$((project_wiki_count + 1))
|
|
238
|
+
if [ "$project_wiki_count" -eq 1 ]; then
|
|
239
|
+
project_wiki="$cursor/.lwc/wiki.db"
|
|
240
|
+
project_root="$cursor"
|
|
241
|
+
fi
|
|
242
|
+
if [ -z "$project_boundary" ]; then
|
|
243
|
+
break
|
|
244
|
+
fi
|
|
245
|
+
fi
|
|
246
|
+
if [ -n "$project_boundary" ] && [ "$cursor" = "$project_boundary" ]; then
|
|
247
|
+
break
|
|
248
|
+
fi
|
|
249
|
+
parent="$(dirname "$cursor")"
|
|
250
|
+
[ "$parent" != "$cursor" ] || break
|
|
251
|
+
cursor="$parent"
|
|
252
|
+
done
|
|
253
|
+
|
|
254
|
+
if [ "$project_wiki_count" -gt 1 ]; then
|
|
255
|
+
project_wiki=""
|
|
256
|
+
project_root="$project_boundary"
|
|
257
|
+
project_confidence="conflict"
|
|
258
|
+
project_evidence="multiple .lwc/wiki.db ancestors"
|
|
259
|
+
scope_conflict=true
|
|
260
|
+
elif [ "$project_wiki_count" -eq 1 ]; then
|
|
261
|
+
project_confidence="existing"
|
|
262
|
+
project_evidence=".lwc/wiki.db"
|
|
263
|
+
elif [ -z "$project_wiki" ]; then
|
|
264
|
+
weak_root=""
|
|
265
|
+
weak_evidence=""
|
|
266
|
+
cursor="$cwd"
|
|
267
|
+
while :; do
|
|
268
|
+
if [ "$cursor" = "$home_dir" ]; then
|
|
269
|
+
break
|
|
270
|
+
fi
|
|
271
|
+
|
|
272
|
+
if ! is_excluded_root "$cursor"; then
|
|
273
|
+
project_evidence=""
|
|
274
|
+
strong=false
|
|
275
|
+
|
|
276
|
+
if [ -e "$cursor/.git" ]; then
|
|
277
|
+
add_evidence ".git"
|
|
278
|
+
strong=true
|
|
279
|
+
fi
|
|
280
|
+
|
|
281
|
+
for marker in \
|
|
282
|
+
Cargo.toml package.json pyproject.toml go.mod pom.xml \
|
|
283
|
+
build.gradle build.gradle.kts Gemfile composer.json; do
|
|
284
|
+
if [ -f "$cursor/$marker" ]; then
|
|
285
|
+
add_evidence "$marker"
|
|
286
|
+
strong=true
|
|
287
|
+
fi
|
|
288
|
+
done
|
|
289
|
+
|
|
290
|
+
for marker_path in "$cursor"/*.sln "$cursor"/*.xcodeproj; do
|
|
291
|
+
if [ -e "$marker_path" ]; then
|
|
292
|
+
add_evidence "$(basename "$marker_path")"
|
|
293
|
+
strong=true
|
|
294
|
+
fi
|
|
295
|
+
done
|
|
296
|
+
|
|
297
|
+
if [ "$strong" = true ]; then
|
|
298
|
+
project_root="$cursor"
|
|
299
|
+
project_confidence="strong"
|
|
300
|
+
suggest_project_init=true
|
|
301
|
+
break
|
|
302
|
+
fi
|
|
303
|
+
|
|
304
|
+
readme=""
|
|
305
|
+
for readme_name in README.md README README.txt README.rst; do
|
|
306
|
+
if [ -f "$cursor/$readme_name" ]; then
|
|
307
|
+
readme="$readme_name"
|
|
308
|
+
break
|
|
309
|
+
fi
|
|
310
|
+
done
|
|
311
|
+
if [ -n "$readme" ]; then
|
|
312
|
+
for content_dir in src docs tests; do
|
|
313
|
+
if [ -d "$cursor/$content_dir" ]; then
|
|
314
|
+
if [ -z "$weak_root" ]; then
|
|
315
|
+
weak_root="$cursor"
|
|
316
|
+
weak_evidence="${readme},${content_dir}/"
|
|
317
|
+
fi
|
|
318
|
+
break
|
|
319
|
+
fi
|
|
320
|
+
done
|
|
321
|
+
fi
|
|
322
|
+
fi
|
|
323
|
+
|
|
324
|
+
if [ -n "$project_boundary" ] && [ "$cursor" = "$project_boundary" ]; then
|
|
325
|
+
break
|
|
326
|
+
fi
|
|
327
|
+
parent="$(dirname "$cursor")"
|
|
328
|
+
[ "$parent" != "$cursor" ] || break
|
|
329
|
+
cursor="$parent"
|
|
330
|
+
done
|
|
331
|
+
|
|
332
|
+
if [ -z "$project_root" ] && [ -n "$project_boundary" ]; then
|
|
333
|
+
project_root="$project_boundary"
|
|
334
|
+
project_confidence="authorized"
|
|
335
|
+
project_evidence="LWC_PROJECT_ROOT"
|
|
336
|
+
suggest_project_init=true
|
|
337
|
+
elif [ -z "$project_root" ] && [ -n "$weak_root" ]; then
|
|
338
|
+
project_root="$weak_root"
|
|
339
|
+
project_confidence="weak"
|
|
340
|
+
project_evidence="$weak_evidence"
|
|
341
|
+
fi
|
|
342
|
+
fi
|
|
343
|
+
|
|
344
|
+
printf '{'
|
|
345
|
+
printf '"lwc_path":"%s",' "$(json_escape "$lwc_path")"
|
|
346
|
+
printf '"lwc_version":"%s",' "$(json_escape "$lwc_version")"
|
|
347
|
+
printf '"installed":%s,' "$installed"
|
|
348
|
+
printf '"global_wiki":"%s",' "$(json_escape "$global_wiki")"
|
|
349
|
+
printf '"global_initialized":%s,' "$global_initialized"
|
|
350
|
+
printf '"global_initialized_now":%s,' "$global_initialized_now"
|
|
351
|
+
printf '"suggest_global_init":%s,' "$suggest_global_init"
|
|
352
|
+
printf '"project_boundary":"%s",' "$(json_escape "$project_boundary")"
|
|
353
|
+
printf '"project_wiki":"%s",' "$(json_escape "$project_wiki")"
|
|
354
|
+
printf '"project_root":"%s",' "$(json_escape "$project_root")"
|
|
355
|
+
printf '"project_confidence":"%s",' "$(json_escape "$project_confidence")"
|
|
356
|
+
printf '"project_evidence":"%s",' "$(json_escape "$project_evidence")"
|
|
357
|
+
printf '"suggest_project_init":%s,' "$suggest_project_init"
|
|
358
|
+
printf '"scope_conflict":%s' "$scope_conflict"
|
|
359
|
+
printf '}\n'
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
set -eu
|
|
3
|
+
|
|
4
|
+
repository="JanYork/llm-wiki-cli"
|
|
5
|
+
version="0.14.7"
|
|
6
|
+
tag="v${version}"
|
|
7
|
+
|
|
8
|
+
die() {
|
|
9
|
+
printf 'lwc installer: %s\n' "$*" >&2
|
|
10
|
+
exit 1
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
need() {
|
|
14
|
+
command -v "$1" >/dev/null 2>&1 || die "Required command not found: $1"
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
need curl
|
|
18
|
+
need uname
|
|
19
|
+
need awk
|
|
20
|
+
need grep
|
|
21
|
+
need mktemp
|
|
22
|
+
|
|
23
|
+
case "$(uname -s)" in
|
|
24
|
+
Darwin)
|
|
25
|
+
platform="apple-darwin"
|
|
26
|
+
archive_extension="tar.gz"
|
|
27
|
+
binary_name="lwc"
|
|
28
|
+
;;
|
|
29
|
+
Linux)
|
|
30
|
+
platform="unknown-linux-gnu"
|
|
31
|
+
archive_extension="tar.gz"
|
|
32
|
+
binary_name="lwc"
|
|
33
|
+
;;
|
|
34
|
+
MINGW*|MSYS*|CYGWIN*)
|
|
35
|
+
platform="pc-windows-msvc"
|
|
36
|
+
archive_extension="zip"
|
|
37
|
+
binary_name="lwc.exe"
|
|
38
|
+
;;
|
|
39
|
+
*)
|
|
40
|
+
die "Unsupported operating system: $(uname -s)"
|
|
41
|
+
;;
|
|
42
|
+
esac
|
|
43
|
+
|
|
44
|
+
case "$(uname -m)" in
|
|
45
|
+
x86_64|amd64|AMD64)
|
|
46
|
+
architecture="x86_64"
|
|
47
|
+
;;
|
|
48
|
+
arm64|aarch64|ARM64)
|
|
49
|
+
architecture="aarch64"
|
|
50
|
+
;;
|
|
51
|
+
*)
|
|
52
|
+
die "Unsupported architecture: $(uname -m)"
|
|
53
|
+
;;
|
|
54
|
+
esac
|
|
55
|
+
|
|
56
|
+
target="${architecture}-${platform}"
|
|
57
|
+
archive="lwc-${version}-${target}.${archive_extension}"
|
|
58
|
+
release_url="https://github.com/${repository}/releases/download/${tag}"
|
|
59
|
+
|
|
60
|
+
case "$archive" in
|
|
61
|
+
lwc-0.14.7-aarch64-apple-darwin.tar.gz)
|
|
62
|
+
expected_checksum="2bd22aed6246bfc7f25e73532928b0da40c08b827ba975afe05bd767053ad6fa"
|
|
63
|
+
;;
|
|
64
|
+
lwc-0.14.7-x86_64-apple-darwin.tar.gz)
|
|
65
|
+
expected_checksum="50d9ebf3c4f4d895043b0db4fbcee6d8d62f40d67a00e288515d5b42044df21b"
|
|
66
|
+
;;
|
|
67
|
+
lwc-0.14.7-aarch64-unknown-linux-gnu.tar.gz)
|
|
68
|
+
expected_checksum="6bed79a54293c8aa33006cfb2cc3ac233b82522c082d72d504a4daf37eeac18f"
|
|
69
|
+
;;
|
|
70
|
+
lwc-0.14.7-x86_64-unknown-linux-gnu.tar.gz)
|
|
71
|
+
expected_checksum="ef66a515fa62958e53fb87b8a79bea59912c987fbadb732d028be29252822568"
|
|
72
|
+
;;
|
|
73
|
+
lwc-0.14.7-aarch64-pc-windows-msvc.zip)
|
|
74
|
+
expected_checksum="cb69ca0752daeacaef52ae544f2b11425392b00002d6975db7f6804b1915707c"
|
|
75
|
+
;;
|
|
76
|
+
lwc-0.14.7-x86_64-pc-windows-msvc.zip)
|
|
77
|
+
expected_checksum="d973eeb84e018b19e0d41379f3afb60132b39a36fb29f0691ed99d9fd737fdfb"
|
|
78
|
+
;;
|
|
79
|
+
*)
|
|
80
|
+
die "No reviewed checksum is pinned for $archive"
|
|
81
|
+
;;
|
|
82
|
+
esac
|
|
83
|
+
|
|
84
|
+
if [ -n "${LWC_INSTALL_DIR:-}" ]; then
|
|
85
|
+
install_dir="$LWC_INSTALL_DIR"
|
|
86
|
+
else
|
|
87
|
+
existing="$(command -v lwc 2>/dev/null || true)"
|
|
88
|
+
case "$existing" in
|
|
89
|
+
"$HOME/.local/bin/lwc"|"$HOME/.local/bin/lwc.exe"|\
|
|
90
|
+
"$HOME/.cargo/bin/lwc"|"$HOME/.cargo/bin/lwc.exe")
|
|
91
|
+
install_dir="$(dirname "$existing")"
|
|
92
|
+
;;
|
|
93
|
+
*)
|
|
94
|
+
install_dir="$HOME/.local/bin"
|
|
95
|
+
;;
|
|
96
|
+
esac
|
|
97
|
+
fi
|
|
98
|
+
|
|
99
|
+
destination="${install_dir}/${binary_name}"
|
|
100
|
+
if [ -x "$destination" ]; then
|
|
101
|
+
current_version="$("$destination" --version 2>/dev/null || true)"
|
|
102
|
+
if [ "$current_version" = "lwc ${version}" ]; then
|
|
103
|
+
printf 'lwc %s is already installed at %s\n' "$version" "$destination"
|
|
104
|
+
exit 0
|
|
105
|
+
fi
|
|
106
|
+
action="Updated"
|
|
107
|
+
else
|
|
108
|
+
action="Installed"
|
|
109
|
+
fi
|
|
110
|
+
|
|
111
|
+
case "$archive_extension" in
|
|
112
|
+
tar.gz) need tar ;;
|
|
113
|
+
zip) need unzip ;;
|
|
114
|
+
esac
|
|
115
|
+
|
|
116
|
+
work_dir="$(mktemp -d "${TMPDIR:-/tmp}/lwc-install.XXXXXX")" ||
|
|
117
|
+
die "Could not create a temporary directory"
|
|
118
|
+
staged_binary=""
|
|
119
|
+
cleanup() {
|
|
120
|
+
[ -z "$staged_binary" ] || rm -f "$staged_binary"
|
|
121
|
+
rm -rf "$work_dir"
|
|
122
|
+
}
|
|
123
|
+
trap cleanup 0
|
|
124
|
+
trap 'exit 1' HUP INT TERM
|
|
125
|
+
|
|
126
|
+
curl -fsSL "$release_url/$archive" -o "$work_dir/$archive" ||
|
|
127
|
+
die "Could not download $archive"
|
|
128
|
+
|
|
129
|
+
if command -v sha256sum >/dev/null 2>&1; then
|
|
130
|
+
actual_checksum="$(sha256sum "$work_dir/$archive" | awk '{ print $1 }')"
|
|
131
|
+
elif command -v shasum >/dev/null 2>&1; then
|
|
132
|
+
actual_checksum="$(shasum -a 256 "$work_dir/$archive" | awk '{ print $1 }')"
|
|
133
|
+
elif command -v openssl >/dev/null 2>&1; then
|
|
134
|
+
actual_checksum="$(openssl dgst -sha256 "$work_dir/$archive" | awk '{ print $NF }')"
|
|
135
|
+
else
|
|
136
|
+
die "No SHA-256 tool found (sha256sum, shasum, or openssl)"
|
|
137
|
+
fi
|
|
138
|
+
|
|
139
|
+
expected_checksum="$(printf '%s' "$expected_checksum" | tr '[:upper:]' '[:lower:]')"
|
|
140
|
+
actual_checksum="$(printf '%s' "$actual_checksum" | tr '[:upper:]' '[:lower:]')"
|
|
141
|
+
[ "$actual_checksum" = "$expected_checksum" ] ||
|
|
142
|
+
die "Checksum verification failed for $archive"
|
|
143
|
+
|
|
144
|
+
case "$archive_extension" in
|
|
145
|
+
tar.gz)
|
|
146
|
+
tar -xzf "$work_dir/$archive" -C "$work_dir"
|
|
147
|
+
;;
|
|
148
|
+
zip)
|
|
149
|
+
unzip -q "$work_dir/$archive" -d "$work_dir"
|
|
150
|
+
;;
|
|
151
|
+
esac
|
|
152
|
+
|
|
153
|
+
downloaded_binary="$work_dir/lwc-${version}-${target}/${binary_name}"
|
|
154
|
+
[ -f "$downloaded_binary" ] || die "Release archive does not contain $binary_name"
|
|
155
|
+
chmod +x "$downloaded_binary"
|
|
156
|
+
[ "$("$downloaded_binary" --version 2>/dev/null || true)" = "lwc ${version}" ] ||
|
|
157
|
+
die "Downloaded binary failed its version check"
|
|
158
|
+
|
|
159
|
+
mkdir -p "$install_dir"
|
|
160
|
+
[ -w "$install_dir" ] || die "Install directory is not writable: $install_dir"
|
|
161
|
+
|
|
162
|
+
staged_binary="$install_dir/.lwc.install.$$"
|
|
163
|
+
cp "$downloaded_binary" "$staged_binary"
|
|
164
|
+
chmod +x "$staged_binary"
|
|
165
|
+
mv -f "$staged_binary" "$destination"
|
|
166
|
+
staged_binary=""
|
|
167
|
+
|
|
168
|
+
printf '%s lwc %s at %s\n' "$action" "$version" "$destination"
|
|
169
|
+
case ":${PATH}:" in
|
|
170
|
+
*":${install_dir}:"*) ;;
|
|
171
|
+
*) printf 'Add %s to PATH to run lwc directly.\n' "$install_dir" ;;
|
|
172
|
+
esac
|
package/package.json
CHANGED