@creatoria/miniapp-mcp 0.1.2 → 0.2.0
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.
- package/README.md +14 -3
- package/dist/app/cli/index.d.ts +6 -0
- package/dist/app/cli/index.d.ts.map +1 -0
- package/dist/app/cli/index.js +6 -0
- package/dist/app/cli/index.js.map +1 -0
- package/dist/app/index.d.ts +6 -0
- package/dist/app/index.d.ts.map +1 -0
- package/dist/app/index.js +6 -0
- package/dist/app/index.js.map +1 -0
- package/dist/app/server/index.d.ts +7 -0
- package/dist/app/server/index.d.ts.map +1 -0
- package/dist/app/server/index.js +6 -0
- package/dist/app/server/index.js.map +1 -0
- package/dist/capabilities/assert/index.d.ts +5 -0
- package/dist/capabilities/assert/index.d.ts.map +1 -0
- package/dist/capabilities/assert/index.js +5 -0
- package/dist/capabilities/assert/index.js.map +1 -0
- package/dist/capabilities/automator/index.d.ts +6 -0
- package/dist/capabilities/automator/index.d.ts.map +1 -0
- package/dist/capabilities/automator/index.js +6 -0
- package/dist/capabilities/automator/index.js.map +1 -0
- package/dist/capabilities/automator/schemas/close.d.ts +5 -0
- package/dist/capabilities/automator/schemas/close.d.ts.map +1 -0
- package/dist/capabilities/automator/schemas/close.js +11 -0
- package/dist/capabilities/automator/schemas/close.js.map +1 -0
- package/dist/capabilities/automator/schemas/connect.d.ts +11 -0
- package/dist/capabilities/automator/schemas/connect.d.ts.map +1 -0
- package/dist/capabilities/automator/schemas/connect.js +19 -0
- package/dist/capabilities/automator/schemas/connect.js.map +1 -0
- package/dist/capabilities/automator/schemas/disconnect.d.ts +5 -0
- package/dist/capabilities/automator/schemas/disconnect.d.ts.map +1 -0
- package/dist/capabilities/automator/schemas/disconnect.js +11 -0
- package/dist/capabilities/automator/schemas/disconnect.js.map +1 -0
- package/dist/capabilities/automator/schemas/index.d.ts +4 -0
- package/dist/capabilities/automator/schemas/index.d.ts.map +1 -0
- package/dist/capabilities/automator/schemas/index.js +12 -0
- package/dist/capabilities/automator/schemas/index.js.map +1 -0
- package/dist/capabilities/automator/schemas/launch.d.ts +17 -0
- package/dist/capabilities/automator/schemas/launch.d.ts.map +1 -0
- package/dist/capabilities/automator/schemas/launch.js +26 -0
- package/dist/capabilities/automator/schemas/launch.js.map +1 -0
- package/dist/capabilities/element/index.d.ts +5 -0
- package/dist/capabilities/element/index.d.ts.map +1 -0
- package/dist/capabilities/element/index.js +5 -0
- package/dist/capabilities/element/index.js.map +1 -0
- package/dist/capabilities/index.d.ts +15 -0
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/index.js +14 -0
- package/dist/capabilities/index.js.map +1 -0
- package/dist/capabilities/miniprogram/index.d.ts +5 -0
- package/dist/capabilities/miniprogram/index.d.ts.map +1 -0
- package/dist/capabilities/miniprogram/index.js +5 -0
- package/dist/capabilities/miniprogram/index.js.map +1 -0
- package/dist/capabilities/network/index.d.ts +5 -0
- package/dist/capabilities/network/index.d.ts.map +1 -0
- package/dist/capabilities/network/index.js +5 -0
- package/dist/capabilities/network/index.js.map +1 -0
- package/dist/capabilities/page/index.d.ts +5 -0
- package/dist/capabilities/page/index.d.ts.map +1 -0
- package/dist/capabilities/page/index.js +5 -0
- package/dist/capabilities/page/index.js.map +1 -0
- package/dist/capabilities/record/index.d.ts +5 -0
- package/dist/capabilities/record/index.d.ts.map +1 -0
- package/dist/capabilities/record/index.js +5 -0
- package/dist/capabilities/record/index.js.map +1 -0
- package/dist/capabilities/schema-registry.d.ts +4 -0
- package/dist/capabilities/schema-registry.d.ts.map +1 -0
- package/dist/capabilities/schema-registry.js +18 -0
- package/dist/capabilities/schema-registry.js.map +1 -0
- package/dist/capabilities/schema-types.d.ts +22 -0
- package/dist/capabilities/schema-types.d.ts.map +1 -0
- package/dist/capabilities/schema-types.js +2 -0
- package/dist/capabilities/schema-types.js.map +1 -0
- package/dist/capabilities/snapshot/index.d.ts +5 -0
- package/dist/capabilities/snapshot/index.d.ts.map +1 -0
- package/dist/capabilities/snapshot/index.js +5 -0
- package/dist/capabilities/snapshot/index.js.map +1 -0
- package/dist/config/loader.js +1 -1
- package/dist/config/loader.js.map +1 -1
- package/dist/core/element-ref.d.ts +1 -43
- package/dist/core/element-ref.d.ts.map +1 -1
- package/dist/core/element-ref.js +1 -212
- package/dist/core/element-ref.js.map +1 -1
- package/dist/core/logger.d.ts +1 -54
- package/dist/core/logger.d.ts.map +1 -1
- package/dist/core/logger.js +1 -377
- package/dist/core/logger.js.map +1 -1
- package/dist/core/output.d.ts +1 -20
- package/dist/core/output.d.ts.map +1 -1
- package/dist/core/output.js +1 -55
- package/dist/core/output.js.map +1 -1
- package/dist/core/report-generator.d.ts +1 -23
- package/dist/core/report-generator.d.ts.map +1 -1
- package/dist/core/report-generator.js +1 -211
- package/dist/core/report-generator.js.map +1 -1
- package/dist/core/session.d.ts +2 -82
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js +2 -305
- package/dist/core/session.js.map +1 -1
- package/dist/core/timeout.d.ts +1 -48
- package/dist/core/timeout.d.ts.map +1 -1
- package/dist/core/timeout.js +1 -66
- package/dist/core/timeout.js.map +1 -1
- package/dist/core/tool-logger.d.ts +1 -82
- package/dist/core/tool-logger.d.ts.map +1 -1
- package/dist/core/tool-logger.js +1 -452
- package/dist/core/tool-logger.js.map +1 -1
- package/dist/core/validation.d.ts +1 -38
- package/dist/core/validation.d.ts.map +1 -1
- package/dist/core/validation.js +1 -92
- package/dist/core/validation.js.map +1 -1
- package/dist/runtime/element/element-ref.d.ts +44 -0
- package/dist/runtime/element/element-ref.d.ts.map +1 -0
- package/dist/runtime/element/element-ref.js +214 -0
- package/dist/runtime/element/element-ref.js.map +1 -0
- package/dist/runtime/element/index.d.ts +2 -0
- package/dist/runtime/element/index.d.ts.map +1 -0
- package/dist/runtime/element/index.js +2 -0
- package/dist/runtime/element/index.js.map +1 -0
- package/dist/runtime/index.d.ts +10 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +10 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/logging/index.d.ts +3 -0
- package/dist/runtime/logging/index.d.ts.map +1 -0
- package/dist/runtime/logging/index.js +3 -0
- package/dist/runtime/logging/index.js.map +1 -0
- package/dist/runtime/logging/logger.d.ts +55 -0
- package/dist/runtime/logging/logger.d.ts.map +1 -0
- package/dist/runtime/logging/logger.js +379 -0
- package/dist/runtime/logging/logger.js.map +1 -0
- package/dist/runtime/logging/tool-logger.d.ts +83 -0
- package/dist/runtime/logging/tool-logger.d.ts.map +1 -0
- package/dist/runtime/logging/tool-logger.js +454 -0
- package/dist/runtime/logging/tool-logger.js.map +1 -0
- package/dist/runtime/outputs/index.d.ts +3 -0
- package/dist/runtime/outputs/index.d.ts.map +1 -0
- package/dist/runtime/outputs/index.js +3 -0
- package/dist/runtime/outputs/index.js.map +1 -0
- package/dist/runtime/outputs/output-manager.d.ts +12 -0
- package/dist/runtime/outputs/output-manager.d.ts.map +1 -0
- package/dist/runtime/outputs/output-manager.js +39 -0
- package/dist/runtime/outputs/output-manager.js.map +1 -0
- package/dist/runtime/outputs/report-generator.d.ts +5 -0
- package/dist/runtime/outputs/report-generator.d.ts.map +1 -0
- package/dist/runtime/outputs/report-generator.js +175 -0
- package/dist/runtime/outputs/report-generator.js.map +1 -0
- package/dist/runtime/session/index.d.ts +3 -0
- package/dist/runtime/session/index.d.ts.map +1 -0
- package/dist/runtime/session/index.js +3 -0
- package/dist/runtime/session/index.js.map +1 -0
- package/dist/runtime/session/store.d.ts +28 -0
- package/dist/runtime/session/store.d.ts.map +1 -0
- package/dist/runtime/session/store.js +154 -0
- package/dist/runtime/session/store.js.map +1 -0
- package/dist/runtime/session/utils/cleanup.d.ts +3 -0
- package/dist/runtime/session/utils/cleanup.d.ts.map +1 -0
- package/dist/runtime/session/utils/cleanup.js +78 -0
- package/dist/runtime/session/utils/cleanup.js.map +1 -0
- package/dist/runtime/timeout/index.d.ts +2 -0
- package/dist/runtime/timeout/index.d.ts.map +1 -0
- package/dist/runtime/timeout/index.js +2 -0
- package/dist/runtime/timeout/index.js.map +1 -0
- package/dist/runtime/timeout/timeout.d.ts +49 -0
- package/dist/runtime/timeout/timeout.d.ts.map +1 -0
- package/dist/runtime/timeout/timeout.js +67 -0
- package/dist/runtime/timeout/timeout.js.map +1 -0
- package/dist/runtime/validation/index.d.ts +2 -0
- package/dist/runtime/validation/index.d.ts.map +1 -0
- package/dist/runtime/validation/index.js +2 -0
- package/dist/runtime/validation/index.js.map +1 -0
- package/dist/runtime/validation/validation.d.ts +39 -0
- package/dist/runtime/validation/validation.d.ts.map +1 -0
- package/dist/runtime/validation/validation.js +93 -0
- package/dist/runtime/validation/validation.js.map +1 -0
- package/dist/schemas/automator/miniprogram_close.json +12 -0
- package/dist/schemas/automator/miniprogram_connect.json +19 -0
- package/dist/schemas/automator/miniprogram_disconnect.json +12 -0
- package/dist/schemas/automator/miniprogram_launch.json +30 -0
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +3 -3
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/miniprogram.d.ts +2 -1
- package/dist/tools/miniprogram.d.ts.map +1 -1
- package/dist/tools/miniprogram.js +19 -24
- package/dist/tools/miniprogram.js.map +1 -1
- package/dist/tools/page.js +2 -2
- package/dist/tools/page.js.map +1 -1
- package/docs/directory-structure-and-code-style-best-practices.md +91 -0
- package/docs/migration/README.md +34 -0
- package/docs/migration/TC-ALIGN-01-notes.md +35 -0
- package/docs/migration/runtime-skeleton.md +50 -0
- package/docs/migration/tool-schema-strategy.md +75 -0
- package/docs//345/256/214/346/225/264/345/256/236/347/216/260/346/226/271/346/241/210.md +14 -14
- package/docs//347/254/254/344/270/200/347/211/210/346/234/254/346/226/271/346/241/210.md +7 -7
- package/package.json +4 -2
- package/docs/SIMPLE_USAGE.md +0 -210
- package/docs/architecture.E-Docs.md +0 -1359
- package/docs/architecture.F1.md +0 -720
- package/docs/architecture.F2.md +0 -871
- package/docs/architecture.F3.md +0 -905
- package/docs/architecture.md +0 -90
- package/docs/charter.A1.align.yaml +0 -170
- package/docs/charter.A2.align.yaml +0 -199
- package/docs/charter.A3.align.yaml +0 -242
- package/docs/charter.A4.align.yaml +0 -227
- package/docs/charter.B1.align.yaml +0 -179
- package/docs/charter.B2.align.yaml +0 -200
- package/docs/charter.B3.align.yaml +0 -200
- package/docs/charter.B4.align.yaml +0 -188
- package/docs/charter.C1.align.yaml +0 -190
- package/docs/charter.C2.align.yaml +0 -202
- package/docs/charter.C3.align.yaml +0 -211
- package/docs/charter.C4.align.yaml +0 -263
- package/docs/charter.C5.align.yaml +0 -220
- package/docs/charter.D1.align.yaml +0 -190
- package/docs/charter.D2.align.yaml +0 -234
- package/docs/charter.D3.align.yaml +0 -206
- package/docs/charter.E-Docs.align.yaml +0 -294
- package/docs/charter.F1.align.yaml +0 -193
- package/docs/charter.F2.align.yaml +0 -248
- package/docs/charter.F3.align.yaml +0 -287
- package/docs/charter.G.align.yaml +0 -174
- package/docs/charter.align.yaml +0 -111
- package/docs/maintenance.md +0 -682
- package/docs/playwright-mcp/350/260/203/347/240/224.md +0 -53
- package/docs/setup-guide.md +0 -775
- package/docs/tasks.A1.atomize.md +0 -296
- package/docs/tasks.A2.atomize.md +0 -408
- package/docs/tasks.A3.atomize.md +0 -564
- package/docs/tasks.A4.atomize.md +0 -496
- package/docs/tasks.B1.atomize.md +0 -352
- package/docs/tasks.B2.atomize.md +0 -561
- package/docs/tasks.B3.atomize.md +0 -508
- package/docs/tasks.B4.atomize.md +0 -504
- package/docs/tasks.C1.atomize.md +0 -540
- package/docs/tasks.C2.atomize.md +0 -665
- package/docs/tasks.C3.atomize.md +0 -745
- package/docs/tasks.C4.atomize.md +0 -908
- package/docs/tasks.C5.atomize.md +0 -755
- package/docs/tasks.D1.atomize.md +0 -547
- package/docs/tasks.D2.atomize.md +0 -619
- package/docs/tasks.D3.atomize.md +0 -790
- package/docs/tasks.E-Docs.atomize.md +0 -1204
- package/docs/tasks.atomize.md +0 -189
package/docs/maintenance.md
DELETED
|
@@ -1,682 +0,0 @@
|
|
|
1
|
-
# Maintenance Guide
|
|
2
|
-
|
|
3
|
-
This document provides guidance for maintaining the creatoria-miniapp-mcp project, including regular tasks, updates, monitoring, and troubleshooting.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## 📋 Table of Contents
|
|
8
|
-
|
|
9
|
-
- [Regular Maintenance Tasks](#regular-maintenance-tasks)
|
|
10
|
-
- [Dependency Management](#dependency-management)
|
|
11
|
-
- [Release Process](#release-process)
|
|
12
|
-
- [Monitoring & Health Checks](#monitoring--health-checks)
|
|
13
|
-
- [Backup & Recovery](#backup--recovery)
|
|
14
|
-
- [Performance Tuning](#performance-tuning)
|
|
15
|
-
- [Security Updates](#security-updates)
|
|
16
|
-
- [Troubleshooting](#troubleshooting)
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## Regular Maintenance Tasks
|
|
21
|
-
|
|
22
|
-
### Weekly Tasks
|
|
23
|
-
|
|
24
|
-
#### 1. Run Smoke Tests
|
|
25
|
-
|
|
26
|
-
Ensure core functionality is working:
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
pnpm smoke-test
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
**Expected Output**:
|
|
33
|
-
- ✅ Unit Tests: 545 passing
|
|
34
|
-
- ✅ Tool Count: 65 tools
|
|
35
|
-
- ✅ Lint: No errors
|
|
36
|
-
- ✅ Format: All files formatted
|
|
37
|
-
|
|
38
|
-
**If Failed**: See [Troubleshooting](#troubleshooting) section
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
#### 2. Check for Security Vulnerabilities
|
|
43
|
-
|
|
44
|
-
Run npm audit:
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
pnpm audit
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
**Action Required**:
|
|
51
|
-
- **High/Critical**: Fix immediately
|
|
52
|
-
- **Moderate**: Schedule fix within 1 week
|
|
53
|
-
- **Low**: Review and fix in next release
|
|
54
|
-
|
|
55
|
-
**Fix Vulnerabilities**:
|
|
56
|
-
```bash
|
|
57
|
-
# Automatic fix (if available)
|
|
58
|
-
pnpm audit fix
|
|
59
|
-
|
|
60
|
-
# Manual fix (update specific package)
|
|
61
|
-
pnpm update <package-name>
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
---
|
|
65
|
-
|
|
66
|
-
#### 3. Review Open Issues
|
|
67
|
-
|
|
68
|
-
Check GitHub Issues for:
|
|
69
|
-
- Bug reports requiring triage
|
|
70
|
-
- Feature requests to evaluate
|
|
71
|
-
- Questions needing answers
|
|
72
|
-
|
|
73
|
-
**Triage Labels**:
|
|
74
|
-
- `bug` - Confirmed bugs
|
|
75
|
-
- `enhancement` - Feature requests
|
|
76
|
-
- `question` - User questions
|
|
77
|
-
- `good first issue` - Good for new contributors
|
|
78
|
-
|
|
79
|
-
---
|
|
80
|
-
|
|
81
|
-
### Monthly Tasks
|
|
82
|
-
|
|
83
|
-
#### 1. Dependency Updates
|
|
84
|
-
|
|
85
|
-
Check for outdated dependencies:
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
pnpm outdated
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
**Update Strategy**:
|
|
92
|
-
- **Patch updates** (0.1.0 → 0.1.1): Update immediately
|
|
93
|
-
- **Minor updates** (0.1.0 → 0.2.0): Test thoroughly, update monthly
|
|
94
|
-
- **Major updates** (0.1.0 → 1.0.0): Review breaking changes, plan migration
|
|
95
|
-
|
|
96
|
-
**Update Process**:
|
|
97
|
-
```bash
|
|
98
|
-
# Update all patch versions
|
|
99
|
-
pnpm update
|
|
100
|
-
|
|
101
|
-
# Update specific package to latest
|
|
102
|
-
pnpm update <package-name>@latest
|
|
103
|
-
|
|
104
|
-
# After updating, run full test suite
|
|
105
|
-
pnpm test
|
|
106
|
-
pnpm smoke-test
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
---
|
|
110
|
-
|
|
111
|
-
#### 2. Review and Update Documentation
|
|
112
|
-
|
|
113
|
-
- [ ] Check if README.md tool count matches actual tools (65)
|
|
114
|
-
- [ ] Update examples if API changes occurred
|
|
115
|
-
- [ ] Review troubleshooting guide for new issues
|
|
116
|
-
- [ ] Check if architecture docs are up to date
|
|
117
|
-
|
|
118
|
-
**Update Tool Count**:
|
|
119
|
-
```bash
|
|
120
|
-
pnpm update-readme
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
---
|
|
124
|
-
|
|
125
|
-
#### 3. Performance Monitoring
|
|
126
|
-
|
|
127
|
-
Check for performance regressions:
|
|
128
|
-
|
|
129
|
-
```bash
|
|
130
|
-
# Run unit tests with timing
|
|
131
|
-
pnpm test:unit --verbose
|
|
132
|
-
|
|
133
|
-
# Check for slow tests (>1s)
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
**Performance Metrics**:
|
|
137
|
-
- Unit test suite: < 10 seconds
|
|
138
|
-
- Smoke test: < 20 seconds
|
|
139
|
-
- Individual test: < 1 second (warn if exceeded)
|
|
140
|
-
|
|
141
|
-
---
|
|
142
|
-
|
|
143
|
-
### Quarterly Tasks
|
|
144
|
-
|
|
145
|
-
#### 1. Major Version Updates
|
|
146
|
-
|
|
147
|
-
Review and plan major dependency updates:
|
|
148
|
-
- TypeScript
|
|
149
|
-
- Node.js (LTS versions)
|
|
150
|
-
- @modelcontextprotocol/sdk
|
|
151
|
-
- Jest
|
|
152
|
-
- ESLint/Prettier
|
|
153
|
-
|
|
154
|
-
**Process**:
|
|
155
|
-
1. Create feature branch: `chore/update-deps-Q2-2025`
|
|
156
|
-
2. Update one major dependency at a time
|
|
157
|
-
3. Run full test suite after each update
|
|
158
|
-
4. Document breaking changes in CHANGELOG.md
|
|
159
|
-
5. Create PR for review
|
|
160
|
-
|
|
161
|
-
---
|
|
162
|
-
|
|
163
|
-
#### 2. Security Audit
|
|
164
|
-
|
|
165
|
-
Perform comprehensive security review:
|
|
166
|
-
|
|
167
|
-
```bash
|
|
168
|
-
# Run npm audit
|
|
169
|
-
pnpm audit
|
|
170
|
-
|
|
171
|
-
# Check for known vulnerabilities in dependencies
|
|
172
|
-
npm outdated --long
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
**Review**:
|
|
176
|
-
- [ ] No high/critical vulnerabilities
|
|
177
|
-
- [ ] All dependencies actively maintained
|
|
178
|
-
- [ ] No deprecated packages
|
|
179
|
-
|
|
180
|
-
---
|
|
181
|
-
|
|
182
|
-
#### 3. Code Quality Review
|
|
183
|
-
|
|
184
|
-
Run full quality checks:
|
|
185
|
-
|
|
186
|
-
```bash
|
|
187
|
-
# Type coverage
|
|
188
|
-
pnpm typecheck
|
|
189
|
-
|
|
190
|
-
# Lint entire codebase
|
|
191
|
-
pnpm lint
|
|
192
|
-
|
|
193
|
-
# Check code formatting
|
|
194
|
-
pnpm format:check
|
|
195
|
-
|
|
196
|
-
# Run all tests
|
|
197
|
-
pnpm test
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
---
|
|
201
|
-
|
|
202
|
-
## Dependency Management
|
|
203
|
-
|
|
204
|
-
### Updating Dependencies
|
|
205
|
-
|
|
206
|
-
#### Safe Update Process
|
|
207
|
-
|
|
208
|
-
```bash
|
|
209
|
-
# 1. Create branch
|
|
210
|
-
git checkout -b chore/update-dependencies
|
|
211
|
-
|
|
212
|
-
# 2. Update patch versions
|
|
213
|
-
pnpm update
|
|
214
|
-
|
|
215
|
-
# 3. Run smoke test
|
|
216
|
-
pnpm smoke-test
|
|
217
|
-
|
|
218
|
-
# 4. Commit
|
|
219
|
-
git add package.json pnpm-lock.yaml
|
|
220
|
-
git commit -m "chore: update dependencies (patch)"
|
|
221
|
-
|
|
222
|
-
# 5. Push and create PR
|
|
223
|
-
git push origin chore/update-dependencies
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
---
|
|
227
|
-
|
|
228
|
-
### Critical Dependencies
|
|
229
|
-
|
|
230
|
-
Monitor these closely for updates:
|
|
231
|
-
|
|
232
|
-
| Dependency | Purpose | Update Frequency |
|
|
233
|
-
|------------|---------|------------------|
|
|
234
|
-
| `miniprogram-automator` | Core automation SDK | Check monthly |
|
|
235
|
-
| `@modelcontextprotocol/sdk` | MCP protocol | Check weekly |
|
|
236
|
-
| `typescript` | Type system | Minor updates only |
|
|
237
|
-
| `jest` | Testing framework | Quarterly |
|
|
238
|
-
|
|
239
|
-
---
|
|
240
|
-
|
|
241
|
-
### Known Issues
|
|
242
|
-
|
|
243
|
-
#### miniprogram-automator Type Declarations
|
|
244
|
-
|
|
245
|
-
**Issue**: Incomplete TypeScript type definitions
|
|
246
|
-
|
|
247
|
-
**Impact**: Build warnings (not errors), does not affect runtime
|
|
248
|
-
|
|
249
|
-
**Workaround**: Treated as warnings in smoke-test.sh
|
|
250
|
-
|
|
251
|
-
**Long-term Fix**:
|
|
252
|
-
- Contribute to upstream package
|
|
253
|
-
- Or create local `.d.ts` declarations
|
|
254
|
-
|
|
255
|
-
---
|
|
256
|
-
|
|
257
|
-
## Release Process
|
|
258
|
-
|
|
259
|
-
### Automated Release via Script
|
|
260
|
-
|
|
261
|
-
Use the release script for version bumping and tagging:
|
|
262
|
-
|
|
263
|
-
```bash
|
|
264
|
-
# Patch release (0.1.0 → 0.1.1)
|
|
265
|
-
pnpm release:patch
|
|
266
|
-
|
|
267
|
-
# Minor release (0.1.0 → 0.2.0)
|
|
268
|
-
pnpm release:minor
|
|
269
|
-
|
|
270
|
-
# Major release (0.1.0 → 1.0.0)
|
|
271
|
-
pnpm release:major
|
|
272
|
-
|
|
273
|
-
# Pre-release (0.1.0 → 0.1.1-0)
|
|
274
|
-
pnpm release:prerelease
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
**The script will**:
|
|
278
|
-
1. Run smoke tests
|
|
279
|
-
2. Bump version in package.json
|
|
280
|
-
3. Update README.md "Last Updated" date
|
|
281
|
-
4. Create git commit
|
|
282
|
-
5. Create git tag (v0.1.1)
|
|
283
|
-
6. Display next steps
|
|
284
|
-
|
|
285
|
-
**After Script Completes**:
|
|
286
|
-
```bash
|
|
287
|
-
# Push to GitHub (triggers CI/CD)
|
|
288
|
-
git push origin main --tags
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
**GitHub Actions will**:
|
|
292
|
-
- Create GitHub release with changelog
|
|
293
|
-
- Publish to npm (stable releases only)
|
|
294
|
-
|
|
295
|
-
---
|
|
296
|
-
|
|
297
|
-
### Manual Release Process
|
|
298
|
-
|
|
299
|
-
If the script fails or you need more control:
|
|
300
|
-
|
|
301
|
-
```bash
|
|
302
|
-
# 1. Ensure clean working directory
|
|
303
|
-
git status
|
|
304
|
-
|
|
305
|
-
# 2. Run smoke test manually
|
|
306
|
-
pnpm smoke-test
|
|
307
|
-
|
|
308
|
-
# 3. Bump version
|
|
309
|
-
pnpm version patch # or minor/major
|
|
310
|
-
|
|
311
|
-
# 4. Update docs
|
|
312
|
-
# Edit README.md "Last Updated" date
|
|
313
|
-
|
|
314
|
-
# 5. Commit and tag
|
|
315
|
-
git add .
|
|
316
|
-
git commit -m "chore: release v0.1.1"
|
|
317
|
-
git tag -a v0.1.1 -m "Release v0.1.1"
|
|
318
|
-
|
|
319
|
-
# 6. Push
|
|
320
|
-
git push origin main --tags
|
|
321
|
-
```
|
|
322
|
-
|
|
323
|
-
---
|
|
324
|
-
|
|
325
|
-
### Release Checklist
|
|
326
|
-
|
|
327
|
-
Before creating a release:
|
|
328
|
-
|
|
329
|
-
- [ ] All smoke tests passing
|
|
330
|
-
- [ ] README.md tool count updated (if tools changed)
|
|
331
|
-
- [ ] CHANGELOG.md updated with release notes
|
|
332
|
-
- [ ] No open critical bugs
|
|
333
|
-
- [ ] Documentation up to date
|
|
334
|
-
- [ ] Examples tested
|
|
335
|
-
|
|
336
|
-
---
|
|
337
|
-
|
|
338
|
-
## Monitoring & Health Checks
|
|
339
|
-
|
|
340
|
-
### Automated Health Checks
|
|
341
|
-
|
|
342
|
-
#### GitHub Actions CI
|
|
343
|
-
|
|
344
|
-
Monitors:
|
|
345
|
-
- Every PR merge
|
|
346
|
-
- Every push to main branch
|
|
347
|
-
- Node.js 18.x and 20.x compatibility
|
|
348
|
-
|
|
349
|
-
**Check Status**: https://github.com/your-org/creatoria-miniapp-mcp/actions
|
|
350
|
-
|
|
351
|
-
---
|
|
352
|
-
|
|
353
|
-
#### Smoke Test Coverage
|
|
354
|
-
|
|
355
|
-
The smoke test validates:
|
|
356
|
-
|
|
357
|
-
1. **Build**: TypeScript compilation
|
|
358
|
-
2. **Type Check**: tsc --noEmit
|
|
359
|
-
3. **Unit Tests**: 354 tests across all tool categories
|
|
360
|
-
4. **Tool Count**: Exactly 65 tools registered
|
|
361
|
-
5. **Lint**: ESLint with 0 errors
|
|
362
|
-
6. **Format**: Prettier compliance
|
|
363
|
-
|
|
364
|
-
**Run Locally**:
|
|
365
|
-
```bash
|
|
366
|
-
pnpm smoke-test
|
|
367
|
-
```
|
|
368
|
-
|
|
369
|
-
---
|
|
370
|
-
|
|
371
|
-
### Manual Health Checks
|
|
372
|
-
|
|
373
|
-
#### 1. Tool Registration Integrity
|
|
374
|
-
|
|
375
|
-
Verify tool count hasn't regressed:
|
|
376
|
-
|
|
377
|
-
```bash
|
|
378
|
-
pnpm update-readme 2>&1 | grep "Total:"
|
|
379
|
-
# Expected: 📊 Total: 65 tools
|
|
380
|
-
```
|
|
381
|
-
|
|
382
|
-
---
|
|
383
|
-
|
|
384
|
-
#### 2. Session Cleanup
|
|
385
|
-
|
|
386
|
-
Verify session cleanup works correctly:
|
|
387
|
-
|
|
388
|
-
```bash
|
|
389
|
-
# Run session tests
|
|
390
|
-
pnpm test tests/unit/session.test.ts
|
|
391
|
-
```
|
|
392
|
-
|
|
393
|
-
**Expected**: All tests pass with proper cleanup logs
|
|
394
|
-
|
|
395
|
-
---
|
|
396
|
-
|
|
397
|
-
#### 3. Example Scripts
|
|
398
|
-
|
|
399
|
-
Periodically run example scripts to ensure they work:
|
|
400
|
-
|
|
401
|
-
```bash
|
|
402
|
-
# Set test project
|
|
403
|
-
export TEST_PROJECT_PATH="/path/to/test/miniprogram"
|
|
404
|
-
|
|
405
|
-
# Run basic example
|
|
406
|
-
npx tsx examples/scripts/01-basic-navigation.ts
|
|
407
|
-
```
|
|
408
|
-
|
|
409
|
-
---
|
|
410
|
-
|
|
411
|
-
## Backup & Recovery
|
|
412
|
-
|
|
413
|
-
### What to Backup
|
|
414
|
-
|
|
415
|
-
1. **Source Code**: Stored in Git (GitHub)
|
|
416
|
-
2. **Configuration Files**:
|
|
417
|
-
- `.mcp.json` (user-specific, not in git)
|
|
418
|
-
- `package.json`
|
|
419
|
-
- `tsconfig.json`
|
|
420
|
-
- `.eslintrc.cjs`
|
|
421
|
-
|
|
422
|
-
3. **Documentation**: All in git under `docs/`
|
|
423
|
-
|
|
424
|
-
4. **Test Artifacts** (optional):
|
|
425
|
-
- `.mcp-artifacts/` (generated, can be recreated)
|
|
426
|
-
|
|
427
|
-
---
|
|
428
|
-
|
|
429
|
-
### Recovery Procedures
|
|
430
|
-
|
|
431
|
-
#### Recover from Git
|
|
432
|
-
|
|
433
|
-
```bash
|
|
434
|
-
# Clone fresh repository
|
|
435
|
-
git clone https://github.com/your-org/creatoria-miniapp-mcp.git
|
|
436
|
-
cd creatoria-miniapp-mcp
|
|
437
|
-
|
|
438
|
-
# Install dependencies
|
|
439
|
-
pnpm install
|
|
440
|
-
|
|
441
|
-
# Build
|
|
442
|
-
pnpm build
|
|
443
|
-
|
|
444
|
-
# Verify
|
|
445
|
-
pnpm smoke-test
|
|
446
|
-
```
|
|
447
|
-
|
|
448
|
-
---
|
|
449
|
-
|
|
450
|
-
#### Recover Lost Configuration
|
|
451
|
-
|
|
452
|
-
If `.mcp.json` is lost:
|
|
453
|
-
|
|
454
|
-
```json
|
|
455
|
-
// Create new .mcp.json
|
|
456
|
-
{
|
|
457
|
-
"projectPath": "/path/to/your/miniprogram",
|
|
458
|
-
"cliPath": "/Applications/wechatwebdevtools.app/Contents/MacOS/cli",
|
|
459
|
-
"port": 9420
|
|
460
|
-
}
|
|
461
|
-
```
|
|
462
|
-
|
|
463
|
-
---
|
|
464
|
-
|
|
465
|
-
## Performance Tuning
|
|
466
|
-
|
|
467
|
-
### Identify Slow Tests
|
|
468
|
-
|
|
469
|
-
```bash
|
|
470
|
-
# Run tests with verbose timing
|
|
471
|
-
pnpm test:unit --verbose | grep -E "PASS|FAIL|\\([0-9]+\\s*ms\\)"
|
|
472
|
-
```
|
|
473
|
-
|
|
474
|
-
**Action Thresholds**:
|
|
475
|
-
- Test > 1 second: Investigate and optimize
|
|
476
|
-
- Test suite > 10 seconds: Review test structure
|
|
477
|
-
|
|
478
|
-
---
|
|
479
|
-
|
|
480
|
-
### Optimize Session Cleanup
|
|
481
|
-
|
|
482
|
-
Default session timeout: 30 minutes
|
|
483
|
-
|
|
484
|
-
**Reduce timeout for faster cleanup**:
|
|
485
|
-
```javascript
|
|
486
|
-
// In server config
|
|
487
|
-
{
|
|
488
|
-
sessionTimeout: 10 * 60 * 1000 // 10 minutes
|
|
489
|
-
}
|
|
490
|
-
```
|
|
491
|
-
|
|
492
|
-
**Trade-off**: Shorter timeout = more frequent cleanups, but less idle time tolerance
|
|
493
|
-
|
|
494
|
-
---
|
|
495
|
-
|
|
496
|
-
### Tool Call Optimization
|
|
497
|
-
|
|
498
|
-
Use element references to avoid repeated queries:
|
|
499
|
-
|
|
500
|
-
```javascript
|
|
501
|
-
// ❌ Slow: Query element each time
|
|
502
|
-
await element_tap({ selector: '.btn' })
|
|
503
|
-
await element_get_text({ selector: '.btn' })
|
|
504
|
-
|
|
505
|
-
// ✅ Fast: Query once, use refId
|
|
506
|
-
const btn = await page_query({ selector: '.btn', save: true })
|
|
507
|
-
await element_tap({ refId: btn.refId })
|
|
508
|
-
await element_get_text({ refId: btn.refId })
|
|
509
|
-
```
|
|
510
|
-
|
|
511
|
-
---
|
|
512
|
-
|
|
513
|
-
## Security Updates
|
|
514
|
-
|
|
515
|
-
### Vulnerability Response Process
|
|
516
|
-
|
|
517
|
-
1. **Detection**: `pnpm audit` or GitHub Dependabot alert
|
|
518
|
-
|
|
519
|
-
2. **Assessment**:
|
|
520
|
-
- Severity: Critical/High/Moderate/Low
|
|
521
|
-
- Exploitability: Is the vulnerable code path used?
|
|
522
|
-
- Availability of fix: Is patch available?
|
|
523
|
-
|
|
524
|
-
3. **Response Timeline**:
|
|
525
|
-
- **Critical**: Fix within 24 hours
|
|
526
|
-
- **High**: Fix within 1 week
|
|
527
|
-
- **Moderate**: Fix in next release cycle
|
|
528
|
-
- **Low**: Track for future update
|
|
529
|
-
|
|
530
|
-
4. **Fix Application**:
|
|
531
|
-
```bash
|
|
532
|
-
# Update vulnerable package
|
|
533
|
-
pnpm update <package-name>@<safe-version>
|
|
534
|
-
|
|
535
|
-
# Run full test suite
|
|
536
|
-
pnpm smoke-test
|
|
537
|
-
|
|
538
|
-
# Create hotfix PR
|
|
539
|
-
git checkout -b security/fix-<vulnerability-id>
|
|
540
|
-
git commit -m "security: fix <vulnerability-description>"
|
|
541
|
-
```
|
|
542
|
-
|
|
543
|
-
5. **Release**:
|
|
544
|
-
- Create patch release if critical/high
|
|
545
|
-
- Include in regular release if moderate/low
|
|
546
|
-
|
|
547
|
-
---
|
|
548
|
-
|
|
549
|
-
### Regular Security Practices
|
|
550
|
-
|
|
551
|
-
- [ ] Enable Dependabot alerts on GitHub
|
|
552
|
-
- [ ] Review `pnpm audit` output weekly
|
|
553
|
-
- [ ] Keep Node.js updated to LTS versions
|
|
554
|
-
- [ ] Subscribe to security advisories for critical dependencies
|
|
555
|
-
|
|
556
|
-
---
|
|
557
|
-
|
|
558
|
-
## Troubleshooting
|
|
559
|
-
|
|
560
|
-
### Common Maintenance Issues
|
|
561
|
-
|
|
562
|
-
#### Issue: Smoke Test Fails After Dependency Update
|
|
563
|
-
|
|
564
|
-
**Symptoms**:
|
|
565
|
-
```bash
|
|
566
|
-
$ pnpm smoke-test
|
|
567
|
-
❌ Unit Tests FAILED
|
|
568
|
-
```
|
|
569
|
-
|
|
570
|
-
**Diagnosis**:
|
|
571
|
-
```bash
|
|
572
|
-
# Run tests with verbose output
|
|
573
|
-
pnpm test:unit --verbose
|
|
574
|
-
|
|
575
|
-
# Check for breaking changes in updated packages
|
|
576
|
-
git diff HEAD~1 package.json
|
|
577
|
-
```
|
|
578
|
-
|
|
579
|
-
**Resolution**:
|
|
580
|
-
1. Identify which dependency caused failure
|
|
581
|
-
2. Check changelog for breaking changes
|
|
582
|
-
3. Update code to accommodate changes
|
|
583
|
-
4. Or revert update: `pnpm install <package>@<previous-version>`
|
|
584
|
-
|
|
585
|
-
---
|
|
586
|
-
|
|
587
|
-
#### Issue: Tool Count Mismatch
|
|
588
|
-
|
|
589
|
-
**Symptoms**:
|
|
590
|
-
```bash
|
|
591
|
-
$ pnpm update-readme
|
|
592
|
-
❌ Expected 65 tools, found 63
|
|
593
|
-
```
|
|
594
|
-
|
|
595
|
-
**Diagnosis**:
|
|
596
|
-
```bash
|
|
597
|
-
# Check which tools are missing
|
|
598
|
-
pnpm update-readme 2>&1 | less
|
|
599
|
-
```
|
|
600
|
-
|
|
601
|
-
**Resolution**:
|
|
602
|
-
1. Verify all tool files in `src/tools/` are exporting tools correctly
|
|
603
|
-
2. Check `src/tools/index.ts` registration
|
|
604
|
-
3. Ensure CATEGORY_METADATA matches tool arrays
|
|
605
|
-
|
|
606
|
-
---
|
|
607
|
-
|
|
608
|
-
#### Issue: Build Fails on CI but Passes Locally
|
|
609
|
-
|
|
610
|
-
**Symptoms**: GitHub Actions fail, local build succeeds
|
|
611
|
-
|
|
612
|
-
**Common Causes**:
|
|
613
|
-
- Node version mismatch
|
|
614
|
-
- Missing environment variables
|
|
615
|
-
- File system case sensitivity (macOS vs Linux)
|
|
616
|
-
|
|
617
|
-
**Resolution**:
|
|
618
|
-
```bash
|
|
619
|
-
# Test with same Node version as CI
|
|
620
|
-
nvm use 20
|
|
621
|
-
|
|
622
|
-
# Clean install
|
|
623
|
-
rm -rf node_modules pnpm-lock.yaml
|
|
624
|
-
pnpm install
|
|
625
|
-
|
|
626
|
-
# Build
|
|
627
|
-
pnpm build
|
|
628
|
-
```
|
|
629
|
-
|
|
630
|
-
---
|
|
631
|
-
|
|
632
|
-
#### Issue: Release Script Fails
|
|
633
|
-
|
|
634
|
-
**Symptoms**:
|
|
635
|
-
```bash
|
|
636
|
-
$ pnpm release:patch
|
|
637
|
-
❌ Uncommitted changes detected
|
|
638
|
-
```
|
|
639
|
-
|
|
640
|
-
**Resolution**:
|
|
641
|
-
```bash
|
|
642
|
-
# Commit or stash changes first
|
|
643
|
-
git status
|
|
644
|
-
git add .
|
|
645
|
-
git commit -m "chore: prepare for release"
|
|
646
|
-
|
|
647
|
-
# Retry release
|
|
648
|
-
pnpm release:patch
|
|
649
|
-
```
|
|
650
|
-
|
|
651
|
-
---
|
|
652
|
-
|
|
653
|
-
## Additional Resources
|
|
654
|
-
|
|
655
|
-
### Documentation
|
|
656
|
-
|
|
657
|
-
- [Troubleshooting Guide](./troubleshooting.md) - Common issues and solutions
|
|
658
|
-
- [Contributing Guide](../CONTRIBUTING.md) - How to contribute
|
|
659
|
-
- [Architecture](./architecture.md) - System design overview
|
|
660
|
-
- [API Reference](./api/README.md) - Complete tool documentation
|
|
661
|
-
|
|
662
|
-
### External Resources
|
|
663
|
-
|
|
664
|
-
- [MCP Specification](https://modelcontextprotocol.io/)
|
|
665
|
-
- [miniprogram-automator Docs](https://developers.weixin.qq.com/miniprogram/dev/devtools/auto/)
|
|
666
|
-
- [TypeScript Handbook](https://www.typescriptlang.org/docs/)
|
|
667
|
-
- [Jest Documentation](https://jestjs.io/docs/getting-started)
|
|
668
|
-
|
|
669
|
-
---
|
|
670
|
-
|
|
671
|
-
## Getting Help
|
|
672
|
-
|
|
673
|
-
If you encounter issues not covered in this guide:
|
|
674
|
-
|
|
675
|
-
1. **Check Existing Issues**: [GitHub Issues](https://github.com/your-org/creatoria-miniapp-mcp/issues)
|
|
676
|
-
2. **Start Discussion**: [GitHub Discussions](https://github.com/your-org/creatoria-miniapp-mcp/discussions)
|
|
677
|
-
3. **Contact Maintainers**: Open an issue with `question` label
|
|
678
|
-
|
|
679
|
-
---
|
|
680
|
-
|
|
681
|
-
**Last Updated**: 2025-10-03
|
|
682
|
-
**Next Review**: 2026-01-03 (Quarterly)
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
# Playwright MCP 调研
|
|
2
|
-
|
|
3
|
-
## 仓库定位与分发形态
|
|
4
|
-
- `microsoft/playwright-mcp` 提供的是一个 **薄封装**,入口文件 `index.js` 只导出 `createConnection`,实际逻辑来自 Playwright 主仓库内的 `playwright/lib/mcp/index`。
|
|
5
|
-
- CLI (`cli.js`) 调用 `playwright/lib/mcp/program`,负责解析命令行并挂接 Playwright 提供的标准命令体系。
|
|
6
|
-
- `src/README.md` 明确说明源码已经迁移至 Playwright monorepo;当前仓库主要承载 NPM 包装、文档与发行物。
|
|
7
|
-
- NPM 包通过 `bin.mcp-server-playwright` 暴露命令行,同时支持 `exports`(默认 CommonJS、类型定义 `index.d.ts`)。
|
|
8
|
-
- `package.json` 指向 Playwright alpha 版本依赖(`playwright` 与 `playwright-core` 一致版本),并依赖 `@modelcontextprotocol/sdk`、`zod-to-json-schema` 等生成工具。
|
|
9
|
-
|
|
10
|
-
## Playwright 实现概览(位于 Playwright monorepo)
|
|
11
|
-
### 服务器入口 (`lib/mcp/index.js`)
|
|
12
|
-
- `createConnection(config, contextGetter?)` 解析配置后创建 `BrowserServerBackend`,并通过 `createServer("Playwright", version, backend)` 生成 MCP Server。
|
|
13
|
-
- 支持自定义 `contextGetter`,默认使用 `contextFactory` 根据配置创建浏览器上下文。
|
|
14
|
-
|
|
15
|
-
### 浏览器上下文工厂 (`lib/mcp/browser/browserContextFactory.js`)
|
|
16
|
-
- 根据配置选择不同工厂:
|
|
17
|
-
- `PersistentContextFactory`:持久化 profile,默认模式。
|
|
18
|
-
- `IsolatedContextFactory`:每次会话全新 profile,适合测试。
|
|
19
|
-
- `RemoteContextFactory` 与 `CdpContextFactory`:分别连接 Playwright 远程服务或已有浏览器(CDP)。
|
|
20
|
-
- `SharedContextFactory`:多个客户端复用同一个浏览器上下文。
|
|
21
|
-
- 负责注入初始化脚本、管理 userDataDir、处理追踪(trace/video)保存、CDP 端口注入等。
|
|
22
|
-
|
|
23
|
-
### 服务后端 (`lib/mcp/browser/browserServerBackend.js`)
|
|
24
|
-
- 在 `initialize` 中创建 `Context`(见下),并构建工具清单。
|
|
25
|
-
- `callTool`:根据工具名称查找定义、校验参数(Zod schema),执行并收集响应(日志、输出、错误)。
|
|
26
|
-
|
|
27
|
-
### 会话上下文 (`lib/mcp/browser/context.js`)
|
|
28
|
-
- 管理 Playwright `BrowserContext` 生命周期:
|
|
29
|
-
- 懒加载创建(含网络拦截、init script、trace、session log)。
|
|
30
|
-
- 维护标签页 `Tab` 列表、当前标签切换、关闭逻辑。
|
|
31
|
-
- `InputRecorder` 记录用户操作(避免工具执行时干扰)。
|
|
32
|
-
- `outputFile` / `lookupSecret` 等辅助能力。
|
|
33
|
-
- 根据配置启用网络白名单/黑名单、trace/live 截图等。
|
|
34
|
-
|
|
35
|
-
### 工具体系 (`lib/mcp/browser/tools/*`)
|
|
36
|
-
- 工具根据能力分组:核心自动化(导航、选择、点击、输入、截图)、标签管理、安装浏览器、坐标点击(vision 能力)、PDF、Tracing、Verify 等。
|
|
37
|
-
- 文档 (`README.md`) 中的工具清单由 `update-readme.js` 读取工具 schema 自动生成,确保与实现同步。
|
|
38
|
-
|
|
39
|
-
## 配置与运行模式
|
|
40
|
-
- CLI 支持丰富参数:浏览器选择、CDP/Remote 连接、白/黑名单、持久化目录、init script、权限、storage state、trace/video 输出、capabilities(`vision`/`pdf`/`tracing`/`verify`)等。
|
|
41
|
-
- 可作为本地 MCP (`stdio`)、HTTP 服务(`--port`)或通过浏览器扩展桥接现有浏览器会话。
|
|
42
|
-
- Profile 模式:持久化(默认)/隔离/扩展(Chrome 扩展 `extension/README.md` 说明)。
|
|
43
|
-
|
|
44
|
-
## 构建与发布
|
|
45
|
-
- `scripts.roll` 会同步 Playwright 主仓库的 `config.d.ts` 到当前包,确保类型定义一致。
|
|
46
|
-
- 使用 Playwright Test (`playwright test`) 做端到端验证,并提供 Docker 构建脚本与 CI 工作流。
|
|
47
|
-
|
|
48
|
-
## 对小程序 MCP 项目的启发
|
|
49
|
-
1. **工具粒度与文档生成**:Playwright 通过中心化 schema(Zod)定义工具,自动生成 README 与客户端说明;我们也可以复用这一思路,为小程序工具集提供机器可解析的描述与自动文档。
|
|
50
|
-
2. **上下文管理模式**:`Context` 统一管理会话状态、标签与资源回收,适合迁移到 miniprogram-automator(例如管理 IDE 进程、页面栈、元素引用缓存)。
|
|
51
|
-
3. **配置分层**:支持 CLI 参数、配置文件、环境变量三层合并(`resolveConfig`),可借鉴用于管理小程序项目路径、端口、Mock 配置等。
|
|
52
|
-
4. **扩展能力开关**:通过 `capabilities` 控制额外工具(vision/pdf/tracing),小程序侧可类比启用录制、网络桩、真机远程等特性。
|
|
53
|
-
5. **会话产物输出**:Playwright MCP 自动保存 trace/video/session log;我们可将截图、页面数据、断言结果统一输出,便于调试与 CI。
|