@kaitranntt/ccs 8.4.0-dev.10 → 8.4.0-dev.12
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 +4 -1
- package/dist/auth/profile-registry.d.ts.map +1 -1
- package/dist/auth/profile-registry.js +13 -12
- package/dist/auth/profile-registry.js.map +1 -1
- package/dist/cliproxy/accounts/account-safety.d.ts.map +1 -1
- package/dist/cliproxy/accounts/account-safety.js +56 -56
- package/dist/cliproxy/accounts/account-safety.js.map +1 -1
- package/dist/cliproxy/auth/antigravity-responsibility.d.ts.map +1 -1
- package/dist/cliproxy/auth/antigravity-responsibility.js +15 -15
- package/dist/cliproxy/auth/antigravity-responsibility.js.map +1 -1
- package/dist/cliproxy/auth/auth-token-manager.d.ts.map +1 -1
- package/dist/cliproxy/auth/auth-token-manager.js +2 -1
- package/dist/cliproxy/auth/auth-token-manager.js.map +1 -1
- package/dist/cliproxy/auth/auth-types.d.ts.map +1 -1
- package/dist/cliproxy/auth/auth-types.js +3 -2
- package/dist/cliproxy/auth/auth-types.js.map +1 -1
- package/dist/cliproxy/auth/oauth-handler.d.ts.map +1 -1
- package/dist/cliproxy/auth/oauth-handler.js +16 -5
- package/dist/cliproxy/auth/oauth-handler.js.map +1 -1
- package/dist/cliproxy/auth/provider-refreshers/index.d.ts +2 -1
- package/dist/cliproxy/auth/provider-refreshers/index.d.ts.map +1 -1
- package/dist/cliproxy/auth/provider-refreshers/index.js +4 -2
- package/dist/cliproxy/auth/provider-refreshers/index.js.map +1 -1
- package/dist/cliproxy/auth/token-manager.d.ts +2 -1
- package/dist/cliproxy/auth/token-manager.d.ts.map +1 -1
- package/dist/cliproxy/auth/token-manager.js +2 -1
- package/dist/cliproxy/auth/token-manager.js.map +1 -1
- package/dist/cliproxy/config/model-config.d.ts.map +1 -1
- package/dist/cliproxy/config/model-config.js +32 -32
- package/dist/cliproxy/config/model-config.js.map +1 -1
- package/dist/cliproxy/executor/arg-parser.d.ts.map +1 -1
- package/dist/cliproxy/executor/arg-parser.js +26 -26
- package/dist/cliproxy/executor/arg-parser.js.map +1 -1
- package/dist/cliproxy/executor/auth-coordinator.d.ts.map +1 -1
- package/dist/cliproxy/executor/auth-coordinator.js +15 -14
- package/dist/cliproxy/executor/auth-coordinator.js.map +1 -1
- package/dist/cliproxy/executor/index.d.ts.map +1 -1
- package/dist/cliproxy/executor/index.js +17 -13
- package/dist/cliproxy/executor/index.js.map +1 -1
- package/dist/cliproxy/executor/lifecycle-manager.d.ts.map +1 -1
- package/dist/cliproxy/executor/lifecycle-manager.js +18 -16
- package/dist/cliproxy/executor/lifecycle-manager.js.map +1 -1
- package/dist/cliproxy/executor/model-warnings.d.ts.map +1 -1
- package/dist/cliproxy/executor/model-warnings.js +24 -13
- package/dist/cliproxy/executor/model-warnings.js.map +1 -1
- package/dist/cliproxy/executor/retry-handler.d.ts.map +1 -1
- package/dist/cliproxy/executor/retry-handler.js +13 -11
- package/dist/cliproxy/executor/retry-handler.js.map +1 -1
- package/dist/cliproxy/executor/session-bridge.d.ts.map +1 -1
- package/dist/cliproxy/executor/session-bridge.js +18 -10
- package/dist/cliproxy/executor/session-bridge.js.map +1 -1
- package/dist/cliproxy/management/remote-token-uploader.d.ts.map +1 -1
- package/dist/cliproxy/management/remote-token-uploader.js +11 -11
- package/dist/cliproxy/management/remote-token-uploader.js.map +1 -1
- package/dist/cliproxy/provider-capabilities.d.ts +6 -0
- package/dist/cliproxy/provider-capabilities.d.ts.map +1 -1
- package/dist/cliproxy/provider-capabilities.js +28 -3
- package/dist/cliproxy/provider-capabilities.js.map +1 -1
- package/dist/cliproxy/proxy/https-tunnel-proxy.d.ts +5 -1
- package/dist/cliproxy/proxy/https-tunnel-proxy.d.ts.map +1 -1
- package/dist/cliproxy/proxy/https-tunnel-proxy.js +22 -10
- package/dist/cliproxy/proxy/https-tunnel-proxy.js.map +1 -1
- package/dist/cliproxy/proxy/tool-sanitization-proxy.d.ts +0 -12
- package/dist/cliproxy/proxy/tool-sanitization-proxy.d.ts.map +1 -1
- package/dist/cliproxy/proxy/tool-sanitization-proxy.js +42 -72
- package/dist/cliproxy/proxy/tool-sanitization-proxy.js.map +1 -1
- package/dist/cliproxy/quota/quota-fetcher/account-quota-fetcher.d.ts +21 -0
- package/dist/cliproxy/quota/quota-fetcher/account-quota-fetcher.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/account-quota-fetcher.js +154 -0
- package/dist/cliproxy/quota/quota-fetcher/account-quota-fetcher.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/all-accounts-fetcher.d.ts +35 -0
- package/dist/cliproxy/quota/quota-fetcher/all-accounts-fetcher.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/all-accounts-fetcher.js +98 -0
- package/dist/cliproxy/quota/quota-fetcher/all-accounts-fetcher.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/auth-file-reader.d.ts +22 -0
- package/dist/cliproxy/quota/quota-fetcher/auth-file-reader.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/auth-file-reader.js +111 -0
- package/dist/cliproxy/quota/quota-fetcher/auth-file-reader.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/available-models-fetcher.d.ts +17 -0
- package/dist/cliproxy/quota/quota-fetcher/available-models-fetcher.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/available-models-fetcher.js +85 -0
- package/dist/cliproxy/quota/quota-fetcher/available-models-fetcher.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/constants.d.ts +25 -0
- package/dist/cliproxy/quota/quota-fetcher/constants.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/constants.js +31 -0
- package/dist/cliproxy/quota/quota-fetcher/constants.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/http-client.d.ts +29 -0
- package/dist/cliproxy/quota/quota-fetcher/http-client.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/http-client.js +199 -0
- package/dist/cliproxy/quota/quota-fetcher/http-client.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/project-lookup.d.ts +16 -0
- package/dist/cliproxy/quota/quota-fetcher/project-lookup.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/project-lookup.js +89 -0
- package/dist/cliproxy/quota/quota-fetcher/project-lookup.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/status-classifier.d.ts +29 -0
- package/dist/cliproxy/quota/quota-fetcher/status-classifier.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/status-classifier.js +168 -0
- package/dist/cliproxy/quota/quota-fetcher/status-classifier.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/types.d.ts +165 -0
- package/dist/cliproxy/quota/quota-fetcher/types.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher/types.js +9 -0
- package/dist/cliproxy/quota/quota-fetcher/types.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-claude.d.ts.map +1 -1
- package/dist/cliproxy/quota/quota-fetcher-claude.js +14 -3
- package/dist/cliproxy/quota/quota-fetcher-claude.js.map +1 -1
- package/dist/cliproxy/quota/quota-fetcher-codex.d.ts.map +1 -1
- package/dist/cliproxy/quota/quota-fetcher-codex.js +36 -9
- package/dist/cliproxy/quota/quota-fetcher-codex.js.map +1 -1
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/auth-file-discovery.d.ts +26 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/auth-file-discovery.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/auth-file-discovery.js +132 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/auth-file-discovery.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/bucket-building.d.ts +23 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/bucket-building.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/bucket-building.js +54 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/bucket-building.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/constants.d.ts +26 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/constants.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/constants.js +29 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/constants.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/error-parsing.d.ts +61 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/error-parsing.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/error-parsing.js +259 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/error-parsing.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/index.d.ts +20 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/index.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/index.js +38 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/index.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/managed-request.d.ts +82 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/managed-request.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/managed-request.js +263 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/managed-request.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/quota-fetcher.d.ts +46 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/quota-fetcher.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/quota-fetcher.js +188 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/quota-fetcher.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/shared-utils.d.ts +35 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/shared-utils.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/shared-utils.js +65 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/shared-utils.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/supplementary-metadata.d.ts +37 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/supplementary-metadata.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/supplementary-metadata.js +117 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/supplementary-metadata.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/token-parsing.d.ts +31 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/token-parsing.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/token-parsing.js +77 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/token-parsing.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/types.d.ts +114 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/types.d.ts.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/types.js +10 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli/types.js.map +1 -0
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli.d.ts +13 -58
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli.d.ts.map +1 -1
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli.js +20 -819
- package/dist/cliproxy/quota/quota-fetcher-gemini-cli.js.map +1 -1
- package/dist/cliproxy/quota/quota-fetcher-ghcp.d.ts.map +1 -1
- package/dist/cliproxy/quota/quota-fetcher-ghcp.js +19 -4
- package/dist/cliproxy/quota/quota-fetcher-ghcp.js.map +1 -1
- package/dist/cliproxy/quota/quota-fetcher.d.ts +12 -108
- package/dist/cliproxy/quota/quota-fetcher.d.ts.map +1 -1
- package/dist/cliproxy/quota/quota-fetcher.js +23 -766
- package/dist/cliproxy/quota/quota-fetcher.js.map +1 -1
- package/dist/cliproxy/routing/routing-strategy.d.ts.map +1 -1
- package/dist/cliproxy/routing/routing-strategy.js +11 -3
- package/dist/cliproxy/routing/routing-strategy.js.map +1 -1
- package/dist/commands/cliproxy/quota-subcommand/claude-window-helpers.d.ts +26 -0
- package/dist/commands/cliproxy/quota-subcommand/claude-window-helpers.d.ts.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/claude-window-helpers.js +82 -0
- package/dist/commands/cliproxy/quota-subcommand/claude-window-helpers.js.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/codex-window-helpers.d.ts +41 -0
- package/dist/commands/cliproxy/quota-subcommand/codex-window-helpers.d.ts.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/codex-window-helpers.js +202 -0
- package/dist/commands/cliproxy/quota-subcommand/codex-window-helpers.js.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/format-helpers.d.ts +32 -0
- package/dist/commands/cliproxy/quota-subcommand/format-helpers.d.ts.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/format-helpers.js +90 -0
- package/dist/commands/cliproxy/quota-subcommand/format-helpers.js.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/handlers.d.ts +25 -0
- package/dist/commands/cliproxy/quota-subcommand/handlers.d.ts.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/handlers.js +245 -0
- package/dist/commands/cliproxy/quota-subcommand/handlers.js.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/profile-args.d.ts +10 -0
- package/dist/commands/cliproxy/quota-subcommand/profile-args.d.ts.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/profile-args.js +37 -0
- package/dist/commands/cliproxy/quota-subcommand/profile-args.js.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/provider-runtime.d.ts +12 -0
- package/dist/commands/cliproxy/quota-subcommand/provider-runtime.d.ts.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/provider-runtime.js +64 -0
- package/dist/commands/cliproxy/quota-subcommand/provider-runtime.js.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/quota-failure-display.d.ts +27 -0
- package/dist/commands/cliproxy/quota-subcommand/quota-failure-display.d.ts.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/quota-failure-display.js +74 -0
- package/dist/commands/cliproxy/quota-subcommand/quota-failure-display.js.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/antigravity.d.ts +10 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/antigravity.d.ts.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/antigravity.js +46 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/antigravity.js.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/claude.d.ts +14 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/claude.d.ts.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/claude.js +68 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/claude.js.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/codex.d.ts +14 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/codex.d.ts.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/codex.js +82 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/codex.js.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/gemini-cli.d.ts +14 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/gemini-cli.d.ts.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/gemini-cli.js +61 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/gemini-cli.js.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/ghcp.d.ts +13 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/ghcp.d.ts.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/ghcp.js +63 -0
- package/dist/commands/cliproxy/quota-subcommand/sections/ghcp.js.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/test-exports.d.ts +19 -0
- package/dist/commands/cliproxy/quota-subcommand/test-exports.d.ts.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/test-exports.js +22 -0
- package/dist/commands/cliproxy/quota-subcommand/test-exports.js.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/types.d.ts +42 -0
- package/dist/commands/cliproxy/quota-subcommand/types.d.ts.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand/types.js +9 -0
- package/dist/commands/cliproxy/quota-subcommand/types.js.map +1 -0
- package/dist/commands/cliproxy/quota-subcommand.d.ts +14 -36
- package/dist/commands/cliproxy/quota-subcommand.d.ts.map +1 -1
- package/dist/commands/cliproxy/quota-subcommand.js +21 -872
- package/dist/commands/cliproxy/quota-subcommand.js.map +1 -1
- package/dist/commands/command-catalog.js +1 -1
- package/dist/commands/command-catalog.js.map +1 -1
- package/dist/commands/persist-command/arg-parsing.d.ts +14 -0
- package/dist/commands/persist-command/arg-parsing.d.ts.map +1 -0
- package/dist/commands/persist-command/arg-parsing.js +84 -0
- package/dist/commands/persist-command/arg-parsing.js.map +1 -0
- package/dist/commands/persist-command/backup-rotation.d.ts +23 -0
- package/dist/commands/persist-command/backup-rotation.d.ts.map +1 -0
- package/dist/commands/persist-command/backup-rotation.js +260 -0
- package/dist/commands/persist-command/backup-rotation.js.map +1 -0
- package/dist/commands/persist-command/handler.d.ts +10 -0
- package/dist/commands/persist-command/handler.d.ts.map +1 -0
- package/dist/commands/persist-command/handler.js +267 -0
- package/dist/commands/persist-command/handler.js.map +1 -0
- package/dist/commands/persist-command/help.d.ts +9 -0
- package/dist/commands/persist-command/help.d.ts.map +1 -0
- package/dist/commands/persist-command/help.js +86 -0
- package/dist/commands/persist-command/help.js.map +1 -0
- package/dist/commands/persist-command/receipt.d.ts +13 -0
- package/dist/commands/persist-command/receipt.d.ts.map +1 -0
- package/dist/commands/persist-command/receipt.js +102 -0
- package/dist/commands/persist-command/receipt.js.map +1 -0
- package/dist/commands/persist-command/secret-detection.d.ts +11 -0
- package/dist/commands/persist-command/secret-detection.d.ts.map +1 -0
- package/dist/commands/persist-command/secret-detection.js +54 -0
- package/dist/commands/persist-command/secret-detection.js.map +1 -0
- package/dist/commands/persist-command/secure-file.d.ts +21 -0
- package/dist/commands/persist-command/secure-file.d.ts.map +1 -0
- package/dist/commands/persist-command/secure-file.js +231 -0
- package/dist/commands/persist-command/secure-file.js.map +1 -0
- package/dist/commands/persist-command/types.d.ts +42 -0
- package/dist/commands/persist-command/types.d.ts.map +1 -0
- package/dist/commands/persist-command/types.js +34 -0
- package/dist/commands/persist-command/types.js.map +1 -0
- package/dist/commands/persist-command.d.ts +7 -2
- package/dist/commands/persist-command.d.ts.map +1 -1
- package/dist/commands/persist-command.js +17 -933
- package/dist/commands/persist-command.js.map +1 -1
- package/dist/copilot/copilot-executor.js +25 -25
- package/dist/copilot/copilot-executor.js.map +1 -1
- package/dist/cursor/cursor-daemon-entry.d.ts.map +1 -1
- package/dist/cursor/cursor-daemon-entry.js +34 -9
- package/dist/cursor/cursor-daemon-entry.js.map +1 -1
- package/dist/cursor/cursor-daemon.d.ts.map +1 -1
- package/dist/cursor/cursor-daemon.js +1 -0
- package/dist/cursor/cursor-daemon.js.map +1 -1
- package/dist/cursor/cursor-profile-executor.d.ts.map +1 -1
- package/dist/cursor/cursor-profile-executor.js +18 -17
- package/dist/cursor/cursor-profile-executor.js.map +1 -1
- package/dist/delegation/delegation-handler.d.ts.map +1 -1
- package/dist/delegation/delegation-handler.js +29 -23
- package/dist/delegation/delegation-handler.js.map +1 -1
- package/dist/delegation/headless-executor.d.ts +1 -0
- package/dist/delegation/headless-executor.d.ts.map +1 -1
- package/dist/delegation/headless-executor.js +35 -14
- package/dist/delegation/headless-executor.js.map +1 -1
- package/dist/delegation/session-manager.d.ts.map +1 -1
- package/dist/delegation/session-manager.js +12 -4
- package/dist/delegation/session-manager.js.map +1 -1
- package/dist/dispatcher/cli-argument-parser.d.ts +1 -1
- package/dist/dispatcher/cli-argument-parser.d.ts.map +1 -1
- package/dist/dispatcher/cli-argument-parser.js +24 -23
- package/dist/dispatcher/cli-argument-parser.js.map +1 -1
- package/dist/dispatcher/flows/cliproxy-flow.d.ts.map +1 -1
- package/dist/dispatcher/flows/cliproxy-flow.js +12 -11
- package/dist/dispatcher/flows/cliproxy-flow.js.map +1 -1
- package/dist/dispatcher/flows/settings-flow.d.ts.map +1 -1
- package/dist/dispatcher/flows/settings-flow.js +27 -27
- package/dist/dispatcher/flows/settings-flow.js.map +1 -1
- package/dist/dispatcher/profile-resolver.d.ts.map +1 -1
- package/dist/dispatcher/profile-resolver.js +16 -16
- package/dist/dispatcher/profile-resolver.js.map +1 -1
- package/dist/docker/supervisord-lifecycle.d.ts.map +1 -1
- package/dist/docker/supervisord-lifecycle.js +5 -1
- package/dist/docker/supervisord-lifecycle.js.map +1 -1
- package/dist/errors/error-types.d.ts +26 -22
- package/dist/errors/error-types.d.ts.map +1 -1
- package/dist/errors/error-types.js +15 -12
- package/dist/errors/error-types.js.map +1 -1
- package/dist/errors/exit-codes.d.ts +20 -13
- package/dist/errors/exit-codes.d.ts.map +1 -1
- package/dist/errors/exit-codes.js +32 -28
- package/dist/errors/exit-codes.js.map +1 -1
- package/dist/glmt/delta-accumulator.d.ts +1 -0
- package/dist/glmt/delta-accumulator.d.ts.map +1 -1
- package/dist/glmt/delta-accumulator.js +12 -4
- package/dist/glmt/delta-accumulator.js.map +1 -1
- package/dist/glmt/glmt-proxy.d.ts.map +1 -1
- package/dist/glmt/glmt-proxy.js +39 -10
- package/dist/glmt/glmt-proxy.js.map +1 -1
- package/dist/glmt/glmt-transformer.d.ts.map +1 -1
- package/dist/glmt/glmt-transformer.js +1 -4
- package/dist/glmt/glmt-transformer.js.map +1 -1
- package/dist/glmt/pipeline/request-transformer.d.ts.map +1 -1
- package/dist/glmt/pipeline/request-transformer.js +5 -1
- package/dist/glmt/pipeline/request-transformer.js.map +1 -1
- package/dist/glmt/pipeline/response-builder.d.ts.map +1 -1
- package/dist/glmt/pipeline/response-builder.js +7 -3
- package/dist/glmt/pipeline/response-builder.js.map +1 -1
- package/dist/glmt/pipeline/stream-parser.d.ts.map +1 -1
- package/dist/glmt/pipeline/stream-parser.js +11 -5
- package/dist/glmt/pipeline/stream-parser.js.map +1 -1
- package/dist/glmt/pipeline/tool-call-handler.d.ts.map +1 -1
- package/dist/glmt/pipeline/tool-call-handler.js +7 -1
- package/dist/glmt/pipeline/tool-call-handler.js.map +1 -1
- package/dist/glmt/sse-parser.d.ts +1 -0
- package/dist/glmt/sse-parser.d.ts.map +1 -1
- package/dist/glmt/sse-parser.js +7 -3
- package/dist/glmt/sse-parser.js.map +1 -1
- package/dist/management/shared-manager/fs-helpers.d.ts +69 -0
- package/dist/management/shared-manager/fs-helpers.d.ts.map +1 -0
- package/dist/management/shared-manager/fs-helpers.js +241 -0
- package/dist/management/shared-manager/fs-helpers.js.map +1 -0
- package/dist/management/shared-manager/migrations.d.ts +21 -0
- package/dist/management/shared-manager/migrations.d.ts.map +1 -0
- package/dist/management/shared-manager/migrations.js +187 -0
- package/dist/management/shared-manager/migrations.js.map +1 -0
- package/dist/management/shared-manager/orchestrator.d.ts +87 -0
- package/dist/management/shared-manager/orchestrator.d.ts.map +1 -0
- package/dist/management/shared-manager/orchestrator.js +161 -0
- package/dist/management/shared-manager/orchestrator.js.map +1 -0
- package/dist/management/shared-manager/plugin-layout-internals.d.ts +42 -0
- package/dist/management/shared-manager/plugin-layout-internals.d.ts.map +1 -0
- package/dist/management/shared-manager/plugin-layout-internals.js +192 -0
- package/dist/management/shared-manager/plugin-layout-internals.js.map +1 -0
- package/dist/management/shared-manager/plugin-metadata-normalizer.d.ts +53 -0
- package/dist/management/shared-manager/plugin-metadata-normalizer.d.ts.map +1 -0
- package/dist/management/shared-manager/plugin-metadata-normalizer.js +253 -0
- package/dist/management/shared-manager/plugin-metadata-normalizer.js.map +1 -0
- package/dist/management/shared-manager/project-context-sync.d.ts +36 -0
- package/dist/management/shared-manager/project-context-sync.d.ts.map +1 -0
- package/dist/management/shared-manager/project-context-sync.js +204 -0
- package/dist/management/shared-manager/project-context-sync.js.map +1 -0
- package/dist/management/shared-manager/project-memory-sync.d.ts +21 -0
- package/dist/management/shared-manager/project-memory-sync.d.ts.map +1 -0
- package/dist/management/shared-manager/project-memory-sync.js +113 -0
- package/dist/management/shared-manager/project-memory-sync.js.map +1 -0
- package/dist/management/shared-manager/shared-dir-linker.d.ts +41 -0
- package/dist/management/shared-manager/shared-dir-linker.d.ts.map +1 -0
- package/dist/management/shared-manager/shared-dir-linker.js +227 -0
- package/dist/management/shared-manager/shared-dir-linker.js.map +1 -0
- package/dist/management/shared-manager/symlink-helpers.d.ts +61 -0
- package/dist/management/shared-manager/symlink-helpers.d.ts.map +1 -0
- package/dist/management/shared-manager/symlink-helpers.js +243 -0
- package/dist/management/shared-manager/symlink-helpers.js.map +1 -0
- package/dist/management/shared-manager/types.d.ts +45 -0
- package/dist/management/shared-manager/types.d.ts.map +1 -0
- package/dist/management/shared-manager/types.js +57 -0
- package/dist/management/shared-manager/types.js.map +1 -0
- package/dist/management/shared-manager.d.ts +13 -160
- package/dist/management/shared-manager.d.ts.map +1 -1
- package/dist/management/shared-manager.js +18 -1294
- package/dist/management/shared-manager.js.map +1 -1
- package/dist/proxy/proxy-daemon-entry.js +1 -1
- package/dist/proxy/proxy-daemon-entry.js.map +1 -1
- package/dist/proxy/transformers/sse-stream-transformer.d.ts.map +1 -1
- package/dist/proxy/transformers/sse-stream-transformer.js +12 -17
- package/dist/proxy/transformers/sse-stream-transformer.js.map +1 -1
- package/dist/services/logging/index.d.ts +1 -1
- package/dist/services/logging/index.d.ts.map +1 -1
- package/dist/services/logging/index.js +6 -1
- package/dist/services/logging/index.js.map +1 -1
- package/dist/services/logging/log-context.d.ts +27 -2
- package/dist/services/logging/log-context.d.ts.map +1 -1
- package/dist/services/logging/log-context.js +43 -4
- package/dist/services/logging/log-context.js.map +1 -1
- package/dist/services/logging/log-redaction.d.ts +9 -0
- package/dist/services/logging/log-redaction.d.ts.map +1 -1
- package/dist/services/logging/log-redaction.js +31 -3
- package/dist/services/logging/log-redaction.js.map +1 -1
- package/dist/services/logging/logger.js +2 -2
- package/dist/services/logging/logger.js.map +1 -1
- package/dist/targets/codex-adapter.d.ts.map +1 -1
- package/dist/targets/codex-adapter.js +11 -10
- package/dist/targets/codex-adapter.js.map +1 -1
- package/dist/targets/droid-adapter.d.ts.map +1 -1
- package/dist/targets/droid-adapter.js +12 -12
- package/dist/targets/droid-adapter.js.map +1 -1
- package/dist/ui/assets/{Trans-BXjW_Rw3.js → Trans-BwpUiqvP.js} +1 -1
- package/dist/ui/assets/{accounts-C7JMc-UL.js → accounts-CDeA-kae.js} +1 -1
- package/dist/ui/assets/{alert-dialog-BSSHnWG_.js → alert-dialog-BRkyiRHQ.js} +1 -1
- package/dist/ui/assets/{api-GzEZNvOJ.js → api-BRWfSjSD.js} +1 -1
- package/dist/ui/assets/{auth-section-B6k7LWIq.js → auth-section-Dld8SmBW.js} +1 -1
- package/dist/ui/assets/{backups-section-Cr3g01YN.js → backups-section-BjxUn_e_.js} +1 -1
- package/dist/ui/assets/{channels-CMyh1yhN.js → channels-DNygT5ch.js} +1 -1
- package/dist/ui/assets/{checkbox-BkqYXiER.js → checkbox-BJ0-bsxD.js} +1 -1
- package/dist/ui/assets/{claude-extension-BzYl3zcz.js → claude-extension-CC-wTNix.js} +1 -1
- package/dist/ui/assets/{cliproxy-DwzKzuZI.js → cliproxy-DetLHcry.js} +1 -1
- package/dist/ui/assets/{cliproxy-ai-providers-DL95SYNa.js → cliproxy-ai-providers-Bff5bWqv.js} +1 -1
- package/dist/ui/assets/{cliproxy-control-panel-Ba2Rgzdo.js → cliproxy-control-panel-Bn8hX4VV.js} +1 -1
- package/dist/ui/assets/{codex-ClTEGCnr.js → codex-CNpaciGy.js} +1 -1
- package/dist/ui/assets/{confirm-dialog-BPAO4ILr.js → confirm-dialog-COJMNkgP.js} +1 -1
- package/dist/ui/assets/{copilot-CymHD4gl.js → copilot-DEBijivg.js} +1 -1
- package/dist/ui/assets/{cursor-DAiPXs8h.js → cursor-C-dhAZ4z.js} +1 -1
- package/dist/ui/assets/{droid-CAhLWDOj.js → droid-BqDBIX3T.js} +1 -1
- package/dist/ui/assets/{globalenv-section-BK5x_uXG.js → globalenv-section-BgosEOku.js} +1 -1
- package/dist/ui/assets/{health-D_ErMvYv.js → health-7mnaGWzH.js} +1 -1
- package/dist/ui/assets/{index-BZMyk4bI.js → index-6pgCCA-E.js} +1 -1
- package/dist/ui/assets/{index-BcfwoMDm.js → index-8KxHfBTG.js} +36 -36
- package/dist/ui/assets/{index-BmbKPprT.js → index-C6UKtunR.js} +1 -1
- package/dist/ui/assets/{index-B4cUkPwc.js → index-fDjN779H.js} +1 -1
- package/dist/ui/assets/{index-CEjVNSjg.js → index-pqVnLYqm.js} +1 -1
- package/dist/ui/assets/{index-CFDjAXOB.js → index-qCqsxM4P.js} +1 -1
- package/dist/ui/assets/{index-DCC80SZ0.js → index-yHxwc_u3.js} +1 -1
- package/dist/ui/assets/{logs-DwhXr-9Y.js → logs-i-F9qaEH.js} +1 -1
- package/dist/ui/assets/{masked-input-DWJTe7jh.js → masked-input-D9UchwhD.js} +1 -1
- package/dist/ui/assets/{proxy-status-widget-CJXi8yui.js → proxy-status-widget-BaFIW7Op.js} +1 -1
- package/dist/ui/assets/{raw-json-settings-editor-panel-DWhAi0kI.js → raw-json-settings-editor-panel-sC8qxIaf.js} +1 -1
- package/dist/ui/assets/{searchable-select-CYC4Y8pS.js → searchable-select-C_x7EmF6.js} +1 -1
- package/dist/ui/assets/{separator-JhuNwVKE.js → separator-mNegtV2Z.js} +1 -1
- package/dist/ui/assets/{shared-Hpgs7l5G.js → shared-DpJUlkXs.js} +1 -1
- package/dist/ui/assets/{table-DDJTZfyL.js → table-CtEViMua.js} +1 -1
- package/dist/ui/assets/{updates-CtygOHUO.js → updates-RohG3ly8.js} +1 -1
- package/dist/ui/assets/{use-accounts-CaptC8AS.js → use-accounts-CVjvVzVy.js} +1 -1
- package/dist/ui/index.html +1 -1
- package/dist/utils/image-analysis/mcp-installer.d.ts.map +1 -1
- package/dist/utils/image-analysis/mcp-installer.js +16 -13
- package/dist/utils/image-analysis/mcp-installer.js.map +1 -1
- package/dist/utils/websearch/mcp-installer.d.ts.map +1 -1
- package/dist/utils/websearch/mcp-installer.js +14 -12
- package/dist/utils/websearch/mcp-installer.js.map +1 -1
- package/dist/web-server/middleware/request-logging-middleware.d.ts.map +1 -1
- package/dist/web-server/middleware/request-logging-middleware.js +14 -9
- package/dist/web-server/middleware/request-logging-middleware.js.map +1 -1
- package/dist/web-server/routes/bar-routes.d.ts.map +1 -1
- package/dist/web-server/routes/bar-routes.js +11 -2
- package/dist/web-server/routes/bar-routes.js.map +1 -1
- package/dist/web-server/routes/claude-extension-routes.d.ts.map +1 -1
- package/dist/web-server/routes/claude-extension-routes.js +3 -2
- package/dist/web-server/routes/claude-extension-routes.js.map +1 -1
- package/dist/web-server/routes/cliproxy-auth-routes.d.ts +1 -0
- package/dist/web-server/routes/cliproxy-auth-routes.d.ts.map +1 -1
- package/dist/web-server/routes/cliproxy-auth-routes.js +20 -5
- package/dist/web-server/routes/cliproxy-auth-routes.js.map +1 -1
- package/dist/web-server/routes/cliproxy-stats-routes/config-routes.d.ts +16 -0
- package/dist/web-server/routes/cliproxy-stats-routes/config-routes.d.ts.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes/config-routes.js +219 -0
- package/dist/web-server/routes/cliproxy-stats-routes/config-routes.js.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes/error-log-routes.d.ts +12 -0
- package/dist/web-server/routes/cliproxy-stats-routes/error-log-routes.d.ts.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes/error-log-routes.js +153 -0
- package/dist/web-server/routes/cliproxy-stats-routes/error-log-routes.js.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes/quota-helpers.d.ts +19 -0
- package/dist/web-server/routes/cliproxy-stats-routes/quota-helpers.d.ts.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes/quota-helpers.js +38 -0
- package/dist/web-server/routes/cliproxy-stats-routes/quota-helpers.js.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes/quota-routes.d.ts +13 -0
- package/dist/web-server/routes/cliproxy-stats-routes/quota-routes.d.ts.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes/quota-routes.js +195 -0
- package/dist/web-server/routes/cliproxy-stats-routes/quota-routes.js.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes/restart-route.d.ts +17 -0
- package/dist/web-server/routes/cliproxy-stats-routes/restart-route.d.ts.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes/restart-route.js +34 -0
- package/dist/web-server/routes/cliproxy-stats-routes/restart-route.js.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes/router.d.ts +10 -0
- package/dist/web-server/routes/cliproxy-stats-routes/router.d.ts.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes/router.js +245 -0
- package/dist/web-server/routes/cliproxy-stats-routes/router.js.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes/shared.d.ts +35 -0
- package/dist/web-server/routes/cliproxy-stats-routes/shared.d.ts.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes/shared.js +59 -0
- package/dist/web-server/routes/cliproxy-stats-routes/shared.js.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes/version-helpers.d.ts +44 -0
- package/dist/web-server/routes/cliproxy-stats-routes/version-helpers.d.ts.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes/version-helpers.js +66 -0
- package/dist/web-server/routes/cliproxy-stats-routes/version-helpers.js.map +1 -0
- package/dist/web-server/routes/cliproxy-stats-routes.d.ts +16 -57
- package/dist/web-server/routes/cliproxy-stats-routes.d.ts.map +1 -1
- package/dist/web-server/routes/cliproxy-stats-routes.js +25 -926
- package/dist/web-server/routes/cliproxy-stats-routes.js.map +1 -1
- package/dist/web-server/routes/cliproxy-sync-routes.d.ts.map +1 -1
- package/dist/web-server/routes/cliproxy-sync-routes.js +9 -2
- package/dist/web-server/routes/cliproxy-sync-routes.js.map +1 -1
- package/dist/web-server/routes/copilot-settings-routes.d.ts.map +1 -1
- package/dist/web-server/routes/copilot-settings-routes.js +2 -1
- package/dist/web-server/routes/copilot-settings-routes.js.map +1 -1
- package/dist/web-server/routes/image-analysis-routes.d.ts.map +1 -1
- package/dist/web-server/routes/image-analysis-routes.js +2 -1
- package/dist/web-server/routes/image-analysis-routes.js.map +1 -1
- package/dist/web-server/routes/persist-routes.d.ts.map +1 -1
- package/dist/web-server/routes/persist-routes.js +8 -1
- package/dist/web-server/routes/persist-routes.js.map +1 -1
- package/dist/web-server/routes/proxy-routes.d.ts.map +1 -1
- package/dist/web-server/routes/proxy-routes.js +33 -5
- package/dist/web-server/routes/proxy-routes.js.map +1 -1
- package/dist/web-server/routes/route-helpers.d.ts.map +1 -1
- package/dist/web-server/routes/route-helpers.js +10 -6
- package/dist/web-server/routes/route-helpers.js.map +1 -1
- package/dist/web-server/routes/settings-routes.d.ts.map +1 -1
- package/dist/web-server/routes/settings-routes.js +7 -6
- package/dist/web-server/routes/settings-routes.js.map +1 -1
- package/dist/web-server/usage/aggregator.d.ts.map +1 -1
- package/dist/web-server/usage/aggregator.js +8 -8
- package/dist/web-server/usage/aggregator.js.map +1 -1
- package/dist/web-server/usage/handlers.d.ts.map +1 -1
- package/dist/web-server/usage/handlers.js +1 -1
- package/dist/web-server/usage/handlers.js.map +1 -1
- package/package.json +1 -1
- package/scripts/ci-parity-gate.sh +31 -0
- package/scripts/generate-throw-error-baseline.js +103 -0
- package/scripts/hardening-inventory.js +62 -4
- package/scripts/maintainability-metrics.js +356 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Generate the baseline allowlist for eslint-rules/no-new-throw-error.js.
|
|
5
|
+
*
|
|
6
|
+
* Walks src/ (non-test), finds every `throw new Error(...)` site using the same
|
|
7
|
+
* comment-stripping as scripts/maintainability-metrics.js (so the baseline
|
|
8
|
+
* matches what the ESLint AST sees — comments are not ThrowStatement nodes),
|
|
9
|
+
* and writes eslint-rules/throw-error-baseline.json as a sorted array of
|
|
10
|
+
* `${relativePath}:${line}` keys.
|
|
11
|
+
*
|
|
12
|
+
* Run after intentionally adding a new grandfathered throw, or quarterly to
|
|
13
|
+
* prune entries that have since been converted to typed errors.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
'use strict';
|
|
17
|
+
|
|
18
|
+
const fs = require('fs');
|
|
19
|
+
const path = require('path');
|
|
20
|
+
|
|
21
|
+
const ROOT_DIR = path.resolve(__dirname, '..');
|
|
22
|
+
const SRC_DIR = path.join(ROOT_DIR, 'src');
|
|
23
|
+
const OUTPUT_PATH = path.join(ROOT_DIR, 'eslint-rules', 'throw-error-baseline.json');
|
|
24
|
+
|
|
25
|
+
const SOURCE_EXTENSIONS = new Set(['.ts', '.tsx', '.js', '.jsx', '.mjs', '.cjs']);
|
|
26
|
+
const THROW_NEW_ERROR_REGEX = /\bthrow\s+new\s+Error\s*\(/g;
|
|
27
|
+
|
|
28
|
+
function isTestPath(relPath) {
|
|
29
|
+
return (
|
|
30
|
+
/(?:^|\/)(?:__tests__|tests?)\//.test(relPath) ||
|
|
31
|
+
/\.test\./.test(relPath) ||
|
|
32
|
+
/\.spec\./.test(relPath)
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function toPosix(p) {
|
|
37
|
+
return p.split(path.sep).join('/');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function relPath(fullPath) {
|
|
41
|
+
return toPosix(path.relative(ROOT_DIR, fullPath));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Lazy require: hardening-inventory.js requires this module's sibling maintainability-metrics.js
|
|
45
|
+
// at top level; requiring it back at top level here would capture a partial module.exports.
|
|
46
|
+
// A function-scope require resolves against the fully-loaded module at call time.
|
|
47
|
+
function stripCommentsOnce(sourceText) {
|
|
48
|
+
return require('./hardening-inventory.js').stripComments(sourceText);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function walkFiles(dirPath) {
|
|
52
|
+
const out = [];
|
|
53
|
+
let entries;
|
|
54
|
+
try {
|
|
55
|
+
entries = fs.readdirSync(dirPath, { withFileTypes: true });
|
|
56
|
+
} catch {
|
|
57
|
+
return out;
|
|
58
|
+
}
|
|
59
|
+
for (const entry of entries) {
|
|
60
|
+
if (entry.name === 'node_modules' || entry.name === 'dist') continue;
|
|
61
|
+
const full = path.join(dirPath, entry.name);
|
|
62
|
+
if (entry.isDirectory()) {
|
|
63
|
+
out.push.apply(out, walkFiles(full));
|
|
64
|
+
} else if (entry.isFile() && SOURCE_EXTENSIONS.has(path.extname(full))) {
|
|
65
|
+
out.push(full);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return out;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function collectSites() {
|
|
72
|
+
const sites = [];
|
|
73
|
+
for (const full of walkFiles(SRC_DIR)) {
|
|
74
|
+
const rel = relPath(full);
|
|
75
|
+
if (isTestPath(rel)) continue;
|
|
76
|
+
// Match on the RAW source (not comment-stripped). ESLint lints the raw
|
|
77
|
+
// file, so the baseline must reflect real throw lines as the AST sees them.
|
|
78
|
+
// stripComments can undercount on files whose regex/template literals confuse
|
|
79
|
+
// its state machine; raw matching is a superset (may include comment/string
|
|
80
|
+
// mentions, which are harmless unused allowlist entries) and never undercounts.
|
|
81
|
+
const sourceText = fs.readFileSync(full, 'utf8');
|
|
82
|
+
const re = new RegExp(THROW_NEW_ERROR_REGEX.source, 'g');
|
|
83
|
+
let match;
|
|
84
|
+
while ((match = re.exec(sourceText)) !== null) {
|
|
85
|
+
const line = sourceText.slice(0, match.index).split(/\r?\n/).length;
|
|
86
|
+
sites.push(`${rel}:${line}`);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return sites.sort();
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function main() {
|
|
93
|
+
const sites = collectSites();
|
|
94
|
+
fs.mkdirSync(path.dirname(OUTPUT_PATH), { recursive: true });
|
|
95
|
+
fs.writeFileSync(OUTPUT_PATH, JSON.stringify(sites, null, 2) + '\n', 'utf8');
|
|
96
|
+
console.log(`[throw-error-baseline] ${sites.length} sites -> ${relPath(OUTPUT_PATH)}`);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (require.main === module) {
|
|
100
|
+
main();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
module.exports = { collectSites, OUTPUT_PATH };
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const path = require('path');
|
|
5
5
|
|
|
6
|
+
const { collectMaintainabilityMetrics } = require('./maintainability-metrics.js');
|
|
7
|
+
|
|
6
8
|
const ROOT_DIR = path.resolve(__dirname, '..');
|
|
7
9
|
const SRC_DIR = path.join(ROOT_DIR, 'src');
|
|
8
10
|
const REPORT_DIR = path.join(ROOT_DIR, 'docs', 'reports');
|
|
@@ -430,6 +432,7 @@ function buildReport() {
|
|
|
430
432
|
.filter((file) => /shim|re-export|compat/i.test(path.basename(file)))
|
|
431
433
|
),
|
|
432
434
|
},
|
|
435
|
+
maintainability: collectMaintainabilityMetrics(ROOT_DIR),
|
|
433
436
|
};
|
|
434
437
|
}
|
|
435
438
|
|
|
@@ -489,6 +492,55 @@ function renderMarkdown(report) {
|
|
|
489
492
|
lines.push('- _none_');
|
|
490
493
|
}
|
|
491
494
|
|
|
495
|
+
const m = report.maintainability;
|
|
496
|
+
if (m) {
|
|
497
|
+
lines.push('## Maintainability Metrics');
|
|
498
|
+
lines.push('');
|
|
499
|
+
lines.push('| Metric | Value |');
|
|
500
|
+
lines.push('|---|---:|');
|
|
501
|
+
lines.push(
|
|
502
|
+
`| typed-error adoption (typed/total throws) | ${(m.typedErrors.adoptionRatio * 100).toFixed(1)}% (${m.typedErrors.typedThrows}/${m.typedErrors.totalThrows}) |`
|
|
503
|
+
);
|
|
504
|
+
lines.push(
|
|
505
|
+
`| typed-error adoption (P4 locked subdomains) | ${(m.typedErrorAdoption.ratio * 100).toFixed(1)}% (${m.typedErrorAdoption.numerator}/${m.typedErrorAdoption.denominator}), target 40% |`
|
|
506
|
+
);
|
|
507
|
+
lines.push(
|
|
508
|
+
`| hotpath console.error/warn occurrences | ${m.hotpathConsoleErrors.hotpathOccurrences} (${m.hotpathConsoleErrors.totalOccurrences} total, ${m.hotpathConsoleErrors.exemptOccurrences} CLI-UX exempt) |`
|
|
509
|
+
);
|
|
510
|
+
lines.push(`| hotpath console.error/warn files | ${m.hotpathConsoleErrors.filesAffected} |`);
|
|
511
|
+
lines.push(
|
|
512
|
+
`| files with createLogger | ${m.loggerCoverage.filesWithCreateLogger}/${m.loggerCoverage.totalSourceFiles} |`
|
|
513
|
+
);
|
|
514
|
+
lines.push(
|
|
515
|
+
`| subdomains with zero createLogger | ${m.loggerCoverage.subdomainsWithZeroCreateLogger.length} (${m.loggerCoverage.subdomainsWithZeroCreateLogger.join(', ') || 'none'}) |`
|
|
516
|
+
);
|
|
517
|
+
lines.push(`| files > 400 LOC | ${m.largeFiles.countOver400} |`);
|
|
518
|
+
lines.push(`| files > 600 LOC | ${m.largeFiles.countOver600} |`);
|
|
519
|
+
lines.push('');
|
|
520
|
+
lines.push('### Top Hotpath console.error/warn Files');
|
|
521
|
+
lines.push('');
|
|
522
|
+
lines.push('| File | console.error/warn |');
|
|
523
|
+
lines.push('|---|---:|');
|
|
524
|
+
for (const item of m.hotpathConsoleErrors.topFiles) {
|
|
525
|
+
lines.push(`| \`${item.file}\` | ${item.count} |`);
|
|
526
|
+
}
|
|
527
|
+
if (m.hotpathConsoleErrors.topFiles.length === 0) {
|
|
528
|
+
lines.push('| _none_ | 0 |');
|
|
529
|
+
}
|
|
530
|
+
lines.push('');
|
|
531
|
+
lines.push('### Files > 400 LOC (top 15)');
|
|
532
|
+
lines.push('');
|
|
533
|
+
lines.push('| File | LOC |');
|
|
534
|
+
lines.push('|---|---:|');
|
|
535
|
+
for (const item of m.largeFiles.topOver400) {
|
|
536
|
+
lines.push(`| \`${item.file}\` | ${item.loc} |`);
|
|
537
|
+
}
|
|
538
|
+
if (m.largeFiles.topOver400.length === 0) {
|
|
539
|
+
lines.push('| _none_ | 0 |');
|
|
540
|
+
}
|
|
541
|
+
lines.push('');
|
|
542
|
+
}
|
|
543
|
+
|
|
492
544
|
lines.push('');
|
|
493
545
|
return lines.join('\n');
|
|
494
546
|
}
|
|
@@ -510,17 +562,23 @@ function main() {
|
|
|
510
562
|
console.log(
|
|
511
563
|
`[hardening-inventory] legacy markers total=${report.legacyShim.totalMarkers}, files=${report.legacyShim.filesAffected}`
|
|
512
564
|
);
|
|
565
|
+
if (report.maintainability) {
|
|
566
|
+
const mt = report.maintainability;
|
|
567
|
+
console.log(
|
|
568
|
+
`[hardening-inventory] maintainability: typed-adoption=${(mt.typedErrors.adoptionRatio * 100).toFixed(1)}% (${mt.typedErrors.typedThrows}/${mt.typedErrors.totalThrows}), locked=${(mt.typedErrorAdoption.ratio * 100).toFixed(1)}% (${mt.typedErrorAdoption.numerator}/${mt.typedErrorAdoption.denominator}), console.error=${mt.hotpathConsoleErrors.hotpathOccurrences}, zero-logger-subdomains=${mt.loggerCoverage.subdomainsWithZeroCreateLogger.length}, >400LOC=${mt.largeFiles.countOver400}`
|
|
569
|
+
);
|
|
570
|
+
}
|
|
513
571
|
console.log(`[hardening-inventory] wrote ${relJson}`);
|
|
514
572
|
console.log(`[hardening-inventory] wrote ${relMd}`);
|
|
515
573
|
}
|
|
516
574
|
|
|
517
|
-
if (require.main === module) {
|
|
518
|
-
main();
|
|
519
|
-
}
|
|
520
|
-
|
|
521
575
|
module.exports = {
|
|
522
576
|
buildReport,
|
|
523
577
|
collectSyncCallSites,
|
|
524
578
|
renderMarkdown,
|
|
525
579
|
stripComments,
|
|
526
580
|
};
|
|
581
|
+
|
|
582
|
+
if (require.main === module) {
|
|
583
|
+
main();
|
|
584
|
+
}
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Maintainability metrics collector for the CCS CLI maintainability epic.
|
|
5
|
+
*
|
|
6
|
+
* Computes the metrics the epic tracks across phases:
|
|
7
|
+
* - typed-error adoption (throw new <TypedError> vs throw new Error vs other)
|
|
8
|
+
* - createLogger coverage by subdomain (which subdomains have zero)
|
|
9
|
+
* - hotpath console.error / console.warn call-site count (CLI-UX exempt)
|
|
10
|
+
* - files > 400 / 600 LOC
|
|
11
|
+
* - typed-error adoption in the P4 LOCKED denominator subdomains
|
|
12
|
+
*
|
|
13
|
+
* Accuracy relies on stripping comments/strings before regex matching. We
|
|
14
|
+
* reuse hardening-inventory.js#stripComments for that. The require is lazy
|
|
15
|
+
* (inside sanitize()) because hardening-inventory.js requires THIS module at
|
|
16
|
+
* its top level; a top-level require back would capture hardening-inventory's
|
|
17
|
+
* partial module.exports during the load cycle (it reassigns module.exports at
|
|
18
|
+
* the bottom). A function-scope require resolves against the fully-loaded
|
|
19
|
+
* module at call time, so the cycle is harmless.
|
|
20
|
+
*
|
|
21
|
+
* Approximate by design (grep-based). Method documented in
|
|
22
|
+
* docs/hardening-debt-burndown.md. Re-baseline when the schema changes.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
const fs = require('fs');
|
|
26
|
+
const path = require('path');
|
|
27
|
+
|
|
28
|
+
const SOURCE_EXTENSIONS = new Set(['.ts', '.tsx', '.js', '.jsx', '.mjs', '.cjs']);
|
|
29
|
+
|
|
30
|
+
// CCSError subclasses (src/errors/error-types.ts). A `throw new <OneOfThese>`
|
|
31
|
+
// counts as TYPED. `throw new Error(...)` is plain. Any other `throw new X(`
|
|
32
|
+
// is "other" (error subclass outside the canonical taxonomy).
|
|
33
|
+
const TYPED_ERROR_CLASSES = new Set([
|
|
34
|
+
'CCSError',
|
|
35
|
+
'ConfigError',
|
|
36
|
+
'NetworkError',
|
|
37
|
+
'AuthError',
|
|
38
|
+
'BinaryError',
|
|
39
|
+
'ProviderError',
|
|
40
|
+
'ProfileError',
|
|
41
|
+
'ProxyError',
|
|
42
|
+
'MigrationError',
|
|
43
|
+
'UserAbortError',
|
|
44
|
+
'ValidationError',
|
|
45
|
+
'RetryableError',
|
|
46
|
+
]);
|
|
47
|
+
|
|
48
|
+
// P4 LOCKED denominator: typed-error adoption is measured ONLY over these
|
|
49
|
+
// subdomains so the >40% goal cannot be gamed by narrowing scope. Emits both
|
|
50
|
+
// numerator and denominator counts alongside the ratio.
|
|
51
|
+
const TYPED_ADOPTION_SUBDOMAINS = ['cliproxy/quota', 'cliproxy/auth', 'web-server/routes', 'auth'];
|
|
52
|
+
|
|
53
|
+
// CLI-UX print surfaces exempt from the hotpath console.error sweep (P3).
|
|
54
|
+
// Diagnostics here are legitimate user-facing terminal output, not loggable
|
|
55
|
+
// errors, and stay on stdout/stderr via utils/ui. src/utils/error-manager.ts is
|
|
56
|
+
// the user-facing error display module (ErrorManager.show*), a sibling to
|
|
57
|
+
// utils/ui, so its console.error calls are display output, not diagnostics.
|
|
58
|
+
const CLI_UX_EXEMPT_PREFIXES = [
|
|
59
|
+
'src/commands/',
|
|
60
|
+
'src/management/',
|
|
61
|
+
'src/utils/ui/',
|
|
62
|
+
'src/utils/error-manager.ts',
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
const THROW_NEW_REGEX = /\bthrow\s+new\s+([A-Za-z_$][A-Za-z0-9_$]*)\s*\(/g;
|
|
66
|
+
const CONSOLE_ERR_WARN_REGEX = /\bconsole\s*\.\s*(?:error|warn)\s*\(/g;
|
|
67
|
+
const CREATE_LOGGER_REGEX = /\bcreateLogger\s*\(/;
|
|
68
|
+
|
|
69
|
+
function sanitize(sourceText) {
|
|
70
|
+
// Lazy require; see module header for the circular-dependency rationale.
|
|
71
|
+
return require('./hardening-inventory.js').stripComments(sourceText);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function toPosixPath(filePath) {
|
|
75
|
+
return filePath.split(path.sep).join('/');
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function isSourceFile(filePath) {
|
|
79
|
+
return SOURCE_EXTENSIONS.has(path.extname(filePath));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function isTestFile(relPath) {
|
|
83
|
+
return (
|
|
84
|
+
/(?:^|\/)(?:__tests__|tests?)\//.test(relPath) ||
|
|
85
|
+
/\.test\./.test(relPath) ||
|
|
86
|
+
/\.spec\./.test(relPath)
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function isCliUxExempt(relPath) {
|
|
91
|
+
return CLI_UX_EXEMPT_PREFIXES.some(function (prefix) {
|
|
92
|
+
return relPath.startsWith(prefix);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Subdomain key for a src-relative path.
|
|
98
|
+
* src/cliproxy/quota/x.ts -> "cliproxy/quota"
|
|
99
|
+
* src/auth/x.ts -> "auth"
|
|
100
|
+
* src/x.ts -> "<root>"
|
|
101
|
+
*/
|
|
102
|
+
function subdomainOf(relPath) {
|
|
103
|
+
const rest = relPath.replace(/^src\//, '');
|
|
104
|
+
const parts = rest.split('/');
|
|
105
|
+
if (parts[0] === 'cliproxy' && parts.length > 2) {
|
|
106
|
+
return parts[0] + '/' + parts[1];
|
|
107
|
+
}
|
|
108
|
+
return parts[0] || '<root>';
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function round4(n) {
|
|
112
|
+
return Math.round(n * 10000) / 10000;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Items may be file-shaped ({file,count}) or subdomain-shaped ({subdomain,count});
|
|
116
|
+
// the tiebreaker key is whichever label field is present.
|
|
117
|
+
function labelOf(item) {
|
|
118
|
+
return item.file || item.subdomain || '';
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function topByCount(items, limit) {
|
|
122
|
+
return items
|
|
123
|
+
.slice()
|
|
124
|
+
.sort(function (a, b) {
|
|
125
|
+
return b.count - a.count || labelOf(a).localeCompare(labelOf(b));
|
|
126
|
+
})
|
|
127
|
+
.slice(0, limit);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/** Classify `throw new X(` occurrences in sanitized source. */
|
|
131
|
+
function classifyThrows(sourceText) {
|
|
132
|
+
const sanitized = sanitize(sourceText);
|
|
133
|
+
const counts = { typed: 0, plain: 0, other: 0, total: 0 };
|
|
134
|
+
const re = new RegExp(THROW_NEW_REGEX.source, 'g');
|
|
135
|
+
let match;
|
|
136
|
+
while ((match = re.exec(sanitized)) !== null) {
|
|
137
|
+
const identifier = match[1];
|
|
138
|
+
counts.total += 1;
|
|
139
|
+
if (identifier === 'Error') {
|
|
140
|
+
counts.plain += 1;
|
|
141
|
+
} else if (TYPED_ERROR_CLASSES.has(identifier)) {
|
|
142
|
+
counts.typed += 1;
|
|
143
|
+
} else {
|
|
144
|
+
counts.other += 1;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return counts;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/** Count console.error / console.warn call sites in sanitized source. */
|
|
151
|
+
function countConsoleErrors(sourceText) {
|
|
152
|
+
const sanitized = sanitize(sourceText);
|
|
153
|
+
const re = new RegExp(CONSOLE_ERR_WARN_REGEX.source, 'g');
|
|
154
|
+
return (sanitized.match(re) || []).length;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/** True if the file directly creates a logger via createLogger(...). */
|
|
158
|
+
function hasCreateLogger(sourceText) {
|
|
159
|
+
return CREATE_LOGGER_REGEX.test(sanitize(sourceText));
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/** Raw line count of a source file (matches `wc -l` content semantics). */
|
|
163
|
+
function countLoc(sourceText) {
|
|
164
|
+
if (!sourceText) return 0;
|
|
165
|
+
const parts = sourceText.split(/\r?\n/);
|
|
166
|
+
return sourceText.endsWith('\n') ? parts.length - 1 : parts.length;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function walkFiles(dirPath) {
|
|
170
|
+
const output = [];
|
|
171
|
+
let entries;
|
|
172
|
+
try {
|
|
173
|
+
entries = fs.readdirSync(dirPath, { withFileTypes: true });
|
|
174
|
+
} catch (_err) {
|
|
175
|
+
return output;
|
|
176
|
+
}
|
|
177
|
+
for (const entry of entries) {
|
|
178
|
+
if (entry.name === 'node_modules' || entry.name === 'dist') continue;
|
|
179
|
+
const fullPath = path.join(dirPath, entry.name);
|
|
180
|
+
if (entry.isDirectory()) {
|
|
181
|
+
output.push.apply(output, walkFiles(fullPath));
|
|
182
|
+
continue;
|
|
183
|
+
}
|
|
184
|
+
if (entry.isFile() && isSourceFile(fullPath)) output.push(fullPath);
|
|
185
|
+
}
|
|
186
|
+
return output;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function emptyAggregates() {
|
|
190
|
+
return {
|
|
191
|
+
typedBySubdomain: {},
|
|
192
|
+
loggerBySubdomain: {},
|
|
193
|
+
hotpathByFile: [],
|
|
194
|
+
hotpathTotal: 0,
|
|
195
|
+
hotpathExempt: 0,
|
|
196
|
+
hotpathNonExempt: 0,
|
|
197
|
+
hotpathFilesAffected: 0,
|
|
198
|
+
filesWithLogger: 0,
|
|
199
|
+
totalSourceFiles: 0,
|
|
200
|
+
typedTotal: 0,
|
|
201
|
+
typedTyped: 0,
|
|
202
|
+
typedPlain: 0,
|
|
203
|
+
typedOther: 0,
|
|
204
|
+
over400: [],
|
|
205
|
+
over600: [],
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function ensureBucket(obj, key, factory) {
|
|
210
|
+
if (!obj[key]) obj[key] = factory();
|
|
211
|
+
return obj[key];
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Walk <rootDir>/src and aggregate maintainability metrics.
|
|
216
|
+
* Returns the `maintainability` block merged into the hardening inventory.
|
|
217
|
+
*/
|
|
218
|
+
function collectMaintainabilityMetrics(rootDir) {
|
|
219
|
+
const srcDir = path.join(rootDir, 'src');
|
|
220
|
+
const files = walkFiles(srcDir);
|
|
221
|
+
const agg = emptyAggregates();
|
|
222
|
+
|
|
223
|
+
for (const fullPath of files) {
|
|
224
|
+
const relPath = toPosixPath(path.relative(rootDir, fullPath));
|
|
225
|
+
if (isTestFile(relPath)) continue;
|
|
226
|
+
const sourceText = fs.readFileSync(fullPath, 'utf8');
|
|
227
|
+
const sub = subdomainOf(relPath);
|
|
228
|
+
|
|
229
|
+
const throws = classifyThrows(sourceText);
|
|
230
|
+
agg.typedTotal += throws.total;
|
|
231
|
+
agg.typedTyped += throws.typed;
|
|
232
|
+
agg.typedPlain += throws.plain;
|
|
233
|
+
agg.typedOther += throws.other;
|
|
234
|
+
if (throws.total > 0) {
|
|
235
|
+
const bucket = ensureBucket(agg.typedBySubdomain, sub, function () {
|
|
236
|
+
return { typed: 0, plain: 0, other: 0, total: 0 };
|
|
237
|
+
});
|
|
238
|
+
bucket.typed += throws.typed;
|
|
239
|
+
bucket.plain += throws.plain;
|
|
240
|
+
bucket.other += throws.other;
|
|
241
|
+
bucket.total += throws.total;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
agg.totalSourceFiles += 1;
|
|
245
|
+
const hasLogger = hasCreateLogger(sourceText);
|
|
246
|
+
if (hasLogger) agg.filesWithLogger += 1;
|
|
247
|
+
const lc = ensureBucket(agg.loggerBySubdomain, sub, function () {
|
|
248
|
+
return { files: 0, withLogger: 0 };
|
|
249
|
+
});
|
|
250
|
+
lc.files += 1;
|
|
251
|
+
if (hasLogger) lc.withLogger += 1;
|
|
252
|
+
|
|
253
|
+
const ce = countConsoleErrors(sourceText);
|
|
254
|
+
if (ce > 0) {
|
|
255
|
+
agg.hotpathTotal += ce;
|
|
256
|
+
if (isCliUxExempt(relPath)) {
|
|
257
|
+
agg.hotpathExempt += ce;
|
|
258
|
+
} else {
|
|
259
|
+
agg.hotpathNonExempt += ce;
|
|
260
|
+
agg.hotpathFilesAffected += 1;
|
|
261
|
+
agg.hotpathByFile.push({ file: relPath, count: ce });
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
const loc = countLoc(sourceText);
|
|
266
|
+
if (loc > 600) agg.over600.push({ file: relPath, loc: loc });
|
|
267
|
+
if (loc > 400) agg.over400.push({ file: relPath, loc: loc });
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
const adoptionRatio = agg.typedTotal > 0 ? agg.typedTyped / agg.typedTotal : 0;
|
|
271
|
+
|
|
272
|
+
let numerator = 0;
|
|
273
|
+
let denominator = 0;
|
|
274
|
+
for (const sub of TYPED_ADOPTION_SUBDOMAINS) {
|
|
275
|
+
const bucket = agg.typedBySubdomain[sub];
|
|
276
|
+
if (bucket) {
|
|
277
|
+
numerator += bucket.typed;
|
|
278
|
+
denominator += bucket.total;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
const typedAdoptionRatio = denominator > 0 ? numerator / denominator : 0;
|
|
282
|
+
|
|
283
|
+
const subdomainsWithZeroCreateLogger = Object.keys(agg.loggerBySubdomain)
|
|
284
|
+
.filter(function (k) {
|
|
285
|
+
return agg.loggerBySubdomain[k].files > 0 && agg.loggerBySubdomain[k].withLogger === 0;
|
|
286
|
+
})
|
|
287
|
+
.sort();
|
|
288
|
+
|
|
289
|
+
const topOver400 = agg.over400
|
|
290
|
+
.slice()
|
|
291
|
+
.sort(function (a, b) {
|
|
292
|
+
return b.loc - a.loc || a.file.localeCompare(b.file);
|
|
293
|
+
})
|
|
294
|
+
.slice(0, 15);
|
|
295
|
+
|
|
296
|
+
return {
|
|
297
|
+
typedErrors: {
|
|
298
|
+
totalThrows: agg.typedTotal,
|
|
299
|
+
typedThrows: agg.typedTyped,
|
|
300
|
+
plainThrows: agg.typedPlain,
|
|
301
|
+
otherThrows: agg.typedOther,
|
|
302
|
+
adoptionRatio: round4(adoptionRatio),
|
|
303
|
+
topSubdomainsByThrows: topByCount(
|
|
304
|
+
Object.keys(agg.typedBySubdomain).map(function (k) {
|
|
305
|
+
const v = agg.typedBySubdomain[k];
|
|
306
|
+
return { subdomain: k, count: v.total, typed: v.typed, plain: v.plain };
|
|
307
|
+
}),
|
|
308
|
+
10
|
|
309
|
+
),
|
|
310
|
+
},
|
|
311
|
+
typedErrorAdoption: {
|
|
312
|
+
subdomains: TYPED_ADOPTION_SUBDOMAINS.slice(),
|
|
313
|
+
numerator: numerator,
|
|
314
|
+
denominator: denominator,
|
|
315
|
+
ratio: round4(typedAdoptionRatio),
|
|
316
|
+
targetRatio: 0.4,
|
|
317
|
+
},
|
|
318
|
+
loggerCoverage: {
|
|
319
|
+
filesWithCreateLogger: agg.filesWithLogger,
|
|
320
|
+
totalSourceFiles: agg.totalSourceFiles,
|
|
321
|
+
coverageRatio: round4(
|
|
322
|
+
agg.totalSourceFiles > 0 ? agg.filesWithLogger / agg.totalSourceFiles : 0
|
|
323
|
+
),
|
|
324
|
+
subdomainsWithZeroCreateLogger: subdomainsWithZeroCreateLogger,
|
|
325
|
+
topSubdomainsByFiles: topByCount(
|
|
326
|
+
Object.keys(agg.loggerBySubdomain).map(function (k) {
|
|
327
|
+
const v = agg.loggerBySubdomain[k];
|
|
328
|
+
return { subdomain: k, count: v.files, withLogger: v.withLogger };
|
|
329
|
+
}),
|
|
330
|
+
10
|
|
331
|
+
),
|
|
332
|
+
},
|
|
333
|
+
hotpathConsoleErrors: {
|
|
334
|
+
totalOccurrences: agg.hotpathTotal,
|
|
335
|
+
exemptOccurrences: agg.hotpathExempt,
|
|
336
|
+
hotpathOccurrences: agg.hotpathNonExempt,
|
|
337
|
+
filesAffected: agg.hotpathFilesAffected,
|
|
338
|
+
topFiles: topByCount(agg.hotpathByFile, 15),
|
|
339
|
+
},
|
|
340
|
+
largeFiles: {
|
|
341
|
+
countOver400: agg.over400.length,
|
|
342
|
+
countOver600: agg.over600.length,
|
|
343
|
+
topOver400: topOver400,
|
|
344
|
+
},
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
module.exports = {
|
|
349
|
+
collectMaintainabilityMetrics: collectMaintainabilityMetrics,
|
|
350
|
+
classifyThrows: classifyThrows,
|
|
351
|
+
countConsoleErrors: countConsoleErrors,
|
|
352
|
+
hasCreateLogger: hasCreateLogger,
|
|
353
|
+
countLoc: countLoc,
|
|
354
|
+
TYPED_ERROR_CLASSES: TYPED_ERROR_CLASSES,
|
|
355
|
+
TYPED_ADOPTION_SUBDOMAINS: TYPED_ADOPTION_SUBDOMAINS,
|
|
356
|
+
};
|