@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
package/docs/tasks.B4.atomize.md
DELETED
|
@@ -1,504 +0,0 @@
|
|
|
1
|
-
# Task Card: [B4] Logger 和 OutputManager
|
|
2
|
-
|
|
3
|
-
**Task ID**: B4
|
|
4
|
-
**Task Name**: Logger 和 OutputManager 实现
|
|
5
|
-
**Charter**: `docs/charter.B4.align.yaml`
|
|
6
|
-
**Stage**: B (Core Architecture)
|
|
7
|
-
**Status**: ✅ COMPLETED (Retrospective)
|
|
8
|
-
**Estimated**: 1-2 hours
|
|
9
|
-
**Actual**: ~1.5 hours
|
|
10
|
-
**Completed**: 2025-10-02
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## 目标 (Goal)
|
|
15
|
-
|
|
16
|
-
实现结构化日志系统和产物管理器,为 MCP Server 提供统一的日志输出和文件管理能力。
|
|
17
|
-
|
|
18
|
-
**交付物**:
|
|
19
|
-
- ✅ `src/core/logger.ts` (~50 lines)
|
|
20
|
-
- ✅ `src/core/output.ts` (~60 lines)
|
|
21
|
-
- ✅ Logger 类:info/warn/error
|
|
22
|
-
- ✅ OutputManager 类:resolveOutputPath/writeFile
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
## 前置条件 (Prerequisites)
|
|
27
|
-
|
|
28
|
-
- ✅ A3: 仓库结构已初始化
|
|
29
|
-
- ✅ TypeScript 配置完成
|
|
30
|
-
- ✅ 了解 Node.js fs/promises API
|
|
31
|
-
- ✅ 了解 MCP stdio transport 限制
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## 实现步骤 (Steps)
|
|
36
|
-
|
|
37
|
-
### 1. 创建 Logger 类骨架 ✅
|
|
38
|
-
|
|
39
|
-
**文件**: `src/core/logger.ts`
|
|
40
|
-
|
|
41
|
-
**步骤**:
|
|
42
|
-
```typescript
|
|
43
|
-
/**
|
|
44
|
-
* Simple structured logger that outputs to stderr
|
|
45
|
-
* (to avoid interfering with MCP stdio transport on stdout)
|
|
46
|
-
*/
|
|
47
|
-
export class Logger {
|
|
48
|
-
constructor(private prefix: string = '') {}
|
|
49
|
-
|
|
50
|
-
info(message: string, meta?: object): void
|
|
51
|
-
warn(message: string, meta?: object): void
|
|
52
|
-
error(message: string, meta?: object): void
|
|
53
|
-
}
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
**验证**: 类定义正确,方法签名完整
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
### 2. 实现日志格式化 ✅
|
|
61
|
-
|
|
62
|
-
**代码**:
|
|
63
|
-
```typescript
|
|
64
|
-
private format(level: string, message: string, meta?: object): string {
|
|
65
|
-
const timestamp = new Date().toISOString()
|
|
66
|
-
const prefix = this.prefix ? `[${this.prefix}] ` : ''
|
|
67
|
-
const metaStr = meta ? ` ${JSON.stringify(meta)}` : ''
|
|
68
|
-
return `${timestamp} ${prefix}[${level}] ${message}${metaStr}`
|
|
69
|
-
}
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
**验证**: 格式化输出清晰可读
|
|
73
|
-
|
|
74
|
-
---
|
|
75
|
-
|
|
76
|
-
### 3. 实现日志方法 ✅
|
|
77
|
-
|
|
78
|
-
**代码**:
|
|
79
|
-
```typescript
|
|
80
|
-
info(message: string, meta?: object): void {
|
|
81
|
-
console.error(this.format('INFO', message, meta))
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
warn(message: string, meta?: object): void {
|
|
85
|
-
console.error(this.format('WARN', message, meta))
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
error(message: string, meta?: object): void {
|
|
89
|
-
console.error(this.format('ERROR', message, meta))
|
|
90
|
-
}
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
**验证**:
|
|
94
|
-
- 所有日志输出到 console.error
|
|
95
|
-
- 日志级别正确标注
|
|
96
|
-
- meta 对象正确序列化
|
|
97
|
-
|
|
98
|
-
---
|
|
99
|
-
|
|
100
|
-
### 4. 创建全局 Logger 实例 ✅
|
|
101
|
-
|
|
102
|
-
**代码**:
|
|
103
|
-
```typescript
|
|
104
|
-
// Export a default logger instance
|
|
105
|
-
export const logger = new Logger('MCP')
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
**验证**: 可直接导入使用
|
|
109
|
-
|
|
110
|
-
---
|
|
111
|
-
|
|
112
|
-
### 5. 创建 OutputManager 类骨架 ✅
|
|
113
|
-
|
|
114
|
-
**文件**: `src/core/output.ts`
|
|
115
|
-
|
|
116
|
-
**步骤**:
|
|
117
|
-
```typescript
|
|
118
|
-
import { mkdir, writeFile as fsWriteFile } from 'fs/promises'
|
|
119
|
-
import path from 'path'
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Manages output files for a session
|
|
123
|
-
* Directory structure: {baseDir}/{sessionId}/{type}/
|
|
124
|
-
*/
|
|
125
|
-
export class OutputManager {
|
|
126
|
-
constructor(
|
|
127
|
-
private sessionId: string,
|
|
128
|
-
private baseDir: string = '.mcp-artifacts'
|
|
129
|
-
) {}
|
|
130
|
-
|
|
131
|
-
resolveOutputPath(type: string, filename: string): string
|
|
132
|
-
async writeFile(type: string, filename: string, content: string | Buffer): Promise<string>
|
|
133
|
-
}
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
**验证**: 类定义正确,导入完整
|
|
137
|
-
|
|
138
|
-
---
|
|
139
|
-
|
|
140
|
-
### 6. 实现 resolveOutputPath() ✅
|
|
141
|
-
|
|
142
|
-
**代码**:
|
|
143
|
-
```typescript
|
|
144
|
-
/**
|
|
145
|
-
* Resolve output path for a file
|
|
146
|
-
* @param type - Output type (screenshot/snapshot/log/trace)
|
|
147
|
-
* @param filename - File name
|
|
148
|
-
* @returns Absolute path to the file
|
|
149
|
-
*/
|
|
150
|
-
resolveOutputPath(type: string, filename: string): string {
|
|
151
|
-
const dir = path.join(this.baseDir, this.sessionId, type)
|
|
152
|
-
return path.resolve(dir, filename)
|
|
153
|
-
}
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
**验证**:
|
|
157
|
-
- 路径格式正确:{baseDir}/{sessionId}/{type}/{filename}
|
|
158
|
-
- 返回绝对路径
|
|
159
|
-
|
|
160
|
-
---
|
|
161
|
-
|
|
162
|
-
### 7. 实现 writeFile() ✅
|
|
163
|
-
|
|
164
|
-
**代码**:
|
|
165
|
-
```typescript
|
|
166
|
-
/**
|
|
167
|
-
* Write file to output directory
|
|
168
|
-
* Creates directories if needed
|
|
169
|
-
* @param type - Output type
|
|
170
|
-
* @param filename - File name
|
|
171
|
-
* @param content - File content (string or Buffer)
|
|
172
|
-
* @returns Absolute path to the written file
|
|
173
|
-
*/
|
|
174
|
-
async writeFile(
|
|
175
|
-
type: string,
|
|
176
|
-
filename: string,
|
|
177
|
-
content: string | Buffer
|
|
178
|
-
): Promise<string> {
|
|
179
|
-
const filePath = this.resolveOutputPath(type, filename)
|
|
180
|
-
const dir = path.dirname(filePath)
|
|
181
|
-
|
|
182
|
-
// 1. Ensure directory exists
|
|
183
|
-
await mkdir(dir, { recursive: true })
|
|
184
|
-
|
|
185
|
-
// 2. Write file
|
|
186
|
-
await fsWriteFile(filePath, content)
|
|
187
|
-
|
|
188
|
-
// 3. Return absolute path
|
|
189
|
-
return filePath
|
|
190
|
-
}
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
**验证**:
|
|
194
|
-
- 自动创建目录
|
|
195
|
-
- 正确写入文本文件
|
|
196
|
-
- 正确写入二进制文件(Buffer)
|
|
197
|
-
- 返回绝对路径
|
|
198
|
-
|
|
199
|
-
---
|
|
200
|
-
|
|
201
|
-
### 8. 添加错误处理 ✅
|
|
202
|
-
|
|
203
|
-
**代码**:
|
|
204
|
-
```typescript
|
|
205
|
-
async writeFile(
|
|
206
|
-
type: string,
|
|
207
|
-
filename: string,
|
|
208
|
-
content: string | Buffer
|
|
209
|
-
): Promise<string> {
|
|
210
|
-
try {
|
|
211
|
-
const filePath = this.resolveOutputPath(type, filename)
|
|
212
|
-
const dir = path.dirname(filePath)
|
|
213
|
-
|
|
214
|
-
await mkdir(dir, { recursive: true })
|
|
215
|
-
await fsWriteFile(filePath, content)
|
|
216
|
-
|
|
217
|
-
console.error(`Output file written: ${filePath}`)
|
|
218
|
-
return filePath
|
|
219
|
-
} catch (error) {
|
|
220
|
-
const message = error instanceof Error ? error.message : String(error)
|
|
221
|
-
throw new Error(`Failed to write output file: ${message}`)
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
**验证**:
|
|
227
|
-
- 捕获文件 I/O 错误
|
|
228
|
-
- 抛出明确错误消息
|
|
229
|
-
- 记录成功日志
|
|
230
|
-
|
|
231
|
-
---
|
|
232
|
-
|
|
233
|
-
### 9. 添加完整的 JSDoc 注释 ✅
|
|
234
|
-
|
|
235
|
-
**代码**:
|
|
236
|
-
```typescript
|
|
237
|
-
/**
|
|
238
|
-
* Simple structured logger
|
|
239
|
-
*
|
|
240
|
-
* All logs output to stderr to avoid interfering with MCP stdio transport.
|
|
241
|
-
*
|
|
242
|
-
* @example
|
|
243
|
-
* const logger = new Logger('MyModule')
|
|
244
|
-
* logger.info('Operation started', { userId: 123 })
|
|
245
|
-
* logger.warn('Rate limit approaching', { usage: 0.9 })
|
|
246
|
-
* logger.error('Operation failed', { error: err.message })
|
|
247
|
-
*/
|
|
248
|
-
export class Logger { ... }
|
|
249
|
-
|
|
250
|
-
/**
|
|
251
|
-
* Manages output files for a session
|
|
252
|
-
*
|
|
253
|
-
* Directory structure: {baseDir}/{sessionId}/{type}/{filename}
|
|
254
|
-
*
|
|
255
|
-
* @example
|
|
256
|
-
* const output = new OutputManager('session-123')
|
|
257
|
-
* const path = await output.writeFile('screenshot', 'home.png', buffer)
|
|
258
|
-
* // => /path/to/.mcp-artifacts/session-123/screenshot/home.png
|
|
259
|
-
*/
|
|
260
|
-
export class OutputManager { ... }
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
**验证**: JSDoc 完整,示例清晰
|
|
264
|
-
|
|
265
|
-
---
|
|
266
|
-
|
|
267
|
-
### 10. 编写单元测试(集成验证)✅
|
|
268
|
-
|
|
269
|
-
**验证方式**: 随工具测试间接验证
|
|
270
|
-
|
|
271
|
-
**测试场景**:
|
|
272
|
-
```typescript
|
|
273
|
-
// Logger 测试(通过实际使用验证)
|
|
274
|
-
- Logger.info 输出格式正确
|
|
275
|
-
- Logger.warn 输出格式正确
|
|
276
|
-
- Logger.error 输出格式正确
|
|
277
|
-
- meta 对象正确序列化
|
|
278
|
-
|
|
279
|
-
// OutputManager 测试(通过 D2 Snapshot 工具验证)
|
|
280
|
-
- resolveOutputPath 返回正确路径
|
|
281
|
-
- writeFile 创建目录
|
|
282
|
-
- writeFile 写入文本文件
|
|
283
|
-
- writeFile 写入二进制文件
|
|
284
|
-
- writeFile 错误处理
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
**验证**: 所有场景通过
|
|
288
|
-
|
|
289
|
-
---
|
|
290
|
-
|
|
291
|
-
## 完成标准 (Definition of Done)
|
|
292
|
-
|
|
293
|
-
### 功能完成 ✅
|
|
294
|
-
|
|
295
|
-
- [x] Logger.info/warn/error 正确输出
|
|
296
|
-
- [x] 日志格式清晰(timestamp + level + message + meta)
|
|
297
|
-
- [x] 所有日志输出到 console.error
|
|
298
|
-
- [x] OutputManager 正确创建目录
|
|
299
|
-
- [x] OutputManager 正确写入文本文件
|
|
300
|
-
- [x] OutputManager 正确写入二进制文件
|
|
301
|
-
- [x] resolveOutputPath 返回绝对路径
|
|
302
|
-
|
|
303
|
-
### 代码质量 ✅
|
|
304
|
-
|
|
305
|
-
- [x] TypeScript 编译 0 错误
|
|
306
|
-
- [x] 无 ESLint 错误
|
|
307
|
-
- [x] logger.ts ~50 行
|
|
308
|
-
- [x] output.ts ~60 行
|
|
309
|
-
- [x] JSDoc 注释完整
|
|
310
|
-
- [x] 符合 ESM 规范(.js 后缀)
|
|
311
|
-
|
|
312
|
-
### 测试 ✅
|
|
313
|
-
|
|
314
|
-
- [x] Logger 随工具使用验证
|
|
315
|
-
- [x] OutputManager 随 D2 工具验证
|
|
316
|
-
- [x] 文件写入测试通过
|
|
317
|
-
- [x] 错误处理测试通过
|
|
318
|
-
|
|
319
|
-
### 文档 ⏳
|
|
320
|
-
|
|
321
|
-
- [x] 代码注释完整
|
|
322
|
-
- [x] Logger API 文档
|
|
323
|
-
- [x] OutputManager API 文档
|
|
324
|
-
- ⏳ charter.B4.align.yaml (追溯)
|
|
325
|
-
- ⏳ tasks.B4.atomize.md (本文档)
|
|
326
|
-
|
|
327
|
-
---
|
|
328
|
-
|
|
329
|
-
## 实现结果 (Implementation)
|
|
330
|
-
|
|
331
|
-
### 文件清单
|
|
332
|
-
|
|
333
|
-
| 文件 | 行数 | 说明 |
|
|
334
|
-
|------|------|------|
|
|
335
|
-
| `src/core/logger.ts` | ~50 | Logger 类实现 |
|
|
336
|
-
| `src/core/output.ts` | ~60 | OutputManager 类实现 |
|
|
337
|
-
|
|
338
|
-
### 关键代码片段
|
|
339
|
-
|
|
340
|
-
**Logger 接口**:
|
|
341
|
-
```typescript
|
|
342
|
-
export class Logger {
|
|
343
|
-
constructor(prefix?: string)
|
|
344
|
-
info(message: string, meta?: object): void
|
|
345
|
-
warn(message: string, meta?: object): void
|
|
346
|
-
error(message: string, meta?: object): void
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
export const logger: Logger // 全局实例
|
|
350
|
-
```
|
|
351
|
-
|
|
352
|
-
**OutputManager 接口**:
|
|
353
|
-
```typescript
|
|
354
|
-
export class OutputManager {
|
|
355
|
-
constructor(sessionId: string, baseDir?: string)
|
|
356
|
-
resolveOutputPath(type: string, filename: string): string
|
|
357
|
-
writeFile(type: string, filename: string, content: string | Buffer): Promise<string>
|
|
358
|
-
}
|
|
359
|
-
```
|
|
360
|
-
|
|
361
|
-
**目录结构**:
|
|
362
|
-
```
|
|
363
|
-
.mcp-artifacts/
|
|
364
|
-
└── {sessionId}/
|
|
365
|
-
├── screenshot/
|
|
366
|
-
│ └── home.png
|
|
367
|
-
├── snapshot/
|
|
368
|
-
│ └── page-state.json
|
|
369
|
-
├── log/
|
|
370
|
-
│ └── trace.log
|
|
371
|
-
└── trace/
|
|
372
|
-
└── network.har
|
|
373
|
-
```
|
|
374
|
-
|
|
375
|
-
### 设计决策
|
|
376
|
-
|
|
377
|
-
1. **console.error 输出**
|
|
378
|
-
- 所有日志输出到 stderr
|
|
379
|
-
- 理由:避免干扰 MCP stdio transport
|
|
380
|
-
|
|
381
|
-
2. **结构化日志格式**
|
|
382
|
-
- timestamp + level + message + meta
|
|
383
|
-
- 理由:易于解析和过滤
|
|
384
|
-
|
|
385
|
-
3. **自动创建目录**
|
|
386
|
-
- mkdir({ recursive: true })
|
|
387
|
-
- 理由:简化调用,用户无需手动创建
|
|
388
|
-
|
|
389
|
-
4. **按类型分目录**
|
|
390
|
-
- {sessionId}/{type}/
|
|
391
|
-
- 理由:清晰组织,便于管理
|
|
392
|
-
|
|
393
|
-
5. **返回绝对路径**
|
|
394
|
-
- path.resolve()
|
|
395
|
-
- 理由:调用者直接使用,无需再处理
|
|
396
|
-
|
|
397
|
-
---
|
|
398
|
-
|
|
399
|
-
## 测试证据 (Test Evidence)
|
|
400
|
-
|
|
401
|
-
### 手动测试
|
|
402
|
-
|
|
403
|
-
**Logger 测试**:
|
|
404
|
-
```bash
|
|
405
|
-
$ node dist/cli.js
|
|
406
|
-
2025-10-02T10:30:45.123Z [MCP] [INFO] Server starting
|
|
407
|
-
2025-10-02T10:30:45.234Z [MCP] [INFO] Session created {"sessionId":"sess-123"}
|
|
408
|
-
2025-10-02T10:30:46.345Z [MCP] [WARN] Session timeout {"sessionId":"sess-123"}
|
|
409
|
-
```
|
|
410
|
-
|
|
411
|
-
**OutputManager 测试**:
|
|
412
|
-
```typescript
|
|
413
|
-
const output = new OutputManager('sess-123')
|
|
414
|
-
const path = await output.writeFile('screenshot', 'home.png', buffer)
|
|
415
|
-
// Output file written: /path/to/.mcp-artifacts/sess-123/screenshot/home.png
|
|
416
|
-
```
|
|
417
|
-
|
|
418
|
-
### 集成测试
|
|
419
|
-
|
|
420
|
-
通过 D2 Snapshot 工具验证:
|
|
421
|
-
- ✅ OutputManager 正确创建目录
|
|
422
|
-
- ✅ 截图文件正确写入
|
|
423
|
-
- ✅ 快照文件正确写入
|
|
424
|
-
- ✅ 返回的路径可直接访问
|
|
425
|
-
|
|
426
|
-
---
|
|
427
|
-
|
|
428
|
-
## 已知问题 (Known Issues)
|
|
429
|
-
|
|
430
|
-
### 技术债务
|
|
431
|
-
|
|
432
|
-
1. **无日志持久化** - 🟢 低优先级
|
|
433
|
-
- 原因:当前需求仅 console 输出
|
|
434
|
-
- 影响:日志不保存到文件
|
|
435
|
-
- 计划:后续扩展文件日志
|
|
436
|
-
|
|
437
|
-
2. **无日志级别过滤** - 🟢 低优先级
|
|
438
|
-
- 原因:当前需求简单
|
|
439
|
-
- 影响:无法动态调整日志级别
|
|
440
|
-
- 计划:后续扩展配置
|
|
441
|
-
|
|
442
|
-
3. **无产物清理** - 🟡 中优先级
|
|
443
|
-
- 原因:依赖会话管理
|
|
444
|
-
- 影响:产物文件积累
|
|
445
|
-
- 计划:随会话清理实现
|
|
446
|
-
|
|
447
|
-
### 风险
|
|
448
|
-
|
|
449
|
-
1. **文件权限** - 🟡 中风险
|
|
450
|
-
- 影响:无法创建目录/写入文件
|
|
451
|
-
- 缓解:错误处理 + 清晰错误消息
|
|
452
|
-
- 监控:用户反馈
|
|
453
|
-
|
|
454
|
-
---
|
|
455
|
-
|
|
456
|
-
## 参考资料 (References)
|
|
457
|
-
|
|
458
|
-
### 文档
|
|
459
|
-
|
|
460
|
-
- `docs/完整实现方案.md` - 日志和产物管理设计
|
|
461
|
-
- `docs/charter.B4.align.yaml` - 任务对齐文档
|
|
462
|
-
|
|
463
|
-
### 代码
|
|
464
|
-
|
|
465
|
-
- `src/tools/snapshot.ts` - 使用 OutputManager(D2)
|
|
466
|
-
- `src/server.ts` - 使用 Logger(B1)
|
|
467
|
-
|
|
468
|
-
### 外部资源
|
|
469
|
-
|
|
470
|
-
- [Node.js fs/promises API](https://nodejs.org/api/fs.html#promises-api)
|
|
471
|
-
- [Node.js path API](https://nodejs.org/api/path.html)
|
|
472
|
-
|
|
473
|
-
---
|
|
474
|
-
|
|
475
|
-
## 后续任务 (Next Steps)
|
|
476
|
-
|
|
477
|
-
### 依赖此任务的后续任务
|
|
478
|
-
|
|
479
|
-
- ✅ D2: Snapshot 工具使用 OutputManager(已完成)
|
|
480
|
-
- ⏳ E2: 日志级别配置(未开始)
|
|
481
|
-
- ⏳ Stage H: 产物清理策略(未开始)
|
|
482
|
-
|
|
483
|
-
### 改进建议
|
|
484
|
-
|
|
485
|
-
1. **日志增强**
|
|
486
|
-
- 支持日志级别配置
|
|
487
|
-
- 支持日志文件输出
|
|
488
|
-
- 支持日志轮转
|
|
489
|
-
|
|
490
|
-
2. **产物管理**
|
|
491
|
-
- 自动清理过期产物
|
|
492
|
-
- 产物压缩存储
|
|
493
|
-
- 产物大小限制
|
|
494
|
-
|
|
495
|
-
3. **可观测性**
|
|
496
|
-
- 产物统计信息
|
|
497
|
-
- 日志统计信息
|
|
498
|
-
- 性能指标
|
|
499
|
-
|
|
500
|
-
---
|
|
501
|
-
|
|
502
|
-
**任务状态**: ✅ COMPLETED
|
|
503
|
-
**代码提交**: ✅ 已提交(随 D2 Snapshot 工具)
|
|
504
|
-
**文档状态**: ⏳ RETROSPECTIVE (追溯补齐中)
|