@imgly/codesign-mcp 0.1.6 → 0.1.7
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 +5 -10
- package/dist/cli/http.d.ts.map +1 -1
- package/dist/cli/http.js +12 -2
- package/dist/cli/http.js.map +1 -1
- package/dist/cli/stdio.d.ts.map +1 -1
- package/dist/cli/stdio.js +103 -35
- package/dist/cli/stdio.js.map +1 -1
- package/dist/config.d.ts +11 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +12 -1
- package/dist/config.js.map +1 -1
- package/dist/diagnostics/events.d.ts +6 -0
- package/dist/diagnostics/events.d.ts.map +1 -1
- package/dist/diagnostics/events.js.map +1 -1
- package/dist/engine/cesdk-adapter.d.ts +5 -1
- package/dist/engine/cesdk-adapter.d.ts.map +1 -1
- package/dist/engine/cesdk-adapter.js +8 -1
- package/dist/engine/cesdk-adapter.js.map +1 -1
- package/dist/engine/engine-capacity.d.ts +16 -0
- package/dist/engine/engine-capacity.d.ts.map +1 -0
- package/dist/engine/engine-capacity.js +48 -0
- package/dist/engine/engine-capacity.js.map +1 -0
- package/dist/engine/engine-slots.d.ts +48 -0
- package/dist/engine/engine-slots.d.ts.map +1 -0
- package/dist/engine/engine-slots.js +182 -0
- package/dist/engine/engine-slots.js.map +1 -0
- package/dist/tools/engine.d.ts +13 -0
- package/dist/tools/engine.d.ts.map +1 -1
- package/dist/tools/engine.js +28 -0
- package/dist/tools/engine.js.map +1 -1
- package/package.json +2 -2
- package/dist/dashboard/router.d.ts +0 -3
- package/dist/dashboard/router.d.ts.map +0 -1
- package/dist/dashboard/router.js +0 -19
- package/dist/dashboard/router.js.map +0 -1
- package/dist/dashboard/spa-assets.generated.d.ts +0 -2
- package/dist/dashboard/spa-assets.generated.d.ts.map +0 -1
- package/dist/dashboard/spa-assets.generated.js +0 -220
- package/dist/dashboard/spa-assets.generated.js.map +0 -1
- package/dist/metrics/mount.d.ts +0 -11
- package/dist/metrics/mount.d.ts.map +0 -1
- package/dist/metrics/mount.js +0 -13
- package/dist/metrics/mount.js.map +0 -1
- package/dist/metrics/recorder.d.ts +0 -55
- package/dist/metrics/recorder.d.ts.map +0 -1
- package/dist/metrics/recorder.js +0 -97
- package/dist/metrics/recorder.js.map +0 -1
- package/dist/test/scripts/changelog-add.d.ts +0 -8
- package/dist/test/scripts/changelog-add.d.ts.map +0 -1
- package/dist/test/scripts/changelog-add.js +0 -50
- package/dist/test/scripts/changelog-add.js.map +0 -1
- package/dist/test/scripts/changelog-collate.d.ts +0 -38
- package/dist/test/scripts/changelog-collate.d.ts.map +0 -1
- package/dist/test/scripts/changelog-collate.js +0 -171
- package/dist/test/scripts/changelog-collate.js.map +0 -1
- package/dist/test/test/changelog.test.d.ts +0 -2
- package/dist/test/test/changelog.test.d.ts.map +0 -1
- package/dist/test/test/changelog.test.js +0 -293
- package/dist/test/test/changelog.test.js.map +0 -1
- package/dist/test/test/cli/dispatcher.test.d.ts +0 -2
- package/dist/test/test/cli/dispatcher.test.d.ts.map +0 -1
- package/dist/test/test/cli/dispatcher.test.js +0 -54
- package/dist/test/test/cli/dispatcher.test.js.map +0 -1
- package/dist/test/test/cli/redirect-console.test.d.ts +0 -2
- package/dist/test/test/cli/redirect-console.test.d.ts.map +0 -1
- package/dist/test/test/cli/redirect-console.test.js +0 -78
- package/dist/test/test/cli/redirect-console.test.js.map +0 -1
- package/dist/test/test/cli/resolve-license.test.d.ts +0 -2
- package/dist/test/test/cli/resolve-license.test.d.ts.map +0 -1
- package/dist/test/test/cli/resolve-license.test.js +0 -29
- package/dist/test/test/cli/resolve-license.test.js.map +0 -1
- package/dist/test/test/cli/stdio-diagnostics.test.d.ts +0 -2
- package/dist/test/test/cli/stdio-diagnostics.test.d.ts.map +0 -1
- package/dist/test/test/cli/stdio-diagnostics.test.js +0 -31
- package/dist/test/test/cli/stdio-diagnostics.test.js.map +0 -1
- package/dist/test/test/cli/stdio-license.test.d.ts +0 -2
- package/dist/test/test/cli/stdio-license.test.d.ts.map +0 -1
- package/dist/test/test/cli/stdio-license.test.js +0 -19
- package/dist/test/test/cli/stdio-license.test.js.map +0 -1
- package/dist/test/test/config.test.d.ts +0 -2
- package/dist/test/test/config.test.d.ts.map +0 -1
- package/dist/test/test/config.test.js +0 -95
- package/dist/test/test/config.test.js.map +0 -1
- package/dist/test/test/cross-ref.test.d.ts +0 -2
- package/dist/test/test/cross-ref.test.d.ts.map +0 -1
- package/dist/test/test/cross-ref.test.js +0 -39
- package/dist/test/test/cross-ref.test.js.map +0 -1
- package/dist/test/test/diagnostics/bundle.test.d.ts +0 -2
- package/dist/test/test/diagnostics/bundle.test.d.ts.map +0 -1
- package/dist/test/test/diagnostics/bundle.test.js +0 -53
- package/dist/test/test/diagnostics/bundle.test.js.map +0 -1
- package/dist/test/test/diagnostics/compose.test.d.ts +0 -2
- package/dist/test/test/diagnostics/compose.test.d.ts.map +0 -1
- package/dist/test/test/diagnostics/compose.test.js +0 -31
- package/dist/test/test/diagnostics/compose.test.js.map +0 -1
- package/dist/test/test/diagnostics/file-sink.test.d.ts +0 -2
- package/dist/test/test/diagnostics/file-sink.test.d.ts.map +0 -1
- package/dist/test/test/diagnostics/file-sink.test.js +0 -113
- package/dist/test/test/diagnostics/file-sink.test.js.map +0 -1
- package/dist/test/test/diagnostics/redact.test.d.ts +0 -2
- package/dist/test/test/diagnostics/redact.test.d.ts.map +0 -1
- package/dist/test/test/diagnostics/redact.test.js +0 -59
- package/dist/test/test/diagnostics/redact.test.js.map +0 -1
- package/dist/test/test/diagnostics/tool-call-adapter.test.d.ts +0 -2
- package/dist/test/test/diagnostics/tool-call-adapter.test.d.ts.map +0 -1
- package/dist/test/test/diagnostics/tool-call-adapter.test.js +0 -34
- package/dist/test/test/diagnostics/tool-call-adapter.test.js.map +0 -1
- package/dist/test/test/engine/asset-sources.test.d.ts +0 -2
- package/dist/test/test/engine/asset-sources.test.d.ts.map +0 -1
- package/dist/test/test/engine/asset-sources.test.js +0 -100
- package/dist/test/test/engine/asset-sources.test.js.map +0 -1
- package/dist/test/test/engine/cesdk-adapter.test.d.ts +0 -2
- package/dist/test/test/engine/cesdk-adapter.test.d.ts.map +0 -1
- package/dist/test/test/engine/cesdk-adapter.test.js +0 -32
- package/dist/test/test/engine/cesdk-adapter.test.js.map +0 -1
- package/dist/test/test/engine/mutex.test.d.ts +0 -2
- package/dist/test/test/engine/mutex.test.d.ts.map +0 -1
- package/dist/test/test/engine/mutex.test.js +0 -63
- package/dist/test/test/engine/mutex.test.js.map +0 -1
- package/dist/test/test/engine/session.test.d.ts +0 -2
- package/dist/test/test/engine/session.test.d.ts.map +0 -1
- package/dist/test/test/engine/session.test.js +0 -159
- package/dist/test/test/engine/session.test.js.map +0 -1
- package/dist/test/test/engine/unsplash-source.test.d.ts +0 -2
- package/dist/test/test/engine/unsplash-source.test.d.ts.map +0 -1
- package/dist/test/test/engine/unsplash-source.test.js +0 -129
- package/dist/test/test/engine/unsplash-source.test.js.map +0 -1
- package/dist/test/test/engine/uri-resolver.test.d.ts +0 -2
- package/dist/test/test/engine/uri-resolver.test.d.ts.map +0 -1
- package/dist/test/test/engine/uri-resolver.test.js +0 -38
- package/dist/test/test/engine/uri-resolver.test.js.map +0 -1
- package/dist/test/test/gateway/hosted-stub.test.d.ts +0 -2
- package/dist/test/test/gateway/hosted-stub.test.d.ts.map +0 -1
- package/dist/test/test/gateway/hosted-stub.test.js +0 -11
- package/dist/test/test/gateway/hosted-stub.test.js.map +0 -1
- package/dist/test/test/gateway/local.test.d.ts +0 -2
- package/dist/test/test/gateway/local.test.d.ts.map +0 -1
- package/dist/test/test/gateway/local.test.js +0 -29
- package/dist/test/test/gateway/local.test.js.map +0 -1
- package/dist/test/test/handbook-contract.test.d.ts +0 -2
- package/dist/test/test/handbook-contract.test.d.ts.map +0 -1
- package/dist/test/test/handbook-contract.test.js +0 -79
- package/dist/test/test/handbook-contract.test.js.map +0 -1
- package/dist/test/test/http/server.test.d.ts +0 -2
- package/dist/test/test/http/server.test.d.ts.map +0 -1
- package/dist/test/test/http/server.test.js +0 -338
- package/dist/test/test/http/server.test.js.map +0 -1
- package/dist/test/test/http/session-id-header.test.d.ts +0 -2
- package/dist/test/test/http/session-id-header.test.d.ts.map +0 -1
- package/dist/test/test/http/session-id-header.test.js +0 -76
- package/dist/test/test/http/session-id-header.test.js.map +0 -1
- package/dist/test/test/http/session-manager.test.d.ts +0 -2
- package/dist/test/test/http/session-manager.test.d.ts.map +0 -1
- package/dist/test/test/http/session-manager.test.js +0 -97
- package/dist/test/test/http/session-manager.test.js.map +0 -1
- package/dist/test/test/http/workspace-auth.test.d.ts +0 -2
- package/dist/test/test/http/workspace-auth.test.d.ts.map +0 -1
- package/dist/test/test/http/workspace-auth.test.js +0 -40
- package/dist/test/test/http/workspace-auth.test.js.map +0 -1
- package/dist/test/test/metrics/mount.test.d.ts +0 -2
- package/dist/test/test/metrics/mount.test.d.ts.map +0 -1
- package/dist/test/test/metrics/mount.test.js +0 -59
- package/dist/test/test/metrics/mount.test.js.map +0 -1
- package/dist/test/test/metrics/recorder.test.d.ts +0 -2
- package/dist/test/test/metrics/recorder.test.d.ts.map +0 -1
- package/dist/test/test/metrics/recorder.test.js +0 -118
- package/dist/test/test/metrics/recorder.test.js.map +0 -1
- package/dist/test/test/revisions/hash.test.d.ts +0 -2
- package/dist/test/test/revisions/hash.test.d.ts.map +0 -1
- package/dist/test/test/revisions/hash.test.js +0 -33
- package/dist/test/test/revisions/hash.test.js.map +0 -1
- package/dist/test/test/revisions/store.test.d.ts +0 -2
- package/dist/test/test/revisions/store.test.d.ts.map +0 -1
- package/dist/test/test/revisions/store.test.js +0 -315
- package/dist/test/test/revisions/store.test.js.map +0 -1
- package/dist/test/test/server.metrics.test.d.ts +0 -2
- package/dist/test/test/server.metrics.test.d.ts.map +0 -1
- package/dist/test/test/server.metrics.test.js +0 -87
- package/dist/test/test/server.metrics.test.js.map +0 -1
- package/dist/test/test/server.test.d.ts +0 -2
- package/dist/test/test/server.test.d.ts.map +0 -1
- package/dist/test/test/server.test.js +0 -146
- package/dist/test/test/server.test.js.map +0 -1
- package/dist/test/test/skill-tools.test.d.ts +0 -2
- package/dist/test/test/skill-tools.test.d.ts.map +0 -1
- package/dist/test/test/skill-tools.test.js +0 -84
- package/dist/test/test/skill-tools.test.js.map +0 -1
- package/dist/test/test/smoke.test.d.ts +0 -2
- package/dist/test/test/smoke.test.d.ts.map +0 -1
- package/dist/test/test/smoke.test.js +0 -8
- package/dist/test/test/smoke.test.js.map +0 -1
- package/dist/test/test/tools/asset-generate.test.d.ts +0 -2
- package/dist/test/test/tools/asset-generate.test.d.ts.map +0 -1
- package/dist/test/test/tools/asset-generate.test.js +0 -66
- package/dist/test/test/tools/asset-generate.test.js.map +0 -1
- package/dist/test/test/tools/asset-search.test.d.ts +0 -2
- package/dist/test/test/tools/asset-search.test.d.ts.map +0 -1
- package/dist/test/test/tools/asset-search.test.js +0 -121
- package/dist/test/test/tools/asset-search.test.js.map +0 -1
- package/dist/test/test/tools/edit-harness.d.ts +0 -14
- package/dist/test/test/tools/edit-harness.d.ts.map +0 -1
- package/dist/test/test/tools/edit-harness.js +0 -30
- package/dist/test/test/tools/edit-harness.js.map +0 -1
- package/dist/test/test/tools/edit.telemetry.test.d.ts +0 -2
- package/dist/test/test/tools/edit.telemetry.test.d.ts.map +0 -1
- package/dist/test/test/tools/edit.telemetry.test.js +0 -46
- package/dist/test/test/tools/edit.telemetry.test.js.map +0 -1
- package/dist/test/test/tools/edit.test.d.ts +0 -2
- package/dist/test/test/tools/edit.test.d.ts.map +0 -1
- package/dist/test/test/tools/edit.test.js +0 -267
- package/dist/test/test/tools/edit.test.js.map +0 -1
- package/dist/test/test/tools/export-harness.d.ts +0 -13
- package/dist/test/test/tools/export-harness.d.ts.map +0 -1
- package/dist/test/test/tools/export-harness.js +0 -27
- package/dist/test/test/tools/export-harness.js.map +0 -1
- package/dist/test/test/tools/export.telemetry.test.d.ts +0 -2
- package/dist/test/test/tools/export.telemetry.test.d.ts.map +0 -1
- package/dist/test/test/tools/export.telemetry.test.js +0 -65
- package/dist/test/test/tools/export.telemetry.test.js.map +0 -1
- package/dist/test/test/tools/export.test.d.ts +0 -2
- package/dist/test/test/tools/export.test.d.ts.map +0 -1
- package/dist/test/test/tools/export.test.js +0 -174
- package/dist/test/test/tools/export.test.js.map +0 -1
- package/dist/test/test/tools/history.test.d.ts +0 -2
- package/dist/test/test/tools/history.test.d.ts.map +0 -1
- package/dist/test/test/tools/history.test.js +0 -29
- package/dist/test/test/tools/history.test.js.map +0 -1
- package/dist/test/test/tools/import.test.d.ts +0 -2
- package/dist/test/test/tools/import.test.d.ts.map +0 -1
- package/dist/test/test/tools/import.test.js +0 -122
- package/dist/test/test/tools/import.test.js.map +0 -1
- package/dist/test/test/tools/index.test.d.ts +0 -2
- package/dist/test/test/tools/index.test.d.ts.map +0 -1
- package/dist/test/test/tools/index.test.js +0 -117
- package/dist/test/test/tools/index.test.js.map +0 -1
- package/dist/test/test/tools/inspect.test.d.ts +0 -2
- package/dist/test/test/tools/inspect.test.d.ts.map +0 -1
- package/dist/test/test/tools/inspect.test.js +0 -62
- package/dist/test/test/tools/inspect.test.js.map +0 -1
- package/dist/test/test/tools/list.test.d.ts +0 -2
- package/dist/test/test/tools/list.test.d.ts.map +0 -1
- package/dist/test/test/tools/list.test.js +0 -23
- package/dist/test/test/tools/list.test.js.map +0 -1
- package/dist/test/test/tools/load.integration.test.d.ts +0 -2
- package/dist/test/test/tools/load.integration.test.d.ts.map +0 -1
- package/dist/test/test/tools/load.integration.test.js +0 -165
- package/dist/test/test/tools/load.integration.test.js.map +0 -1
- package/dist/test/test/tools/load.test.d.ts +0 -2
- package/dist/test/test/tools/load.test.d.ts.map +0 -1
- package/dist/test/test/tools/load.test.js +0 -387
- package/dist/test/test/tools/load.test.js.map +0 -1
- package/dist/test/test/tools/metrics.test.d.ts +0 -2
- package/dist/test/test/tools/metrics.test.d.ts.map +0 -1
- package/dist/test/test/tools/metrics.test.js +0 -29
- package/dist/test/test/tools/metrics.test.js.map +0 -1
- package/dist/test/test/tools/open-editor.test.d.ts +0 -2
- package/dist/test/test/tools/open-editor.test.d.ts.map +0 -1
- package/dist/test/test/tools/open-editor.test.js +0 -53
- package/dist/test/test/tools/open-editor.test.js.map +0 -1
- package/dist/test/test/tools/preview-harness.d.ts +0 -9
- package/dist/test/test/tools/preview-harness.d.ts.map +0 -1
- package/dist/test/test/tools/preview-harness.js +0 -23
- package/dist/test/test/tools/preview-harness.js.map +0 -1
- package/dist/test/test/tools/preview.telemetry.test.d.ts +0 -2
- package/dist/test/test/tools/preview.telemetry.test.d.ts.map +0 -1
- package/dist/test/test/tools/preview.telemetry.test.js +0 -36
- package/dist/test/test/tools/preview.telemetry.test.js.map +0 -1
- package/dist/test/test/tools/preview.test.d.ts +0 -2
- package/dist/test/test/tools/preview.test.d.ts.map +0 -1
- package/dist/test/test/tools/preview.test.js +0 -75
- package/dist/test/test/tools/preview.test.js.map +0 -1
- package/dist/test/test/tools/rename.test.d.ts +0 -2
- package/dist/test/test/tools/rename.test.d.ts.map +0 -1
- package/dist/test/test/tools/rename.test.js +0 -16
- package/dist/test/test/tools/rename.test.js.map +0 -1
- package/dist/test/test/tools/save.test.d.ts +0 -2
- package/dist/test/test/tools/save.test.d.ts.map +0 -1
- package/dist/test/test/tools/save.test.js +0 -137
- package/dist/test/test/tools/save.test.js.map +0 -1
- package/dist/test/test/tools/schema-best-practices.d.ts +0 -13
- package/dist/test/test/tools/schema-best-practices.d.ts.map +0 -1
- package/dist/test/test/tools/schema-best-practices.js +0 -169
- package/dist/test/test/tools/schema-best-practices.js.map +0 -1
- package/dist/test/test/tools/schema-best-practices.test.d.ts +0 -3
- package/dist/test/test/tools/schema-best-practices.test.d.ts.map +0 -1
- package/dist/test/test/tools/schema-best-practices.test.js +0 -194
- package/dist/test/test/tools/schema-best-practices.test.js.map +0 -1
- package/dist/test/test/tools/spans.test.d.ts +0 -2
- package/dist/test/test/tools/spans.test.d.ts.map +0 -1
- package/dist/test/test/tools/spans.test.js +0 -84
- package/dist/test/test/tools/spans.test.js.map +0 -1
- package/dist/test/test/viewer/broadcaster.test.d.ts +0 -2
- package/dist/test/test/viewer/broadcaster.test.d.ts.map +0 -1
- package/dist/test/test/viewer/broadcaster.test.js +0 -53
- package/dist/test/test/viewer/broadcaster.test.js.map +0 -1
- package/dist/test/test/viewer/cesdk-cdn.test.d.ts +0 -2
- package/dist/test/test/viewer/cesdk-cdn.test.d.ts.map +0 -1
- package/dist/test/test/viewer/cesdk-cdn.test.js +0 -19
- package/dist/test/test/viewer/cesdk-cdn.test.js.map +0 -1
- package/dist/test/test/viewer/config-route.test.d.ts +0 -2
- package/dist/test/test/viewer/config-route.test.d.ts.map +0 -1
- package/dist/test/test/viewer/config-route.test.js +0 -28
- package/dist/test/test/viewer/config-route.test.js.map +0 -1
- package/dist/test/test/viewer/resource-route.test.d.ts +0 -2
- package/dist/test/test/viewer/resource-route.test.d.ts.map +0 -1
- package/dist/test/test/viewer/resource-route.test.js +0 -70
- package/dist/test/test/viewer/resource-route.test.js.map +0 -1
- package/dist/test/test/viewer/router.test.d.ts +0 -2
- package/dist/test/test/viewer/router.test.d.ts.map +0 -1
- package/dist/test/test/viewer/router.test.js +0 -227
- package/dist/test/test/viewer/router.test.js.map +0 -1
- package/dist/test/test/viewer/session-mount.test.d.ts +0 -2
- package/dist/test/test/viewer/session-mount.test.d.ts.map +0 -1
- package/dist/test/test/viewer/session-mount.test.js +0 -52
- package/dist/test/test/viewer/session-mount.test.js.map +0 -1
- package/dist/test/test/viewer/spa-version.test.d.ts +0 -2
- package/dist/test/test/viewer/spa-version.test.d.ts.map +0 -1
- package/dist/test/test/viewer/spa-version.test.js +0 -14
- package/dist/test/test/viewer/spa-version.test.js.map +0 -1
- package/dist/test/test/viewer/url-builder.test.d.ts +0 -2
- package/dist/test/test/viewer/url-builder.test.d.ts.map +0 -1
- package/dist/test/test/viewer/url-builder.test.js +0 -98
- package/dist/test/test/viewer/url-builder.test.js.map +0 -1
- package/dist/test/test/workspace/content-hash.test.d.ts +0 -2
- package/dist/test/test/workspace/content-hash.test.d.ts.map +0 -1
- package/dist/test/test/workspace/content-hash.test.js +0 -17
- package/dist/test/test/workspace/content-hash.test.js.map +0 -1
- package/dist/test/test/workspace/hosted-stub.test.d.ts +0 -2
- package/dist/test/test/workspace/hosted-stub.test.d.ts.map +0 -1
- package/dist/test/test/workspace/hosted-stub.test.js +0 -30
- package/dist/test/test/workspace/hosted-stub.test.js.map +0 -1
- package/dist/test/test/workspace/in-memory.test.d.ts +0 -2
- package/dist/test/test/workspace/in-memory.test.d.ts.map +0 -1
- package/dist/test/test/workspace/in-memory.test.js +0 -4
- package/dist/test/test/workspace/in-memory.test.js.map +0 -1
- package/dist/test/test/workspace/node-fs.test.d.ts +0 -2
- package/dist/test/test/workspace/node-fs.test.d.ts.map +0 -1
- package/dist/test/test/workspace/node-fs.test.js +0 -20
- package/dist/test/test/workspace/node-fs.test.js.map +0 -1
- package/dist/test/test/workspace/s3.test.d.ts +0 -2
- package/dist/test/test/workspace/s3.test.d.ts.map +0 -1
- package/dist/test/test/workspace/s3.test.js +0 -153
- package/dist/test/test/workspace/s3.test.js.map +0 -1
- package/dist/test/test/workspace/scoped.test.d.ts +0 -2
- package/dist/test/test/workspace/scoped.test.d.ts.map +0 -1
- package/dist/test/test/workspace/scoped.test.js +0 -59
- package/dist/test/test/workspace/scoped.test.js.map +0 -1
- package/dist/test/test/workspace/shared-contract.d.ts +0 -3
- package/dist/test/test/workspace/shared-contract.d.ts.map +0 -1
- package/dist/test/test/workspace/shared-contract.js +0 -92
- package/dist/test/test/workspace/shared-contract.js.map +0 -1
- package/dist/test/tsconfig.test.tsbuildinfo +0 -1
- package/dist/test/vitest.config.d.ts +0 -3
- package/dist/test/vitest.config.d.ts.map +0 -1
- package/dist/test/vitest.config.js +0 -8
- package/dist/test/vitest.config.js.map +0 -1
- package/dist/tools/metrics.d.ts +0 -11
- package/dist/tools/metrics.d.ts.map +0 -1
- package/dist/tools/metrics.js +0 -28
- package/dist/tools/metrics.js.map +0 -1
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
// AUTO-GENERATED by scripts/generate-spa-assets.mjs. Do not edit by hand.
|
|
2
|
-
export const SPA_ASSETS = {
|
|
3
|
-
"index.html": `<!doctype html>
|
|
4
|
-
<html lang="en">
|
|
5
|
-
<head>
|
|
6
|
-
<meta charset="utf-8" />
|
|
7
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
8
|
-
<title>codesign-mcp — metrics</title>
|
|
9
|
-
<style>
|
|
10
|
-
:root {
|
|
11
|
-
color-scheme: light dark;
|
|
12
|
-
}
|
|
13
|
-
body {
|
|
14
|
-
font:
|
|
15
|
-
14px/1.5 system-ui,
|
|
16
|
-
sans-serif;
|
|
17
|
-
margin: 0;
|
|
18
|
-
padding: 1.5rem;
|
|
19
|
-
}
|
|
20
|
-
h1 {
|
|
21
|
-
font-size: 1.1rem;
|
|
22
|
-
margin: 0 0 1rem;
|
|
23
|
-
}
|
|
24
|
-
h2 {
|
|
25
|
-
font-size: 0.9rem;
|
|
26
|
-
margin: 0 0 0.5rem;
|
|
27
|
-
}
|
|
28
|
-
.cards {
|
|
29
|
-
display: flex;
|
|
30
|
-
flex-wrap: wrap;
|
|
31
|
-
gap: 1rem;
|
|
32
|
-
margin-bottom: 1.5rem;
|
|
33
|
-
}
|
|
34
|
-
.card {
|
|
35
|
-
border: 1px solid #8884;
|
|
36
|
-
border-radius: 8px;
|
|
37
|
-
padding: 0.75rem 1rem;
|
|
38
|
-
min-width: 9rem;
|
|
39
|
-
}
|
|
40
|
-
.card .label {
|
|
41
|
-
font-size: 0.75rem;
|
|
42
|
-
opacity: 0.7;
|
|
43
|
-
text-transform: uppercase;
|
|
44
|
-
letter-spacing: 0.04em;
|
|
45
|
-
}
|
|
46
|
-
.card .value {
|
|
47
|
-
font-size: 1.3rem;
|
|
48
|
-
font-variant-numeric: tabular-nums;
|
|
49
|
-
}
|
|
50
|
-
table {
|
|
51
|
-
border-collapse: collapse;
|
|
52
|
-
width: 100%;
|
|
53
|
-
margin-bottom: 1.5rem;
|
|
54
|
-
}
|
|
55
|
-
th,
|
|
56
|
-
td {
|
|
57
|
-
text-align: right;
|
|
58
|
-
padding: 0.3rem 0.6rem;
|
|
59
|
-
border-bottom: 1px solid #8883;
|
|
60
|
-
font-variant-numeric: tabular-nums;
|
|
61
|
-
}
|
|
62
|
-
th:first-child,
|
|
63
|
-
td:first-child {
|
|
64
|
-
text-align: left;
|
|
65
|
-
}
|
|
66
|
-
.recent {
|
|
67
|
-
list-style: none;
|
|
68
|
-
padding: 0;
|
|
69
|
-
margin: 0;
|
|
70
|
-
max-height: 16rem;
|
|
71
|
-
overflow: auto;
|
|
72
|
-
font-variant-numeric: tabular-nums;
|
|
73
|
-
}
|
|
74
|
-
.recent li {
|
|
75
|
-
display: flex;
|
|
76
|
-
gap: 0.75rem;
|
|
77
|
-
padding: 0.15rem 0;
|
|
78
|
-
border-bottom: 1px solid #8882;
|
|
79
|
-
}
|
|
80
|
-
.err {
|
|
81
|
-
color: #c0392b;
|
|
82
|
-
}
|
|
83
|
-
.muted {
|
|
84
|
-
opacity: 0.6;
|
|
85
|
-
}
|
|
86
|
-
#status {
|
|
87
|
-
font-size: 0.8rem;
|
|
88
|
-
opacity: 0.7;
|
|
89
|
-
margin-left: 0.5rem;
|
|
90
|
-
}
|
|
91
|
-
</style>
|
|
92
|
-
</head>
|
|
93
|
-
<body>
|
|
94
|
-
<h1>codesign-mcp metrics <span id="status">connecting…</span></h1>
|
|
95
|
-
<div class="cards" id="cards"></div>
|
|
96
|
-
<h2>Per-tool</h2>
|
|
97
|
-
<table>
|
|
98
|
-
<thead>
|
|
99
|
-
<tr>
|
|
100
|
-
<th>tool</th>
|
|
101
|
-
<th>calls</th>
|
|
102
|
-
<th>err%</th>
|
|
103
|
-
<th>p50 ms</th>
|
|
104
|
-
<th>p95 ms</th>
|
|
105
|
-
<th>max ms</th>
|
|
106
|
-
</tr>
|
|
107
|
-
</thead>
|
|
108
|
-
<tbody id="tools"></tbody>
|
|
109
|
-
</table>
|
|
110
|
-
<h2>Recent calls</h2>
|
|
111
|
-
<ul class="recent" id="recent"></ul>
|
|
112
|
-
<script>
|
|
113
|
-
const METRICS_URL = '{{METRICS_URL}}';
|
|
114
|
-
const fmtBytes = (n) => {
|
|
115
|
-
if (n == null) return '—';
|
|
116
|
-
const u = ['B', 'KB', 'MB', 'GB'];
|
|
117
|
-
let i = 0;
|
|
118
|
-
let v = n;
|
|
119
|
-
while (v >= 1024 && i < u.length - 1) {
|
|
120
|
-
v /= 1024;
|
|
121
|
-
i++;
|
|
122
|
-
}
|
|
123
|
-
return v.toFixed(1) + ' ' + u[i];
|
|
124
|
-
};
|
|
125
|
-
const fmtMs = (n) => (n == null ? '—' : Math.round(n).toString());
|
|
126
|
-
const esc = (s) =>
|
|
127
|
-
String(s)
|
|
128
|
-
.replace(/&/g, '&')
|
|
129
|
-
.replace(/</g, '<')
|
|
130
|
-
.replace(/>/g, '>');
|
|
131
|
-
const card = (label, value) =>
|
|
132
|
-
'<div class="card"><div class="label">' +
|
|
133
|
-
label +
|
|
134
|
-
'</div><div class="value">' +
|
|
135
|
-
value +
|
|
136
|
-
'</div></div>';
|
|
137
|
-
|
|
138
|
-
async function tick() {
|
|
139
|
-
let data;
|
|
140
|
-
try {
|
|
141
|
-
const r = await fetch(METRICS_URL, { cache: 'no-store' });
|
|
142
|
-
if (!r.ok) throw new Error('HTTP ' + r.status);
|
|
143
|
-
data = await r.json();
|
|
144
|
-
} catch (e) {
|
|
145
|
-
document.getElementById('status').textContent =
|
|
146
|
-
'offline (' + e.message + ')';
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
document.getElementById('status').textContent =
|
|
150
|
-
'updated ' + new Date().toLocaleTimeString();
|
|
151
|
-
|
|
152
|
-
const mem = data.memory || {};
|
|
153
|
-
document.getElementById('cards').innerHTML = [
|
|
154
|
-
card(
|
|
155
|
-
'sessions',
|
|
156
|
-
(data.activeSessions ?? 0) + ' / ' + (data.maxSessions ?? '?')
|
|
157
|
-
),
|
|
158
|
-
card('uptime', Math.round((data.uptimeMs ?? 0) / 1000) + ' s'),
|
|
159
|
-
card('rss', fmtBytes(mem.rss)),
|
|
160
|
-
card('heap used', fmtBytes(mem.heapUsed)),
|
|
161
|
-
card('external', fmtBytes(mem.external)),
|
|
162
|
-
card('arrayBuffers', fmtBytes(mem.arrayBuffers))
|
|
163
|
-
].join('');
|
|
164
|
-
|
|
165
|
-
const tools = (data.tools || [])
|
|
166
|
-
.slice()
|
|
167
|
-
.sort((a, b) => b.count - a.count);
|
|
168
|
-
document.getElementById('tools').innerHTML =
|
|
169
|
-
tools
|
|
170
|
-
.map((t) => {
|
|
171
|
-
const errPct = t.count
|
|
172
|
-
? ((t.errorCount / t.count) * 100).toFixed(0)
|
|
173
|
-
: '0';
|
|
174
|
-
return (
|
|
175
|
-
'<tr><td>' +
|
|
176
|
-
esc(t.tool) +
|
|
177
|
-
'</td><td>' +
|
|
178
|
-
t.count +
|
|
179
|
-
'</td><td>' +
|
|
180
|
-
errPct +
|
|
181
|
-
'</td><td>' +
|
|
182
|
-
fmtMs(t.p50) +
|
|
183
|
-
'</td><td>' +
|
|
184
|
-
fmtMs(t.p95) +
|
|
185
|
-
'</td><td>' +
|
|
186
|
-
fmtMs(t.max) +
|
|
187
|
-
'</td></tr>'
|
|
188
|
-
);
|
|
189
|
-
})
|
|
190
|
-
.join('') ||
|
|
191
|
-
'<tr><td colspan="6" class="muted">no calls yet</td></tr>';
|
|
192
|
-
|
|
193
|
-
const recent = (data.recent || []).slice().reverse();
|
|
194
|
-
document.getElementById('recent').innerHTML =
|
|
195
|
-
recent
|
|
196
|
-
.map((r) => {
|
|
197
|
-
const t = new Date(r.ts).toLocaleTimeString();
|
|
198
|
-
const mark = r.ok ? '✓' : '<span class="err">✗</span>';
|
|
199
|
-
return (
|
|
200
|
-
'<li><span>' +
|
|
201
|
-
mark +
|
|
202
|
-
'</span><span>' +
|
|
203
|
-
esc(r.tool) +
|
|
204
|
-
'</span><span>' +
|
|
205
|
-
fmtMs(r.durationMs) +
|
|
206
|
-
' ms</span><span class="muted">' +
|
|
207
|
-
t +
|
|
208
|
-
'</span></li>'
|
|
209
|
-
);
|
|
210
|
-
})
|
|
211
|
-
.join('') || '<li class="muted">no calls yet</li>';
|
|
212
|
-
}
|
|
213
|
-
tick();
|
|
214
|
-
setInterval(tick, 3000);
|
|
215
|
-
</script>
|
|
216
|
-
</body>
|
|
217
|
-
</html>
|
|
218
|
-
`,
|
|
219
|
-
};
|
|
220
|
-
//# sourceMappingURL=spa-assets.generated.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spa-assets.generated.js","sourceRoot":"","sources":["../../src/dashboard/spa-assets.generated.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,MAAM,CAAC,MAAM,UAAU,GAA2B;IACjD,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuNd;CACA,CAAC","sourcesContent":["// AUTO-GENERATED by scripts/generate-spa-assets.mjs. Do not edit by hand.\nexport const SPA_ASSETS: Record<string, string> = {\n\t\"index.html\": `<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <title>codesign-mcp — metrics</title>\n <style>\n :root {\n color-scheme: light dark;\n }\n body {\n font:\n 14px/1.5 system-ui,\n sans-serif;\n margin: 0;\n padding: 1.5rem;\n }\n h1 {\n font-size: 1.1rem;\n margin: 0 0 1rem;\n }\n h2 {\n font-size: 0.9rem;\n margin: 0 0 0.5rem;\n }\n .cards {\n display: flex;\n flex-wrap: wrap;\n gap: 1rem;\n margin-bottom: 1.5rem;\n }\n .card {\n border: 1px solid #8884;\n border-radius: 8px;\n padding: 0.75rem 1rem;\n min-width: 9rem;\n }\n .card .label {\n font-size: 0.75rem;\n opacity: 0.7;\n text-transform: uppercase;\n letter-spacing: 0.04em;\n }\n .card .value {\n font-size: 1.3rem;\n font-variant-numeric: tabular-nums;\n }\n table {\n border-collapse: collapse;\n width: 100%;\n margin-bottom: 1.5rem;\n }\n th,\n td {\n text-align: right;\n padding: 0.3rem 0.6rem;\n border-bottom: 1px solid #8883;\n font-variant-numeric: tabular-nums;\n }\n th:first-child,\n td:first-child {\n text-align: left;\n }\n .recent {\n list-style: none;\n padding: 0;\n margin: 0;\n max-height: 16rem;\n overflow: auto;\n font-variant-numeric: tabular-nums;\n }\n .recent li {\n display: flex;\n gap: 0.75rem;\n padding: 0.15rem 0;\n border-bottom: 1px solid #8882;\n }\n .err {\n color: #c0392b;\n }\n .muted {\n opacity: 0.6;\n }\n #status {\n font-size: 0.8rem;\n opacity: 0.7;\n margin-left: 0.5rem;\n }\n </style>\n </head>\n <body>\n <h1>codesign-mcp metrics <span id=\"status\">connecting…</span></h1>\n <div class=\"cards\" id=\"cards\"></div>\n <h2>Per-tool</h2>\n <table>\n <thead>\n <tr>\n <th>tool</th>\n <th>calls</th>\n <th>err%</th>\n <th>p50 ms</th>\n <th>p95 ms</th>\n <th>max ms</th>\n </tr>\n </thead>\n <tbody id=\"tools\"></tbody>\n </table>\n <h2>Recent calls</h2>\n <ul class=\"recent\" id=\"recent\"></ul>\n <script>\n const METRICS_URL = '{{METRICS_URL}}';\n const fmtBytes = (n) => {\n if (n == null) return '—';\n const u = ['B', 'KB', 'MB', 'GB'];\n let i = 0;\n let v = n;\n while (v >= 1024 && i < u.length - 1) {\n v /= 1024;\n i++;\n }\n return v.toFixed(1) + ' ' + u[i];\n };\n const fmtMs = (n) => (n == null ? '—' : Math.round(n).toString());\n const esc = (s) =>\n String(s)\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>');\n const card = (label, value) =>\n '<div class=\"card\"><div class=\"label\">' +\n label +\n '</div><div class=\"value\">' +\n value +\n '</div></div>';\n\n async function tick() {\n let data;\n try {\n const r = await fetch(METRICS_URL, { cache: 'no-store' });\n if (!r.ok) throw new Error('HTTP ' + r.status);\n data = await r.json();\n } catch (e) {\n document.getElementById('status').textContent =\n 'offline (' + e.message + ')';\n return;\n }\n document.getElementById('status').textContent =\n 'updated ' + new Date().toLocaleTimeString();\n\n const mem = data.memory || {};\n document.getElementById('cards').innerHTML = [\n card(\n 'sessions',\n (data.activeSessions ?? 0) + ' / ' + (data.maxSessions ?? '?')\n ),\n card('uptime', Math.round((data.uptimeMs ?? 0) / 1000) + ' s'),\n card('rss', fmtBytes(mem.rss)),\n card('heap used', fmtBytes(mem.heapUsed)),\n card('external', fmtBytes(mem.external)),\n card('arrayBuffers', fmtBytes(mem.arrayBuffers))\n ].join('');\n\n const tools = (data.tools || [])\n .slice()\n .sort((a, b) => b.count - a.count);\n document.getElementById('tools').innerHTML =\n tools\n .map((t) => {\n const errPct = t.count\n ? ((t.errorCount / t.count) * 100).toFixed(0)\n : '0';\n return (\n '<tr><td>' +\n esc(t.tool) +\n '</td><td>' +\n t.count +\n '</td><td>' +\n errPct +\n '</td><td>' +\n fmtMs(t.p50) +\n '</td><td>' +\n fmtMs(t.p95) +\n '</td><td>' +\n fmtMs(t.max) +\n '</td></tr>'\n );\n })\n .join('') ||\n '<tr><td colspan=\"6\" class=\"muted\">no calls yet</td></tr>';\n\n const recent = (data.recent || []).slice().reverse();\n document.getElementById('recent').innerHTML =\n recent\n .map((r) => {\n const t = new Date(r.ts).toLocaleTimeString();\n const mark = r.ok ? '✓' : '<span class=\"err\">✗</span>';\n return (\n '<li><span>' +\n mark +\n '</span><span>' +\n esc(r.tool) +\n '</span><span>' +\n fmtMs(r.durationMs) +\n ' ms</span><span class=\"muted\">' +\n t +\n '</span></li>'\n );\n })\n .join('') || '<li class=\"muted\">no calls yet</li>';\n }\n tick();\n setInterval(tick, 3000);\n </script>\n </body>\n</html>\n`,\n};\n"]}
|
package/dist/metrics/mount.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Express } from 'express';
|
|
2
|
-
import type { MetricsRecorder } from './recorder.js';
|
|
3
|
-
export interface MountMetricsOptions {
|
|
4
|
-
recorder: MetricsRecorder;
|
|
5
|
-
/** The session/RAM cap (ServerConfig.maxEngines) — the gauge denominator. */
|
|
6
|
-
maxSessions: number;
|
|
7
|
-
/** Live active-session count, read at request time. */
|
|
8
|
-
activeSessions: () => number;
|
|
9
|
-
}
|
|
10
|
-
export declare function mountMetricsEndpoints(app: Express, opts: MountMetricsOptions): void;
|
|
11
|
-
//# sourceMappingURL=mount.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../src/metrics/mount.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,eAAe,CAAC;IAC1B,6EAA6E;IAC7E,WAAW,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,cAAc,EAAE,MAAM,MAAM,CAAC;CAC9B;AAED,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE,mBAAmB,GACxB,IAAI,CAUN"}
|
package/dist/metrics/mount.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createDashboardRouter } from '../dashboard/router.js';
|
|
2
|
-
export function mountMetricsEndpoints(app, opts) {
|
|
3
|
-
app.get('/metrics', (_req, res) => {
|
|
4
|
-
res.json({
|
|
5
|
-
...opts.recorder.snapshot(),
|
|
6
|
-
activeSessions: opts.activeSessions(),
|
|
7
|
-
maxSessions: opts.maxSessions,
|
|
8
|
-
uptimeMs: Math.round(process.uptime() * 1000)
|
|
9
|
-
});
|
|
10
|
-
});
|
|
11
|
-
app.use('/dashboard', createDashboardRouter());
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=mount.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mount.js","sourceRoot":"","sources":["../../src/metrics/mount.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAW/D,MAAM,UAAU,qBAAqB,CACnC,GAAY,EACZ,IAAyB;IAEzB,GAAG,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;QAChC,GAAG,CAAC,IAAI,CAAC;YACP,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE;YAC3B,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE;YACrC,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC;SAC9C,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,GAAG,CAAC,GAAG,CAAC,YAAY,EAAE,qBAAqB,EAAE,CAAC,CAAC;AACjD,CAAC","sourcesContent":["// packages/codesign-mcp/src/metrics/mount.ts\n//\n// Mounts the metrics surface — GET /metrics (JSON) + the /dashboard SPA — onto\n// an Express app. Factored out of the HTTP composition root so the route and\n// its merged-snapshot shape are unit-testable without booting a real engine.\n// The route reads server-level facts (active sessions, uptime) LIVE at request\n// time; the recorder owns only the per-tool/memory state.\nimport type { Express } from 'express';\nimport { createDashboardRouter } from '../dashboard/router.js';\nimport type { MetricsRecorder } from './recorder.js';\n\nexport interface MountMetricsOptions {\n recorder: MetricsRecorder;\n /** The session/RAM cap (ServerConfig.maxEngines) — the gauge denominator. */\n maxSessions: number;\n /** Live active-session count, read at request time. */\n activeSessions: () => number;\n}\n\nexport function mountMetricsEndpoints(\n app: Express,\n opts: MountMetricsOptions\n): void {\n app.get('/metrics', (_req, res) => {\n res.json({\n ...opts.recorder.snapshot(),\n activeSessions: opts.activeSessions(),\n maxSessions: opts.maxSessions,\n uptimeMs: Math.round(process.uptime() * 1000)\n });\n });\n app.use('/dashboard', createDashboardRouter());\n}\n"]}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
export interface MetricsRecorderOptions {
|
|
2
|
-
/** Max tool-call records kept in the recent-calls ring. Default 100. */
|
|
3
|
-
recentLimit?: number;
|
|
4
|
-
/** Max per-tool durations retained for percentile math. Default 256. */
|
|
5
|
-
sampleSize?: number;
|
|
6
|
-
/** Process-memory sampling interval in ms. Default 5000. */
|
|
7
|
-
memorySampleMs?: number;
|
|
8
|
-
}
|
|
9
|
-
export interface ToolStat {
|
|
10
|
-
tool: string;
|
|
11
|
-
count: number;
|
|
12
|
-
errorCount: number;
|
|
13
|
-
min: number;
|
|
14
|
-
max: number;
|
|
15
|
-
mean: number;
|
|
16
|
-
p50: number;
|
|
17
|
-
p95: number;
|
|
18
|
-
}
|
|
19
|
-
export interface MemorySample {
|
|
20
|
-
rss: number;
|
|
21
|
-
heapUsed: number;
|
|
22
|
-
external: number;
|
|
23
|
-
arrayBuffers: number;
|
|
24
|
-
}
|
|
25
|
-
export interface ToolCallRecord {
|
|
26
|
-
tool: string;
|
|
27
|
-
durationMs: number;
|
|
28
|
-
ok: boolean;
|
|
29
|
-
ts: number;
|
|
30
|
-
}
|
|
31
|
-
export interface MetricsSnapshot {
|
|
32
|
-
tools: ToolStat[];
|
|
33
|
-
recent: ToolCallRecord[];
|
|
34
|
-
memory: MemorySample | null;
|
|
35
|
-
}
|
|
36
|
-
export declare class MetricsRecorder {
|
|
37
|
-
private readonly recentLimit;
|
|
38
|
-
private readonly sampleSize;
|
|
39
|
-
private readonly memorySampleMs;
|
|
40
|
-
private readonly recent;
|
|
41
|
-
private readonly tools;
|
|
42
|
-
private memory;
|
|
43
|
-
private timer;
|
|
44
|
-
constructor(opts?: MetricsRecorderOptions);
|
|
45
|
-
record(event: {
|
|
46
|
-
tool: string;
|
|
47
|
-
durationMs: number;
|
|
48
|
-
ok: boolean;
|
|
49
|
-
}): void;
|
|
50
|
-
sampleMemory(): void;
|
|
51
|
-
start(): void;
|
|
52
|
-
stop(): void;
|
|
53
|
-
snapshot(): MetricsSnapshot;
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=recorder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"recorder.d.ts","sourceRoot":"","sources":["../../src/metrics/recorder.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,sBAAsB;IACrC,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,OAAO,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;CAC7B;AAiBD,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IACxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwB;IAC/C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA8B;IACpD,OAAO,CAAC,MAAM,CAA6B;IAC3C,OAAO,CAAC,KAAK,CAA+C;gBAEhD,IAAI,GAAE,sBAA2B;IAM7C,MAAM,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI;IAoBtE,YAAY,IAAI,IAAI;IAUpB,KAAK,IAAI,IAAI;IAQb,IAAI,IAAI,IAAI;IAMZ,QAAQ,IAAI,eAAe;CAmB5B"}
|
package/dist/metrics/recorder.js
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
// packages/codesign-mcp/src/metrics/recorder.ts
|
|
2
|
-
//
|
|
3
|
-
// In-memory, process-global performance recorder for the MCP server. Times
|
|
4
|
-
// every tool call (TOTAL wall-time only — "Approach A"), samples process
|
|
5
|
-
// memory on a timer, and exposes a point-in-time snapshot for the /metrics
|
|
6
|
-
// route and the dashboard SPA. Ephemeral: all state lives in memory and resets
|
|
7
|
-
// on restart. No persistence, no time-series, no secrets.
|
|
8
|
-
//
|
|
9
|
-
// APPROACH-A LIMITATION (deliberate, design §3): the recorder is fed by a
|
|
10
|
-
// single wrapper AROUND each tool call (see server.ts), so it observes only
|
|
11
|
-
// total wall-time. It cannot split engine-lock wait from execution, nor detect
|
|
12
|
-
// a cold engine reload — those happen INSIDE the call and are invisible to an
|
|
13
|
-
// outer wrapper. The deeper splits are a future addition (design §8) and must
|
|
14
|
-
// NOT couple Mutex / EngineSession to this recorder.
|
|
15
|
-
/** Nearest-rank percentile over an ascending-sorted sample. */
|
|
16
|
-
function percentile(sorted, p) {
|
|
17
|
-
if (sorted.length === 0)
|
|
18
|
-
return 0;
|
|
19
|
-
const rank = Math.ceil((p / 100) * sorted.length);
|
|
20
|
-
const idx = Math.min(sorted.length - 1, Math.max(0, rank - 1));
|
|
21
|
-
return sorted[idx];
|
|
22
|
-
}
|
|
23
|
-
export class MetricsRecorder {
|
|
24
|
-
constructor(opts = {}) {
|
|
25
|
-
this.recent = [];
|
|
26
|
-
this.tools = new Map();
|
|
27
|
-
this.memory = null;
|
|
28
|
-
this.timer = null;
|
|
29
|
-
this.recentLimit = opts.recentLimit ?? 100;
|
|
30
|
-
this.sampleSize = opts.sampleSize ?? 256;
|
|
31
|
-
this.memorySampleMs = opts.memorySampleMs ?? 5000;
|
|
32
|
-
}
|
|
33
|
-
record(event) {
|
|
34
|
-
this.recent.push({
|
|
35
|
-
tool: event.tool,
|
|
36
|
-
durationMs: event.durationMs,
|
|
37
|
-
ok: event.ok,
|
|
38
|
-
ts: Date.now()
|
|
39
|
-
});
|
|
40
|
-
if (this.recent.length > this.recentLimit)
|
|
41
|
-
this.recent.shift();
|
|
42
|
-
let agg = this.tools.get(event.tool);
|
|
43
|
-
if (!agg) {
|
|
44
|
-
agg = { count: 0, errorCount: 0, durations: [] };
|
|
45
|
-
this.tools.set(event.tool, agg);
|
|
46
|
-
}
|
|
47
|
-
agg.count += 1;
|
|
48
|
-
if (!event.ok)
|
|
49
|
-
agg.errorCount += 1;
|
|
50
|
-
agg.durations.push(event.durationMs);
|
|
51
|
-
if (agg.durations.length > this.sampleSize)
|
|
52
|
-
agg.durations.shift();
|
|
53
|
-
}
|
|
54
|
-
sampleMemory() {
|
|
55
|
-
const m = process.memoryUsage();
|
|
56
|
-
this.memory = {
|
|
57
|
-
rss: m.rss,
|
|
58
|
-
heapUsed: m.heapUsed,
|
|
59
|
-
external: m.external,
|
|
60
|
-
arrayBuffers: m.arrayBuffers
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
start() {
|
|
64
|
-
if (this.timer)
|
|
65
|
-
return;
|
|
66
|
-
this.sampleMemory(); // seed so the first snapshot isn't null
|
|
67
|
-
this.timer = setInterval(() => this.sampleMemory(), this.memorySampleMs);
|
|
68
|
-
// Never keep the event loop alive on the metrics timer alone.
|
|
69
|
-
this.timer.unref();
|
|
70
|
-
}
|
|
71
|
-
stop() {
|
|
72
|
-
if (!this.timer)
|
|
73
|
-
return;
|
|
74
|
-
clearInterval(this.timer);
|
|
75
|
-
this.timer = null;
|
|
76
|
-
}
|
|
77
|
-
snapshot() {
|
|
78
|
-
const tools = [];
|
|
79
|
-
for (const [tool, agg] of this.tools) {
|
|
80
|
-
const sorted = [...agg.durations].sort((a, b) => a - b);
|
|
81
|
-
const n = sorted.length;
|
|
82
|
-
const sum = sorted.reduce((s, d) => s + d, 0);
|
|
83
|
-
tools.push({
|
|
84
|
-
tool,
|
|
85
|
-
count: agg.count,
|
|
86
|
-
errorCount: agg.errorCount,
|
|
87
|
-
min: n ? sorted[0] : 0,
|
|
88
|
-
max: n ? sorted[n - 1] : 0,
|
|
89
|
-
mean: n ? sum / n : 0,
|
|
90
|
-
p50: percentile(sorted, 50),
|
|
91
|
-
p95: percentile(sorted, 95)
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
return { tools, recent: [...this.recent], memory: this.memory };
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
//# sourceMappingURL=recorder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"recorder.js","sourceRoot":"","sources":["../../src/metrics/recorder.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,EAAE;AACF,2EAA2E;AAC3E,yEAAyE;AACzE,2EAA2E;AAC3E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AC;QACL,CAAC;QACD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;IAClE,CAAC;CACF","sourcesContent":["// packages/codesign-mcp/src/metrics/recorder.ts\n//\n// In-memory, process-global performance recorder for the MCP server. Times\n// every tool call (TOTAL wall-time only — \"Approach A\"), samples process\n// memory on a timer, and exposes a point-in-time snapshot for the /metrics\n// route and the dashboard SPA. Ephemeral: all state lives in memory and resets\n// on restart. No persistence, no time-series, no secrets.\n//\n// APPROACH-A LIMITATION (deliberate, design §3): the recorder is fed by a\n// single wrapper AROUND each tool call (see server.ts), so it observes only\n// total wall-time. It cannot split engine-lock wait from execution, nor detect\n// a cold engine reload — those happen INSIDE the call and are invisible to an\n// outer wrapper. The deeper splits are a future addition (design §8) and must\n// NOT couple Mutex / EngineSession to this recorder.\n\nexport interface MetricsRecorderOptions {\n /** Max tool-call records kept in the recent-calls ring. Default 100. */\n recentLimit?: number;\n /** Max per-tool durations retained for percentile math. Default 256. */\n sampleSize?: number;\n /** Process-memory sampling interval in ms. Default 5000. */\n memorySampleMs?: number;\n}\n\nexport interface ToolStat {\n tool: string;\n count: number;\n errorCount: number;\n min: number;\n max: number;\n mean: number;\n p50: number;\n p95: number;\n}\n\nexport interface MemorySample {\n rss: number;\n heapUsed: number;\n external: number;\n arrayBuffers: number;\n}\n\nexport interface ToolCallRecord {\n tool: string;\n durationMs: number;\n ok: boolean;\n ts: number;\n}\n\nexport interface MetricsSnapshot {\n tools: ToolStat[];\n recent: ToolCallRecord[];\n memory: MemorySample | null;\n}\n\n/** Per-tool running aggregate. `durations` is a bounded, most-recent sample. */\ninterface ToolAgg {\n count: number; // lifetime\n errorCount: number; // lifetime\n durations: number[]; // bounded to sampleSize; oldest shifted out\n}\n\n/** Nearest-rank percentile over an ascending-sorted sample. */\nfunction percentile(sorted: number[], p: number): number {\n if (sorted.length === 0) return 0;\n const rank = Math.ceil((p / 100) * sorted.length);\n const idx = Math.min(sorted.length - 1, Math.max(0, rank - 1));\n return sorted[idx];\n}\n\nexport class MetricsRecorder {\n private readonly recentLimit: number;\n private readonly sampleSize: number;\n private readonly memorySampleMs: number;\n private readonly recent: ToolCallRecord[] = [];\n private readonly tools = new Map<string, ToolAgg>();\n private memory: MemorySample | null = null;\n private timer: ReturnType<typeof setInterval> | null = null;\n\n constructor(opts: MetricsRecorderOptions = {}) {\n this.recentLimit = opts.recentLimit ?? 100;\n this.sampleSize = opts.sampleSize ?? 256;\n this.memorySampleMs = opts.memorySampleMs ?? 5000;\n }\n\n record(event: { tool: string; durationMs: number; ok: boolean }): void {\n this.recent.push({\n tool: event.tool,\n durationMs: event.durationMs,\n ok: event.ok,\n ts: Date.now()\n });\n if (this.recent.length > this.recentLimit) this.recent.shift();\n\n let agg = this.tools.get(event.tool);\n if (!agg) {\n agg = { count: 0, errorCount: 0, durations: [] };\n this.tools.set(event.tool, agg);\n }\n agg.count += 1;\n if (!event.ok) agg.errorCount += 1;\n agg.durations.push(event.durationMs);\n if (agg.durations.length > this.sampleSize) agg.durations.shift();\n }\n\n sampleMemory(): void {\n const m = process.memoryUsage();\n this.memory = {\n rss: m.rss,\n heapUsed: m.heapUsed,\n external: m.external,\n arrayBuffers: m.arrayBuffers\n };\n }\n\n start(): void {\n if (this.timer) return;\n this.sampleMemory(); // seed so the first snapshot isn't null\n this.timer = setInterval(() => this.sampleMemory(), this.memorySampleMs);\n // Never keep the event loop alive on the metrics timer alone.\n this.timer.unref();\n }\n\n stop(): void {\n if (!this.timer) return;\n clearInterval(this.timer);\n this.timer = null;\n }\n\n snapshot(): MetricsSnapshot {\n const tools: ToolStat[] = [];\n for (const [tool, agg] of this.tools) {\n const sorted = [...agg.durations].sort((a, b) => a - b);\n const n = sorted.length;\n const sum = sorted.reduce((s, d) => s + d, 0);\n tools.push({\n tool,\n count: agg.count,\n errorCount: agg.errorCount,\n min: n ? sorted[0] : 0,\n max: n ? sorted[n - 1] : 0,\n mean: n ? sum / n : 0,\n p50: percentile(sorted, 50),\n p95: percentile(sorted, 95)\n });\n }\n return { tools, recent: [...this.recent], memory: this.memory };\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"changelog-add.d.ts","sourceRoot":"","sources":["../../../scripts/changelog-add.ts"],"names":[],"mappings":";AAOA,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMlD;AAED,wBAAsB,QAAQ,CAAC,IAAI,EAAE;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,OAAO,CAAC,MAAM,CAAC,CAWlB"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// Create a new changelog-next entry from the template.
|
|
3
|
-
// Run via `node --experimental-strip-types` (see package.json).
|
|
4
|
-
import { copyFile, access } from 'node:fs/promises';
|
|
5
|
-
import { dirname, join } from 'node:path';
|
|
6
|
-
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
7
|
-
export function entryFileName(name) {
|
|
8
|
-
const sanitized = name
|
|
9
|
-
.replace(/[\\/]/g, '-')
|
|
10
|
-
.replace(/^-+/, '')
|
|
11
|
-
.replace(/\.md$/i, '');
|
|
12
|
-
return `${sanitized}.md`;
|
|
13
|
-
}
|
|
14
|
-
export async function addEntry(opts) {
|
|
15
|
-
const target = join(opts.entriesDir, entryFileName(opts.name));
|
|
16
|
-
let exists = true;
|
|
17
|
-
try {
|
|
18
|
-
await access(target);
|
|
19
|
-
}
|
|
20
|
-
catch {
|
|
21
|
-
exists = false;
|
|
22
|
-
}
|
|
23
|
-
if (exists)
|
|
24
|
-
throw new Error(`entry already exists: ${target}`);
|
|
25
|
-
await copyFile(opts.templatePath, target);
|
|
26
|
-
return target;
|
|
27
|
-
}
|
|
28
|
-
async function main() {
|
|
29
|
-
const name = process.argv[2];
|
|
30
|
-
if (!name) {
|
|
31
|
-
console.error('usage: node --experimental-strip-types scripts/changelog-add.ts <name>');
|
|
32
|
-
process.exit(1);
|
|
33
|
-
}
|
|
34
|
-
const here = dirname(fileURLToPath(import.meta.url));
|
|
35
|
-
const entriesDir = join(here, '..', 'changelog-next');
|
|
36
|
-
const target = await addEntry({
|
|
37
|
-
templatePath: join(entriesDir, '-template.md'),
|
|
38
|
-
entriesDir,
|
|
39
|
-
name
|
|
40
|
-
});
|
|
41
|
-
console.log(`created ${target} — edit it and commit.`);
|
|
42
|
-
}
|
|
43
|
-
if (process.argv[1] &&
|
|
44
|
-
import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
45
|
-
main().catch((err) => {
|
|
46
|
-
console.error(err instanceof Error ? err.message : String(err));
|
|
47
|
-
process.exit(1);
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=changelog-add.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"changelog-add.js","sourceRoot":"","sources":["../../../scripts/changelog-add.ts"],"names":[],"mappings":";AACA,uDAAuD;AACvD,gEAAgE;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAExD,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,MAAM,SAAS,GAAG,IAAI;SACnB,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;SACtB,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;SAClB,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IACzB,OAAO,GAAG,SAAS,KAAK,CAAC;AAC3B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,IAI9B;IACC,MAAM,MAAM,GAA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AAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;QAC5B,OAAO,CAAC,KAAK,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QAChE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["#!/usr/bin/env node\n// Create a new changelog-next entry from the template.\n// Run via `node --experimental-strip-types` (see package.json).\nimport { copyFile, access } from 'node:fs/promises';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\n\nexport function entryFileName(name: string): string {\n const sanitized = name\n .replace(/[\\\\/]/g, '-')\n .replace(/^-+/, '')\n .replace(/\\.md$/i, '');\n return `${sanitized}.md`;\n}\n\nexport async function addEntry(opts: {\n templatePath: string;\n entriesDir: string;\n name: string;\n}): Promise<string> {\n const target = join(opts.entriesDir, entryFileName(opts.name));\n let exists = true;\n try {\n await access(target);\n } catch {\n exists = false;\n }\n if (exists) throw new Error(`entry already exists: ${target}`);\n await copyFile(opts.templatePath, target);\n return target;\n}\n\nasync function main(): Promise<void> {\n const name = process.argv[2];\n if (!name) {\n console.error(\n 'usage: node --experimental-strip-types scripts/changelog-add.ts <name>'\n );\n process.exit(1);\n }\n const here = dirname(fileURLToPath(import.meta.url));\n const entriesDir = join(here, '..', 'changelog-next');\n const target = await addEntry({\n templatePath: join(entriesDir, '-template.md'),\n entriesDir,\n name\n });\n console.log(`created ${target} — edit it and commit.`);\n}\n\nif (\n process.argv[1] &&\n import.meta.url === pathToFileURL(process.argv[1]).href\n) {\n main().catch((err: unknown) => {\n console.error(err instanceof Error ? err.message : String(err));\n process.exit(1);\n });\n}\n"]}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
export interface ChangelogEntry {
|
|
3
|
-
name: string;
|
|
4
|
-
type: string;
|
|
5
|
-
breaking: boolean;
|
|
6
|
-
body: string;
|
|
7
|
-
}
|
|
8
|
-
export interface GroupedEntries {
|
|
9
|
-
breaking: string[];
|
|
10
|
-
changes: string[];
|
|
11
|
-
fixed: string[];
|
|
12
|
-
deprecated: string[];
|
|
13
|
-
}
|
|
14
|
-
export declare function parseEntry(text: string): {
|
|
15
|
-
type: string;
|
|
16
|
-
breaking: boolean;
|
|
17
|
-
body: string;
|
|
18
|
-
};
|
|
19
|
-
export declare function groupEntries(entries: ChangelogEntry[]): GroupedEntries;
|
|
20
|
-
export declare function renderVersionSection(version: string, grouped: GroupedEntries, absorbedBody?: string): string;
|
|
21
|
-
export declare function extractUnreleased(md: string): {
|
|
22
|
-
body: string;
|
|
23
|
-
md: string;
|
|
24
|
-
};
|
|
25
|
-
export declare function hasVersion(md: string, version: string): boolean;
|
|
26
|
-
export declare function insertVersionSection(md: string, sectionMd: string): string;
|
|
27
|
-
export type CollateResult = {
|
|
28
|
-
noop: true;
|
|
29
|
-
} | {
|
|
30
|
-
noop: false;
|
|
31
|
-
section: string;
|
|
32
|
-
};
|
|
33
|
-
export declare function collateFiles(opts: {
|
|
34
|
-
entriesDir: string;
|
|
35
|
-
changelogPath: string;
|
|
36
|
-
version: string;
|
|
37
|
-
}): Promise<CollateResult>;
|
|
38
|
-
//# sourceMappingURL=changelog-collate.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"changelog-collate.d.ts","sourceRoot":"","sources":["../../../scripts/changelog-collate.ts"],"names":[],"mappings":";AAKA,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,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