From e0eda22e21c1a8cb162e76391f4bd5f955e21957 Mon Sep 17 00:00:00 2001 From: Ein Anderssono Date: Mon, 19 Oct 2026 12:04:48 +0200 Subject: [PATCH] Bundle Wllama license from its pinned release --- licenses/GEMMA_SOURCE.txt | 1 + licenses/WLLAMA_LICENSE.txt | 21 +++++++++++++++++++++ scripts/build-assets.mjs | 10 +--------- 3 files changed, 23 insertions(+), 9 deletions(-) create mode 100644 licenses/WLLAMA_LICENSE.txt diff --git a/licenses/GEMMA_SOURCE.txt b/licenses/GEMMA_SOURCE.txt index f0f0029..32f0c06 100644 --- a/licenses/GEMMA_SOURCE.txt +++ b/licenses/GEMMA_SOURCE.txt @@ -19,3 +19,4 @@ Legal text snapshots checked against Google's official pages on 2026-10-19: The bundled HTML contains the full article text in a minimal, script-free wrapper. The manifest fingerprints the exact bundled copies; a changed copy requires new user acceptance before this browser downloads or uses Gemma. +Wllama license copy: https://github.com/ngxson/wllama/blob/3.8.1/LICENCE diff --git a/licenses/WLLAMA_LICENSE.txt b/licenses/WLLAMA_LICENSE.txt new file mode 100644 index 0000000..e122efc --- /dev/null +++ b/licenses/WLLAMA_LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Xuan Son NGUYEN + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/scripts/build-assets.mjs b/scripts/build-assets.mjs index 78e3f4d..1a12e28 100644 --- a/scripts/build-assets.mjs +++ b/scripts/build-assets.mjs @@ -70,15 +70,7 @@ await unlink(tgzPath); for (const relative of ['esm/index.js', 'esm/wasm/wllama.wasm']) { if (!(await stat(join(wllamaRoot, relative))).isFile()) throw new Error(`Missing Wllama runtime asset: ${relative}`); } -const wllamaLicenseCandidates = ['LICENSE', 'LICENSE.md', 'LICENSE.txt']; -let wllamaLicense; -for (const candidate of wllamaLicenseCandidates) { - const candidatePath = join(wllamaRoot, candidate); - if ((await stat(candidatePath).catch(() => null))?.isFile()) { wllamaLicense = candidatePath; break; } -} -if (!wllamaLicense) throw new Error('Wllama package is missing its license file'); -await cp(wllamaLicense, join(licenseRoot, 'WLLAMA_LICENSE.txt')); -for (const file of ['GEMMA_USER_TERMS.html', 'GEMMA_TERMS.html', 'GEMMA_PROHIBITED_USE_POLICY.html', 'GEMMA_NOTICE.txt', 'GEMMA_SOURCE.txt', 'LLAMA_CPP_LICENSE.txt']) { +for (const file of ['GEMMA_USER_TERMS.html', 'GEMMA_TERMS.html', 'GEMMA_PROHIBITED_USE_POLICY.html', 'GEMMA_NOTICE.txt', 'GEMMA_SOURCE.txt', 'WLLAMA_LICENSE.txt', 'LLAMA_CPP_LICENSE.txt']) { const source = join(root, 'licenses', file); if (!(await stat(source).catch(() => null))?.isFile()) throw new Error(`Missing Gemma legal asset: ${file}`); await cp(source, join(licenseRoot, file));