+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If your software can interact with users remotely through a computer
+network, you should also make sure that it provides a way for users to
+get its source. For example, if your program is a web application, its
+interface could display a "Source" link that leads users to an archive
+of the code. There are many ways you could offer source, and different
+solutions will be better for different programs; see section 13 for the
+specific requirements.
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU AGPL, see
+.
diff --git a/stackchan-server/NOTICE.md b/stackchan-server/NOTICE.md
new file mode 100644
index 0000000..3af461c
--- /dev/null
+++ b/stackchan-server/NOTICE.md
@@ -0,0 +1,52 @@
+# Copyright and licensing / 版权与许可
+
+StackChan AI Server project-authored changes: Copyright (c) 2026 rudyll.
+Other authors retain copyright in their contributions and upstream works.
+
+The current combined project is licensed under the GNU Affero General Public
+License, version 3 only (**AGPL-3.0-only**), unless a component has an explicit
+separate license. The full, unmodified terms are in [LICENSE](LICENSE).
+This program is distributed without any warranty, including the implied
+warranties of merchantability or fitness for a particular purpose.
+
+当前组合项目采用 AGPL-3.0-only;项目新增修改的版权归 rudyll,其他作者保留其
+贡献和上游作品的版权。明确标注其他许可的组件保留原许可。本程序不提供任何担保。
+
+## Upstream and historical permissions
+
+- This server includes code derived from M5Stack StackChan. Preserve the original
+ `SPDX-FileCopyrightText: 2026 M5Stack Technology CO LTD` notices and the
+ [M5Stack MIT license](licenses/MIT-M5Stack.txt). This is not an official M5Stack
+ application, and no endorsement or exclusive rights to the StackChan name are claimed.
+- Source through commit `deddd647c8ef2e3a6fd7a0ab39bdce91680a12ba`, including
+ `v2.8.0-beta.3`, `macos-v0.1.0` and `macos-v0.1.1`, was published under MIT.
+ Those versions and their existing downloads retain their original permissions;
+ see [the previous project MIT notice](licenses/MIT-legacy-project.txt).
+- Existing explicitly MIT-marked files/portions remain available under MIT.
+ The project-level AGPL does not erase their copyright or permissive grants.
+ New project contributions default to AGPL-3.0-only. A mixed file can identify
+ the original MIT portions and new AGPL modifications separately.
+- Go modules and native libraries retain their own licenses. Preserve their
+ copyright, license and patent notices, and provide applicable corresponding
+ source. An AGPL project license is not a replacement for third-party terms.
+
+此前已发布的 MIT 版本和安装包不会被追溯改成 AGPL。M5Stack 原有代码、明确标注
+MIT 的旧有文件或部分,以及依赖库,均保留原有许可与版权声明。
+
+## Source availability and sponsorship
+
+The [source repository](https://github.com/rudyll/stackchan-ai-server) contains
+the project history and build instructions. Distributors must identify and
+provide the exact corresponding source for their build, including modifications
+and required build/install scripts and dependencies; a moving `main` link alone
+is not a substitute. Modified network services must provide the source offer
+required by AGPL section 13 to their remote users. See
+[the release checklist](https://github.com/rudyll/stackchan-ai-server/blob/main/docs/licensing.md).
+
+Commercial use is permitted subject to the applicable licenses. Sponsorship is
+voluntary: no mandatory donation, sales royalty, profit share, upstream pull
+request or copyright transfer is imposed by this project's sponsorship policy.
+Sponsorship is not a commercial-license exception or a support contract.
+
+商业使用须遵守相应许可,但无需强制捐赠或利润分成。源码提供义务不等于必须向
+本仓库提交 PR 或转让版权。赞助完全自愿,不构成商业许可例外或付费支持合同。
diff --git a/stackchan-server/README.md b/stackchan-server/README.md
index a4f2970..2c30c2a 100644
--- a/stackchan-server/README.md
+++ b/stackchan-server/README.md
@@ -2,7 +2,13 @@

-[](LICENSE)
+[](LICENSE)
+
+Current combined source: **AGPL-3.0-only**, with original third-party permissions
+retained in [NOTICE](NOTICE.md). Previously published MIT releases, including
+`v2.8.0-beta.3` and `macos-v0.1.1`, keep their original license.
+[Sponsorship is voluntary / 赞助完全自愿](../SPONSORING.md); no confirmed payment
+destination is published yet. [Contribution rules](../CONTRIBUTING.md).
Home Assistant add-on and standalone Docker runtime for [StackChan](https://github.com/m5stack/StackChan) — an AI robot built on M5Stack CoreS3.
diff --git a/stackchan-server/collect-licenses.sh b/stackchan-server/collect-licenses.sh
new file mode 100644
index 0000000..65424d6
--- /dev/null
+++ b/stackchan-server/collect-licenses.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+# Collect notices for the actual Go dependencies, not just direct go.mod entries.
+set -eu
+OUTPUT_DIR=${1:?Usage: collect-licenses.sh OUTPUT_DIR}
+mkdir -p "$OUTPUT_DIR"
+OUTPUT_DIR=$(cd "$OUTPUT_DIR" && pwd)
+GO_ROOT=$(go env GOROOT)
+GO_LICENSE="$GO_ROOT/LICENSE"
+[ -f "$GO_LICENSE" ] || GO_LICENSE="$(dirname "$GO_ROOT")/LICENSE"
+cp "$GO_LICENSE" "$OUTPUT_DIR/Go.txt"
+MODULE_LIST=$(mktemp)
+trap 'rm -f "$MODULE_LIST"' EXIT
+go list -mod=readonly -deps -f '{{if .Module}}{{.Module.Path}}|{{.Module.Dir}}{{end}}' . > "$MODULE_LIST"
+sort -u -o "$MODULE_LIST" "$MODULE_LIST"
+while IFS='|' read -r module_path module_dir; do
+ [ -n "$module_dir" ] || continue
+ module_name=$(printf '%s' "$module_path" | tr '/:' '__')
+ find "$module_dir" -maxdepth 1 -type f \( -iname 'license*' -o -iname 'copying*' -o -iname 'notice*' \) -print | while IFS= read -r license_file; do
+ cp "$license_file" "$OUTPUT_DIR/$module_name-$(basename "$license_file")"
+ done
+done < "$MODULE_LIST"
diff --git a/stackchan-server/licenses/MIT-M5Stack.txt b/stackchan-server/licenses/MIT-M5Stack.txt
new file mode 100644
index 0000000..98d36b6
--- /dev/null
+++ b/stackchan-server/licenses/MIT-M5Stack.txt
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 M5Stack Technology CO LTD
+
+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.
diff --git a/stackchan-server/licenses/MIT-legacy-project.txt b/stackchan-server/licenses/MIT-legacy-project.txt
new file mode 100644
index 0000000..99a95c0
--- /dev/null
+++ b/stackchan-server/licenses/MIT-legacy-project.txt
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 rudyll
+
+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.
diff --git a/stackchan-server/macos/NOTICE.txt b/stackchan-server/macos/NOTICE.txt
index ee0f7ca..ad2440e 100644
--- a/stackchan-server/macos/NOTICE.txt
+++ b/stackchan-server/macos/NOTICE.txt
@@ -4,6 +4,10 @@ project. Source files identify the following copyright holder:
SPDX-FileCopyrightText: 2026 M5Stack Technology CO LTD
SPDX-License-Identifier: MIT
-Project changes: Copyright (c) 2026 rudyll. See StackChan.txt for the MIT license.
+Current combined project: AGPL-3.0-only. Project changes: Copyright (c) 2026 rudyll.
+See StackChan.txt for the full AGPL license and Project-NOTICE.md for scope.
+M5Stack's original MIT portions retain their MIT permissions; see MIT-M5Stack.txt.
+Earlier project releases retain MIT; see MIT-legacy-project.txt.
See the other files in this directory for Go and dependency license notices.
This community server package is not an official M5Stack application.
+Sponsorship is voluntary and does not grant a commercial-license exception.
diff --git a/stackchan-server/macos/README.md b/stackchan-server/macos/README.md
index d58623e..e3a904f 100644
--- a/stackchan-server/macos/README.md
+++ b/stackchan-server/macos/README.md
@@ -8,6 +8,14 @@
The app contains Apple Silicon and Intel executables, targeting macOS 12+.
The macOS preview is versioned separately from HA releases.
+The existing `macos-v0.1.1` download retains its original **MIT** license. Current
+source builds use **AGPL-3.0-only** for the combined project, preserving upstream
+rights; see [NOTICE](../NOTICE.md). This license transition does not rebuild or
+overwrite that DMG. Before distributing a future AGPL build, provide its exact
+corresponding source and follow the [source-release checklist](../../docs/licensing.md).
+现有 0.1.1 安装包仍采用原 MIT 许可;当前源码采用 AGPL-3.0-only,不追溯修改旧版。
+[支持项目 / Voluntary sponsorship](../../SPONSORING.md) is optional.
+
## Install / 安装
1. Open the DMG and drag **StackChan AI Server.app** into **Applications**.
diff --git a/stackchan-server/macos/build-dmg.sh b/stackchan-server/macos/build-dmg.sh
index 1cdf497..e8e80da 100644
--- a/stackchan-server/macos/build-dmg.sh
+++ b/stackchan-server/macos/build-dmg.sh
@@ -29,6 +29,8 @@ sed "s/__VERSION__/$VERSION/g" "$SCRIPT_DIR/Info.plist" > "$APP_DIR/Contents/Inf
cp "$SCRIPT_DIR/config.yaml" "$APP_DIR/Contents/Resources/config.yaml"
cp "$SCRIPT_DIR/app-launcher.sh" "$APP_DIR/Contents/MacOS/stackchan-server"
cp "$SERVER_DIR/LICENSE" "$APP_DIR/Contents/Resources/Licenses/StackChan.txt"
+cp "$SERVER_DIR/NOTICE.md" "$APP_DIR/Contents/Resources/Licenses/Project-NOTICE.md"
+cp "$SERVER_DIR/licenses/"*.txt "$APP_DIR/Contents/Resources/Licenses/"
cp "$SCRIPT_DIR/NOTICE.txt" "$APP_DIR/Contents/Resources/Licenses/NOTICE.txt"
cp "$SCRIPT_DIR/INSTALL.txt" "$APP_DIR/Contents/Resources/INSTALL.txt"
printf 'Version: %s\nSource revision: %s\nArchitectures: %s\nMinimum macOS target: 12.0\n' \
diff --git a/stackchan-server/server/README.MD b/stackchan-server/server/README.MD
index 32a29cd..31d2ef4 100644
--- a/stackchan-server/server/README.MD
+++ b/stackchan-server/server/README.MD
@@ -261,7 +261,9 @@ For major changes, please open an issue first to discuss what you would like to
[SPDX-FileCopyrightText: 2026 M5Stack Technology CO LTD](LICENSE)
-[SPDX-License-Identifier: MIT](LICENSE)
+[Current combined project: AGPL-3.0-only](../LICENSE).
+Original M5Stack MIT permissions and prior release permissions are preserved;
+see [copyright and license scope](../NOTICE.md).
---
@@ -275,4 +277,4 @@ For questions and support, please open an issue in the GitHub repository or cont
- [GoFrame](https://goframe.org/) - The Go framework used in this project
- [M5Stack](https://m5stack.com/) - For supporting open-source development
-- All contributors who help improve this project
\ No newline at end of file
+- All contributors who help improve this project
diff --git a/stackchan-server/server/internal/service/ai/config_ui_html.go b/stackchan-server/server/internal/service/ai/config_ui_html.go
index ef78a88..171f5d5 100644
--- a/stackchan-server/server/internal/service/ai/config_ui_html.go
+++ b/stackchan-server/server/internal/service/ai/config_ui_html.go
@@ -1,10 +1,22 @@
/*
SPDX-FileCopyrightText: 2026 M5Stack Technology CO LTD
-SPDX-License-Identifier: MIT
+SPDX-FileCopyrightText: 2026 rudyll
+SPDX-License-Identifier: MIT AND AGPL-3.0-only
+
+Original portions retain MIT. Project modifications after the MIT release
+commit deddd647c8ef2e3a6fd7a0ab39bdce91680a12ba are AGPL-3.0-only.
+See the project NOTICE.md and retained MIT license text.
*/
package ai
+const projectLegalFooter = ``
+
const configUIHTML = `
@@ -69,7 +81,7 @@ const configUIHTML = `
-
+` + projectLegalFooter + `