@monoes/monomindcli 2.8.4 → 2.9.1
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/.claude/helpers/auto-memory-hook.mjs +0 -0
- package/.claude/helpers/handlers/route-handler.cjs +12 -0
- package/.claude/helpers/handlers/session-restore-handler.cjs +28 -7
- package/.claude/helpers/hook-handler.cjs +0 -0
- package/.claude/helpers/utils/micro-agents.cjs +22 -0
- package/.claude/skills/monodesign/scripts/live/sveltekit-adapter.mjs +11 -6
- package/.claude/skills/monodesign/scripts/live-inject.mjs +20 -7
- package/.claude/skills/monodesign/scripts/live-server.mjs +38 -2
- package/LICENSE +191 -0
- package/README.md +8 -6
- package/dist/src/browser/dashboard/server.d.ts +5 -0
- package/dist/src/browser/dashboard/server.d.ts.map +1 -1
- package/dist/src/browser/dashboard/server.js +59 -4
- package/dist/src/browser/dashboard/server.js.map +1 -1
- package/dist/src/browser/dashboard/ui.html +18 -8
- package/dist/src/browser/workflow/store.d.ts.map +1 -1
- package/dist/src/browser/workflow/store.js +3 -2
- package/dist/src/browser/workflow/store.js.map +1 -1
- package/dist/src/capabilities/cap-documents.d.ts.map +1 -1
- package/dist/src/capabilities/cap-documents.js +14 -9
- package/dist/src/capabilities/cap-documents.js.map +1 -1
- package/dist/src/commands/doctor.d.ts.map +1 -1
- package/dist/src/commands/doctor.js +22 -18
- package/dist/src/commands/doctor.js.map +1 -1
- package/dist/src/commands/download-embeddings.d.ts +8 -0
- package/dist/src/commands/download-embeddings.d.ts.map +1 -0
- package/dist/src/commands/download-embeddings.js +34 -0
- package/dist/src/commands/download-embeddings.js.map +1 -0
- package/dist/src/commands/hooks.d.ts.map +1 -1
- package/dist/src/commands/hooks.js +14 -0
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/index.d.ts.map +1 -1
- package/dist/src/commands/index.js +4 -0
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/init-wizard.js +1 -1
- package/dist/src/commands/init-wizard.js.map +1 -1
- package/dist/src/commands/init.d.ts.map +1 -1
- package/dist/src/commands/init.js +48 -1
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/monograph.d.ts.map +1 -1
- package/dist/src/commands/monograph.js +35 -1
- package/dist/src/commands/monograph.js.map +1 -1
- package/dist/src/commands/org-observe.d.ts +10 -0
- package/dist/src/commands/org-observe.d.ts.map +1 -1
- package/dist/src/commands/org-observe.js +195 -31
- package/dist/src/commands/org-observe.js.map +1 -1
- package/dist/src/commands/org.d.ts +1 -0
- package/dist/src/commands/org.d.ts.map +1 -1
- package/dist/src/commands/org.js +139 -3
- package/dist/src/commands/org.js.map +1 -1
- package/dist/src/commands/route.d.ts +1 -9
- package/dist/src/commands/route.d.ts.map +1 -1
- package/dist/src/commands/route.js +42 -65
- package/dist/src/commands/route.js.map +1 -1
- package/dist/src/commands/security-cve.d.ts.map +1 -1
- package/dist/src/commands/security-cve.js +2 -1
- package/dist/src/commands/security-cve.js.map +1 -1
- package/dist/src/index.d.ts +0 -10
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -15
- package/dist/src/index.js.map +1 -1
- package/dist/src/init/copy-assets.d.ts +17 -0
- package/dist/src/init/copy-assets.d.ts.map +1 -0
- package/dist/src/init/copy-assets.js +271 -0
- package/dist/src/init/copy-assets.js.map +1 -0
- package/dist/src/init/executor.d.ts +2 -30
- package/dist/src/init/executor.d.ts.map +1 -1
- package/dist/src/init/executor.js +56 -2493
- package/dist/src/init/executor.js.map +1 -1
- package/dist/src/init/helpers-generator.d.ts.map +1 -1
- package/dist/src/init/helpers-generator.js +9 -0
- package/dist/src/init/helpers-generator.js.map +1 -1
- package/dist/src/init/settings-generator.d.ts.map +1 -1
- package/dist/src/init/settings-generator.js +0 -4
- package/dist/src/init/settings-generator.js.map +1 -1
- package/dist/src/init/shared.d.ts +112 -0
- package/dist/src/init/shared.d.ts.map +1 -0
- package/dist/src/init/shared.js +475 -0
- package/dist/src/init/shared.js.map +1 -0
- package/dist/src/init/statusline-generator.d.ts.map +1 -1
- package/dist/src/init/statusline-generator.js +37 -0
- package/dist/src/init/statusline-generator.js.map +1 -1
- package/dist/src/init/types.d.ts +1 -1
- package/dist/src/init/types.d.ts.map +1 -1
- package/dist/src/init/upgrade.d.ts +34 -0
- package/dist/src/init/upgrade.d.ts.map +1 -0
- package/dist/src/init/upgrade.js +477 -0
- package/dist/src/init/upgrade.js.map +1 -0
- package/dist/src/init/write-antigravity.d.ts +13 -0
- package/dist/src/init/write-antigravity.d.ts.map +1 -0
- package/dist/src/init/write-antigravity.js +117 -0
- package/dist/src/init/write-antigravity.js.map +1 -0
- package/dist/src/init/write-capabilities.d.ts +9 -0
- package/dist/src/init/write-capabilities.d.ts.map +1 -0
- package/dist/src/init/write-capabilities.js +392 -0
- package/dist/src/init/write-capabilities.js.map +1 -0
- package/dist/src/init/write-claude.d.ts +25 -0
- package/dist/src/init/write-claude.d.ts.map +1 -0
- package/dist/src/init/write-claude.js +279 -0
- package/dist/src/init/write-claude.js.map +1 -0
- package/dist/src/init/write-kimicode.d.ts +19 -0
- package/dist/src/init/write-kimicode.d.ts.map +1 -0
- package/dist/src/init/write-kimicode.js +223 -0
- package/dist/src/init/write-kimicode.js.map +1 -0
- package/dist/src/init/write-opencode.d.ts +14 -0
- package/dist/src/init/write-opencode.d.ts.map +1 -0
- package/dist/src/init/write-opencode.js +130 -0
- package/dist/src/init/write-opencode.js.map +1 -0
- package/dist/src/init/write-runtime-config.d.ts +14 -0
- package/dist/src/init/write-runtime-config.d.ts.map +1 -0
- package/dist/src/init/write-runtime-config.js +214 -0
- package/dist/src/init/write-runtime-config.js.map +1 -0
- package/dist/src/init/write-sample-org.d.ts +9 -0
- package/dist/src/init/write-sample-org.d.ts.map +1 -0
- package/dist/src/init/write-sample-org.js +39 -0
- package/dist/src/init/write-sample-org.js.map +1 -0
- package/dist/src/knowledge/eval/golden-set.js +1 -1
- package/dist/src/knowledge/eval/golden-set.js.map +1 -1
- package/dist/src/mcp-tools/analyze-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/analyze-tools.js +2 -25
- package/dist/src/mcp-tools/analyze-tools.js.map +1 -1
- package/dist/src/mcp-tools/auto-install.d.ts.map +1 -1
- package/dist/src/mcp-tools/auto-install.js +2 -1
- package/dist/src/mcp-tools/auto-install.js.map +1 -1
- package/dist/src/mcp-tools/hooks-routing.d.ts.map +1 -1
- package/dist/src/mcp-tools/hooks-routing.js +26 -0
- package/dist/src/mcp-tools/hooks-routing.js.map +1 -1
- package/dist/src/mcp-tools/memory-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/memory-tools.js +2 -37
- package/dist/src/mcp-tools/memory-tools.js.map +1 -1
- package/dist/src/mcp-tools/monograph/agent-history-tools.d.ts +5 -0
- package/dist/src/mcp-tools/monograph/agent-history-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/monograph/agent-history-tools.js +177 -0
- package/dist/src/mcp-tools/monograph/agent-history-tools.js.map +1 -0
- package/dist/src/mcp-tools/monograph/build-tools.d.ts +9 -0
- package/dist/src/mcp-tools/monograph/build-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/monograph/build-tools.js +299 -0
- package/dist/src/mcp-tools/monograph/build-tools.js.map +1 -0
- package/dist/src/mcp-tools/monograph/group-tools.d.ts +10 -0
- package/dist/src/mcp-tools/monograph/group-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/monograph/group-tools.js +225 -0
- package/dist/src/mcp-tools/monograph/group-tools.js.map +1 -0
- package/dist/src/mcp-tools/monograph/health-tools.d.ts +6 -0
- package/dist/src/mcp-tools/monograph/health-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/monograph/health-tools.js +113 -0
- package/dist/src/mcp-tools/monograph/health-tools.js.map +1 -0
- package/dist/src/mcp-tools/monograph/impact-tools.d.ts +9 -0
- package/dist/src/mcp-tools/monograph/impact-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/monograph/impact-tools.js +532 -0
- package/dist/src/mcp-tools/monograph/impact-tools.js.map +1 -0
- package/dist/src/mcp-tools/monograph/index.d.ts +10 -0
- package/dist/src/mcp-tools/monograph/index.d.ts.map +1 -0
- package/dist/src/mcp-tools/monograph/index.js +73 -0
- package/dist/src/mcp-tools/monograph/index.js.map +1 -0
- package/dist/src/mcp-tools/monograph/query-tools.d.ts +11 -0
- package/dist/src/mcp-tools/monograph/query-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/monograph/query-tools.js +500 -0
- package/dist/src/mcp-tools/monograph/query-tools.js.map +1 -0
- package/dist/src/mcp-tools/monograph/shared.d.ts +64 -0
- package/dist/src/mcp-tools/monograph/shared.d.ts.map +1 -0
- package/dist/src/mcp-tools/monograph/shared.js +215 -0
- package/dist/src/mcp-tools/monograph/shared.js.map +1 -0
- package/dist/src/mcp-tools/monograph/visualize-tools.d.ts +10 -0
- package/dist/src/mcp-tools/monograph/visualize-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/monograph/visualize-tools.js +382 -0
- package/dist/src/mcp-tools/monograph/visualize-tools.js.map +1 -0
- package/dist/src/mcp-tools/monograph-tools.d.ts +4 -23
- package/dist/src/mcp-tools/monograph-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/monograph-tools.js +4 -2439
- package/dist/src/mcp-tools/monograph-tools.js.map +1 -1
- package/dist/src/mcp-tools/monomind-tools.d.ts +8 -0
- package/dist/src/mcp-tools/monomind-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/monomind-tools.js +13 -1
- package/dist/src/mcp-tools/monomind-tools.js.map +1 -1
- package/dist/src/mcp-tools/quality/security-compliance/detect-secrets.d.ts.map +1 -1
- package/dist/src/mcp-tools/quality/security-compliance/detect-secrets.js +31 -2
- package/dist/src/mcp-tools/quality/security-compliance/detect-secrets.js.map +1 -1
- package/dist/src/mcp-tools/terminal-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/terminal-tools.js +31 -1
- package/dist/src/mcp-tools/terminal-tools.js.map +1 -1
- package/dist/src/mcp-tools/types.d.ts +8 -27
- package/dist/src/mcp-tools/types.d.ts.map +1 -1
- package/dist/src/mcp-tools/types.js +9 -91
- package/dist/src/mcp-tools/types.js.map +1 -1
- package/dist/src/memory/file-permissions.d.ts +15 -0
- package/dist/src/memory/file-permissions.d.ts.map +1 -0
- package/dist/src/memory/file-permissions.js +25 -0
- package/dist/src/memory/file-permissions.js.map +1 -0
- package/dist/src/memory/memory-bridge.d.ts.map +1 -1
- package/dist/src/memory/memory-bridge.js +94 -34
- package/dist/src/memory/memory-bridge.js.map +1 -1
- package/dist/src/memory/memory-crud.d.ts.map +1 -1
- package/dist/src/memory/memory-crud.js +298 -275
- package/dist/src/memory/memory-crud.js.map +1 -1
- package/dist/src/memory/memory-initializer.d.ts +2 -4
- package/dist/src/memory/memory-initializer.d.ts.map +1 -1
- package/dist/src/memory/memory-initializer.js +53 -76
- package/dist/src/memory/memory-initializer.js.map +1 -1
- package/dist/src/memory/memory-migrations.d.ts +1 -14
- package/dist/src/memory/memory-migrations.d.ts.map +1 -1
- package/dist/src/memory/memory-migrations.js +52 -105
- package/dist/src/memory/memory-migrations.js.map +1 -1
- package/dist/src/memory/sona-optimizer.d.ts +1 -1
- package/dist/src/memory/sona-optimizer.js +1 -1
- package/dist/src/monovector/index.d.ts +16 -19
- package/dist/src/monovector/index.d.ts.map +1 -1
- package/dist/src/monovector/index.js +50 -8
- package/dist/src/monovector/index.js.map +1 -1
- package/dist/src/orgrt/approvals.d.ts +16 -0
- package/dist/src/orgrt/approvals.d.ts.map +1 -0
- package/dist/src/orgrt/approvals.js +72 -0
- package/dist/src/orgrt/approvals.js.map +1 -0
- package/dist/src/orgrt/bus.d.ts.map +1 -1
- package/dist/src/orgrt/bus.js +21 -0
- package/dist/src/orgrt/bus.js.map +1 -1
- package/dist/src/orgrt/checkpoint-ops.d.ts +19 -0
- package/dist/src/orgrt/checkpoint-ops.d.ts.map +1 -0
- package/dist/src/orgrt/checkpoint-ops.js +219 -0
- package/dist/src/orgrt/checkpoint-ops.js.map +1 -0
- package/dist/src/orgrt/checkpoint.d.ts +33 -1
- package/dist/src/orgrt/checkpoint.d.ts.map +1 -1
- package/dist/src/orgrt/checkpoint.js +50 -6
- package/dist/src/orgrt/checkpoint.js.map +1 -1
- package/dist/src/orgrt/cross-org.d.ts +32 -0
- package/dist/src/orgrt/cross-org.d.ts.map +1 -0
- package/dist/src/orgrt/cross-org.js +256 -0
- package/dist/src/orgrt/cross-org.js.map +1 -0
- package/dist/src/orgrt/daemon.d.ts +131 -157
- package/dist/src/orgrt/daemon.d.ts.map +1 -1
- package/dist/src/orgrt/daemon.js +356 -966
- package/dist/src/orgrt/daemon.js.map +1 -1
- package/dist/src/orgrt/decisions.d.ts +33 -0
- package/dist/src/orgrt/decisions.d.ts.map +1 -0
- package/dist/src/orgrt/decisions.js +169 -0
- package/dist/src/orgrt/decisions.js.map +1 -0
- package/dist/src/orgrt/kimicode-runner.d.ts.map +1 -1
- package/dist/src/orgrt/kimicode-runner.js +5 -1
- package/dist/src/orgrt/kimicode-runner.js.map +1 -1
- package/dist/src/orgrt/opencode-runner.d.ts.map +1 -1
- package/dist/src/orgrt/opencode-runner.js +10 -2
- package/dist/src/orgrt/opencode-runner.js.map +1 -1
- package/dist/src/orgrt/org-memory.d.ts +45 -0
- package/dist/src/orgrt/org-memory.d.ts.map +1 -0
- package/dist/src/orgrt/org-memory.js +220 -0
- package/dist/src/orgrt/org-memory.js.map +1 -0
- package/dist/src/orgrt/policy.d.ts +4 -0
- package/dist/src/orgrt/policy.d.ts.map +1 -1
- package/dist/src/orgrt/policy.js +13 -1
- package/dist/src/orgrt/policy.js.map +1 -1
- package/dist/src/orgrt/prechecks.d.ts +15 -0
- package/dist/src/orgrt/prechecks.d.ts.map +1 -0
- package/dist/src/orgrt/prechecks.js +21 -0
- package/dist/src/orgrt/prechecks.js.map +1 -0
- package/dist/src/orgrt/questions.d.ts +39 -0
- package/dist/src/orgrt/questions.d.ts.map +1 -0
- package/dist/src/orgrt/questions.js +135 -0
- package/dist/src/orgrt/questions.js.map +1 -0
- package/dist/src/orgrt/remote.d.ts +25 -0
- package/dist/src/orgrt/remote.d.ts.map +1 -0
- package/dist/src/orgrt/remote.js +73 -0
- package/dist/src/orgrt/remote.js.map +1 -0
- package/dist/src/orgrt/scheduler-integration.d.ts +19 -0
- package/dist/src/orgrt/scheduler-integration.d.ts.map +1 -0
- package/dist/src/orgrt/scheduler-integration.js +90 -0
- package/dist/src/orgrt/scheduler-integration.js.map +1 -0
- package/dist/src/orgrt/server.d.ts.map +1 -1
- package/dist/src/orgrt/server.js +70 -2
- package/dist/src/orgrt/server.js.map +1 -1
- package/dist/src/orgrt/session.d.ts +30 -1
- package/dist/src/orgrt/session.d.ts.map +1 -1
- package/dist/src/orgrt/session.js +184 -53
- package/dist/src/orgrt/session.js.map +1 -1
- package/dist/src/orgrt/state-detector.d.ts +19 -0
- package/dist/src/orgrt/state-detector.d.ts.map +1 -0
- package/dist/src/orgrt/state-detector.js +59 -0
- package/dist/src/orgrt/state-detector.js.map +1 -0
- package/dist/src/orgrt/task-dag.d.ts +27 -0
- package/dist/src/orgrt/task-dag.d.ts.map +1 -0
- package/dist/src/orgrt/task-dag.js +100 -0
- package/dist/src/orgrt/task-dag.js.map +1 -0
- package/dist/src/orgrt/tool-fence.d.ts +7 -4
- package/dist/src/orgrt/tool-fence.d.ts.map +1 -1
- package/dist/src/orgrt/tool-fence.js +47 -6
- package/dist/src/orgrt/tool-fence.js.map +1 -1
- package/dist/src/orgrt/types.d.ts +57 -2
- package/dist/src/orgrt/types.d.ts.map +1 -1
- package/dist/src/orgrt/types.js +34 -3
- package/dist/src/orgrt/types.js.map +1 -1
- package/dist/src/routing/model-download.d.ts +49 -0
- package/dist/src/routing/model-download.d.ts.map +1 -0
- package/dist/src/routing/model-download.js +106 -0
- package/dist/src/routing/model-download.js.map +1 -0
- package/dist/src/services/crash-reporter.d.ts +5 -0
- package/dist/src/services/crash-reporter.d.ts.map +1 -1
- package/dist/src/services/crash-reporter.js +49 -0
- package/dist/src/services/crash-reporter.js.map +1 -1
- package/dist/src/transfer/anonymization/index.d.ts +18 -15
- package/dist/src/transfer/anonymization/index.d.ts.map +1 -1
- package/dist/src/transfer/anonymization/index.js +7 -119
- package/dist/src/transfer/anonymization/index.js.map +1 -1
- package/dist/src/ui/dashboard.html +606 -7
- package/dist/src/ui/orgs.html +7 -1
- package/dist/src/ui/routes-monograph.mjs +6 -0
- package/dist/src/ui/server.mjs +327 -7
- package/dist/src/update/checker.d.ts.map +1 -1
- package/dist/src/update/checker.js +2 -1
- package/dist/src/update/checker.js.map +1 -1
- package/dist/src/update/executor.d.ts.map +1 -1
- package/dist/src/update/executor.js +7 -3
- package/dist/src/update/executor.js.map +1 -1
- package/dist/src/update/index.d.ts +0 -1
- package/dist/src/update/index.d.ts.map +1 -1
- package/dist/src/update/index.js +5 -24
- package/dist/src/update/index.js.map +1 -1
- package/dist/src/utils/db-mutex.d.ts +11 -0
- package/dist/src/utils/db-mutex.d.ts.map +1 -0
- package/dist/src/utils/db-mutex.js +23 -0
- package/dist/src/utils/db-mutex.js.map +1 -0
- package/dist/src/utils/input-guards.d.ts +23 -0
- package/dist/src/utils/input-guards.d.ts.map +1 -1
- package/dist/src/utils/input-guards.js +72 -0
- package/dist/src/utils/input-guards.js.map +1 -1
- package/dist/src/utils/npm-command.d.ts +10 -0
- package/dist/src/utils/npm-command.d.ts.map +1 -0
- package/dist/src/utils/npm-command.js +12 -0
- package/dist/src/utils/npm-command.js.map +1 -0
- package/dist/src/utils/paths.d.ts +28 -0
- package/dist/src/utils/paths.d.ts.map +1 -0
- package/dist/src/utils/paths.js +108 -0
- package/dist/src/utils/paths.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +17 -17
- package/scripts/download-embedding-model.mjs +97 -0
- package/scripts/publish.sh +0 -0
- package/scripts/sync-claude-assets.sh +0 -0
- package/dist/src/production/circuit-breaker.d.ts +0 -121
- package/dist/src/production/circuit-breaker.d.ts.map +0 -1
- package/dist/src/production/circuit-breaker.js +0 -262
- package/dist/src/production/circuit-breaker.js.map +0 -1
- package/dist/src/production/error-handler.d.ts +0 -119
- package/dist/src/production/error-handler.d.ts.map +0 -1
- package/dist/src/production/error-handler.js +0 -324
- package/dist/src/production/error-handler.js.map +0 -1
- package/dist/src/production/index.d.ts +0 -6
- package/dist/src/production/index.d.ts.map +0 -1
- package/dist/src/production/index.js +0 -6
- package/dist/src/production/index.js.map +0 -1
- package/dist/src/production/monitoring.d.ts +0 -181
- package/dist/src/production/monitoring.d.ts.map +0 -1
- package/dist/src/production/monitoring.js +0 -375
- package/dist/src/production/monitoring.js.map +0 -1
- package/dist/src/production/rate-limiter.d.ts +0 -125
- package/dist/src/production/rate-limiter.d.ts.map +0 -1
- package/dist/src/production/rate-limiter.js +0 -218
- package/dist/src/production/rate-limiter.js.map +0 -1
- package/dist/src/production/retry.d.ts +0 -48
- package/dist/src/production/retry.d.ts.map +0 -1
- package/dist/src/production/retry.js +0 -189
- package/dist/src/production/retry.js.map +0 -1
- package/dist/src/transfer/types.d.ts +0 -245
- package/dist/src/transfer/types.d.ts.map +0 -1
- package/dist/src/transfer/types.js +0 -6
- package/dist/src/transfer/types.js.map +0 -1
|
@@ -1,375 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Production Monitoring and Observability
|
|
3
|
-
*
|
|
4
|
-
* Provides monitoring hooks for:
|
|
5
|
-
* - Request/response metrics
|
|
6
|
-
* - Error tracking
|
|
7
|
-
* - Performance monitoring
|
|
8
|
-
* - Health checks
|
|
9
|
-
* - Alerting
|
|
10
|
-
*
|
|
11
|
-
* @module @monomind/cli/production/monitoring
|
|
12
|
-
*/
|
|
13
|
-
// ============================================================================
|
|
14
|
-
// Default Configuration
|
|
15
|
-
// ============================================================================
|
|
16
|
-
const DEFAULT_CONFIG = {
|
|
17
|
-
enabled: true,
|
|
18
|
-
retentionMs: 3600000, // 1 hour
|
|
19
|
-
maxMetrics: 100000,
|
|
20
|
-
samplingRate: 1.0,
|
|
21
|
-
alertThresholds: {
|
|
22
|
-
error_rate: { warning: 0.05, critical: 0.1 },
|
|
23
|
-
response_time_ms: { warning: 1000, critical: 5000 },
|
|
24
|
-
active_requests: { warning: 100, critical: 500 },
|
|
25
|
-
},
|
|
26
|
-
healthCheckIntervalMs: 30000,
|
|
27
|
-
globalLabels: {},
|
|
28
|
-
};
|
|
29
|
-
// ============================================================================
|
|
30
|
-
// Monitoring Implementation
|
|
31
|
-
// ============================================================================
|
|
32
|
-
export class MonitoringHooks {
|
|
33
|
-
config;
|
|
34
|
-
metrics = [];
|
|
35
|
-
responseTimes = [];
|
|
36
|
-
alerts = [];
|
|
37
|
-
healthStatus;
|
|
38
|
-
startTime = Date.now();
|
|
39
|
-
activeRequests = 0;
|
|
40
|
-
requestCount = 0;
|
|
41
|
-
errorCount = 0;
|
|
42
|
-
healthChecks = new Map();
|
|
43
|
-
constructor(config = {}) {
|
|
44
|
-
this.config = { ...DEFAULT_CONFIG, ...config };
|
|
45
|
-
this.healthStatus = {
|
|
46
|
-
healthy: true,
|
|
47
|
-
checks: {},
|
|
48
|
-
timestamp: Date.now(),
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
// ============================================================================
|
|
52
|
-
// Metrics Collection
|
|
53
|
-
// ============================================================================
|
|
54
|
-
/**
|
|
55
|
-
* Record a counter metric
|
|
56
|
-
*/
|
|
57
|
-
counter(name, value = 1, labels = {}) {
|
|
58
|
-
this.recordMetric(name, 'counter', value, labels);
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Record a gauge metric
|
|
62
|
-
*/
|
|
63
|
-
gauge(name, value, labels = {}) {
|
|
64
|
-
this.recordMetric(name, 'gauge', value, labels);
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Record a histogram metric
|
|
68
|
-
*/
|
|
69
|
-
histogram(name, value, labels = {}) {
|
|
70
|
-
this.recordMetric(name, 'histogram', value, labels);
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Record a metric event
|
|
74
|
-
*/
|
|
75
|
-
recordMetric(name, type, value, labels) {
|
|
76
|
-
if (!this.config.enabled)
|
|
77
|
-
return;
|
|
78
|
-
// Apply sampling
|
|
79
|
-
if (Math.random() > this.config.samplingRate)
|
|
80
|
-
return;
|
|
81
|
-
// Cap metric name and label keys/values to prevent DoS
|
|
82
|
-
const safeName = String(name).slice(0, 256);
|
|
83
|
-
const safeLabels = {};
|
|
84
|
-
let labelCount = 0;
|
|
85
|
-
for (const [k, v] of Object.entries(labels)) {
|
|
86
|
-
if (!Object.hasOwn(labels, k))
|
|
87
|
-
continue;
|
|
88
|
-
if (++labelCount > 20)
|
|
89
|
-
break;
|
|
90
|
-
// Block prototype pollution keys
|
|
91
|
-
if (k === '__proto__' || k === 'constructor' || k === 'prototype')
|
|
92
|
-
continue;
|
|
93
|
-
safeLabels[String(k).slice(0, 64)] = String(v).slice(0, 512);
|
|
94
|
-
}
|
|
95
|
-
const event = {
|
|
96
|
-
name: safeName,
|
|
97
|
-
type,
|
|
98
|
-
value,
|
|
99
|
-
labels: { ...this.config.globalLabels, ...safeLabels },
|
|
100
|
-
timestamp: Date.now(),
|
|
101
|
-
};
|
|
102
|
-
this.metrics.push(event);
|
|
103
|
-
// Check alerts
|
|
104
|
-
this.checkAlerts(name, value);
|
|
105
|
-
// Cleanup old metrics
|
|
106
|
-
this.cleanupMetrics();
|
|
107
|
-
}
|
|
108
|
-
// ============================================================================
|
|
109
|
-
// Request Tracking
|
|
110
|
-
// ============================================================================
|
|
111
|
-
/**
|
|
112
|
-
* Start tracking a request
|
|
113
|
-
*/
|
|
114
|
-
startRequest(requestId) {
|
|
115
|
-
this.activeRequests++;
|
|
116
|
-
this.requestCount++;
|
|
117
|
-
const startTime = Date.now();
|
|
118
|
-
this.counter('request_started', 1, {});
|
|
119
|
-
// Return end function
|
|
120
|
-
return () => {
|
|
121
|
-
this.activeRequests--;
|
|
122
|
-
const duration = Date.now() - startTime;
|
|
123
|
-
this.responseTimes.push(duration);
|
|
124
|
-
this.histogram('response_time_ms', duration, {});
|
|
125
|
-
// Keep only last 1000 response times
|
|
126
|
-
if (this.responseTimes.length > 1000) {
|
|
127
|
-
this.responseTimes = this.responseTimes.slice(-1000);
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Record an error
|
|
133
|
-
*/
|
|
134
|
-
recordError(error, labels = {}) {
|
|
135
|
-
this.errorCount++;
|
|
136
|
-
this.counter('error', 1, {
|
|
137
|
-
...labels,
|
|
138
|
-
errorType: error.name,
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
// ============================================================================
|
|
142
|
-
// Health Checks
|
|
143
|
-
// ============================================================================
|
|
144
|
-
/**
|
|
145
|
-
* Register a health check
|
|
146
|
-
*/
|
|
147
|
-
registerHealthCheck(name, check) {
|
|
148
|
-
// Cap name length to prevent map-key inflation
|
|
149
|
-
this.healthChecks.set(String(name).slice(0, 128), check);
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Run all health checks
|
|
153
|
-
*/
|
|
154
|
-
async runHealthChecks() {
|
|
155
|
-
const checks = {};
|
|
156
|
-
let allHealthy = true;
|
|
157
|
-
for (const [name, check] of this.healthChecks) {
|
|
158
|
-
const startTime = Date.now();
|
|
159
|
-
try {
|
|
160
|
-
const result = await check();
|
|
161
|
-
checks[name] = {
|
|
162
|
-
status: result.healthy ? 'healthy' : 'unhealthy',
|
|
163
|
-
message: result.message,
|
|
164
|
-
lastCheck: Date.now(),
|
|
165
|
-
responseTimeMs: Date.now() - startTime,
|
|
166
|
-
};
|
|
167
|
-
if (!result.healthy)
|
|
168
|
-
allHealthy = false;
|
|
169
|
-
}
|
|
170
|
-
catch (error) {
|
|
171
|
-
checks[name] = {
|
|
172
|
-
status: 'unhealthy',
|
|
173
|
-
message: error.message,
|
|
174
|
-
lastCheck: Date.now(),
|
|
175
|
-
responseTimeMs: Date.now() - startTime,
|
|
176
|
-
};
|
|
177
|
-
allHealthy = false;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
this.healthStatus = {
|
|
181
|
-
healthy: allHealthy,
|
|
182
|
-
checks,
|
|
183
|
-
timestamp: Date.now(),
|
|
184
|
-
};
|
|
185
|
-
return this.healthStatus;
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Get current health status
|
|
189
|
-
*/
|
|
190
|
-
getHealthStatus() {
|
|
191
|
-
return this.healthStatus;
|
|
192
|
-
}
|
|
193
|
-
// ============================================================================
|
|
194
|
-
// Performance Metrics
|
|
195
|
-
// ============================================================================
|
|
196
|
-
/**
|
|
197
|
-
* Get performance metrics
|
|
198
|
-
*/
|
|
199
|
-
getPerformanceMetrics() {
|
|
200
|
-
const sortedTimes = [...this.responseTimes].sort((a, b) => a - b);
|
|
201
|
-
const count = sortedTimes.length;
|
|
202
|
-
const percentile = (p) => {
|
|
203
|
-
if (count === 0)
|
|
204
|
-
return 0;
|
|
205
|
-
const index = Math.ceil(count * p) - 1;
|
|
206
|
-
return sortedTimes[Math.min(index, count - 1)];
|
|
207
|
-
};
|
|
208
|
-
const avgResponseTime = count > 0 ? sortedTimes.reduce((a, b) => a + b, 0) / count : 0;
|
|
209
|
-
return {
|
|
210
|
-
requestCount: this.requestCount,
|
|
211
|
-
errorCount: this.errorCount,
|
|
212
|
-
errorRate: this.requestCount > 0 ? this.errorCount / this.requestCount : 0,
|
|
213
|
-
avgResponseTimeMs: Math.round(avgResponseTime),
|
|
214
|
-
p50ResponseTimeMs: percentile(0.5),
|
|
215
|
-
p95ResponseTimeMs: percentile(0.95),
|
|
216
|
-
p99ResponseTimeMs: percentile(0.99),
|
|
217
|
-
activeRequests: this.activeRequests,
|
|
218
|
-
uptime: Date.now() - this.startTime,
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
// ============================================================================
|
|
222
|
-
// Alerting
|
|
223
|
-
// ============================================================================
|
|
224
|
-
/**
|
|
225
|
-
* Get active alerts
|
|
226
|
-
*/
|
|
227
|
-
getAlerts(level) {
|
|
228
|
-
let filtered = this.alerts.filter((a) => !a.acknowledged);
|
|
229
|
-
if (level) {
|
|
230
|
-
filtered = filtered.filter((a) => a.level === level);
|
|
231
|
-
}
|
|
232
|
-
return filtered;
|
|
233
|
-
}
|
|
234
|
-
/**
|
|
235
|
-
* Acknowledge an alert
|
|
236
|
-
*/
|
|
237
|
-
acknowledgeAlert(alertId) {
|
|
238
|
-
const alert = this.alerts.find((a) => a.id === alertId);
|
|
239
|
-
if (alert) {
|
|
240
|
-
alert.acknowledged = true;
|
|
241
|
-
return true;
|
|
242
|
-
}
|
|
243
|
-
return false;
|
|
244
|
-
}
|
|
245
|
-
/**
|
|
246
|
-
* Clear all alerts
|
|
247
|
-
*/
|
|
248
|
-
clearAlerts() {
|
|
249
|
-
this.alerts = [];
|
|
250
|
-
}
|
|
251
|
-
// ============================================================================
|
|
252
|
-
// Data Export
|
|
253
|
-
// ============================================================================
|
|
254
|
-
/**
|
|
255
|
-
* Get metrics for a specific name
|
|
256
|
-
*/
|
|
257
|
-
getMetrics(name, since) {
|
|
258
|
-
let filtered = this.metrics.filter((m) => m.name === name);
|
|
259
|
-
if (since) {
|
|
260
|
-
filtered = filtered.filter((m) => m.timestamp >= since);
|
|
261
|
-
}
|
|
262
|
-
return filtered;
|
|
263
|
-
}
|
|
264
|
-
/**
|
|
265
|
-
* Get all metrics summary
|
|
266
|
-
*/
|
|
267
|
-
getMetricsSummary() {
|
|
268
|
-
const summary = {};
|
|
269
|
-
for (const metric of this.metrics) {
|
|
270
|
-
if (!summary[metric.name]) {
|
|
271
|
-
summary[metric.name] = { count: 0, sum: 0, lastValue: 0 };
|
|
272
|
-
}
|
|
273
|
-
summary[metric.name].count++;
|
|
274
|
-
summary[metric.name].sum += metric.value;
|
|
275
|
-
summary[metric.name].lastValue = metric.value;
|
|
276
|
-
}
|
|
277
|
-
const result = {};
|
|
278
|
-
for (const [name, data] of Object.entries(summary)) {
|
|
279
|
-
result[name] = {
|
|
280
|
-
count: data.count,
|
|
281
|
-
lastValue: data.lastValue,
|
|
282
|
-
avgValue: data.count > 0 ? data.sum / data.count : 0,
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
return result;
|
|
286
|
-
}
|
|
287
|
-
/**
|
|
288
|
-
* Reset all metrics
|
|
289
|
-
*/
|
|
290
|
-
reset() {
|
|
291
|
-
this.metrics = [];
|
|
292
|
-
this.responseTimes = [];
|
|
293
|
-
this.alerts = [];
|
|
294
|
-
this.requestCount = 0;
|
|
295
|
-
this.errorCount = 0;
|
|
296
|
-
this.activeRequests = 0;
|
|
297
|
-
this.startTime = Date.now();
|
|
298
|
-
}
|
|
299
|
-
// ============================================================================
|
|
300
|
-
// Private Methods
|
|
301
|
-
// ============================================================================
|
|
302
|
-
checkAlerts(name, value) {
|
|
303
|
-
if (!Object.hasOwn(this.config.alertThresholds, name))
|
|
304
|
-
return;
|
|
305
|
-
const thresholds = this.config.alertThresholds[name];
|
|
306
|
-
if (!thresholds)
|
|
307
|
-
return;
|
|
308
|
-
let level = null;
|
|
309
|
-
let threshold = 0;
|
|
310
|
-
if (value >= thresholds.critical) {
|
|
311
|
-
level = 'critical';
|
|
312
|
-
threshold = thresholds.critical;
|
|
313
|
-
}
|
|
314
|
-
else if (value >= thresholds.warning) {
|
|
315
|
-
level = 'warning';
|
|
316
|
-
threshold = thresholds.warning;
|
|
317
|
-
}
|
|
318
|
-
if (level) {
|
|
319
|
-
// Check if we already have a recent alert for this metric
|
|
320
|
-
const recentAlert = this.alerts.find((a) => a.metric === name &&
|
|
321
|
-
!a.acknowledged &&
|
|
322
|
-
Date.now() - a.timestamp < 60000);
|
|
323
|
-
if (!recentAlert) {
|
|
324
|
-
this.alerts.push({
|
|
325
|
-
id: `alert_${Date.now()}_${Math.random().toString(36).substring(7)}`,
|
|
326
|
-
level,
|
|
327
|
-
metric: name,
|
|
328
|
-
message: `${name} exceeded ${level} threshold: ${value} >= ${threshold}`,
|
|
329
|
-
value,
|
|
330
|
-
threshold,
|
|
331
|
-
timestamp: Date.now(),
|
|
332
|
-
acknowledged: false,
|
|
333
|
-
});
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
cleanupMetrics() {
|
|
338
|
-
const now = Date.now();
|
|
339
|
-
const cutoff = now - this.config.retentionMs;
|
|
340
|
-
// Remove old metrics
|
|
341
|
-
this.metrics = this.metrics.filter((m) => m.timestamp > cutoff);
|
|
342
|
-
// Limit total metrics
|
|
343
|
-
if (this.metrics.length > this.config.maxMetrics) {
|
|
344
|
-
this.metrics = this.metrics.slice(-this.config.maxMetrics);
|
|
345
|
-
}
|
|
346
|
-
// Remove old acknowledged alerts
|
|
347
|
-
this.alerts = this.alerts.filter((a) => !a.acknowledged || Date.now() - a.timestamp < 300000);
|
|
348
|
-
// Cap total alerts to prevent unbounded growth
|
|
349
|
-
const MAX_ALERTS = 500;
|
|
350
|
-
if (this.alerts.length > MAX_ALERTS) {
|
|
351
|
-
this.alerts = this.alerts.slice(-MAX_ALERTS);
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
// ============================================================================
|
|
356
|
-
// Convenience Functions
|
|
357
|
-
// ============================================================================
|
|
358
|
-
let defaultMonitor = null;
|
|
359
|
-
/**
|
|
360
|
-
* Create or get the default monitor
|
|
361
|
-
*/
|
|
362
|
-
export function createMonitor(config) {
|
|
363
|
-
if (!defaultMonitor) {
|
|
364
|
-
defaultMonitor = new MonitoringHooks(config);
|
|
365
|
-
}
|
|
366
|
-
return defaultMonitor;
|
|
367
|
-
}
|
|
368
|
-
/**
|
|
369
|
-
* Get the default monitor
|
|
370
|
-
*/
|
|
371
|
-
export function getMonitor() {
|
|
372
|
-
return createMonitor();
|
|
373
|
-
}
|
|
374
|
-
export default MonitoringHooks;
|
|
375
|
-
//# sourceMappingURL=monitoring.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":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ting
|
|
3
|
-
*
|
|
4
|
-
* Provides token bucket rate limiting with:
|
|
5
|
-
* - Per-operation limits
|
|
6
|
-
* - Per-user/agent limits
|
|
7
|
-
* - Burst allowance
|
|
8
|
-
* - Sliding window tracking
|
|
9
|
-
*
|
|
10
|
-
* @module @monomind/cli/production/rate-limiter
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Per-operation rate limit override.
|
|
14
|
-
*/
|
|
15
|
-
export interface OperationLimit {
|
|
16
|
-
/** Maximum number of requests allowed within the window. */
|
|
17
|
-
maxRequests: number;
|
|
18
|
-
/** Window size in milliseconds. */
|
|
19
|
-
windowMs: number;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Rate limiter configuration. All fields are optional when constructing —
|
|
23
|
-
* unspecified values fall back to {@link DEFAULT_CONFIG}.
|
|
24
|
-
*/
|
|
25
|
-
export interface RateLimiterConfig {
|
|
26
|
-
/** Default maximum requests per window. */
|
|
27
|
-
maxRequests: number;
|
|
28
|
-
/** Default window size in milliseconds. */
|
|
29
|
-
windowMs: number;
|
|
30
|
-
/** Multiplier applied for burst allowance. */
|
|
31
|
-
burstMultiplier: number;
|
|
32
|
-
/** Operations that bypass rate limiting entirely. */
|
|
33
|
-
whitelist: string[];
|
|
34
|
-
/** Per-operation limit overrides keyed by operation name. */
|
|
35
|
-
operationLimits: Record<string, OperationLimit>;
|
|
36
|
-
/** Whether to track limits per user/agent in addition to per operation. */
|
|
37
|
-
perUserLimits: boolean;
|
|
38
|
-
/** Maximum number of distinct buckets to retain before eviction. */
|
|
39
|
-
maxTrackedUsers: number;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Result of a rate limit check.
|
|
43
|
-
*/
|
|
44
|
-
export interface RateLimitResult {
|
|
45
|
-
/** Whether the request is permitted. */
|
|
46
|
-
allowed: boolean;
|
|
47
|
-
/** Remaining requests in the current window. */
|
|
48
|
-
remaining: number;
|
|
49
|
-
/** Epoch timestamp (ms) at which the window resets. */
|
|
50
|
-
resetAt: number;
|
|
51
|
-
/** When rate limited, milliseconds to wait before retrying. */
|
|
52
|
-
retryAfterMs?: number;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Snapshot of the current rate limit state for a key.
|
|
56
|
-
*/
|
|
57
|
-
export interface RateLimitStatus {
|
|
58
|
-
/** Number of requests counted in the current window. */
|
|
59
|
-
current: number;
|
|
60
|
-
/** Configured limit for the operation. */
|
|
61
|
-
limit: number;
|
|
62
|
-
/** Remaining requests in the current window. */
|
|
63
|
-
remaining: number;
|
|
64
|
-
/** Epoch timestamp (ms) at which the window resets. */
|
|
65
|
-
resetAt: number;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Aggregate operation usage entry used in statistics.
|
|
69
|
-
*/
|
|
70
|
-
export interface OperationStat {
|
|
71
|
-
/** Operation name. */
|
|
72
|
-
operation: string;
|
|
73
|
-
/** Total requests counted across buckets for the operation. */
|
|
74
|
-
requests: number;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Aggregate rate limiter statistics.
|
|
78
|
-
*/
|
|
79
|
-
export interface RateLimiterStats {
|
|
80
|
-
/** Total number of active buckets. */
|
|
81
|
-
totalBuckets: number;
|
|
82
|
-
/** Number of distinct users currently tracked. */
|
|
83
|
-
activeUsers: number;
|
|
84
|
-
/** Top operations by request volume. */
|
|
85
|
-
mostLimitedOperations: OperationStat[];
|
|
86
|
-
}
|
|
87
|
-
export declare class RateLimiter {
|
|
88
|
-
private config;
|
|
89
|
-
private buckets;
|
|
90
|
-
private globalBucket;
|
|
91
|
-
constructor(config?: Partial<RateLimiterConfig>);
|
|
92
|
-
/**
|
|
93
|
-
* Check if a request is allowed
|
|
94
|
-
*/
|
|
95
|
-
check(operation: string, userId?: string): RateLimitResult;
|
|
96
|
-
/**
|
|
97
|
-
* Consume a token (use after successful request)
|
|
98
|
-
*/
|
|
99
|
-
consume(operation: string, userId?: string): boolean;
|
|
100
|
-
/**
|
|
101
|
-
* Get current rate limit status
|
|
102
|
-
*/
|
|
103
|
-
getStatus(operation: string, userId?: string): RateLimitStatus;
|
|
104
|
-
/**
|
|
105
|
-
* Reset limits for a specific key
|
|
106
|
-
*/
|
|
107
|
-
reset(operation: string, userId?: string): void;
|
|
108
|
-
/**
|
|
109
|
-
* Reset all limits
|
|
110
|
-
*/
|
|
111
|
-
resetAll(): void;
|
|
112
|
-
/**
|
|
113
|
-
* Get statistics
|
|
114
|
-
*/
|
|
115
|
-
getStats(): RateLimiterStats;
|
|
116
|
-
private getLimits;
|
|
117
|
-
private createBucket;
|
|
118
|
-
private cleanupBuckets;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Create a rate limiter with default config
|
|
122
|
-
*/
|
|
123
|
-
export declare function createRateLimiter(config?: Partial<RateLimiterConfig>): RateLimiter;
|
|
124
|
-
export default RateLimiter;
|
|
125
|
-
//# sourceMappingURL=rate-limiter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rate-limiter.d.ts","sourceRoot":"","sources":["../../../src/production/rate-limiter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,4DAA4D;IAC5D,WAAW,EAAE,MAAM,CAAC;IACpB,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,eAAe,EAAE,MAAM,CAAC;IACxB,qDAAqD;IACrD,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,6DAA6D;IAC7D,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAChD,2EAA2E;IAC3E,aAAa,EAAE,OAAO,CAAC;IACvB,oEAAoE;IACpE,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