create-maa-project 1.2.2__tar.gz → 2.0.0__tar.gz
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.
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/.release/create-maa-project-manifest.json +23 -23
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/PKG-INFO +2 -2
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/README.md +1 -1
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/package.json +1 -1
- create_maa_project-2.0.0/py-wrapper/create_maa_project/__init__.py +1 -0
- create_maa_project-2.0.0/py-wrapper/create_maa_project/release_manifest.py +2 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/pyproject.toml +1 -1
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/src/assets.ts +57 -7
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/src/project.ts +65 -3
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/src/scaffold.ts +5 -3
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/src/types.ts +7 -4
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/src/update.ts +3 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/addons/dev-tools/tools/check-project.mjs +4 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/addons/github/tools/build-release.mjs +23 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/agent/agent/bootstrap.py +137 -20
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/tests/scaffold.test.ts +90 -5
- create_maa_project-2.0.0/tests/test_agent_bootstrap.py +153 -0
- create_maa_project-1.2.2/py-wrapper/create_maa_project/__init__.py +0 -1
- create_maa_project-1.2.2/py-wrapper/create_maa_project/release_manifest.py +0 -2
- create_maa_project-1.2.2/tests/test_agent_bootstrap.py +0 -39
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/.editorconfig +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/.gitattributes +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/.github/cliff.toml +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/.github/workflows/network-assets.yml +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/.github/workflows/release.yml +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/.github/workflows/schema-sync.yml +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/.gitignore +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/.prettierignore +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/.prettierrc.mjs +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/LICENSE +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/README.en.md +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/pnpm-lock.yaml +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/pnpm-workspace.yaml +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/py-wrapper/create_maa_project/__main__.py +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/scripts/build-sea.mjs +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/scripts/build.mjs +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/scripts/check-network-assets.ts +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/scripts/create-release-manifest.mjs +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/scripts/generate-template-assets.mjs +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/scripts/prepare-pypi-release.mjs +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/scripts/sync-release-version.mjs +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/scripts/sync-schema.mjs +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/scripts/test-python.mjs +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/src/addons.ts +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/src/args.ts +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/src/controllers.ts +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/src/doctor.ts +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/src/features.ts +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/src/incremental-addons.ts +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/src/index.ts +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/src/lang.ts +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/src/log.ts +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/src/mcp.ts +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/src/prompt.ts +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/src/report.ts +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/src/sync.ts +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/src/template-assets.generated.ts +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/src/templates.ts +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/src/utils.ts +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/addons/auto-format/.github/workflows/format.yml +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/addons/community/CONTRIBUTING.md +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/addons/community/PULL_REQUEST_TEMPLATE.md +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/addons/community/bug_report.yml +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/addons/community/feature_request.yml +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/addons/community/issue_config.yml +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/addons/community/other_issue.yml +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/addons/dependabot/.github/dependabot.yml +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/addons/dev-tools/.vscode/extensions.agent.json +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/addons/dev-tools/.vscode/extensions.json +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/addons/dev-tools/.vscode/launch.agent.json +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/addons/dev-tools/.vscode/settings.agent.json +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/addons/dev-tools/.vscode/settings.json +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/addons/dev-tools/.vscode/tasks.github.json +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/addons/dev-tools/.vscode/tasks.json +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/addons/dev-tools/package.json +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/addons/dev-tools/pnpm-workspace.yaml +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/addons/dev-tools/tools/validate-schema.mjs +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/addons/git-cliff/.github/cliff.toml +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/addons/github/.github/workflows/check.yml +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/addons/github/.github/workflows/release.yml +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/addons/github/tools/sync-runtime.mjs +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/addons/optimize-images/.github/workflows/optimize-images.yml +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/addons/optimize-images/tools/optimize-images.mjs +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/addons/schema-sync/.github/workflows/schema-sync.yml +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/addons/schema-sync/tools/sync-schema.mjs +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/agent/README.en.md +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/agent/README.md +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/agent/agent/__init__.py +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/agent/agent/agent_runtime.py +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/agent/agent/custom/__init__.py +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/agent/agent/custom/action/__init__.py +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/agent/agent/custom/action/general.py +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/agent/agent/custom/reco/__init__.py +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/agent/agent/custom/reco/general.py +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/agent/agent/custom/sink/__init__.py +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/agent/agent/main.py +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/agent/agent/utils/__init__.py +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/agent/agent/utils/logger.py +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/agent/agent/utils/maa_types.py +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/agent/agent/utils/params.py +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/agent/agent/utils/pienv.py +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/agent/agent/utils/runtime_paths.py +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/agent/pyproject.toml +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/agent/requirements.txt +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/agent/tools/schema/custom.action.schema.json +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/agent/tools/schema/custom.recognition.schema.json +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/agent/uv.lock +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/base/.editorconfig +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/base/.gitattributes +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/base/.gitignore +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/base/.prettierignore +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/base/.prettierrc.mjs +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/base/README.en.md +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/base/README.md +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/base/gitignore.tmpl +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/base/interface.json.tmpl +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/base/licenses/AGPL-3.0-or-later.txt +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/base/licenses/MIT.txt +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/base/maatools.config.mts +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/base/resource/base/default_pipeline.json +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/base/resource/base/image/empty.png +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/base/resource/base/model/ocr/manifest.json +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/base/resource/base/pipeline/tutorial.json +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/base/tasks/tutorial.json +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/base/tools/schema/custom.action.schema.json +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/base/tools/schema/custom.recognition.schema.json +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/base/tools/schema/interface.schema.json +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/base/tools/schema/interface_config.schema.json +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/base/tools/schema/interface_import.schema.json +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/base/tools/schema/pipeline.schema.json +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/templates/base/tools/schema/schema-manifest.json +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/tests/addons.test.ts +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/tests/args.test.ts +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/tests/child-env.ts +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/tests/lang.test.ts +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/tests/mcp.test.ts +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/tests/project.test.ts +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/tests/prompt.test.ts +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/tests/report.test.ts +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/tests/templates.test.ts +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/tests/test_py_wrapper.py +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/tsconfig.json +0 -0
- {create_maa_project-1.2.2 → create_maa_project-2.0.0}/vitest.config.ts +0 -0
{create_maa_project-1.2.2 → create_maa_project-2.0.0}/.release/create-maa-project-manifest.json
RENAMED
|
@@ -1,68 +1,68 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "create-maa-project",
|
|
4
|
-
"version": "
|
|
5
|
-
"tag": "
|
|
4
|
+
"version": "2.0.0",
|
|
5
|
+
"tag": "v2.0.0",
|
|
6
6
|
"assets": [
|
|
7
7
|
{
|
|
8
8
|
"kind": "sea",
|
|
9
9
|
"os": "linux",
|
|
10
10
|
"arch": "aarch64",
|
|
11
|
-
"version": "
|
|
11
|
+
"version": "2.0.0",
|
|
12
12
|
"name": "create-maa-project-linux-aarch64",
|
|
13
|
-
"url": "https://github.com/Windsland52/create-maa-project/releases/download/
|
|
14
|
-
"sha256": "
|
|
13
|
+
"url": "https://github.com/Windsland52/create-maa-project/releases/download/v2.0.0/create-maa-project-linux-aarch64",
|
|
14
|
+
"sha256": "e9f66b8c95f8a06a393216c3c50d8b032fcb4cbe54495c62d49156167e0b650a",
|
|
15
15
|
"size": 123145344
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"kind": "sea",
|
|
19
19
|
"os": "linux",
|
|
20
20
|
"arch": "x86_64",
|
|
21
|
-
"version": "
|
|
21
|
+
"version": "2.0.0",
|
|
22
22
|
"name": "create-maa-project-linux-x86_64",
|
|
23
|
-
"url": "https://github.com/Windsland52/create-maa-project/releases/download/
|
|
24
|
-
"sha256": "
|
|
23
|
+
"url": "https://github.com/Windsland52/create-maa-project/releases/download/v2.0.0/create-maa-project-linux-x86_64",
|
|
24
|
+
"sha256": "853215e9e7004fb4e90bdba933a3665af7aac01b15497c0ef2f16d85aaea06dd",
|
|
25
25
|
"size": 125045952
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
"kind": "sea",
|
|
29
29
|
"os": "macos",
|
|
30
30
|
"arch": "aarch64",
|
|
31
|
-
"version": "
|
|
31
|
+
"version": "2.0.0",
|
|
32
32
|
"name": "create-maa-project-macos-aarch64",
|
|
33
|
-
"url": "https://github.com/Windsland52/create-maa-project/releases/download/
|
|
34
|
-
"sha256": "
|
|
33
|
+
"url": "https://github.com/Windsland52/create-maa-project/releases/download/v2.0.0/create-maa-project-macos-aarch64",
|
|
34
|
+
"sha256": "5d88be2d4be7662247fc94ab575dacb102c03e99e1de2c2f252c7d90a917cdd0",
|
|
35
35
|
"size": 121408240
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
"kind": "sea",
|
|
39
39
|
"os": "macos",
|
|
40
40
|
"arch": "x86_64",
|
|
41
|
-
"version": "
|
|
41
|
+
"version": "2.0.0",
|
|
42
42
|
"name": "create-maa-project-macos-x86_64",
|
|
43
|
-
"url": "https://github.com/Windsland52/create-maa-project/releases/download/
|
|
44
|
-
"sha256": "
|
|
45
|
-
"size":
|
|
43
|
+
"url": "https://github.com/Windsland52/create-maa-project/releases/download/v2.0.0/create-maa-project-macos-x86_64",
|
|
44
|
+
"sha256": "8c312a395c561982602d392733b5ee15bde172e18315b9181bb4eff2fc56d7dc",
|
|
45
|
+
"size": 124480496
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
"kind": "sea",
|
|
49
49
|
"os": "win",
|
|
50
50
|
"arch": "aarch64",
|
|
51
|
-
"version": "
|
|
51
|
+
"version": "2.0.0",
|
|
52
52
|
"name": "create-maa-project-win-aarch64.exe",
|
|
53
|
-
"url": "https://github.com/Windsland52/create-maa-project/releases/download/
|
|
54
|
-
"sha256": "
|
|
55
|
-
"size":
|
|
53
|
+
"url": "https://github.com/Windsland52/create-maa-project/releases/download/v2.0.0/create-maa-project-win-aarch64.exe",
|
|
54
|
+
"sha256": "03d7d2b754aa7cd7808d49154de6d13cf2d61bece93e127f2e2e67ad86cebde6",
|
|
55
|
+
"size": 82569728
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
"kind": "sea",
|
|
59
59
|
"os": "win",
|
|
60
60
|
"arch": "x86_64",
|
|
61
|
-
"version": "
|
|
61
|
+
"version": "2.0.0",
|
|
62
62
|
"name": "create-maa-project-win-x86_64.exe",
|
|
63
|
-
"url": "https://github.com/Windsland52/create-maa-project/releases/download/
|
|
64
|
-
"sha256": "
|
|
65
|
-
"size":
|
|
63
|
+
"url": "https://github.com/Windsland52/create-maa-project/releases/download/v2.0.0/create-maa-project-win-x86_64.exe",
|
|
64
|
+
"sha256": "4bc035d226f5c220026cc9b8d4802386524e94c8ddabea5fd8b104ea8fbf81ec",
|
|
65
|
+
"size": 94035968
|
|
66
66
|
}
|
|
67
67
|
]
|
|
68
68
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: create-maa-project
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.0.0
|
|
4
4
|
Summary: 用于创建和维护 MaaFW 应用项目的脚手架 CLI / Scaffold and maintenance CLI for MaaFW application projects
|
|
5
5
|
Project-URL: Homepage, https://github.com/Windsland52/create-maa-project
|
|
6
6
|
Project-URL: Source, https://github.com/Windsland52/create-maa-project
|
|
@@ -192,7 +192,7 @@ CLI 只在首次创建时写入 `interface.json`、`package.json`、`tasks/`、`
|
|
|
192
192
|
|
|
193
193
|
进入 Git 的状态文件:
|
|
194
194
|
|
|
195
|
-
- `maa-project.json`:用户意图,包括项目元数据、功能/插件选择、资源包、runtime channel、网络模式、license 和 Agent
|
|
195
|
+
- `maa-project.json`:用户意图,包括项目元数据、功能/插件选择、资源包、runtime channel/version、网络模式、license 和 Agent 配置。`version` 非空时精确版本优先;为空时按 `stable`、`beta`(含 rc)或 `alpha` channel 解析。
|
|
196
196
|
- `maa-project.lock.json`:resolved 状态、pending actions、模板版本和 managed file hash。
|
|
197
197
|
|
|
198
198
|
本机状态放在 `.create-maa-project/`,生成项目默认忽略该目录:
|
|
@@ -181,7 +181,7 @@ CLI 只在首次创建时写入 `interface.json`、`package.json`、`tasks/`、`
|
|
|
181
181
|
|
|
182
182
|
进入 Git 的状态文件:
|
|
183
183
|
|
|
184
|
-
- `maa-project.json`:用户意图,包括项目元数据、功能/插件选择、资源包、runtime channel、网络模式、license 和 Agent
|
|
184
|
+
- `maa-project.json`:用户意图,包括项目元数据、功能/插件选择、资源包、runtime channel/version、网络模式、license 和 Agent 配置。`version` 非空时精确版本优先;为空时按 `stable`、`beta`(含 rc)或 `alpha` channel 解析。
|
|
185
185
|
- `maa-project.lock.json`:resolved 状态、pending actions、模板版本和 managed file hash。
|
|
186
186
|
|
|
187
187
|
本机状态放在 `.create-maa-project/`,生成项目默认忽略该目录:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.0.0"
|
|
@@ -28,6 +28,7 @@ export type ProductAssetManifest = Omit<AssetManifest, 'assets'> & {
|
|
|
28
28
|
export type ProductAssetManifestRequest = {
|
|
29
29
|
product: string
|
|
30
30
|
channel?: string
|
|
31
|
+
version?: string
|
|
31
32
|
platform?: string
|
|
32
33
|
}
|
|
33
34
|
|
|
@@ -167,8 +168,12 @@ export async function resolveProductAssetManifestFromGithubRelease(
|
|
|
167
168
|
const requestedPlatform = resolveRequestedRuntimePlatform(request.platform)
|
|
168
169
|
if (!requestedPlatform) return undefined
|
|
169
170
|
const selectedPlatform = requestedPlatform === 'all' ? undefined : requestedPlatform
|
|
170
|
-
const
|
|
171
|
-
|
|
171
|
+
const channel = normalizeReleaseChannel(request.channel)
|
|
172
|
+
const version = request.version?.trim()
|
|
173
|
+
const release = version
|
|
174
|
+
? await fetchGithubReleaseByTag(config, version, options.fetchJson)
|
|
175
|
+
: await fetchGithubReleaseByChannel(config, channel, options.fetchJson)
|
|
176
|
+
return parseGithubReleaseManifest(config, release, channel, selectedPlatform)
|
|
172
177
|
}
|
|
173
178
|
|
|
174
179
|
export async function downloadManifestAssets(
|
|
@@ -567,15 +572,60 @@ function isIgnoredArchiveEntry(path: string): boolean {
|
|
|
567
572
|
return lower === '.ds_store' || lower.endsWith('/.ds_store') || lower.startsWith('__macosx/')
|
|
568
573
|
}
|
|
569
574
|
|
|
570
|
-
async function
|
|
575
|
+
async function fetchGithubReleaseByTag(
|
|
576
|
+
config: ProductReleaseConfig,
|
|
577
|
+
tag: string,
|
|
578
|
+
fetchJson: GithubReleaseJsonFetcher = defaultGithubReleaseJsonFetch,
|
|
579
|
+
): Promise<unknown> {
|
|
580
|
+
return fetchJson(
|
|
581
|
+
`https://api.github.com/repos/${config.owner}/${config.repo}/releases/tags/${encodeURIComponent(tag)}`,
|
|
582
|
+
{
|
|
583
|
+
headers: githubRequestHeaders(),
|
|
584
|
+
},
|
|
585
|
+
)
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
async function fetchGithubReleaseByChannel(
|
|
571
589
|
config: ProductReleaseConfig,
|
|
572
590
|
channel: string,
|
|
573
591
|
fetchJson: GithubReleaseJsonFetcher = defaultGithubReleaseJsonFetch,
|
|
574
592
|
): Promise<unknown> {
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
593
|
+
if (channel === 'stable') {
|
|
594
|
+
return fetchJson(`https://api.github.com/repos/${config.owner}/${config.repo}/releases/latest`, {
|
|
595
|
+
headers: githubRequestHeaders(),
|
|
596
|
+
})
|
|
597
|
+
}
|
|
598
|
+
if (channel !== 'beta' && channel !== 'alpha') {
|
|
599
|
+
return fetchGithubReleaseByTag(config, channel, fetchJson)
|
|
600
|
+
}
|
|
601
|
+
const releases = await fetchJson(
|
|
602
|
+
`https://api.github.com/repos/${config.owner}/${config.repo}/releases?per_page=100`,
|
|
603
|
+
{ headers: githubRequestHeaders() },
|
|
604
|
+
)
|
|
605
|
+
if (!Array.isArray(releases)) throw new Error(`Invalid GitHub releases payload for ${config.product}.`)
|
|
606
|
+
const release = releases.find((value) => isReleaseAllowedForChannel(value, channel))
|
|
607
|
+
if (!release) throw new Error(`No ${config.product} release found for channel ${channel}.`)
|
|
608
|
+
return release
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
function normalizeReleaseChannel(channel: string | undefined): string {
|
|
612
|
+
const value = channel?.trim() || 'stable'
|
|
613
|
+
return value === 'latest' ? 'stable' : value
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
function isReleaseAllowedForChannel(value: unknown, channel: 'beta' | 'alpha'): boolean {
|
|
617
|
+
if (!isRecord(value) || value.draft === true || typeof value.tag_name !== 'string') return false
|
|
618
|
+
const maturity = releaseMaturity(value.tag_name)
|
|
619
|
+
const priority = { stable: 2, beta: 1, alpha: 0 }
|
|
620
|
+
return priority[maturity] >= priority[channel]
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
function releaseMaturity(tag: string): 'stable' | 'beta' | 'alpha' {
|
|
624
|
+
const lower = tag.toLowerCase()
|
|
625
|
+
if (/(?:^|[.-])alpha(?:[.-]|$)/.test(lower)) return 'alpha'
|
|
626
|
+
if (/(?:^|[.-])beta(?:[.-]|$)/.test(lower)) return 'beta'
|
|
627
|
+
if (/(?:^|[.-])rc(?:[.-]|$)/.test(lower)) return 'beta'
|
|
628
|
+
return 'stable'
|
|
579
629
|
}
|
|
580
630
|
|
|
581
631
|
async function defaultGithubReleaseJsonFetch(
|
|
@@ -7,6 +7,7 @@ import type {
|
|
|
7
7
|
ManagedFileInput,
|
|
8
8
|
ManagedFileState,
|
|
9
9
|
PendingItem,
|
|
10
|
+
ReleaseChannel,
|
|
10
11
|
} from './types.js'
|
|
11
12
|
import { exists, nowIso, readText, sha256, stableJson, writeText } from './utils.js'
|
|
12
13
|
|
|
@@ -19,7 +20,60 @@ export async function readProjectConfig(root: string): Promise<MaaProjectConfig>
|
|
|
19
20
|
if (!(await exists(configPath))) {
|
|
20
21
|
throw new Error(`No ${CONFIG_FILE} found. Run this command in a MaaFW project root.`)
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
+
const config = JSON.parse(await readText(configPath)) as MaaProjectConfig
|
|
24
|
+
return migrateProjectConfig(config)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function migrateProjectConfig(config: MaaProjectConfig): MaaProjectConfig {
|
|
28
|
+
if (config.schemaVersion !== 1 && config.schemaVersion !== 2) {
|
|
29
|
+
throw new Error(`Unsupported maa-project.json schemaVersion: ${String(config.schemaVersion)}`)
|
|
30
|
+
}
|
|
31
|
+
if (config.schemaVersion === 1) {
|
|
32
|
+
migrateReleaseSelector(config.maafw)
|
|
33
|
+
migrateReleaseSelector(config.runtime.mfa)
|
|
34
|
+
if (config.runtime.mxu) migrateReleaseSelector(config.runtime.mxu)
|
|
35
|
+
config.schemaVersion = 2
|
|
36
|
+
}
|
|
37
|
+
normalizeReleaseSelector(config.maafw, 'maafw')
|
|
38
|
+
normalizeReleaseSelector(config.runtime.mfa, 'runtime.mfa')
|
|
39
|
+
if (config.runtime.mxu) normalizeReleaseSelector(config.runtime.mxu, 'runtime.mxu')
|
|
40
|
+
return config
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function normalizeReleaseSelector(selector: { channel: string; version?: string }, path: string): void {
|
|
44
|
+
selector.channel = selector.channel.trim()
|
|
45
|
+
selector.version = selector.version?.trim() ?? ''
|
|
46
|
+
if (!isReleaseChannel(selector.channel)) {
|
|
47
|
+
throw new Error(`${path}.channel must be one of: stable, beta, alpha`)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function migrateReleaseSelector(selector: { channel: string; version?: string }): void {
|
|
52
|
+
const legacy = selector.channel.trim()
|
|
53
|
+
if (legacy === 'latest') {
|
|
54
|
+
selector.channel = 'stable'
|
|
55
|
+
selector.version = ''
|
|
56
|
+
return
|
|
57
|
+
}
|
|
58
|
+
if (isReleaseChannel(legacy)) {
|
|
59
|
+
selector.channel = legacy
|
|
60
|
+
selector.version = ''
|
|
61
|
+
return
|
|
62
|
+
}
|
|
63
|
+
selector.channel = inferReleaseChannel(legacy)
|
|
64
|
+
selector.version = legacy
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function isReleaseChannel(value: string): value is ReleaseChannel {
|
|
68
|
+
return value === 'stable' || value === 'beta' || value === 'alpha'
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function inferReleaseChannel(version: string): ReleaseChannel {
|
|
72
|
+
const lower = version.toLowerCase()
|
|
73
|
+
if (/(?:^|[.-])alpha(?:[.-]|$)/.test(lower)) return 'alpha'
|
|
74
|
+
if (/(?:^|[.-])beta(?:[.-]|$)/.test(lower)) return 'beta'
|
|
75
|
+
if (/(?:^|[.-])rc(?:[.-]|$)/.test(lower)) return 'beta'
|
|
76
|
+
return 'stable'
|
|
23
77
|
}
|
|
24
78
|
|
|
25
79
|
export async function readProjectLock(root: string): Promise<MaaProjectLock> {
|
|
@@ -27,12 +81,17 @@ export async function readProjectLock(root: string): Promise<MaaProjectLock> {
|
|
|
27
81
|
if (!(await exists(lockPath))) {
|
|
28
82
|
return emptyLock('unknown')
|
|
29
83
|
}
|
|
30
|
-
|
|
84
|
+
const lock = JSON.parse(await readText(lockPath)) as MaaProjectLock
|
|
85
|
+
if (lock.schemaVersion !== 1 && lock.schemaVersion !== 2) {
|
|
86
|
+
throw new Error(`Unsupported maa-project.lock.json schemaVersion: ${String(lock.schemaVersion)}`)
|
|
87
|
+
}
|
|
88
|
+
if (lock.schemaVersion === 1) lock.schemaVersion = 2
|
|
89
|
+
return lock
|
|
31
90
|
}
|
|
32
91
|
|
|
33
92
|
export function emptyLock(version: string): MaaProjectLock {
|
|
34
93
|
return {
|
|
35
|
-
schemaVersion:
|
|
94
|
+
schemaVersion: 2,
|
|
36
95
|
template: {
|
|
37
96
|
createdBy: 'create-maa-project',
|
|
38
97
|
lastUpdatedBy: 'create-maa-project',
|
|
@@ -45,6 +104,9 @@ export function emptyLock(version: string): MaaProjectLock {
|
|
|
45
104
|
}
|
|
46
105
|
|
|
47
106
|
export async function writeProjectState(root: string, config: MaaProjectConfig, lock: MaaProjectLock): Promise<void> {
|
|
107
|
+
if (config.schemaVersion !== lock.schemaVersion) {
|
|
108
|
+
throw new Error('maa-project.json and maa-project.lock.json schemaVersion must match')
|
|
109
|
+
}
|
|
48
110
|
const configContent = stableJson(config)
|
|
49
111
|
delete lock.managedFiles[CONFIG_FILE]
|
|
50
112
|
delete lock.managedFiles[LOCK_FILE]
|
|
@@ -646,7 +646,7 @@ function createConfig(input: {
|
|
|
646
646
|
const includeDevTools = input.resolvedAddons.includes('dev-tools')
|
|
647
647
|
const includeGithub = input.resolvedAddons.includes('github')
|
|
648
648
|
const config: MaaProjectConfig = {
|
|
649
|
-
schemaVersion:
|
|
649
|
+
schemaVersion: 2,
|
|
650
650
|
project: {
|
|
651
651
|
slug: input.slug,
|
|
652
652
|
displayName: input.displayName,
|
|
@@ -665,11 +665,13 @@ function createConfig(input: {
|
|
|
665
665
|
},
|
|
666
666
|
resources: initialResources(input.options),
|
|
667
667
|
maafw: {
|
|
668
|
-
channel: '
|
|
668
|
+
channel: 'stable',
|
|
669
|
+
version: '',
|
|
669
670
|
},
|
|
670
671
|
runtime: {
|
|
671
672
|
mfa: {
|
|
672
|
-
channel: '
|
|
673
|
+
channel: 'stable',
|
|
674
|
+
version: '',
|
|
673
675
|
enabled: includeGithub,
|
|
674
676
|
},
|
|
675
677
|
},
|
|
@@ -3,8 +3,9 @@ export type ControllerKind = 'Adb' | 'Win32' | 'MacOS' | 'PlayCover' | 'Gamepad'
|
|
|
3
3
|
export type LicenseKind = 'AGPL-3.0-or-later' | 'MIT' | 'None'
|
|
4
4
|
export type NetworkMode = 'auto' | 'official'
|
|
5
5
|
export type CliLanguage = 'auto' | 'en' | 'zh-CN'
|
|
6
|
+
export type ReleaseChannel = 'stable' | 'beta' | 'alpha'
|
|
6
7
|
export type MaaProjectConfig = {
|
|
7
|
-
schemaVersion: 1
|
|
8
|
+
schemaVersion: 1 | 2
|
|
8
9
|
project: {
|
|
9
10
|
slug: string
|
|
10
11
|
displayName: string
|
|
@@ -25,7 +26,8 @@ export type MaaProjectConfig = {
|
|
|
25
26
|
}
|
|
26
27
|
resources: ResourcePackConfig[]
|
|
27
28
|
maafw: {
|
|
28
|
-
channel:
|
|
29
|
+
channel: ReleaseChannel | string
|
|
30
|
+
version?: string
|
|
29
31
|
}
|
|
30
32
|
runtime: {
|
|
31
33
|
mfa: RuntimeGuiConfig
|
|
@@ -46,7 +48,8 @@ export type MaaProjectConfig = {
|
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
export type RuntimeGuiConfig = {
|
|
49
|
-
channel:
|
|
51
|
+
channel: ReleaseChannel | string
|
|
52
|
+
version?: string
|
|
50
53
|
enabled: boolean
|
|
51
54
|
}
|
|
52
55
|
|
|
@@ -68,7 +71,7 @@ export type ResourcePackConfig = {
|
|
|
68
71
|
}
|
|
69
72
|
|
|
70
73
|
export type MaaProjectLock = {
|
|
71
|
-
schemaVersion: 1
|
|
74
|
+
schemaVersion: 1 | 2
|
|
72
75
|
template: {
|
|
73
76
|
createdBy: string
|
|
74
77
|
lastUpdatedBy: string
|
|
@@ -198,6 +198,7 @@ export async function recordUpdateRequests(
|
|
|
198
198
|
{
|
|
199
199
|
product: 'MaaFramework',
|
|
200
200
|
channel: config.maafw.channel,
|
|
201
|
+
version: config.maafw.version ?? '',
|
|
201
202
|
},
|
|
202
203
|
environment,
|
|
203
204
|
),
|
|
@@ -219,6 +220,7 @@ export async function recordUpdateRequests(
|
|
|
219
220
|
{
|
|
220
221
|
product: 'MFAAvalonia',
|
|
221
222
|
channel: config.runtime.mfa.channel,
|
|
223
|
+
version: config.runtime.mfa.version ?? '',
|
|
222
224
|
},
|
|
223
225
|
environment,
|
|
224
226
|
),
|
|
@@ -244,6 +246,7 @@ export async function recordUpdateRequests(
|
|
|
244
246
|
{
|
|
245
247
|
product: 'MXU',
|
|
246
248
|
channel: config.runtime.mxu.channel,
|
|
249
|
+
version: config.runtime.mxu.version ?? '',
|
|
247
250
|
},
|
|
248
251
|
environment,
|
|
249
252
|
),
|
|
@@ -6,6 +6,10 @@ const project = JSON.parse(readFileSync("maa-project.json", "utf8"));
|
|
|
6
6
|
const lock = JSON.parse(readFileSync("maa-project.lock.json", "utf8"));
|
|
7
7
|
const imports = interfaceJson.import ?? [];
|
|
8
8
|
|
|
9
|
+
if (project.schemaVersion !== lock.schemaVersion) {
|
|
10
|
+
throw new Error("maa-project.json and maa-project.lock.json schemaVersion must match");
|
|
11
|
+
}
|
|
12
|
+
|
|
9
13
|
if (interfaceJson.name !== project.project?.slug) {
|
|
10
14
|
console.warn("[INFO] interface.json name differs from maa-project.json project.slug; this is allowed.");
|
|
11
15
|
}
|
|
@@ -10,11 +10,13 @@ import {
|
|
|
10
10
|
statSync,
|
|
11
11
|
writeFileSync,
|
|
12
12
|
} from "node:fs";
|
|
13
|
+
import {createHash} from "node:crypto";
|
|
13
14
|
import {basename, dirname, join} from "node:path";
|
|
14
15
|
|
|
15
16
|
const dryRun = process.argv.includes("--dry-run");
|
|
16
17
|
const projectSlug = {{projectSlug}};
|
|
17
18
|
const releaseArtifactName = {{releaseArtifactName}};
|
|
19
|
+
const requirementsMarker = ".create-maa-project-requirements.sha256";
|
|
18
20
|
mkdirSync("dist", {recursive: true});
|
|
19
21
|
|
|
20
22
|
const lock = readJson("maa-project.lock.json");
|
|
@@ -278,6 +280,7 @@ function prepareReleasePackage(guiKey, gui, packagePaths, interfaceJson, runtime
|
|
|
278
280
|
}
|
|
279
281
|
if (packageHasAgent(interfaceJson) && hasEmbeddedPythonRuntime(runtimePlatform)) {
|
|
280
282
|
copyPath(pythonRuntimePath(runtimePlatform), join(pkgDir, "python"));
|
|
283
|
+
writeEmbeddedRequirementsMarker(pkgDir);
|
|
281
284
|
}
|
|
282
285
|
if (!gui.flatLayout) {
|
|
283
286
|
prepareMxuMaafwRuntime(pkgDir, runtimePlatform);
|
|
@@ -364,6 +367,17 @@ function smokeReleasePackage(gui, root, packagePaths, runtimePlatform) {
|
|
|
364
367
|
if (!existsSync(join(root, "agent", "bootstrap.py"))) {
|
|
365
368
|
throw new Error("release package smoke failed: Agent bootstrap is missing");
|
|
366
369
|
}
|
|
370
|
+
if (hasEmbeddedPythonRuntime(runtimePlatform)) {
|
|
371
|
+
const markerPath = join(root, "python", requirementsMarker);
|
|
372
|
+
if (!existsSync(markerPath)) {
|
|
373
|
+
throw new Error("release package smoke failed: Python requirements marker is missing");
|
|
374
|
+
}
|
|
375
|
+
const expectedDigest = requirementsDigest(join(root, "requirements.txt"));
|
|
376
|
+
const actualDigest = readFileSync(markerPath, "utf8").trim();
|
|
377
|
+
if (actualDigest !== expectedDigest) {
|
|
378
|
+
throw new Error("release package smoke failed: Python requirements marker does not match requirements.txt");
|
|
379
|
+
}
|
|
380
|
+
}
|
|
367
381
|
}
|
|
368
382
|
assertUnixExecutablePermissions(root, runtimePlatform);
|
|
369
383
|
for (const path of [
|
|
@@ -409,6 +423,15 @@ function copyDirectoryContents(source, target) {
|
|
|
409
423
|
}
|
|
410
424
|
}
|
|
411
425
|
|
|
426
|
+
function requirementsDigest(requirementsPath) {
|
|
427
|
+
return createHash("sha256").update(readFileSync(requirementsPath)).digest("hex");
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
function writeEmbeddedRequirementsMarker(pkgDir) {
|
|
431
|
+
const digest = requirementsDigest(join(pkgDir, "requirements.txt"));
|
|
432
|
+
writeFileSync(join(pkgDir, "python", requirementsMarker), digest + "\n", "utf8");
|
|
433
|
+
}
|
|
434
|
+
|
|
412
435
|
function shouldCopyAgentPath(source) {
|
|
413
436
|
const name = basename(source).toLowerCase();
|
|
414
437
|
return name !== "__pycache__" && !name.endsWith(".pyc") && !name.endsWith(".pyo");
|