Skip to content

armgit / mso

Public Imported from GitHub
0

Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.

fix(integrations): preserve strict SC bundle validation

Rahman6b80d7671006
diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md
index d6fa8572..098841f2 100644
--- a/docs/PROGRESS.md
+++ b/docs/PROGRESS.md
@@ -19,7 +19,7 @@ new window does not widen cross-origin framing policy.
Local SI-Coder migration discovery previously required the version-reported source path to contain
`si-coder-agent`. The installed SC 0.9.8 currently resolves to a legitimate worktree named
-`/home/rahman/worktrees/sc-flow-merge-main`, so that name check produced a false unavailable state.
+`~/worktrees/sc-flow-merge-main`, so that name check produced a false unavailable state.
Discovery now validates that the resolved SC executable lives inside the absolute checkout reported
by `sc version --json`, treats an explicit `MSO_SC_BIN` override as authoritative, and additionally
validates the exported Integration Bundle v1 producer/mode before reading metadata. Arbitrary
diff --git a/scripts/mso-cli-integrations-sc.sh b/scripts/mso-cli-integrations-sc.sh
index 70ced6af..b185497e 100755
--- a/scripts/mso-cli-integrations-sc.sh
+++ b/scripts/mso-cli-integrations-sc.sh
@@ -18,7 +18,11 @@ integration_sc_bundle(){
dir=$(mktemp -d "${TMPDIR:-/tmp}/mso-sc-migration.XXXXXX") || return 1
chmod 700 "$dir"; out="$dir/sc.integration-bundle.json"
"$bin" data export --out "$out" >/dev/null 2>&1 || rc=$?
- if [ "$rc" -eq 0 ]; then cat "$out"; fi
+ if [ "$rc" -eq 0 ] && jq -e '.format=="integration-bundle" and .version==1 and .producer.name=="si-coder" and .mode=="metadata" and (.users|type=="array")' "$out" >/dev/null 2>&1; then
+ cat "$out"
+ else
+ rc=1
+ fi
[ ! -e "$out" ] || { : >"$out"; unlink "$out"; }
rmdir "$dir" 2>/dev/null || true
return "$rc"