From 7e30c801d6c0680cbcc75c464040d7e8af8e1f71 Mon Sep 17 00:00:00 2001 From: LIghtJUNction Date: Thu, 1 Oct 2026 07:57:02 +0800 Subject: [PATCH 1/4] fix: install current Pi plugin without a host version ceiling --- pi.ps1 | 5 ++--- pi.sh | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pi.ps1 b/pi.ps1 index 80d23c5..cc2e27f 100644 --- a/pi.ps1 +++ b/pi.ps1 @@ -3,10 +3,9 @@ if ($args.Count) { throw 'Usage: .\pi.ps1' } $installer = Invoke-RestMethod https://pi.dev/install.ps1 & ([scriptblock]::Create($installer + "`n" + @' $pi = Join-Path (Get-PiBinDir) 'pi.cmd' -$version = & $pi --version +& $pi --version if ($LASTEXITCODE) { exit $LASTEXITCODE } -if ($version -notmatch '^0\.(86\.[1-9]\d*|87\.\d+)$') { Write-Warning "Pi $version installed; LMM alpha supports 0.86.1 through 0.87.x, plugin skipped."; exit 0 } $env:LMM_PI_BIN = $pi -npm.cmd exec --yes --package=@tokennotincluded/pi-lmm-provider@0.1.0-alpha.2 -- lmm-pi-provider npm:@tokennotincluded/pi-lmm-provider@0.1.0-alpha.2 +npm.cmd exec --yes --package=@tokennotincluded/pi-lmm-provider@alpha -- lmm-pi-provider git:github.com/TokenNotIncluded/pi-lmm-provider@83e4c3ec22e9d9909904141f43c7424c59b7a474 exit $LASTEXITCODE '@)) diff --git a/pi.sh b/pi.sh index 6aec997..dd66b97 100755 --- a/pi.sh +++ b/pi.sh @@ -7,7 +7,6 @@ if [[ -n ${TERMUX_VERSION:-} || ${PREFIX:-} == */com.termux/files/usr ]]; then fi installer=$(curl -fsSL https://pi.dev/install.sh) exec sh -c "$installer"' -pi=$(pi_installed_path); version=$("$pi" --version) -case "$version" in 0.86.[1-9]*|0.87.*) ;; *) echo "Pi $version installed; LMM alpha supports 0.86.1 through 0.87.x, plugin skipped." >&2; exit 0;; esac +pi=$(pi_installed_path); "$pi" --version command -v npm >/dev/null 2>&1 || { echo "npm is required to install the LMM plugin and remove conflicting sources." >&2; exit 1; } -LMM_PI_BIN="$pi" npm exec --yes --package=@tokennotincluded/pi-lmm-provider@0.1.0-alpha.2 -- lmm-pi-provider npm:@tokennotincluded/pi-lmm-provider@0.1.0-alpha.2' +LMM_PI_BIN="$pi" npm exec --yes --package=@tokennotincluded/pi-lmm-provider@alpha -- lmm-pi-provider git:github.com/TokenNotIncluded/pi-lmm-provider@83e4c3ec22e9d9909904141f43c7424c59b7a474' From e8fb3fd02f9a00eef59e3a8a6a9567872b7e8248 Mon Sep 17 00:00:00 2001 From: LIghtJUNction Date: Thu, 1 Oct 2026 07:59:55 +0800 Subject: [PATCH 2/4] fix: resolve current Pi provider from upstream main on reinstall --- pi.ps1 | 2 +- pi.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pi.ps1 b/pi.ps1 index cc2e27f..4f1ad8f 100644 --- a/pi.ps1 +++ b/pi.ps1 @@ -6,6 +6,6 @@ $pi = Join-Path (Get-PiBinDir) 'pi.cmd' & $pi --version if ($LASTEXITCODE) { exit $LASTEXITCODE } $env:LMM_PI_BIN = $pi -npm.cmd exec --yes --package=@tokennotincluded/pi-lmm-provider@alpha -- lmm-pi-provider git:github.com/TokenNotIncluded/pi-lmm-provider@83e4c3ec22e9d9909904141f43c7424c59b7a474 +npm.cmd exec --yes --package=@tokennotincluded/pi-lmm-provider@alpha -- lmm-pi-provider git:github.com/TokenNotIncluded/pi-lmm-provider exit $LASTEXITCODE '@)) diff --git a/pi.sh b/pi.sh index dd66b97..ebbc3da 100755 --- a/pi.sh +++ b/pi.sh @@ -9,4 +9,4 @@ installer=$(curl -fsSL https://pi.dev/install.sh) exec sh -c "$installer"' pi=$(pi_installed_path); "$pi" --version command -v npm >/dev/null 2>&1 || { echo "npm is required to install the LMM plugin and remove conflicting sources." >&2; exit 1; } -LMM_PI_BIN="$pi" npm exec --yes --package=@tokennotincluded/pi-lmm-provider@alpha -- lmm-pi-provider git:github.com/TokenNotIncluded/pi-lmm-provider@83e4c3ec22e9d9909904141f43c7424c59b7a474' +LMM_PI_BIN="$pi" npm exec --yes --package=@tokennotincluded/pi-lmm-provider@alpha -- lmm-pi-provider git:github.com/TokenNotIncluded/pi-lmm-provider' From 5ce789b450539a46e512d1a2b2728cf763fbd6d1 Mon Sep 17 00:00:00 2001 From: LIghtJUNction Date: Thu, 1 Oct 2026 08:00:40 +0800 Subject: [PATCH 3/4] test: verify latest Pi hosts install the current Git provider --- test.ps1 | 6 ++++-- test.py | 16 ++++++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/test.ps1 b/test.ps1 index 8d5a78f..22020ef 100644 --- a/test.ps1 +++ b/test.ps1 @@ -40,10 +40,12 @@ function npm.cmd { } function pi.cmd { throw 'must not invoke stale pi on PATH' } '@ -Check 'pi.ps1' $piSetup 0 'lmm-pi-provider\|npm:@tokennotincluded/pi-lmm-provider' +Check 'pi.ps1' $piSetup 0 'lmm-pi-provider\|git:github.com/TokenNotIncluded/pi-lmm-provider' Check 'pi.ps1' ($piSetup+"`n`$env:PI_TEST_INSTALLER='Write-Output cancelled; exit 0'") 0 'cancelled' Check 'pi.ps1' ($piSetup+"`n`$env:PI_TEST_INSTALLER='Write-Output failed; exit 9'") 9 'failed' -Check 'pi.ps1' ($piSetup+"`n`$env:PI_TEST_VERSION='0.88.0'; function official-pi { if (`$args[0] -ne '--version') { throw 'unsupported plugin must not run' }; `$env:PI_TEST_VERSION }") 0 'plugin skipped' +foreach ($version in @('0.88.0', '0.99.2', '1.2.0')) { + Check 'pi.ps1' ($piSetup+"`n`$env:PI_TEST_VERSION='$version'") 0 'lmm-pi-provider\|git:github.com/TokenNotIncluded/pi-lmm-provider' +} Check 'pi.ps1' ($piSetup+"`nfunction official-pi { if (`$args[0] -ne '--version') { throw 'plugin must not run' }; `$global:LASTEXITCODE=8 }") 8 '' Check 'pi.ps1' ($piSetup+"`nfunction npm.cmd { Write-Output plugin-failed; `$global:LASTEXITCODE=7 }") 7 'plugin-failed' Check 'pi.ps1' "function Invoke-RestMethod { throw 'download-failed' }" 1 'download-failed' diff --git a/test.py b/test.py index 9102930..82a636a 100644 --- a/test.py +++ b/test.py @@ -107,7 +107,7 @@ def test_pi_delegates_to_official_installer_and_uses_its_environment(self): self.assertEqual(self.calls(),[ ['curl',['-fsSL','https://pi.dev/install.sh']], ['official-pi',['--version']], - ['npm',['exec','--yes','--package=@tokennotincluded/pi-lmm-provider@0.1.0-alpha.2','--','lmm-pi-provider','npm:@tokennotincluded/pi-lmm-provider@0.1.0-alpha.2']], + ['npm',['exec','--yes','--package=@tokennotincluded/pi-lmm-provider@alpha','--','lmm-pi-provider','git:github.com/TokenNotIncluded/pi-lmm-provider']], ]) def test_pi_official_failure_or_cancellation_stops_plugin(self): @@ -118,11 +118,15 @@ def test_pi_official_failure_or_cancellation_stops_plugin(self): self.assertTrue(all(name=='curl' for name,_ in self.calls())) shutil.rmtree(self.home/"official pi's bin") - def test_pi_unsupported_host_is_not_downgraded_for_plugin(self): - result=self.run_script('pi.sh',PI_VERSION='0.88.0') - self.assertEqual(result.returncode,0,result.stderr) - self.assertIn('plugin skipped',result.stderr) - self.assertEqual([name for name,_ in self.calls()],['curl','official-pi']) + def test_pi_latest_and_future_hosts_always_install_current_plugin(self): + for version in ('0.88.0', '0.99.2', '1.2.0'): + with self.subTest(version=version): + result=self.run_script('pi.sh',PI_VERSION=version) + self.assertEqual(result.returncode,0,result.stderr) + self.assertNotIn('plugin skipped',result.stderr) + self.assertEqual([name for name,_ in self.calls()],['curl','official-pi','npm']) + self.assertEqual(self.calls()[-1][1][-1], 'git:github.com/TokenNotIncluded/pi-lmm-provider') + shutil.rmtree(self.home/"official pi's bin") def test_pi_version_and_plugin_failures_propagate(self): for env in ({'PI_VERSION_EXIT':'8'},{'NPM_EXIT':'7'}): From 0f51c63ae305e949ac0846e075221d9feb4ceb5c Mon Sep 17 00:00:00 2001 From: LIghtJUNction Date: Thu, 1 Oct 2026 08:00:57 +0800 Subject: [PATCH 4/4] test: reset independent Pi version fixture logs --- test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test.py b/test.py index 82a636a..313f149 100644 --- a/test.py +++ b/test.py @@ -127,6 +127,7 @@ def test_pi_latest_and_future_hosts_always_install_current_plugin(self): self.assertEqual([name for name,_ in self.calls()],['curl','official-pi','npm']) self.assertEqual(self.calls()[-1][1][-1], 'git:github.com/TokenNotIncluded/pi-lmm-provider') shutil.rmtree(self.home/"official pi's bin") + self.log.write_text('') def test_pi_version_and_plugin_failures_propagate(self): for env in ({'PI_VERSION_EXIT':'8'},{'NPM_EXIT':'7'}):