@stll/oxlint-config 2.1.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/toolchain-guard.cjs +1 -1
- package/dist/toolchain-guard.mjs +1 -1
- package/dist/toolchain-inputs.cjs +141 -81
- package/dist/toolchain-inputs.cjs.map +1 -1
- package/dist/toolchain-inputs.mjs +141 -81
- package/dist/toolchain-inputs.mjs.map +1 -1
- package/package.json +4 -4
- package/toolchain.json +6 -6
package/dist/toolchain-guard.cjs
CHANGED
|
@@ -34,7 +34,7 @@ const repositoryBun = (floor, manifest) => {
|
|
|
34
34
|
};
|
|
35
35
|
//#endregion
|
|
36
36
|
//#region src/toolchain-consumer-checks.ts
|
|
37
|
-
const consumerRunnerVersion = "
|
|
37
|
+
const consumerRunnerVersion = "3.0.0";
|
|
38
38
|
const consumerCheckWorkflow = "stella/.github/.github/workflows/package-consumer-compat.yml";
|
|
39
39
|
const record$10 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
40
40
|
const repositoryDirectory = (value) => typeof value === "string" && value !== "" && !value.includes("\\") && !value.includes("${{") && !value.split("").some((character) => {
|
package/dist/toolchain-guard.mjs
CHANGED
|
@@ -31,7 +31,7 @@ const repositoryBun = (floor, manifest) => {
|
|
|
31
31
|
};
|
|
32
32
|
//#endregion
|
|
33
33
|
//#region src/toolchain-consumer-checks.ts
|
|
34
|
-
const consumerRunnerVersion = "
|
|
34
|
+
const consumerRunnerVersion = "3.0.0";
|
|
35
35
|
const consumerCheckWorkflow = "stella/.github/.github/workflows/package-consumer-compat.yml";
|
|
36
36
|
const record$10 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
37
37
|
const repositoryDirectory = (value) => typeof value === "string" && value !== "" && !value.includes("\\") && !value.includes("${{") && !value.split("").some((character) => {
|
|
@@ -8,6 +8,91 @@ let node_crypto = require("node:crypto");
|
|
|
8
8
|
let semver = require("semver");
|
|
9
9
|
let node_util = require("node:util");
|
|
10
10
|
let yaml = require("yaml");
|
|
11
|
+
//#region src/cloud-setup-shell.ts
|
|
12
|
+
const cloudShellProfilePath = "/etc/profile.d/stll-cloud.sh";
|
|
13
|
+
const cloudShellProfileSource = `. ${cloudShellProfilePath}`;
|
|
14
|
+
const quote$1 = (value) => `'${value.replaceAll("'", "'\\''")}'`;
|
|
15
|
+
/**
|
|
16
|
+
* install, cp and mv place the file inside a target that resolves to a
|
|
17
|
+
* directory and still succeed, so every generated file publish refuses one
|
|
18
|
+
* first. `target` is the exact shell word the publish command uses.
|
|
19
|
+
*/
|
|
20
|
+
const refuseDirectoryTarget = (target) => `[[ ! -d ${target} ]] || fail 'Install target is a directory; remove it and rerun install:' ${target}`;
|
|
21
|
+
const renderCloudShellProfile = ({ nodeVersion, bunVersion, rust }) => {
|
|
22
|
+
const node = `/opt/stll-cloud/node/${nodeVersion}/bin`;
|
|
23
|
+
const bun = `/opt/stll-cloud/bun/${bunVersion}`;
|
|
24
|
+
return `# Generated by stll-cloud-setup; managed cloud shell environment.
|
|
25
|
+
# Remove managed entries before prepending, including repeated shell startup.
|
|
26
|
+
_stll_cloud_remaining="\${PATH-}"
|
|
27
|
+
_stll_cloud_result=''
|
|
28
|
+
_stll_cloud_separator=''
|
|
29
|
+
while :; do
|
|
30
|
+
case "$_stll_cloud_remaining" in
|
|
31
|
+
*:*) _stll_cloud_part="\${_stll_cloud_remaining%%:*}"; _stll_cloud_remaining="\${_stll_cloud_remaining#*:}"; _stll_cloud_more=yes ;;
|
|
32
|
+
*) _stll_cloud_part="$_stll_cloud_remaining"; _stll_cloud_more=no ;;
|
|
33
|
+
esac
|
|
34
|
+
case "$_stll_cloud_part" in
|
|
35
|
+
${quote$1(node)}|${quote$1(bun)}|/usr/local/bin) ;;
|
|
36
|
+
*) _stll_cloud_result="$_stll_cloud_result$_stll_cloud_separator$_stll_cloud_part"; _stll_cloud_separator=: ;;
|
|
37
|
+
esac
|
|
38
|
+
[ "$_stll_cloud_more" = yes ] || break
|
|
39
|
+
done
|
|
40
|
+
export PATH=${quote$1(`${node}:${bun}:/usr/local/bin`)}"\${_stll_cloud_separator:+:}$_stll_cloud_result"
|
|
41
|
+
unset _stll_cloud_remaining _stll_cloud_result _stll_cloud_separator _stll_cloud_part _stll_cloud_more
|
|
42
|
+
${rust === void 0 ? "" : `export RUSTUP_HOME=/opt/stll-cloud/rustup\nexport CARGO_HOME=/opt/stll-cloud/cargo\nexport RUSTUP_TOOLCHAIN=${quote$1(rust.channel)}\nexport RUSTUP_AUTO_INSTALL=0\n`}`;
|
|
43
|
+
};
|
|
44
|
+
const userStartup = String.raw`
|
|
45
|
+
set -euo pipefail
|
|
46
|
+
for name in .bashrc .profile .bash_profile .bash_login; do
|
|
47
|
+
file="$HOME/$name"
|
|
48
|
+
if [[ ! -e "$file" && ! -L "$file" && "$name" != .bashrc && "$name" != .profile ]]; then continue; fi
|
|
49
|
+
[[ ! -L "$file" ]] || { echo "cloud-setup: shell startup file must not be a symlink: $name" >&2; exit 1; }
|
|
50
|
+
if [[ -e "$file" ]]; then
|
|
51
|
+
[[ -f "$file" && "$(stat -c '%h:%u' "$file")" == "1:$(id -u)" ]] || { echo "cloud-setup: shell startup file must be owned and single-link: $name" >&2; exit 1; }
|
|
52
|
+
fi
|
|
53
|
+
temporary="$(mktemp "$HOME/.stll-cloud-shell.XXXXXX")"
|
|
54
|
+
trap 'rm -f -- "$temporary"' EXIT
|
|
55
|
+
if [[ "$name" == .bashrc ]]; then
|
|
56
|
+
printf '%s\n' '# stll-cloud: early environment' '@SOURCE@' > "$temporary"
|
|
57
|
+
fi
|
|
58
|
+
if [[ -f "$file" ]]; then
|
|
59
|
+
# Remove only exact managed blocks; preserve unrelated startup lines and permissions.
|
|
60
|
+
awk '
|
|
61
|
+
$0 == "# stll-cloud: early environment" || $0 == "# stll-cloud: session environment" {
|
|
62
|
+
if ((getline following) <= 0 || following != "@SOURCE@") exit 1
|
|
63
|
+
next
|
|
64
|
+
}
|
|
65
|
+
{ print }
|
|
66
|
+
' "$file" >> "$temporary" || { echo "cloud-setup: managed shell startup block differs: $name" >&2; exit 1; }
|
|
67
|
+
fi
|
|
68
|
+
printf '%s\n' '# stll-cloud: session environment' '@SOURCE@' >> "$temporary"
|
|
69
|
+
if [[ -f "$file" ]] && cmp -s "$temporary" "$file"; then rm -- "$temporary"; continue; fi
|
|
70
|
+
if [[ -f "$file" ]]; then chmod --reference="$file" "$temporary"; else chmod 644 "$temporary"; fi
|
|
71
|
+
mv -f -- "$temporary" "$file"
|
|
72
|
+
done
|
|
73
|
+
`;
|
|
74
|
+
const renderCloudShellInstall = (options) => {
|
|
75
|
+
const profile = renderCloudShellProfile(options);
|
|
76
|
+
return `install_shell_environment() (
|
|
77
|
+
# Subshell scope retains temporary for EXIT cleanup after a failed command.
|
|
78
|
+
[[ ! -L ${quote$1(cloudShellProfilePath)} ]] || fail 'Managed shell profile must not be a symlink'
|
|
79
|
+
if [[ -e ${quote$1(cloudShellProfilePath)} ]]; then
|
|
80
|
+
[[ -f ${quote$1(cloudShellProfilePath)} && "$(stat -c '%h:%u' ${quote$1(cloudShellProfilePath)})" == 1:0 ]] || fail 'Managed shell profile must be a root-owned single-link file'
|
|
81
|
+
fi
|
|
82
|
+
temporary="$(mktemp)"
|
|
83
|
+
trap 'rm -f -- "$temporary"' EXIT
|
|
84
|
+
cat > "$temporary" <<'STLL_CLOUD_PROFILE'
|
|
85
|
+
${profile}STLL_CLOUD_PROFILE
|
|
86
|
+
if ! cmp -s "$temporary" ${quote$1(cloudShellProfilePath)}; then install -m 644 "$temporary" ${quote$1(cloudShellProfilePath)}; fi
|
|
87
|
+
runuser -u "$OUTPUT_USER" -- env HOME="$OUTPUT_HOME" bash -c ${quote$1(userStartup.replaceAll("@SOURCE@", cloudShellProfileSource))}
|
|
88
|
+
)
|
|
89
|
+
verify_shell_environment() {
|
|
90
|
+
[[ -f ${quote$1(cloudShellProfilePath)} && ! -L ${quote$1(cloudShellProfilePath)} && "$(stat -c '%h:%u' ${quote$1(cloudShellProfilePath)})" == 1:0 ]] || fail 'Managed shell environment is unavailable; run install'
|
|
91
|
+
[[ "$(sha256sum -- ${quote$1(cloudShellProfilePath)} | cut -d ' ' -f1)" == ${quote$1((0, node_crypto.createHash)("sha256").update(profile).digest("hex"))} ]] || fail 'Managed shell environment differs; run install'
|
|
92
|
+
}
|
|
93
|
+
`;
|
|
94
|
+
};
|
|
95
|
+
//#endregion
|
|
11
96
|
//#region src/cloud-setup-install.ts
|
|
12
97
|
const packageInstall = String.raw`
|
|
13
98
|
# Prevent package maintainer scripts from starting unmanaged system services.
|
|
@@ -184,6 +269,7 @@ const postgresInstall = String.raw`
|
|
|
184
269
|
key_fingerprint="$(pgdg_key_fingerprint "$key")"
|
|
185
270
|
[[ "$key_fingerprint" == @PGDG_FINGERPRINT@ ]] || fail 'PostgreSQL signing key mismatch'
|
|
186
271
|
install -d -m 755 /usr/share/keyrings
|
|
272
|
+
${refuseDirectoryTarget("/usr/share/keyrings/stll-pgdg.asc")}
|
|
187
273
|
install -m 644 "$key" /usr/share/keyrings/stll-pgdg.asc
|
|
188
274
|
rm -- "$key"
|
|
189
275
|
printf '%s\n' '@PGDG_SOURCE@' > /etc/apt/sources.list.d/stll-pgdg.list
|
|
@@ -803,85 +889,6 @@ const renderCloudServiceStart = ({ services, postgres, valkey }) => {
|
|
|
803
889
|
return `${common}\nstart_services() {\n local SERVICE_UID file attempt\n SERVICE_UID="$(id -u stll-cloud)"\n [[ -d "$STATE" && ! -L "$STATE" && "$(stat -c '%u' "$STATE")" == 0 ]] || fail "Invalid cloud service state directory"\n${bodies.join("")}\n}\n`;
|
|
804
890
|
};
|
|
805
891
|
//#endregion
|
|
806
|
-
//#region src/cloud-setup-shell.ts
|
|
807
|
-
const cloudShellProfilePath = "/etc/profile.d/stll-cloud.sh";
|
|
808
|
-
const cloudShellProfileSource = `. ${cloudShellProfilePath}`;
|
|
809
|
-
const quote$1 = (value) => `'${value.replaceAll("'", "'\\''")}'`;
|
|
810
|
-
const renderCloudShellProfile = ({ nodeVersion, bunVersion, rust }) => {
|
|
811
|
-
const node = `/opt/stll-cloud/node/${nodeVersion}/bin`;
|
|
812
|
-
const bun = `/opt/stll-cloud/bun/${bunVersion}`;
|
|
813
|
-
return `# Generated by stll-cloud-setup; managed cloud shell environment.
|
|
814
|
-
# Remove managed entries before prepending, including repeated shell startup.
|
|
815
|
-
_stll_cloud_remaining="\${PATH-}"
|
|
816
|
-
_stll_cloud_result=''
|
|
817
|
-
_stll_cloud_separator=''
|
|
818
|
-
while :; do
|
|
819
|
-
case "$_stll_cloud_remaining" in
|
|
820
|
-
*:*) _stll_cloud_part="\${_stll_cloud_remaining%%:*}"; _stll_cloud_remaining="\${_stll_cloud_remaining#*:}"; _stll_cloud_more=yes ;;
|
|
821
|
-
*) _stll_cloud_part="$_stll_cloud_remaining"; _stll_cloud_more=no ;;
|
|
822
|
-
esac
|
|
823
|
-
case "$_stll_cloud_part" in
|
|
824
|
-
${quote$1(node)}|${quote$1(bun)}|/usr/local/bin) ;;
|
|
825
|
-
*) _stll_cloud_result="$_stll_cloud_result$_stll_cloud_separator$_stll_cloud_part"; _stll_cloud_separator=: ;;
|
|
826
|
-
esac
|
|
827
|
-
[ "$_stll_cloud_more" = yes ] || break
|
|
828
|
-
done
|
|
829
|
-
export PATH=${quote$1(`${node}:${bun}:/usr/local/bin`)}"\${_stll_cloud_separator:+:}$_stll_cloud_result"
|
|
830
|
-
unset _stll_cloud_remaining _stll_cloud_result _stll_cloud_separator _stll_cloud_part _stll_cloud_more
|
|
831
|
-
${rust === void 0 ? "" : `export RUSTUP_HOME=/opt/stll-cloud/rustup\nexport CARGO_HOME=/opt/stll-cloud/cargo\nexport RUSTUP_TOOLCHAIN=${quote$1(rust.channel)}\nexport RUSTUP_AUTO_INSTALL=0\n`}`;
|
|
832
|
-
};
|
|
833
|
-
const userStartup = String.raw`
|
|
834
|
-
set -euo pipefail
|
|
835
|
-
for name in .bashrc .profile .bash_profile .bash_login; do
|
|
836
|
-
file="$HOME/$name"
|
|
837
|
-
if [[ ! -e "$file" && ! -L "$file" && "$name" != .bashrc && "$name" != .profile ]]; then continue; fi
|
|
838
|
-
[[ ! -L "$file" ]] || { echo "cloud-setup: shell startup file must not be a symlink: $name" >&2; exit 1; }
|
|
839
|
-
if [[ -e "$file" ]]; then
|
|
840
|
-
[[ -f "$file" && "$(stat -c '%h:%u' "$file")" == "1:$(id -u)" ]] || { echo "cloud-setup: shell startup file must be owned and single-link: $name" >&2; exit 1; }
|
|
841
|
-
fi
|
|
842
|
-
temporary="$(mktemp "$HOME/.stll-cloud-shell.XXXXXX")"
|
|
843
|
-
trap 'rm -f -- "$temporary"' EXIT
|
|
844
|
-
if [[ "$name" == .bashrc ]]; then
|
|
845
|
-
printf '%s\n' '# stll-cloud: early environment' '@SOURCE@' > "$temporary"
|
|
846
|
-
fi
|
|
847
|
-
if [[ -f "$file" ]]; then
|
|
848
|
-
# Remove only exact managed blocks; preserve unrelated startup lines and permissions.
|
|
849
|
-
awk '
|
|
850
|
-
$0 == "# stll-cloud: early environment" || $0 == "# stll-cloud: session environment" {
|
|
851
|
-
if ((getline following) <= 0 || following != "@SOURCE@") exit 1
|
|
852
|
-
next
|
|
853
|
-
}
|
|
854
|
-
{ print }
|
|
855
|
-
' "$file" >> "$temporary" || { echo "cloud-setup: managed shell startup block differs: $name" >&2; exit 1; }
|
|
856
|
-
fi
|
|
857
|
-
printf '%s\n' '# stll-cloud: session environment' '@SOURCE@' >> "$temporary"
|
|
858
|
-
if [[ -f "$file" ]] && cmp -s "$temporary" "$file"; then rm -- "$temporary"; continue; fi
|
|
859
|
-
if [[ -f "$file" ]]; then chmod --reference="$file" "$temporary"; else chmod 644 "$temporary"; fi
|
|
860
|
-
mv -f -- "$temporary" "$file"
|
|
861
|
-
done
|
|
862
|
-
`;
|
|
863
|
-
const renderCloudShellInstall = (options) => {
|
|
864
|
-
const profile = renderCloudShellProfile(options);
|
|
865
|
-
return `install_shell_environment() (
|
|
866
|
-
# Subshell scope retains temporary for EXIT cleanup after a failed command.
|
|
867
|
-
[[ ! -L ${quote$1(cloudShellProfilePath)} ]] || fail 'Managed shell profile must not be a symlink'
|
|
868
|
-
if [[ -e ${quote$1(cloudShellProfilePath)} ]]; then
|
|
869
|
-
[[ -f ${quote$1(cloudShellProfilePath)} && "$(stat -c '%h:%u' ${quote$1(cloudShellProfilePath)})" == 1:0 ]] || fail 'Managed shell profile must be a root-owned single-link file'
|
|
870
|
-
fi
|
|
871
|
-
temporary="$(mktemp)"
|
|
872
|
-
trap 'rm -f -- "$temporary"' EXIT
|
|
873
|
-
cat > "$temporary" <<'STLL_CLOUD_PROFILE'
|
|
874
|
-
${profile}STLL_CLOUD_PROFILE
|
|
875
|
-
if ! cmp -s "$temporary" ${quote$1(cloudShellProfilePath)}; then install -m 644 "$temporary" ${quote$1(cloudShellProfilePath)}; fi
|
|
876
|
-
runuser -u "$OUTPUT_USER" -- env HOME="$OUTPUT_HOME" bash -c ${quote$1(userStartup.replaceAll("@SOURCE@", cloudShellProfileSource))}
|
|
877
|
-
)
|
|
878
|
-
verify_shell_environment() {
|
|
879
|
-
[[ -f ${quote$1(cloudShellProfilePath)} && ! -L ${quote$1(cloudShellProfilePath)} && "$(stat -c '%h:%u' ${quote$1(cloudShellProfilePath)})" == 1:0 ]] || fail 'Managed shell environment is unavailable; run install'
|
|
880
|
-
[[ "$(sha256sum -- ${quote$1(cloudShellProfilePath)} | cut -d ' ' -f1)" == ${quote$1((0, node_crypto.createHash)("sha256").update(profile).digest("hex"))} ]] || fail 'Managed shell environment differs; run install'
|
|
881
|
-
}
|
|
882
|
-
`;
|
|
883
|
-
};
|
|
884
|
-
//#endregion
|
|
885
892
|
//#region src/cloud-setup-toolchains.ts
|
|
886
893
|
const record$2 = (input) => typeof input === "object" && input !== null && !Array.isArray(input);
|
|
887
894
|
/** Resolve the same tracked snapshot for generation and the mandatory drift check. */
|
|
@@ -1036,6 +1043,7 @@ install_rust() (
|
|
|
1036
1043
|
# Launchers persist the system homes in fresh shells without profile sourcing.
|
|
1037
1044
|
printf '%s\n' '#!/bin/sh' 'export RUSTUP_HOME=/opt/stll-cloud/rustup' 'export CARGO_HOME=/opt/stll-cloud/cargo' 'export RUSTUP_AUTO_INSTALL=0' 'export RUSTUP_TOOLCHAIN=@RUST@' "exec /opt/stll-cloud/cargo/bin/$tool \"\$@\"" > "$scratch/$tool"
|
|
1038
1045
|
if ! cmp -s "$scratch/$tool" "/usr/local/bin/$tool"; then
|
|
1046
|
+
${refuseDirectoryTarget("\"/usr/local/bin/$tool\"")}
|
|
1039
1047
|
install -m 755 "$scratch/$tool" "/usr/local/bin/$tool"
|
|
1040
1048
|
fi
|
|
1041
1049
|
done
|
|
@@ -1081,7 +1089,7 @@ install_${tool.replaceAll("-", "_")}() (
|
|
|
1081
1089
|
tar -xzf "$scratch/archive.tar.gz" -C "$scratch"
|
|
1082
1090
|
install -d -m 755 ${quote(directory)}
|
|
1083
1091
|
case "$ARCH" in
|
|
1084
|
-
${["amd64", "arm64"].map((arch) => ` ${arch})\n${Object.entries(release[arch].binaries).map(([binary, path]) => ` install -m 755 "$scratch/${path}" ${quote(`${directory}/${binary}`)}`).join("\n")}\n ;;`).join("\n")}
|
|
1092
|
+
${["amd64", "arm64"].map((arch) => ` ${arch})\n${Object.entries(release[arch].binaries).map(([binary, path]) => ` ${refuseDirectoryTarget(quote(`${directory}/${binary}`))}\n install -m 755 "$scratch/${path}" ${quote(`${directory}/${binary}`)}`).join("\n")}\n ;;`).join("\n")}
|
|
1085
1093
|
esac
|
|
1086
1094
|
verify_${tool.replaceAll("-", "_")} || fail ${quote(`Installed ${tool} version differs from its pin`)}
|
|
1087
1095
|
fi
|
|
@@ -1303,6 +1311,7 @@ install_runtimes() (
|
|
|
1303
1311
|
(cd "$scratch"; awk -v name="$bun_archive" '$2 == name || $2 == "*" name { print $1 " " name; count++ } END { if (count != 1) exit 1 }' bun-sums | sha256sum --strict -c -)
|
|
1304
1312
|
unzip -q "$scratch/$bun_archive" -d "$scratch/bun"
|
|
1305
1313
|
install -d -m 755 "$BUN_DIR"
|
|
1314
|
+
${refuseDirectoryTarget("\"$BUN_DIR/bun\"")}
|
|
1306
1315
|
install -m 755 "$scratch/bun/$bun_folder/bun" "$BUN_DIR/bun"
|
|
1307
1316
|
fi
|
|
1308
1317
|
runtime_ready
|
|
@@ -1657,6 +1666,52 @@ $cloud_shell_exports"
|
|
|
1657
1666
|
fi`
|
|
1658
1667
|
}]
|
|
1659
1668
|
});
|
|
1669
|
+
const releasedSnapshotHook = (script) => ({
|
|
1670
|
+
matcher: "",
|
|
1671
|
+
hooks: [{
|
|
1672
|
+
type: "command",
|
|
1673
|
+
command: `if [ "\${CLAUDE_CODE_REMOTE:-}" = "true" ]; then
|
|
1674
|
+
cloud_setup_incomplete() {
|
|
1675
|
+
printf '%s\\n' 'Cloud setup could not establish a verified session environment. From the repository root, run bash .agents/cloud-setup.sh install and then bash .agents/cloud-setup.sh start. Do not assume pinned tools or services are ready until start succeeds.'
|
|
1676
|
+
printf '%s\\n' "cloud-setup: $1" >&2
|
|
1677
|
+
exit 0
|
|
1678
|
+
}
|
|
1679
|
+
if [ -n "\${CLAUDE_ENV_FILE:-}" ]; then
|
|
1680
|
+
cloud_session_exports="$(${script} session)" || cloud_setup_incomplete 'startup failed; run install'
|
|
1681
|
+
else
|
|
1682
|
+
${script} start >&2 || cloud_setup_incomplete 'startup failed; run install'
|
|
1683
|
+
exit 0
|
|
1684
|
+
fi
|
|
1685
|
+
if [ -n "\${CLAUDE_ENV_FILE:-}" ]; then
|
|
1686
|
+
if [ ! -s ${cloudShellProfilePath} ]; then
|
|
1687
|
+
cloud_setup_incomplete 'cloud shell profile is unavailable; run install'
|
|
1688
|
+
fi
|
|
1689
|
+
cloud_shell_exports="$(cat ${cloudShellProfilePath})" || cloud_setup_incomplete 'cloud shell profile could not be read; run install'
|
|
1690
|
+
[ -n "$cloud_shell_exports" ] || cloud_setup_incomplete 'cloud shell profile is unavailable; run install'
|
|
1691
|
+
if [ -e "$CLAUDE_ENV_FILE" ] || [ -L "$CLAUDE_ENV_FILE" ]; then
|
|
1692
|
+
[ -f "$CLAUDE_ENV_FILE" ] && [ ! -L "$CLAUDE_ENV_FILE" ] || cloud_setup_incomplete 'session environment must be a regular file; check its path and rerun start'
|
|
1693
|
+
fi
|
|
1694
|
+
cloud_env_snapshot="\${CLAUDE_ENV_FILE}.stll-cloud"
|
|
1695
|
+
case "$cloud_env_snapshot" in
|
|
1696
|
+
*"'"*) cloud_setup_incomplete 'session environment path must not contain a single quote; check its path and rerun start' ;;
|
|
1697
|
+
esac
|
|
1698
|
+
if [ -n "$cloud_session_exports" ]; then
|
|
1699
|
+
cloud_session_exports="$cloud_session_exports
|
|
1700
|
+
$cloud_shell_exports"
|
|
1701
|
+
else
|
|
1702
|
+
cloud_session_exports="$cloud_shell_exports"
|
|
1703
|
+
fi
|
|
1704
|
+
cloud_env_temporary="$(umask 077; mktemp "\${cloud_env_snapshot}.XXXXXX")" || cloud_setup_incomplete 'session environment could not be prepared; check its write access and rerun start'
|
|
1705
|
+
printf '%s\\n' "$cloud_session_exports" > "$cloud_env_temporary" || { rm -f -- "$cloud_env_temporary"; cloud_setup_incomplete 'session environment could not be prepared; check its write access and rerun start'; }
|
|
1706
|
+
mv -f -- "$cloud_env_temporary" "$cloud_env_snapshot" || { rm -f -- "$cloud_env_temporary"; cloud_setup_incomplete 'session environment could not be persisted; check its write access and rerun start'; }
|
|
1707
|
+
cloud_env_source=". '$cloud_env_snapshot'"
|
|
1708
|
+
if [ ! -f "$CLAUDE_ENV_FILE" ] || ! grep -Fqx -- "$cloud_env_source" "$CLAUDE_ENV_FILE"; then
|
|
1709
|
+
printf '\\n%s\\n' "$cloud_env_source" >> "$CLAUDE_ENV_FILE" || cloud_setup_incomplete 'session environment could not be persisted; check its write access and rerun start'
|
|
1710
|
+
fi
|
|
1711
|
+
fi
|
|
1712
|
+
fi`
|
|
1713
|
+
}]
|
|
1714
|
+
});
|
|
1660
1715
|
const sessionStartHook = (script) => ({
|
|
1661
1716
|
matcher: "",
|
|
1662
1717
|
hooks: [{
|
|
@@ -1686,6 +1741,9 @@ const sessionStartHook = (script) => ({
|
|
|
1686
1741
|
case "$cloud_env_snapshot" in
|
|
1687
1742
|
*"'"*) cloud_setup_incomplete 'session environment path must not contain a single quote; check its path and rerun start' ;;
|
|
1688
1743
|
esac
|
|
1744
|
+
if [ -e "$cloud_env_snapshot" ] || [ -L "$cloud_env_snapshot" ]; then
|
|
1745
|
+
[ -f "$cloud_env_snapshot" ] && [ ! -L "$cloud_env_snapshot" ] || cloud_setup_incomplete "session environment snapshot must be a regular file; remove $cloud_env_snapshot and rerun start"
|
|
1746
|
+
fi
|
|
1689
1747
|
if [ -n "$cloud_session_exports" ]; then
|
|
1690
1748
|
cloud_session_exports="$cloud_session_exports
|
|
1691
1749
|
$cloud_shell_exports"
|
|
@@ -1695,6 +1753,7 @@ $cloud_shell_exports"
|
|
|
1695
1753
|
cloud_env_temporary="$(umask 077; mktemp "\${cloud_env_snapshot}.XXXXXX")" || cloud_setup_incomplete 'session environment could not be prepared; check its write access and rerun start'
|
|
1696
1754
|
printf '%s\\n' "$cloud_session_exports" > "$cloud_env_temporary" || { rm -f -- "$cloud_env_temporary"; cloud_setup_incomplete 'session environment could not be prepared; check its write access and rerun start'; }
|
|
1697
1755
|
mv -f -- "$cloud_env_temporary" "$cloud_env_snapshot" || { rm -f -- "$cloud_env_temporary"; cloud_setup_incomplete 'session environment could not be persisted; check its write access and rerun start'; }
|
|
1756
|
+
[ -f "$cloud_env_snapshot" ] && [ ! -L "$cloud_env_snapshot" ] || cloud_setup_incomplete "session environment snapshot must be a regular file; remove $cloud_env_snapshot and rerun start"
|
|
1698
1757
|
cloud_env_source=". '$cloud_env_snapshot'"
|
|
1699
1758
|
if [ ! -f "$CLAUDE_ENV_FILE" ] || ! grep -Fqx -- "$cloud_env_source" "$CLAUDE_ENV_FILE"; then
|
|
1700
1759
|
printf '\\n%s\\n' "$cloud_env_source" >> "$CLAUDE_ENV_FILE" || cloud_setup_incomplete 'session environment could not be persisted; check its write access and rerun start'
|
|
@@ -1730,7 +1789,8 @@ const previousCloudSessionStartHooks = [
|
|
|
1730
1789
|
releasedSessionStartHook(`bash ${cloudSetupPath}`),
|
|
1731
1790
|
releasedSessionStartHook(`bash "$CLAUDE_PROJECT_DIR/${cloudSetupPath}"`),
|
|
1732
1791
|
currentMainSessionStartHook(`bash "$CLAUDE_PROJECT_DIR/${cloudSetupPath}"`),
|
|
1733
|
-
releasedTemporaryFileHook(`bash "$CLAUDE_PROJECT_DIR/${cloudSetupPath}"`)
|
|
1792
|
+
releasedTemporaryFileHook(`bash "$CLAUDE_PROJECT_DIR/${cloudSetupPath}"`),
|
|
1793
|
+
releasedSnapshotHook(`bash "$CLAUDE_PROJECT_DIR/${cloudSetupPath}"`)
|
|
1734
1794
|
];
|
|
1735
1795
|
const cloudAttribution = {
|
|
1736
1796
|
commit: "",
|