@creatoria/miniapp-mcp 0.1.3 → 0.2.2
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 +131 -66
- 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/handlers/assert-handlers.d.ts +98 -0
- package/dist/capabilities/assert/handlers/assert-handlers.d.ts.map +1 -0
- package/dist/capabilities/assert/handlers/assert-handlers.js +179 -0
- package/dist/capabilities/assert/handlers/assert-handlers.js.map +1 -0
- package/dist/capabilities/assert/handlers/index.d.ts +7 -0
- package/dist/capabilities/assert/handlers/index.d.ts.map +1 -0
- package/dist/capabilities/assert/handlers/index.js +7 -0
- package/dist/capabilities/assert/handlers/index.js.map +1 -0
- package/dist/capabilities/assert/index.d.ts +15 -0
- package/dist/capabilities/assert/index.d.ts.map +1 -0
- package/dist/capabilities/assert/index.js +90 -0
- package/dist/capabilities/assert/index.js.map +1 -0
- package/dist/capabilities/assert/schemas/index.d.ts +101 -0
- package/dist/capabilities/assert/schemas/index.d.ts.map +1 -0
- package/dist/capabilities/assert/schemas/index.js +62 -0
- package/dist/capabilities/assert/schemas/index.js.map +1 -0
- package/dist/capabilities/automator/handlers/close.d.ts +18 -0
- package/dist/capabilities/automator/handlers/close.d.ts.map +1 -0
- package/dist/capabilities/automator/handlers/close.js +45 -0
- package/dist/capabilities/automator/handlers/close.js.map +1 -0
- package/dist/capabilities/automator/handlers/connect.d.ts +24 -0
- package/dist/capabilities/automator/handlers/connect.d.ts.map +1 -0
- package/dist/capabilities/automator/handlers/connect.js +51 -0
- package/dist/capabilities/automator/handlers/connect.js.map +1 -0
- package/dist/capabilities/automator/handlers/disconnect.d.ts +16 -0
- package/dist/capabilities/automator/handlers/disconnect.d.ts.map +1 -0
- package/dist/capabilities/automator/handlers/disconnect.js +44 -0
- package/dist/capabilities/automator/handlers/disconnect.js.map +1 -0
- package/dist/capabilities/automator/handlers/index.d.ts +8 -0
- package/dist/capabilities/automator/handlers/index.d.ts.map +1 -0
- package/dist/capabilities/automator/handlers/index.js +8 -0
- package/dist/capabilities/automator/handlers/index.js.map +1 -0
- package/dist/capabilities/automator/handlers/launch.d.ts +25 -0
- package/dist/capabilities/automator/handlers/launch.d.ts.map +1 -0
- package/dist/capabilities/automator/handlers/launch.js +61 -0
- package/dist/capabilities/automator/handlers/launch.js.map +1 -0
- package/dist/capabilities/automator/index.d.ts +15 -0
- package/dist/capabilities/automator/index.d.ts.map +1 -0
- package/dist/capabilities/automator/index.js +55 -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 +9 -0
- package/dist/capabilities/automator/schemas/index.d.ts.map +1 -0
- package/dist/capabilities/automator/schemas/index.js +14 -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/handlers/element-handlers.d.ts +212 -0
- package/dist/capabilities/element/handlers/element-handlers.d.ts.map +1 -0
- package/dist/capabilities/element/handlers/element-handlers.js +383 -0
- package/dist/capabilities/element/handlers/element-handlers.js.map +1 -0
- package/dist/capabilities/element/handlers/index.d.ts +7 -0
- package/dist/capabilities/element/handlers/index.d.ts.map +1 -0
- package/dist/capabilities/element/handlers/index.js +27 -0
- package/dist/capabilities/element/handlers/index.js.map +1 -0
- package/dist/capabilities/element/index.d.ts +20 -0
- package/dist/capabilities/element/index.d.ts.map +1 -0
- package/dist/capabilities/element/index.js +199 -0
- package/dist/capabilities/element/index.js.map +1 -0
- package/dist/capabilities/element/schemas/index.d.ts +325 -0
- package/dist/capabilities/element/schemas/index.d.ts.map +1 -0
- package/dist/capabilities/element/schemas/index.js +168 -0
- package/dist/capabilities/element/schemas/index.js.map +1 -0
- package/dist/capabilities/index.d.ts +34 -0
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/index.js +40 -0
- package/dist/capabilities/index.js.map +1 -0
- package/dist/capabilities/loader.d.ts +61 -0
- package/dist/capabilities/loader.d.ts.map +1 -0
- package/dist/capabilities/loader.js +164 -0
- package/dist/capabilities/loader.js.map +1 -0
- package/dist/capabilities/miniprogram/handlers/call-wx.d.ts +24 -0
- package/dist/capabilities/miniprogram/handlers/call-wx.d.ts.map +1 -0
- package/dist/capabilities/miniprogram/handlers/call-wx.js +37 -0
- package/dist/capabilities/miniprogram/handlers/call-wx.js.map +1 -0
- package/dist/capabilities/miniprogram/handlers/evaluate.d.ts +32 -0
- package/dist/capabilities/miniprogram/handlers/evaluate.d.ts.map +1 -0
- package/dist/capabilities/miniprogram/handlers/evaluate.js +51 -0
- package/dist/capabilities/miniprogram/handlers/evaluate.js.map +1 -0
- package/dist/capabilities/miniprogram/handlers/index.d.ts +12 -0
- package/dist/capabilities/miniprogram/handlers/index.d.ts.map +1 -0
- package/dist/capabilities/miniprogram/handlers/index.js +12 -0
- package/dist/capabilities/miniprogram/handlers/index.js.map +1 -0
- package/dist/capabilities/miniprogram/handlers/navigate.d.ts +26 -0
- package/dist/capabilities/miniprogram/handlers/navigate.d.ts.map +1 -0
- package/dist/capabilities/miniprogram/handlers/navigate.js +56 -0
- package/dist/capabilities/miniprogram/handlers/navigate.js.map +1 -0
- package/dist/capabilities/miniprogram/handlers/page-stack.d.ts +20 -0
- package/dist/capabilities/miniprogram/handlers/page-stack.d.ts.map +1 -0
- package/dist/capabilities/miniprogram/handlers/page-stack.js +37 -0
- package/dist/capabilities/miniprogram/handlers/page-stack.js.map +1 -0
- package/dist/capabilities/miniprogram/handlers/screenshot.d.ts +33 -0
- package/dist/capabilities/miniprogram/handlers/screenshot.d.ts.map +1 -0
- package/dist/capabilities/miniprogram/handlers/screenshot.js +132 -0
- package/dist/capabilities/miniprogram/handlers/screenshot.js.map +1 -0
- package/dist/capabilities/miniprogram/handlers/system-info.d.ts +17 -0
- package/dist/capabilities/miniprogram/handlers/system-info.d.ts.map +1 -0
- package/dist/capabilities/miniprogram/handlers/system-info.js +31 -0
- package/dist/capabilities/miniprogram/handlers/system-info.js.map +1 -0
- package/dist/capabilities/miniprogram/index.d.ts +15 -0
- package/dist/capabilities/miniprogram/index.d.ts.map +1 -0
- package/dist/capabilities/miniprogram/index.js +69 -0
- package/dist/capabilities/miniprogram/index.js.map +1 -0
- package/dist/capabilities/miniprogram/schemas/call-wx.d.ts +15 -0
- package/dist/capabilities/miniprogram/schemas/call-wx.d.ts.map +1 -0
- package/dist/capabilities/miniprogram/schemas/call-wx.js +11 -0
- package/dist/capabilities/miniprogram/schemas/call-wx.js.map +1 -0
- package/dist/capabilities/miniprogram/schemas/evaluate.d.ts +15 -0
- package/dist/capabilities/miniprogram/schemas/evaluate.d.ts.map +1 -0
- package/dist/capabilities/miniprogram/schemas/evaluate.js +11 -0
- package/dist/capabilities/miniprogram/schemas/evaluate.js.map +1 -0
- package/dist/capabilities/miniprogram/schemas/index.d.ts +10 -0
- package/dist/capabilities/miniprogram/schemas/index.d.ts.map +1 -0
- package/dist/capabilities/miniprogram/schemas/index.js +10 -0
- package/dist/capabilities/miniprogram/schemas/index.js.map +1 -0
- package/dist/capabilities/miniprogram/schemas/navigate.d.ts +18 -0
- package/dist/capabilities/miniprogram/schemas/navigate.d.ts.map +1 -0
- package/dist/capabilities/miniprogram/schemas/navigate.js +22 -0
- package/dist/capabilities/miniprogram/schemas/navigate.js.map +1 -0
- package/dist/capabilities/miniprogram/schemas/page-stack.d.ts +6 -0
- package/dist/capabilities/miniprogram/schemas/page-stack.d.ts.map +1 -0
- package/dist/capabilities/miniprogram/schemas/page-stack.js +6 -0
- package/dist/capabilities/miniprogram/schemas/page-stack.js.map +1 -0
- package/dist/capabilities/miniprogram/schemas/screenshot.d.ts +18 -0
- package/dist/capabilities/miniprogram/schemas/screenshot.d.ts.map +1 -0
- package/dist/capabilities/miniprogram/schemas/screenshot.js +21 -0
- package/dist/capabilities/miniprogram/schemas/screenshot.js.map +1 -0
- package/dist/capabilities/miniprogram/schemas/system-info.d.ts +6 -0
- package/dist/capabilities/miniprogram/schemas/system-info.d.ts.map +1 -0
- package/dist/capabilities/miniprogram/schemas/system-info.js +6 -0
- package/dist/capabilities/miniprogram/schemas/system-info.js.map +1 -0
- package/dist/capabilities/network/handlers/index.d.ts +7 -0
- package/dist/capabilities/network/handlers/index.d.ts.map +1 -0
- package/dist/capabilities/network/handlers/index.js +7 -0
- package/dist/capabilities/network/handlers/index.js.map +1 -0
- package/dist/capabilities/network/handlers/network-handlers.d.ts +53 -0
- package/dist/capabilities/network/handlers/network-handlers.d.ts.map +1 -0
- package/dist/capabilities/network/handlers/network-handlers.js +127 -0
- package/dist/capabilities/network/handlers/network-handlers.js.map +1 -0
- package/dist/capabilities/network/index.d.ts +15 -0
- package/dist/capabilities/network/index.d.ts.map +1 -0
- package/dist/capabilities/network/index.js +69 -0
- package/dist/capabilities/network/index.js.map +1 -0
- package/dist/capabilities/network/schemas/index.d.ts +53 -0
- package/dist/capabilities/network/schemas/index.d.ts.map +1 -0
- package/dist/capabilities/network/schemas/index.js +33 -0
- package/dist/capabilities/network/schemas/index.js.map +1 -0
- package/dist/capabilities/page/handlers/index.d.ts +7 -0
- package/dist/capabilities/page/handlers/index.d.ts.map +1 -0
- package/dist/capabilities/page/handlers/index.js +7 -0
- package/dist/capabilities/page/handlers/index.js.map +1 -0
- package/dist/capabilities/page/handlers/page-handlers.d.ts +165 -0
- package/dist/capabilities/page/handlers/page-handlers.d.ts.map +1 -0
- package/dist/capabilities/page/handlers/page-handlers.js +258 -0
- package/dist/capabilities/page/handlers/page-handlers.js.map +1 -0
- package/dist/capabilities/page/index.d.ts +15 -0
- package/dist/capabilities/page/index.d.ts.map +1 -0
- package/dist/capabilities/page/index.js +83 -0
- package/dist/capabilities/page/index.js.map +1 -0
- package/dist/capabilities/page/schemas/index.d.ts +91 -0
- package/dist/capabilities/page/schemas/index.d.ts.map +1 -0
- package/dist/capabilities/page/schemas/index.js +55 -0
- package/dist/capabilities/page/schemas/index.js.map +1 -0
- package/dist/capabilities/record/handlers/index.d.ts +7 -0
- package/dist/capabilities/record/handlers/index.d.ts.map +1 -0
- package/dist/capabilities/record/handlers/index.js +7 -0
- package/dist/capabilities/record/handlers/index.js.map +1 -0
- package/dist/capabilities/record/handlers/record-handlers.d.ts +76 -0
- package/dist/capabilities/record/handlers/record-handlers.d.ts.map +1 -0
- package/dist/capabilities/record/handlers/record-handlers.js +255 -0
- package/dist/capabilities/record/handlers/record-handlers.js.map +1 -0
- package/dist/capabilities/record/index.d.ts +15 -0
- package/dist/capabilities/record/index.d.ts.map +1 -0
- package/dist/capabilities/record/index.js +69 -0
- package/dist/capabilities/record/index.js.map +1 -0
- package/dist/capabilities/record/schemas/index.d.ts +47 -0
- package/dist/capabilities/record/schemas/index.d.ts.map +1 -0
- package/dist/capabilities/record/schemas/index.js +33 -0
- package/dist/capabilities/record/schemas/index.js.map +1 -0
- package/dist/capabilities/registry.d.ts +138 -0
- package/dist/capabilities/registry.d.ts.map +1 -0
- package/dist/capabilities/registry.js +261 -0
- package/dist/capabilities/registry.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/handlers/index.d.ts +7 -0
- package/dist/capabilities/snapshot/handlers/index.d.ts.map +1 -0
- package/dist/capabilities/snapshot/handlers/index.js +7 -0
- package/dist/capabilities/snapshot/handlers/index.js.map +1 -0
- package/dist/capabilities/snapshot/handlers/snapshot-handlers.d.ts +75 -0
- package/dist/capabilities/snapshot/handlers/snapshot-handlers.d.ts.map +1 -0
- package/dist/capabilities/snapshot/handlers/snapshot-handlers.js +201 -0
- package/dist/capabilities/snapshot/handlers/snapshot-handlers.js.map +1 -0
- package/dist/capabilities/snapshot/index.d.ts +15 -0
- package/dist/capabilities/snapshot/index.d.ts.map +1 -0
- package/dist/capabilities/snapshot/index.js +48 -0
- package/dist/capabilities/snapshot/index.js.map +1 -0
- package/dist/capabilities/snapshot/schemas/index.d.ts +47 -0
- package/dist/capabilities/snapshot/schemas/index.d.ts.map +1 -0
- package/dist/capabilities/snapshot/schemas/index.js +28 -0
- package/dist/capabilities/snapshot/schemas/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 +11 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +11 -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/retry/index.d.ts +5 -0
- package/dist/runtime/retry/index.d.ts.map +1 -0
- package/dist/runtime/retry/index.js +5 -0
- package/dist/runtime/retry/index.js.map +1 -0
- package/dist/runtime/retry/retry.d.ts +61 -0
- package/dist/runtime/retry/retry.d.ts.map +1 -0
- package/dist/runtime/retry/retry.js +90 -0
- package/dist/runtime/retry/retry.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 +59 -0
- package/dist/runtime/timeout/timeout.d.ts.map +1 -0
- package/dist/runtime/timeout/timeout.js +77 -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 +5 -5
- package/dist/server.js.map +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +8 -4
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/miniprogram.d.ts +11 -2
- package/dist/tools/miniprogram.d.ts.map +1 -1
- package/dist/tools/miniprogram.js +111 -41
- 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/current/01-architecture-migration.md +337 -0
- package/docs/current/02-screenshot-timeout-fix.md +589 -0
- package/docs/current/README.md +226 -0
- 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
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { generateAndSaveReports } from '../../outputs/report-generator.js';
|
|
2
|
+
export async function cleanupSessionResources(session, sessionId) {
|
|
3
|
+
const errors = [];
|
|
4
|
+
if (session.reportData) {
|
|
5
|
+
try {
|
|
6
|
+
await generateAndSaveReports(session);
|
|
7
|
+
console.error(`Session reports generated for ${sessionId}`);
|
|
8
|
+
}
|
|
9
|
+
catch (error) {
|
|
10
|
+
console.error(`Failed to generate session reports for ${sessionId}:`, error);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
if (session.logger?.dispose) {
|
|
14
|
+
try {
|
|
15
|
+
await session.logger.dispose();
|
|
16
|
+
console.error(`Logger disposed for session ${sessionId}`);
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
20
|
+
errors.push(new Error(`Failed to dispose logger: ${err.message}`));
|
|
21
|
+
console.error(`Failed to dispose logger for session ${sessionId}:`, error);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
if (session.miniProgram) {
|
|
25
|
+
try {
|
|
26
|
+
if (typeof session.miniProgram.disconnect === 'function') {
|
|
27
|
+
await session.miniProgram.disconnect();
|
|
28
|
+
}
|
|
29
|
+
console.error(`Disconnected miniProgram for session ${sessionId}`);
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
33
|
+
errors.push(new Error(`Failed to disconnect miniProgram: ${err.message}`));
|
|
34
|
+
console.error(`Failed to disconnect miniProgram for session ${sessionId}:`, error);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const ideProcess = session.ideProcess;
|
|
38
|
+
if (ideProcess) {
|
|
39
|
+
try {
|
|
40
|
+
if (typeof ideProcess.kill === 'function') {
|
|
41
|
+
if (typeof ideProcess.once === 'function') {
|
|
42
|
+
await new Promise((resolve, reject) => {
|
|
43
|
+
const timeout = setTimeout(() => {
|
|
44
|
+
reject(new Error('IDE process did not exit within 5 seconds'));
|
|
45
|
+
}, 5000);
|
|
46
|
+
ideProcess.once('exit', () => {
|
|
47
|
+
clearTimeout(timeout);
|
|
48
|
+
resolve();
|
|
49
|
+
});
|
|
50
|
+
ideProcess.kill();
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
ideProcess.kill();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
console.error(`Killed IDE process for session ${sessionId}`);
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
61
|
+
errors.push(new Error(`Failed to kill IDE process: ${err.message}`));
|
|
62
|
+
console.error(`Failed to kill IDE process for session ${sessionId}:`, error);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
try {
|
|
66
|
+
session.elements.clear();
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
70
|
+
errors.push(new Error(`Failed to clear element cache: ${err.message}`));
|
|
71
|
+
}
|
|
72
|
+
if (errors.length > 0) {
|
|
73
|
+
console.error(`Session ${sessionId} cleanup completed with ${errors.length} error(s)`);
|
|
74
|
+
throw new AggregateError(errors, `Session cleanup had ${errors.length} error(s)`);
|
|
75
|
+
}
|
|
76
|
+
console.error(`Session ${sessionId} cleaned up successfully`);
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=cleanup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cleanup.js","sourceRoot":"","sources":["../../../../src/runtime/session/utils/cleanup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,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AK,EAAE,CAAC;YACf,MAAM,GAAG,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;YACrE,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,+BAA+B,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA;YACpE,OAAO,CAAC,KAAK,CAAC,0CAA0C,SAAS,GAAG,EAAE,KAAK,CAAC,CAAA;QAC9E,CAAC;IACH,CAAC;IAED,IAAI,CAAC;QACH,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAA;IAC1B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,GAAG,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;QACrE,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,kCAAkC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA;IACzE,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,OAAO,CAAC,KAAK,CAAC,WAAW,SAAS,2BAA2B,MAAM,CAAC,MAAM,WAAW,CAAC,CAAA;QACtF,MAAM,IAAI,cAAc,CAAC,MAAM,EAAE,uBAAuB,MAAM,CAAC,MAAM,WAAW,CAAC,CAAA;IACnF,CAAC;IAED,OAAO,CAAC,KAAK,CAAC,WAAW,SAAS,0BAA0B,CAAC,CAAA;AAC/D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/timeout/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/runtime/timeout/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Timeout utilities for protecting async operations
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Wraps a promise with timeout protection
|
|
6
|
+
*
|
|
7
|
+
* @param promise - The promise to wrap
|
|
8
|
+
* @param timeoutMs - Timeout in milliseconds
|
|
9
|
+
* @param operation - Description of the operation for error messages
|
|
10
|
+
* @returns The promise result or throws TimeoutError
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const result = await withTimeout(
|
|
15
|
+
* page.$(selector),
|
|
16
|
+
* 5000,
|
|
17
|
+
* 'Query element'
|
|
18
|
+
* )
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function withTimeout<T>(promise: Promise<T>, timeoutMs: number, operation: string): Promise<T>;
|
|
22
|
+
/**
|
|
23
|
+
* Default timeout values for different operations
|
|
24
|
+
*/
|
|
25
|
+
export declare const DEFAULT_TIMEOUTS: {
|
|
26
|
+
/** Default timeout for most operations (30 seconds) */
|
|
27
|
+
readonly default: 30000;
|
|
28
|
+
/** Timeout for evaluate operations (5 seconds) */
|
|
29
|
+
readonly evaluate: 5000;
|
|
30
|
+
/** Timeout for launch operations (60 seconds) */
|
|
31
|
+
readonly launch: 60000;
|
|
32
|
+
/** Timeout for connect operations (30 seconds) */
|
|
33
|
+
readonly connect: 30000;
|
|
34
|
+
/** Timeout for screenshot operations (10 seconds) */
|
|
35
|
+
readonly screenshot: 10000;
|
|
36
|
+
/** Timeout for fullPage screenshot operations (30 seconds) */
|
|
37
|
+
readonly screenshotFullPage: 30000;
|
|
38
|
+
/** Timeout for navigation operations (30 seconds) */
|
|
39
|
+
readonly navigation: 30000;
|
|
40
|
+
/** Timeout for callWx operations (10 seconds) */
|
|
41
|
+
readonly callWx: 10000;
|
|
42
|
+
/** Timeout for pageStack operations (5 seconds) */
|
|
43
|
+
readonly pageStack: 5000;
|
|
44
|
+
/** Timeout for systemInfo operations (5 seconds) */
|
|
45
|
+
readonly systemInfo: 5000;
|
|
46
|
+
/** Timeout for waitFor operations (30 seconds) */
|
|
47
|
+
readonly waitFor: 30000;
|
|
48
|
+
/** Timeout for element queries (10 seconds) */
|
|
49
|
+
readonly query: 10000;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Get timeout value with fallback chain:
|
|
53
|
+
* 1. Operation-specific timeout from config
|
|
54
|
+
* 2. Global timeout from config
|
|
55
|
+
* 3. Operation-specific default
|
|
56
|
+
* 4. Global default (30s)
|
|
57
|
+
*/
|
|
58
|
+
export declare function getTimeout(configTimeout: number | undefined, operationDefault: number): number;
|
|
59
|
+
//# sourceMappingURL=timeout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeout.d.ts","sourceRoot":"","sources":["../../../src/runtime/timeout/timeout.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,WAAW,CAAC,CAAC,EACjC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EACnB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,CAAC,CAAC,CAiBZ;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB;IAC3B,uDAAuD;;IAEvD,kDAAkD;;IAElD,iDAAiD;;IAEjD,kDAAkD;;IAElD,qDAAqD;;IAErD,8DAA8D;;IAE9D,qDAAqD;;IAErD,iDAAiD;;IAEjD,mDAAmD;;IAEnD,oDAAoD;;IAEpD,kDAAkD;;IAElD,+CAA+C;;CAEvC,CAAA;AAEV;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,EAAE,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAE9F"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Timeout utilities for protecting async operations
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Wraps a promise with timeout protection
|
|
6
|
+
*
|
|
7
|
+
* @param promise - The promise to wrap
|
|
8
|
+
* @param timeoutMs - Timeout in milliseconds
|
|
9
|
+
* @param operation - Description of the operation for error messages
|
|
10
|
+
* @returns The promise result or throws TimeoutError
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const result = await withTimeout(
|
|
15
|
+
* page.$(selector),
|
|
16
|
+
* 5000,
|
|
17
|
+
* 'Query element'
|
|
18
|
+
* )
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export async function withTimeout(promise, timeoutMs, operation) {
|
|
22
|
+
let timeoutId;
|
|
23
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
24
|
+
timeoutId = setTimeout(() => {
|
|
25
|
+
reject(new Error(`${operation} timed out after ${timeoutMs}ms`));
|
|
26
|
+
}, timeoutMs);
|
|
27
|
+
});
|
|
28
|
+
try {
|
|
29
|
+
const result = await Promise.race([promise, timeoutPromise]);
|
|
30
|
+
clearTimeout(timeoutId);
|
|
31
|
+
return result;
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
clearTimeout(timeoutId);
|
|
35
|
+
throw error;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Default timeout values for different operations
|
|
40
|
+
*/
|
|
41
|
+
export const DEFAULT_TIMEOUTS = {
|
|
42
|
+
/** Default timeout for most operations (30 seconds) */
|
|
43
|
+
default: 30000,
|
|
44
|
+
/** Timeout for evaluate operations (5 seconds) */
|
|
45
|
+
evaluate: 5000,
|
|
46
|
+
/** Timeout for launch operations (60 seconds) */
|
|
47
|
+
launch: 60000,
|
|
48
|
+
/** Timeout for connect operations (30 seconds) */
|
|
49
|
+
connect: 30000,
|
|
50
|
+
/** Timeout for screenshot operations (10 seconds) */
|
|
51
|
+
screenshot: 10000,
|
|
52
|
+
/** Timeout for fullPage screenshot operations (30 seconds) */
|
|
53
|
+
screenshotFullPage: 30000,
|
|
54
|
+
/** Timeout for navigation operations (30 seconds) */
|
|
55
|
+
navigation: 30000,
|
|
56
|
+
/** Timeout for callWx operations (10 seconds) */
|
|
57
|
+
callWx: 10000,
|
|
58
|
+
/** Timeout for pageStack operations (5 seconds) */
|
|
59
|
+
pageStack: 5000,
|
|
60
|
+
/** Timeout for systemInfo operations (5 seconds) */
|
|
61
|
+
systemInfo: 5000,
|
|
62
|
+
/** Timeout for waitFor operations (30 seconds) */
|
|
63
|
+
waitFor: 30000,
|
|
64
|
+
/** Timeout for element queries (10 seconds) */
|
|
65
|
+
query: 10000,
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Get timeout value with fallback chain:
|
|
69
|
+
* 1. Operation-specific timeout from config
|
|
70
|
+
* 2. Global timeout from config
|
|
71
|
+
* 3. Operation-specific default
|
|
72
|
+
* 4. Global default (30s)
|
|
73
|
+
*/
|
|
74
|
+
export function getTimeout(configTimeout, operationDefault) {
|
|
75
|
+
return configTimeout ?? operationDefault ?? DEFAULT_TIMEOUTS.default;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=timeout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeout.js","sourceRoot":"","sources":["../../../src/runtime/timeout/timeout.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,OAAmB,EACnB,SAAiB,EACjB,SAAiB;IAEjB,IAAI,SAAyB,CAAA;IAE7B,MAAM,cAAc,GAAG,IAAI,OAAO,CAAI,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE;QAClD,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE;YAC1B,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,SAAS,oBAAoB,SAAS,IAAI,CAAC,CAAC,CAAA;QAClE,CAAC,EAAE,SAAS,CAAC,CAAA;IACf,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAA;QAC5D,YAAY,CAAC,SAAU,CAAC,CAAA;QACxB,OAAO,MAAM,CAAA;IACf,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,YAAY,CAAC,SAAU,CAAC,CAAA;QACxB,MAAM,KAAK,CAAA;IACb,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,uDAAuD;IACvD,OAAO,EAAE,KAAK;IACd,kDAAkD;IAClD,QAAQ,EAAE,IAAI;IACd,iDAAiD;IACjD,MAAM,EAAE,KAAK;IACb,kDAAkD;IAClD,OAAO,EAAE,KAAK;IACd,qDAAqD;IACrD,UAAU,EAAE,KAAK;IACjB,8DAA8D;IAC9D,kBAAkB,EAAE,KAAK;IACzB,qDAAqD;IACrD,UAAU,EAAE,KAAK;IACjB,iDAAiD;IACjD,MAAM,EAAE,KAAK;IACb,mDAAmD;IACnD,SAAS,EAAE,IAAI;IACf,oDAAoD;IACpD,UAAU,EAAE,IAAI;IAChB,kDAAkD;IAClD,OAAO,EAAE,KAAK;IACd,+CAA+C;IAC/C,KAAK,EAAE,KAAK;CACJ,CAAA;AAEV;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,aAAiC,EAAE,gBAAwB;IACpF,OAAO,aAAa,IAAI,gBAAgB,IAAI,gBAAgB,CAAC,OAAO,CAAA;AACtE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/validation/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/runtime/validation/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input validation utilities
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Validates a filename to prevent path traversal attacks
|
|
6
|
+
*
|
|
7
|
+
* Rules:
|
|
8
|
+
* - No path separators (/ or \)
|
|
9
|
+
* - No parent directory references (..)
|
|
10
|
+
* - Only alphanumeric, underscore, hyphen, and dot
|
|
11
|
+
* - Must have a valid extension
|
|
12
|
+
*
|
|
13
|
+
* @param filename - The filename to validate
|
|
14
|
+
* @param allowedExtensions - Array of allowed extensions (without dot)
|
|
15
|
+
* @throws Error if filename is invalid
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* validateFilename('screenshot.png', ['png', 'jpg']) // OK
|
|
20
|
+
* validateFilename('../etc/passwd', ['png']) // throws
|
|
21
|
+
* validateFilename('file/path.png', ['png']) // throws
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function validateFilename(filename: string, allowedExtensions?: string[]): void;
|
|
25
|
+
/**
|
|
26
|
+
* Sanitizes a filename by removing or replacing invalid characters
|
|
27
|
+
*
|
|
28
|
+
* @param filename - The filename to sanitize
|
|
29
|
+
* @param defaultExtension - Default extension if none provided
|
|
30
|
+
* @returns A safe filename
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* sanitizeFilename('my file!.png') // 'my-file.png'
|
|
35
|
+
* sanitizeFilename('test', 'json') // 'test.json'
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare function sanitizeFilename(filename: string, defaultExtension?: string): string;
|
|
39
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../src/runtime/validation/validation.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,iBAAiB,GAAE,MAAM,EAA0C,GAClE,IAAI,CA0CN;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CA0BpF"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input validation utilities
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Validates a filename to prevent path traversal attacks
|
|
6
|
+
*
|
|
7
|
+
* Rules:
|
|
8
|
+
* - No path separators (/ or \)
|
|
9
|
+
* - No parent directory references (..)
|
|
10
|
+
* - Only alphanumeric, underscore, hyphen, and dot
|
|
11
|
+
* - Must have a valid extension
|
|
12
|
+
*
|
|
13
|
+
* @param filename - The filename to validate
|
|
14
|
+
* @param allowedExtensions - Array of allowed extensions (without dot)
|
|
15
|
+
* @throws Error if filename is invalid
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* validateFilename('screenshot.png', ['png', 'jpg']) // OK
|
|
20
|
+
* validateFilename('../etc/passwd', ['png']) // throws
|
|
21
|
+
* validateFilename('file/path.png', ['png']) // throws
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export function validateFilename(filename, allowedExtensions = ['png', 'jpg', 'jpeg', 'json', 'txt']) {
|
|
25
|
+
if (!filename || filename.trim() === '') {
|
|
26
|
+
throw new Error('Filename cannot be empty');
|
|
27
|
+
}
|
|
28
|
+
// Check for path traversal attempts
|
|
29
|
+
if (filename.includes('..')) {
|
|
30
|
+
throw new Error('Filename must not contain ".." sequences (path traversal attempt)');
|
|
31
|
+
}
|
|
32
|
+
// Check for path separators
|
|
33
|
+
if (filename.includes('/') || filename.includes('\\')) {
|
|
34
|
+
throw new Error('Filename must not contain path separators');
|
|
35
|
+
}
|
|
36
|
+
// Check for null bytes (security)
|
|
37
|
+
if (filename.includes('\0')) {
|
|
38
|
+
throw new Error('Filename must not contain null bytes');
|
|
39
|
+
}
|
|
40
|
+
// Validate format: alphanumeric, underscore, hyphen, and dot
|
|
41
|
+
if (!/^[a-zA-Z0-9_.-]+$/.test(filename)) {
|
|
42
|
+
throw new Error('Filename must only contain alphanumeric characters, underscores, hyphens, and dots');
|
|
43
|
+
}
|
|
44
|
+
// Check extension
|
|
45
|
+
const parts = filename.split('.');
|
|
46
|
+
if (parts.length < 2) {
|
|
47
|
+
throw new Error('Filename must have an extension');
|
|
48
|
+
}
|
|
49
|
+
const extension = parts[parts.length - 1].toLowerCase();
|
|
50
|
+
if (!allowedExtensions.includes(extension)) {
|
|
51
|
+
throw new Error(`Invalid file extension. Allowed extensions: ${allowedExtensions.join(', ')}`);
|
|
52
|
+
}
|
|
53
|
+
// Check length (防止过长文件名)
|
|
54
|
+
if (filename.length > 255) {
|
|
55
|
+
throw new Error('Filename is too long (max 255 characters)');
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Sanitizes a filename by removing or replacing invalid characters
|
|
60
|
+
*
|
|
61
|
+
* @param filename - The filename to sanitize
|
|
62
|
+
* @param defaultExtension - Default extension if none provided
|
|
63
|
+
* @returns A safe filename
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```typescript
|
|
67
|
+
* sanitizeFilename('my file!.png') // 'my-file.png'
|
|
68
|
+
* sanitizeFilename('test', 'json') // 'test.json'
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export function sanitizeFilename(filename, defaultExtension) {
|
|
72
|
+
// Remove path components
|
|
73
|
+
filename = filename.split('/').pop();
|
|
74
|
+
filename = filename.split('\\').pop();
|
|
75
|
+
// Remove or replace invalid characters
|
|
76
|
+
filename = filename.replace(/[^a-zA-Z0-9_.-]/g, '-');
|
|
77
|
+
// Remove multiple consecutive hyphens or dots
|
|
78
|
+
filename = filename.replace(/[-]{2,}/g, '-');
|
|
79
|
+
filename = filename.replace(/[.]{2,}/g, '.');
|
|
80
|
+
// Ensure extension
|
|
81
|
+
if (defaultExtension && !filename.includes('.')) {
|
|
82
|
+
filename = `${filename}.${defaultExtension}`;
|
|
83
|
+
}
|
|
84
|
+
// Limit length
|
|
85
|
+
if (filename.length > 255) {
|
|
86
|
+
const parts = filename.split('.');
|
|
87
|
+
const ext = parts.pop();
|
|
88
|
+
const name = parts.join('.').substring(0, 255 - ext.length - 1);
|
|
89
|
+
filename = `${name}.${ext}`;
|
|
90
|
+
}
|
|
91
|
+
return filename;
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../src/runtime/validation/validation.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,gBAAgB,CAC9B,QAAgB,EAChB,oBAA8B,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC;IAEnE,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;IAC7C,CAAC;IAED,oCAAoC;IACpC,IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAA;IACtF,CAAC;IAED,4BAA4B;IAC5B,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACtD,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,C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BAAkB,EAAE,GAAG,CAAC,CAAA;IAEpD,8CAA8C;IAC9C,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC,CAAA;IAC5C,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC,CAAA;IAE5C,mBAAmB;IACnB,IAAI,gBAAgB,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAChD,QAAQ,GAAG,GAAG,QAAQ,IAAI,gBAAgB,EAAE,CAAA;IAC9C,CAAC;IAED,eAAe;IACf,IAAI,QAAQ,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;QAC1B,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QACjC,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,EAAE,CAAA;QACvB,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,GAAG,GAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;QAChE,QAAQ,GAAG,GAAG,IAAI,IAAI,GAAG,EAAE,CAAA;IAC7B,CAAC;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$ref": "#/definitions/miniprogram_close",
|
|
3
|
+
"definitions": {
|
|
4
|
+
"miniprogram_close": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {},
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"description": "Close current mini program session and cleanup all resources"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
12
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$ref": "#/definitions/miniprogram_connect",
|
|
3
|
+
"definitions": {
|
|
4
|
+
"miniprogram_connect": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"port": {
|
|
8
|
+
"type": "integer",
|
|
9
|
+
"minimum": 1,
|
|
10
|
+
"maximum": 65535,
|
|
11
|
+
"description": "Automation port for an existing DevTools instance"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"additionalProperties": false,
|
|
15
|
+
"description": "Connect to an already running WeChat DevTools instance"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
19
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$ref": "#/definitions/miniprogram_disconnect",
|
|
3
|
+
"definitions": {
|
|
4
|
+
"miniprogram_disconnect": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {},
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"description": "Disconnect from miniprogram but keep IDE running"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
12
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$ref": "#/definitions/miniprogram_launch",
|
|
3
|
+
"definitions": {
|
|
4
|
+
"miniprogram_launch": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"projectPath": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"minLength": 1
|
|
10
|
+
},
|
|
11
|
+
"cliPath": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"minLength": 1
|
|
14
|
+
},
|
|
15
|
+
"port": {
|
|
16
|
+
"type": "integer",
|
|
17
|
+
"minimum": 1,
|
|
18
|
+
"maximum": 65535,
|
|
19
|
+
"description": "Automation port for WeChat DevTools"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"required": [
|
|
23
|
+
"projectPath"
|
|
24
|
+
],
|
|
25
|
+
"additionalProperties": false,
|
|
26
|
+
"description": "Launch WeChat Mini Program with automator"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
30
|
+
}
|
package/dist/server.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
5
5
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
6
6
|
import { ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
-
import { SessionStore } from './
|
|
8
|
-
import {
|
|
7
|
+
import { SessionStore } from './runtime/session/index.js';
|
|
8
|
+
import { setupCapabilities } from './capabilities/loader.js';
|
|
9
9
|
import { mergeServerConfig } from './config/defaults.js';
|
|
10
10
|
export async function startServer(config = {}) {
|
|
11
11
|
// Merge config with defaults to ensure all fields are present
|
|
@@ -35,9 +35,9 @@ export async function startServer(config = {}) {
|
|
|
35
35
|
tools: {},
|
|
36
36
|
},
|
|
37
37
|
});
|
|
38
|
-
// Register tools based on capabilities
|
|
39
|
-
//
|
|
40
|
-
const tools =
|
|
38
|
+
// Register tools based on capabilities using new architecture
|
|
39
|
+
// setupCapabilities loads capability modules dynamically and registers handlers
|
|
40
|
+
const { tools } = await setupCapabilities(server, {
|
|
41
41
|
capabilities,
|
|
42
42
|
sessionId, // Pass the unique session ID
|
|
43
43
|
getSession: (sid) => {
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAA;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAA;AAE3E,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"server.js","sour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AAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEhE;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,GAAG,IAAI,EAAE,CAyJtF"}
|
package/dist/tools/index.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* Total: 65 tools
|
|
16
16
|
*/
|
|
17
17
|
import { CallToolRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
18
|
-
import { ToolLogger } from '../
|
|
18
|
+
import { ToolLogger } from '../runtime/logging/tool-logger.js';
|
|
19
19
|
import * as automatorTools from './automator.js';
|
|
20
20
|
import * as miniprogramTools from './miniprogram.js';
|
|
21
21
|
import * as pageTools from './page.js';
|
|
@@ -153,17 +153,21 @@ export const MINIPROGRAM_TOOLS = [
|
|
|
153
153
|
},
|
|
154
154
|
{
|
|
155
155
|
name: 'miniprogram_screenshot',
|
|
156
|
-
description: 'Take a screenshot of the mini program.
|
|
156
|
+
description: 'Take a screenshot of the mini program. Use returnBase64=true for quick base64 response, or provide filename to save to file.',
|
|
157
157
|
inputSchema: {
|
|
158
158
|
type: 'object',
|
|
159
159
|
properties: {
|
|
160
160
|
filename: {
|
|
161
161
|
type: 'string',
|
|
162
|
-
description: 'Optional filename to save screenshot to file. If not provided, returns base64 string
|
|
162
|
+
description: 'Optional filename to save screenshot to file. If not provided and returnBase64=true, returns base64 string directly.',
|
|
163
163
|
},
|
|
164
164
|
fullPage: {
|
|
165
165
|
type: 'boolean',
|
|
166
|
-
description: 'Whether to capture the full page (default: false)',
|
|
166
|
+
description: 'Whether to capture the full page including scroll area (default: false). Note: fullPage screenshots use longer timeout (30s vs 10s).',
|
|
167
|
+
},
|
|
168
|
+
returnBase64: {
|
|
169
|
+
type: 'boolean',
|
|
170
|
+
description: 'Return screenshot as base64 string. If true and no filename provided, returns base64 directly without saving file. (default: false)',
|
|
167
171
|
},
|
|
168
172
|
},
|
|
169
173
|
},
|