@jsonstudio/rcc 0.89.1968 → 0.89.2202
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 +22 -0
- package/config/file-line-limit-policy.json +21 -0
- package/configsamples/config.json +1 -1
- package/configsamples/config.v1.quickstart.sanitized.json +6 -6
- package/configsamples/provider/iflow/config.v1.json +1 -1
- package/dist/app/config-readers.d.ts +18 -0
- package/dist/app/config-readers.js +95 -0
- package/dist/app/config-readers.js.map +1 -0
- package/dist/app/index.d.ts +9 -0
- package/dist/app/index.js +8 -0
- package/dist/app/index.js.map +1 -0
- package/dist/app/shutdown.d.ts +32 -0
- package/dist/app/shutdown.js +41 -0
- package/dist/app/shutdown.js.map +1 -0
- package/dist/bootstrap/index.d.ts +7 -0
- package/dist/bootstrap/index.js +7 -0
- package/dist/bootstrap/index.js.map +1 -0
- package/dist/bootstrap/log-filter.d.ts +15 -0
- package/dist/bootstrap/log-filter.js +81 -0
- package/dist/bootstrap/log-filter.js.map +1 -0
- package/dist/build-info.js +2 -2
- package/dist/cli/commands/claude.js +6 -5
- package/dist/cli/commands/claude.js.map +1 -1
- package/dist/cli/commands/init/basic.d.ts +1 -7
- package/dist/cli/commands/init/basic.js +0 -79
- package/dist/cli/commands/init/basic.js.map +1 -1
- package/dist/cli/commands/init/prompt-utils.d.ts +7 -0
- package/dist/cli/commands/init/prompt-utils.js +80 -0
- package/dist/cli/commands/init/prompt-utils.js.map +1 -0
- package/dist/cli/commands/init/workflows.js +2 -1
- package/dist/cli/commands/init/workflows.js.map +1 -1
- package/dist/cli/commands/init.js +74 -2
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/launcher/index.d.ts +7 -0
- package/dist/cli/commands/launcher/index.js +7 -0
- package/dist/cli/commands/launcher/index.js.map +1 -0
- package/dist/cli/commands/launcher/types.d.ts +112 -0
- package/dist/cli/commands/launcher/types.js +7 -0
- package/dist/cli/commands/launcher/types.js.map +1 -0
- package/dist/cli/commands/launcher/utils.d.ts +114 -0
- package/dist/cli/commands/launcher/utils.js +378 -0
- package/dist/cli/commands/launcher/utils.js.map +1 -0
- package/dist/cli/commands/launcher-kernel.d.ts +2 -74
- package/dist/cli/commands/launcher-kernel.js +141 -143
- package/dist/cli/commands/launcher-kernel.js.map +1 -1
- package/dist/cli/commands/start-types.d.ts +67 -0
- package/dist/cli/commands/start-types.js +3 -0
- package/dist/cli/commands/start-types.js.map +1 -0
- package/dist/cli/commands/start-utils.d.ts +19 -0
- package/dist/cli/commands/start-utils.js +78 -0
- package/dist/cli/commands/start-utils.js.map +1 -0
- package/dist/cli/commands/start.d.ts +2 -67
- package/dist/cli/commands/start.js +201 -48
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/stop.js +17 -1
- package/dist/cli/commands/stop.js.map +1 -1
- package/dist/cli/commands/tmux-inject.js +1 -1
- package/dist/cli/commands/tmux-inject.js.map +1 -1
- package/dist/cli/config/init-config.js +60 -2
- package/dist/cli/config/init-config.js.map +1 -1
- package/dist/cli/config/init-provider-catalog.js +3 -1
- package/dist/cli/config/init-provider-catalog.js.map +1 -1
- package/dist/cli/config/precommand-default-script.d.ts +17 -0
- package/dist/cli/config/precommand-default-script.js +47 -0
- package/dist/cli/config/precommand-default-script.js.map +1 -0
- package/dist/cli/server/port-utils.js +63 -51
- package/dist/cli/server/port-utils.js.map +1 -1
- package/dist/cli.js +2 -0
- package/dist/cli.js.map +1 -1
- package/dist/client/gemini-cli/gemini-cli-protocol-client.js +55 -5
- package/dist/client/gemini-cli/gemini-cli-protocol-client.js.map +1 -1
- package/dist/commands/oauth.js +28 -4
- package/dist/commands/oauth.js.map +1 -1
- package/dist/commands/quota-daemon.js +12 -0
- package/dist/commands/quota-daemon.js.map +1 -1
- package/dist/configsamples/config.v1.quickstart.sanitized.json +6 -6
- package/dist/constants/index.d.ts +34 -0
- package/dist/constants/index.js +57 -0
- package/dist/constants/index.js.map +1 -1
- package/dist/docs/daemon-admin-ui.html +268 -11
- package/dist/error-handling/quiet-error-handling-center.js +19 -1
- package/dist/error-handling/quiet-error-handling-center.js.map +1 -1
- package/dist/index.js +233 -30
- package/dist/index.js.map +1 -1
- package/dist/manager/index.js +4 -4
- package/dist/manager/index.js.map +1 -1
- package/dist/manager/modules/quota/antigravity-quota-core.d.ts +26 -0
- package/dist/manager/modules/quota/antigravity-quota-core.js +23 -0
- package/dist/manager/modules/quota/antigravity-quota-core.js.map +1 -0
- package/dist/manager/modules/quota/antigravity-quota-helpers.d.ts +16 -0
- package/dist/manager/modules/quota/antigravity-quota-helpers.js +167 -0
- package/dist/manager/modules/quota/antigravity-quota-helpers.js.map +1 -0
- package/dist/manager/modules/quota/antigravity-quota-manager.d.ts +10 -39
- package/dist/manager/modules/quota/antigravity-quota-manager.js +167 -464
- package/dist/manager/modules/quota/antigravity-quota-manager.js.map +1 -1
- package/dist/manager/modules/quota/antigravity-quota-persistence.d.ts +20 -0
- package/dist/manager/modules/quota/antigravity-quota-persistence.js +139 -0
- package/dist/manager/modules/quota/antigravity-quota-persistence.js.map +1 -0
- package/dist/manager/modules/quota/antigravity-quota-runtime.d.ts +55 -0
- package/dist/manager/modules/quota/antigravity-quota-runtime.js +174 -0
- package/dist/manager/modules/quota/antigravity-quota-runtime.js.map +1 -0
- package/dist/manager/modules/quota/antigravity-quota-sync.d.ts +46 -0
- package/dist/manager/modules/quota/antigravity-quota-sync.js +162 -0
- package/dist/manager/modules/quota/antigravity-quota-sync.js.map +1 -0
- package/dist/manager/modules/quota/index.d.ts +1 -0
- package/dist/manager/modules/quota/provider-quota-daemon.error-helpers.d.ts +13 -0
- package/dist/manager/modules/quota/provider-quota-daemon.error-helpers.js +149 -0
- package/dist/manager/modules/quota/provider-quota-daemon.error-helpers.js.map +1 -0
- package/dist/manager/modules/quota/provider-quota-daemon.events.js +1 -148
- package/dist/manager/modules/quota/provider-quota-daemon.events.js.map +1 -1
- package/dist/manager/modules/quota/provider-quota-daemon.js.map +1 -1
- package/dist/manager/modules/quota/quota-adapter.d.ts +111 -0
- package/dist/manager/modules/quota/quota-adapter.js +325 -0
- package/dist/manager/modules/quota/quota-adapter.js.map +1 -0
- package/dist/manager/quota/provider-quota-center.d.ts +10 -0
- package/dist/manager/quota/provider-quota-center.js +15 -2
- package/dist/manager/quota/provider-quota-center.js.map +1 -1
- package/dist/modules/llmswitch/bridge/antigravity-signature.d.ts +28 -0
- package/dist/modules/llmswitch/bridge/antigravity-signature.js +180 -0
- package/dist/modules/llmswitch/bridge/antigravity-signature.js.map +1 -0
- package/dist/modules/llmswitch/bridge/index.d.ts +13 -0
- package/dist/modules/llmswitch/bridge/index.js +14 -0
- package/dist/modules/llmswitch/bridge/index.js.map +1 -0
- package/dist/modules/llmswitch/bridge/module-loader.d.ts +16 -0
- package/dist/modules/llmswitch/bridge/module-loader.js +59 -0
- package/dist/modules/llmswitch/bridge/module-loader.js.map +1 -0
- package/dist/modules/llmswitch/bridge/quota-manager.d.ts +8 -0
- package/dist/modules/llmswitch/bridge/quota-manager.js +37 -0
- package/dist/modules/llmswitch/bridge/quota-manager.js.map +1 -0
- package/dist/modules/llmswitch/bridge/response-converter.d.ts +11 -0
- package/dist/modules/llmswitch/bridge/response-converter.js +68 -0
- package/dist/modules/llmswitch/bridge/response-converter.js.map +1 -0
- package/dist/modules/llmswitch/bridge/routing-integrations.d.ts +12 -0
- package/dist/modules/llmswitch/bridge/routing-integrations.js +56 -0
- package/dist/modules/llmswitch/bridge/routing-integrations.js.map +1 -0
- package/dist/modules/llmswitch/bridge/runtime-integrations.d.ts +34 -0
- package/dist/modules/llmswitch/bridge/runtime-integrations.js +87 -0
- package/dist/modules/llmswitch/bridge/runtime-integrations.js.map +1 -0
- package/dist/modules/llmswitch/bridge/snapshot-recorder.d.ts +13 -0
- package/dist/modules/llmswitch/bridge/snapshot-recorder.js +484 -0
- package/dist/modules/llmswitch/bridge/snapshot-recorder.js.map +1 -0
- package/dist/modules/llmswitch/bridge/state-integrations.d.ts +59 -0
- package/dist/modules/llmswitch/bridge/state-integrations.js +264 -0
- package/dist/modules/llmswitch/bridge/state-integrations.js.map +1 -0
- package/dist/modules/llmswitch/bridge.d.ts +14 -131
- package/dist/modules/llmswitch/bridge.js +14 -834
- package/dist/modules/llmswitch/bridge.js.map +1 -1
- package/dist/modules/pipeline/types/provider-config-types.d.ts +240 -0
- package/dist/modules/pipeline/types/provider-config-types.js +2 -0
- package/dist/modules/pipeline/types/provider-config-types.js.map +1 -0
- package/dist/modules/pipeline/types/provider-types.d.ts +2 -239
- package/dist/modules/pipeline/types/provider-types.js +1 -1
- package/dist/modules/pipeline/types/provider-types.js.map +1 -1
- package/dist/modules/pipeline/utils/debug-logger.js +3 -5
- package/dist/modules/pipeline/utils/debug-logger.js.map +1 -1
- package/dist/providers/auth/apikey-auth.d.ts +57 -1
- package/dist/providers/auth/apikey-auth.js +131 -1
- package/dist/providers/auth/apikey-auth.js.map +1 -1
- package/dist/providers/auth/oauth-lifecycle/error-detection.d.ts +8 -0
- package/dist/providers/auth/oauth-lifecycle/error-detection.js +71 -0
- package/dist/providers/auth/oauth-lifecycle/error-detection.js.map +1 -0
- package/dist/providers/auth/oauth-lifecycle/index.d.ts +10 -0
- package/dist/providers/auth/oauth-lifecycle/index.js +11 -0
- package/dist/providers/auth/oauth-lifecycle/index.js.map +1 -0
- package/dist/providers/auth/oauth-lifecycle/path-resolver.d.ts +18 -0
- package/dist/providers/auth/oauth-lifecycle/path-resolver.js +121 -0
- package/dist/providers/auth/oauth-lifecycle/path-resolver.js.map +1 -0
- package/dist/providers/auth/oauth-lifecycle/throttle.d.ts +22 -0
- package/dist/providers/auth/oauth-lifecycle/throttle.js +37 -0
- package/dist/providers/auth/oauth-lifecycle/throttle.js.map +1 -0
- package/dist/providers/auth/oauth-lifecycle/token-helpers.d.ts +36 -0
- package/dist/providers/auth/oauth-lifecycle/token-helpers.js +127 -0
- package/dist/providers/auth/oauth-lifecycle/token-helpers.js.map +1 -0
- package/dist/providers/auth/oauth-lifecycle/token-io.d.ts +14 -0
- package/dist/providers/auth/oauth-lifecycle/token-io.js +151 -0
- package/dist/providers/auth/oauth-lifecycle/token-io.js.map +1 -0
- package/dist/providers/auth/oauth-lifecycle.js +70 -446
- package/dist/providers/auth/oauth-lifecycle.js.map +1 -1
- package/dist/providers/auth/oauth-repair-cooldown.js +8 -3
- package/dist/providers/auth/oauth-repair-cooldown.js.map +1 -1
- package/dist/providers/auth/oauth-repair-env.js +5 -3
- package/dist/providers/auth/oauth-repair-env.js.map +1 -1
- package/dist/providers/auth/oauth-token-utils.d.ts +61 -0
- package/dist/providers/auth/oauth-token-utils.js +187 -0
- package/dist/providers/auth/oauth-token-utils.js.map +1 -0
- package/dist/providers/auth/oauth-utils/camoufox-helper.d.ts +21 -0
- package/dist/providers/auth/oauth-utils/camoufox-helper.js +82 -0
- package/dist/providers/auth/oauth-utils/camoufox-helper.js.map +1 -0
- package/dist/providers/auth/oauth-utils/error-extraction.d.ts +17 -0
- package/dist/providers/auth/oauth-utils/error-extraction.js +80 -0
- package/dist/providers/auth/oauth-utils/error-extraction.js.map +1 -0
- package/dist/providers/auth/oauth-utils/index.d.ts +7 -0
- package/dist/providers/auth/oauth-utils/index.js +8 -0
- package/dist/providers/auth/oauth-utils/index.js.map +1 -0
- package/dist/providers/auth/token-refresh/index.d.ts +6 -0
- package/dist/providers/auth/token-refresh/index.js +7 -0
- package/dist/providers/auth/token-refresh/index.js.map +1 -0
- package/dist/providers/auth/token-refresh/token-state.d.ts +17 -0
- package/dist/providers/auth/token-refresh/token-state.js +30 -0
- package/dist/providers/auth/token-refresh/token-state.js.map +1 -0
- package/dist/providers/auth/token-storage/index.d.ts +7 -0
- package/dist/providers/auth/token-storage/index.js +8 -0
- package/dist/providers/auth/token-storage/index.js.map +1 -0
- package/dist/providers/auth/token-storage/token-file-resolver.d.ts +12 -0
- package/dist/providers/auth/token-storage/token-file-resolver.js +117 -0
- package/dist/providers/auth/token-storage/token-file-resolver.js.map +1 -0
- package/dist/providers/auth/token-storage/token-persistence.d.ts +22 -0
- package/dist/providers/auth/token-storage/token-persistence.js +86 -0
- package/dist/providers/auth/token-storage/token-persistence.js.map +1 -0
- package/dist/providers/auth/tokenfile-auth.js +12 -9
- package/dist/providers/auth/tokenfile-auth.js.map +1 -1
- package/dist/providers/core/api/provider-config.d.ts +8 -0
- package/dist/providers/core/config/camoufox-launcher.d.ts +1 -0
- package/dist/providers/core/config/camoufox-launcher.js +40 -9
- package/dist/providers/core/config/camoufox-launcher.js.map +1 -1
- package/dist/providers/core/config/oauth-flows.js +7 -2
- package/dist/providers/core/config/oauth-flows.js.map +1 -1
- package/dist/providers/core/config/provider-debug-hooks.d.ts +0 -12
- package/dist/providers/core/config/provider-debug-hooks.js +16 -56
- package/dist/providers/core/config/provider-debug-hooks.js.map +1 -1
- package/dist/providers/core/config/provider-debug-output-utils.d.ts +38 -0
- package/dist/providers/core/config/provider-debug-output-utils.js +46 -0
- package/dist/providers/core/config/provider-debug-output-utils.js.map +1 -0
- package/dist/providers/core/config/provider-oauth-configs.js +13 -9
- package/dist/providers/core/config/provider-oauth-configs.js.map +1 -1
- package/dist/providers/core/runtime/antigravity-request-type.d.ts +2 -0
- package/dist/providers/core/runtime/antigravity-request-type.js +126 -0
- package/dist/providers/core/runtime/antigravity-request-type.js.map +1 -0
- package/dist/providers/core/runtime/base-provider-runtime-helpers.d.ts +27 -0
- package/dist/providers/core/runtime/base-provider-runtime-helpers.js +105 -0
- package/dist/providers/core/runtime/base-provider-runtime-helpers.js.map +1 -0
- package/dist/providers/core/runtime/base-provider-series-cooldown.d.ts +19 -0
- package/dist/providers/core/runtime/base-provider-series-cooldown.js +363 -0
- package/dist/providers/core/runtime/base-provider-series-cooldown.js.map +1 -0
- package/dist/providers/core/runtime/base-provider.d.ts +4 -35
- package/dist/providers/core/runtime/base-provider.js +20 -501
- package/dist/providers/core/runtime/base-provider.js.map +1 -1
- package/dist/providers/core/runtime/deepseek-http-provider-helpers.d.ts +32 -0
- package/dist/providers/core/runtime/deepseek-http-provider-helpers.js +301 -0
- package/dist/providers/core/runtime/deepseek-http-provider-helpers.js.map +1 -0
- package/dist/providers/core/runtime/deepseek-http-provider.d.ts +0 -3
- package/dist/providers/core/runtime/deepseek-http-provider.js +5 -127
- package/dist/providers/core/runtime/deepseek-http-provider.js.map +1 -1
- package/dist/providers/core/runtime/deepseek-session-pow-helpers.d.ts +21 -0
- package/dist/providers/core/runtime/deepseek-session-pow-helpers.js +99 -0
- package/dist/providers/core/runtime/deepseek-session-pow-helpers.js.map +1 -0
- package/dist/providers/core/runtime/deepseek-session-pow.js +13 -108
- package/dist/providers/core/runtime/deepseek-session-pow.js.map +1 -1
- package/dist/providers/core/runtime/gemini-cli-http-provider.d.ts +0 -15
- package/dist/providers/core/runtime/gemini-cli-http-provider.js +13 -303
- package/dist/providers/core/runtime/gemini-cli-http-provider.js.map +1 -1
- package/dist/providers/core/runtime/gemini-cli-response-postprocessor.d.ts +9 -0
- package/dist/providers/core/runtime/gemini-cli-response-postprocessor.js +85 -0
- package/dist/providers/core/runtime/gemini-cli-response-postprocessor.js.map +1 -0
- package/dist/providers/core/runtime/gemini-http-provider.js +2 -2
- package/dist/providers/core/runtime/gemini-http-provider.js.map +1 -1
- package/dist/providers/core/runtime/gemini-sse-normalizer.d.ts +25 -0
- package/dist/providers/core/runtime/gemini-sse-normalizer.js +159 -0
- package/dist/providers/core/runtime/gemini-sse-normalizer.js.map +1 -0
- package/dist/providers/core/runtime/http-request-executor.js +1 -48
- package/dist/providers/core/runtime/http-request-executor.js.map +1 -1
- package/dist/providers/core/runtime/http-transport-provider.d.ts +2 -48
- package/dist/providers/core/runtime/http-transport-provider.js +158 -1273
- package/dist/providers/core/runtime/http-transport-provider.js.map +1 -1
- package/dist/providers/core/runtime/provider-bootstrap-utils.d.ts +20 -0
- package/dist/providers/core/runtime/provider-bootstrap-utils.js +78 -0
- package/dist/providers/core/runtime/provider-bootstrap-utils.js.map +1 -0
- package/dist/providers/core/runtime/provider-factory-helpers.d.ts +19 -0
- package/dist/providers/core/runtime/provider-factory-helpers.js +203 -0
- package/dist/providers/core/runtime/provider-factory-helpers.js.map +1 -0
- package/dist/providers/core/runtime/provider-factory.d.ts +9 -7
- package/dist/providers/core/runtime/provider-factory.js +57 -214
- package/dist/providers/core/runtime/provider-factory.js.map +1 -1
- package/dist/providers/core/runtime/provider-family-profile-utils.d.ts +23 -0
- package/dist/providers/core/runtime/provider-family-profile-utils.js +57 -0
- package/dist/providers/core/runtime/provider-family-profile-utils.js.map +1 -0
- package/dist/providers/core/runtime/provider-http-executor-utils.d.ts +32 -0
- package/dist/providers/core/runtime/provider-http-executor-utils.js +92 -0
- package/dist/providers/core/runtime/provider-http-executor-utils.js.map +1 -0
- package/dist/providers/core/runtime/provider-iflow-business-error-utils.d.ts +15 -0
- package/dist/providers/core/runtime/provider-iflow-business-error-utils.js +49 -0
- package/dist/providers/core/runtime/provider-iflow-business-error-utils.js.map +1 -0
- package/dist/providers/core/runtime/provider-request-executor-deps-factory.d.ts +29 -0
- package/dist/providers/core/runtime/provider-request-executor-deps-factory.js +41 -0
- package/dist/providers/core/runtime/provider-request-executor-deps-factory.js.map +1 -0
- package/dist/providers/core/runtime/provider-request-header-orchestrator.d.ts +30 -0
- package/dist/providers/core/runtime/provider-request-header-orchestrator.js +91 -0
- package/dist/providers/core/runtime/provider-request-header-orchestrator.js.map +1 -0
- package/dist/providers/core/runtime/provider-request-preprocessor.d.ts +5 -0
- package/dist/providers/core/runtime/provider-request-preprocessor.js +39 -0
- package/dist/providers/core/runtime/provider-request-preprocessor.js.map +1 -0
- package/dist/providers/core/runtime/provider-request-shaping-utils.d.ts +37 -0
- package/dist/providers/core/runtime/provider-request-shaping-utils.js +65 -0
- package/dist/providers/core/runtime/provider-request-shaping-utils.js.map +1 -0
- package/dist/providers/core/runtime/provider-response-postprocessor.d.ts +7 -0
- package/dist/providers/core/runtime/provider-response-postprocessor.js +28 -0
- package/dist/providers/core/runtime/provider-response-postprocessor.js.map +1 -0
- package/dist/providers/core/runtime/provider-runtime-utils.d.ts +16 -0
- package/dist/providers/core/runtime/provider-runtime-utils.js +51 -0
- package/dist/providers/core/runtime/provider-runtime-utils.js.map +1 -0
- package/dist/providers/core/runtime/responses-provider-helpers.d.ts +37 -0
- package/dist/providers/core/runtime/responses-provider-helpers.js +212 -0
- package/dist/providers/core/runtime/responses-provider-helpers.js.map +1 -0
- package/dist/providers/core/runtime/responses-provider.d.ts +0 -10
- package/dist/providers/core/runtime/responses-provider.js +14 -224
- package/dist/providers/core/runtime/responses-provider.js.map +1 -1
- package/dist/providers/core/runtime/runtime-endpoint-resolver.d.ts +21 -0
- package/dist/providers/core/runtime/runtime-endpoint-resolver.js +64 -0
- package/dist/providers/core/runtime/runtime-endpoint-resolver.js.map +1 -0
- package/dist/providers/core/runtime/service-profile-resolver.d.ts +29 -0
- package/dist/providers/core/runtime/service-profile-resolver.js +88 -0
- package/dist/providers/core/runtime/service-profile-resolver.js.map +1 -0
- package/dist/providers/core/runtime/transport/auth-mode-utils.d.ts +13 -0
- package/dist/providers/core/runtime/transport/auth-mode-utils.js +43 -0
- package/dist/providers/core/runtime/transport/auth-mode-utils.js.map +1 -0
- package/dist/providers/core/runtime/transport/auth-provider-factory.d.ts +37 -0
- package/dist/providers/core/runtime/transport/auth-provider-factory.js +131 -0
- package/dist/providers/core/runtime/transport/auth-provider-factory.js.map +1 -0
- package/dist/providers/core/runtime/transport/header-utils.d.ts +15 -0
- package/dist/providers/core/runtime/transport/header-utils.js +85 -0
- package/dist/providers/core/runtime/transport/header-utils.js.map +1 -0
- package/dist/providers/core/runtime/transport/iflow-signer.d.ts +12 -0
- package/dist/providers/core/runtime/transport/iflow-signer.js +63 -0
- package/dist/providers/core/runtime/transport/iflow-signer.js.map +1 -0
- package/dist/providers/core/runtime/transport/index.d.ts +15 -0
- package/dist/providers/core/runtime/transport/index.js +16 -0
- package/dist/providers/core/runtime/transport/index.js.map +1 -0
- package/dist/providers/core/runtime/transport/oauth-header-preflight.d.ts +12 -0
- package/dist/providers/core/runtime/transport/oauth-header-preflight.js +56 -0
- package/dist/providers/core/runtime/transport/oauth-header-preflight.js.map +1 -0
- package/dist/providers/core/runtime/transport/oauth-recovery-handler.d.ts +34 -0
- package/dist/providers/core/runtime/transport/oauth-recovery-handler.js +126 -0
- package/dist/providers/core/runtime/transport/oauth-recovery-handler.js.map +1 -0
- package/dist/providers/core/runtime/transport/provider-payload-utils.d.ts +21 -0
- package/dist/providers/core/runtime/transport/provider-payload-utils.js +88 -0
- package/dist/providers/core/runtime/transport/provider-payload-utils.js.map +1 -0
- package/dist/providers/core/runtime/transport/request-header-builder.d.ts +24 -0
- package/dist/providers/core/runtime/transport/request-header-builder.js +90 -0
- package/dist/providers/core/runtime/transport/request-header-builder.js.map +1 -0
- package/dist/providers/core/runtime/transport/runtime-detector.d.ts +22 -0
- package/dist/providers/core/runtime/transport/runtime-detector.js +63 -0
- package/dist/providers/core/runtime/transport/runtime-detector.js.map +1 -0
- package/dist/providers/core/runtime/transport/session-header-utils.d.ts +8 -0
- package/dist/providers/core/runtime/transport/session-header-utils.js +72 -0
- package/dist/providers/core/runtime/transport/session-header-utils.js.map +1 -0
- package/dist/providers/core/runtime/vision-debug-utils.d.ts +2 -0
- package/dist/providers/core/runtime/vision-debug-utils.js +31 -0
- package/dist/providers/core/runtime/vision-debug-utils.js.map +1 -1
- package/dist/providers/core/strategies/oauth-auth-code-flow.d.ts +13 -0
- package/dist/providers/core/strategies/oauth-auth-code-flow.js +272 -55
- package/dist/providers/core/strategies/oauth-auth-code-flow.js.map +1 -1
- package/dist/providers/core/utils/snapshot-writer-buffer.d.ts +13 -0
- package/dist/providers/core/utils/snapshot-writer-buffer.js +39 -0
- package/dist/providers/core/utils/snapshot-writer-buffer.js.map +1 -0
- package/dist/providers/core/utils/snapshot-writer.js +75 -54
- package/dist/providers/core/utils/snapshot-writer.js.map +1 -1
- package/dist/providers/profile/families/antigravity-profile.js +2 -10
- package/dist/providers/profile/families/antigravity-profile.js.map +1 -1
- package/dist/providers/profile/families/deepseek-profile.d.ts +2 -0
- package/dist/providers/profile/families/deepseek-profile.js +110 -0
- package/dist/providers/profile/families/deepseek-profile.js.map +1 -0
- package/dist/providers/profile/families/iflow-profile.js +89 -10
- package/dist/providers/profile/families/iflow-profile.js.map +1 -1
- package/dist/providers/profile/provider-profile-loader.d.ts +5 -0
- package/dist/providers/profile/provider-profile-loader.js +35 -0
- package/dist/providers/profile/provider-profile-loader.js.map +1 -1
- package/dist/providers/profile/provider-profile.d.ts +16 -1
- package/dist/runtime/runtime-flags.js +1 -1
- package/dist/runtime/runtime-flags.js.map +1 -1
- package/dist/runtime/wasm-runtime/index.d.ts +56 -0
- package/dist/runtime/wasm-runtime/index.js +69 -0
- package/dist/runtime/wasm-runtime/index.js.map +1 -0
- package/dist/scripts/camoufox/launch-auth.mjs +158 -10
- package/dist/server/handlers/handler-response-utils.d.ts +13 -0
- package/dist/server/handlers/handler-response-utils.js +427 -0
- package/dist/server/handlers/handler-response-utils.js.map +1 -0
- package/dist/server/handlers/handler-utils.d.ts +2 -11
- package/dist/server/handlers/handler-utils.js +21 -421
- package/dist/server/handlers/handler-utils.js.map +1 -1
- package/dist/server/runtime/http-server/clock-client-reaper.d.ts +23 -0
- package/dist/server/runtime/http-server/clock-client-reaper.js +159 -0
- package/dist/server/runtime/http-server/clock-client-reaper.js.map +1 -0
- package/dist/server/runtime/http-server/clock-client-registry-utils.d.ts +87 -0
- package/dist/server/runtime/http-server/clock-client-registry-utils.js +276 -0
- package/dist/server/runtime/http-server/clock-client-registry-utils.js.map +1 -0
- package/dist/server/runtime/http-server/clock-client-registry.d.ts +5 -50
- package/dist/server/runtime/http-server/clock-client-registry.js +74 -320
- package/dist/server/runtime/http-server/clock-client-registry.js.map +1 -1
- package/dist/server/runtime/http-server/clock-client-route-utils.d.ts +12 -0
- package/dist/server/runtime/http-server/clock-client-route-utils.js +210 -0
- package/dist/server/runtime/http-server/clock-client-route-utils.js.map +1 -0
- package/dist/server/runtime/http-server/clock-client-routes.js +27 -201
- package/dist/server/runtime/http-server/clock-client-routes.js.map +1 -1
- package/dist/server/runtime/http-server/clock-daemon-log-throttle.d.ts +12 -0
- package/dist/server/runtime/http-server/clock-daemon-log-throttle.js +56 -0
- package/dist/server/runtime/http-server/clock-daemon-log-throttle.js.map +1 -0
- package/dist/server/runtime/http-server/daemon-admin/control-handler.js +143 -14
- package/dist/server/runtime/http-server/daemon-admin/control-handler.js.map +1 -1
- package/dist/server/runtime/http-server/daemon-admin/credentials-handler-utils.d.ts +19 -0
- package/dist/server/runtime/http-server/daemon-admin/credentials-handler-utils.js +107 -0
- package/dist/server/runtime/http-server/daemon-admin/credentials-handler-utils.js.map +1 -0
- package/dist/server/runtime/http-server/daemon-admin/credentials-handler.js +2 -104
- package/dist/server/runtime/http-server/daemon-admin/credentials-handler.js.map +1 -1
- package/dist/server/runtime/http-server/daemon-admin/providers-handler-routing-utils.d.ts +28 -0
- package/dist/server/runtime/http-server/daemon-admin/providers-handler-routing-utils.js +298 -0
- package/dist/server/runtime/http-server/daemon-admin/providers-handler-routing-utils.js.map +1 -0
- package/dist/server/runtime/http-server/daemon-admin/providers-handler-utils.d.ts +22 -0
- package/dist/server/runtime/http-server/daemon-admin/providers-handler-utils.js +211 -0
- package/dist/server/runtime/http-server/daemon-admin/providers-handler-utils.js.map +1 -0
- package/dist/server/runtime/http-server/daemon-admin/providers-handler.js +25 -454
- package/dist/server/runtime/http-server/daemon-admin/providers-handler.js.map +1 -1
- package/dist/server/runtime/http-server/daemon-admin/quota-handler.js +81 -32
- package/dist/server/runtime/http-server/daemon-admin/quota-handler.js.map +1 -1
- package/dist/server/runtime/http-server/daemon-admin/routecodex-x7e-gate.d.ts +22 -0
- package/dist/server/runtime/http-server/daemon-admin/routecodex-x7e-gate.js +70 -0
- package/dist/server/runtime/http-server/daemon-admin/routecodex-x7e-gate.js.map +1 -0
- package/dist/server/runtime/http-server/executor/antigravity-detector.d.ts +34 -0
- package/dist/server/runtime/http-server/executor/antigravity-detector.js +118 -0
- package/dist/server/runtime/http-server/executor/antigravity-detector.js.map +1 -0
- package/dist/server/runtime/http-server/executor/env-config.d.ts +13 -0
- package/dist/server/runtime/http-server/executor/env-config.js +20 -0
- package/dist/server/runtime/http-server/executor/env-config.js.map +1 -0
- package/dist/server/runtime/http-server/executor/index.d.ts +11 -0
- package/dist/server/runtime/http-server/executor/index.js +18 -0
- package/dist/server/runtime/http-server/executor/index.js.map +1 -0
- package/dist/server/runtime/http-server/executor/provider-request-context.d.ts +20 -0
- package/dist/server/runtime/http-server/executor/provider-request-context.js +38 -0
- package/dist/server/runtime/http-server/executor/provider-request-context.js.map +1 -0
- package/dist/server/runtime/http-server/executor/provider-response-converter.d.ts +23 -0
- package/dist/server/runtime/http-server/executor/provider-response-converter.js +337 -0
- package/dist/server/runtime/http-server/executor/provider-response-converter.js.map +1 -0
- package/dist/server/runtime/http-server/executor/provider-response-utils.d.ts +8 -0
- package/dist/server/runtime/http-server/executor/provider-response-utils.js +93 -0
- package/dist/server/runtime/http-server/executor/provider-response-utils.js.map +1 -0
- package/dist/server/runtime/http-server/executor/provider-runtime-resolver.d.ts +23 -0
- package/dist/server/runtime/http-server/executor/provider-runtime-resolver.js +85 -0
- package/dist/server/runtime/http-server/executor/provider-runtime-resolver.js.map +1 -0
- package/dist/server/runtime/http-server/executor/request-executor-core-utils.d.ts +7 -0
- package/dist/server/runtime/http-server/executor/request-executor-core-utils.js +39 -0
- package/dist/server/runtime/http-server/executor/request-executor-core-utils.js.map +1 -0
- package/dist/server/runtime/http-server/executor/request-retry-helpers.d.ts +16 -0
- package/dist/server/runtime/http-server/executor/request-retry-helpers.js +218 -0
- package/dist/server/runtime/http-server/executor/request-retry-helpers.js.map +1 -0
- package/dist/server/runtime/http-server/executor/retry-engine.d.ts +21 -0
- package/dist/server/runtime/http-server/executor/retry-engine.js +73 -0
- package/dist/server/runtime/http-server/executor/retry-engine.js.map +1 -0
- package/dist/server/runtime/http-server/executor/sse-error-handler.d.ts +14 -0
- package/dist/server/runtime/http-server/executor/sse-error-handler.js +127 -0
- package/dist/server/runtime/http-server/executor/sse-error-handler.js.map +1 -0
- package/dist/server/runtime/http-server/executor/usage-aggregator.d.ts +39 -0
- package/dist/server/runtime/http-server/executor/usage-aggregator.js +177 -0
- package/dist/server/runtime/http-server/executor/usage-aggregator.js.map +1 -0
- package/dist/server/runtime/http-server/executor/usage-logger.d.ts +7 -0
- package/dist/server/runtime/http-server/executor/usage-logger.js +13 -0
- package/dist/server/runtime/http-server/executor/usage-logger.js.map +1 -0
- package/dist/server/runtime/http-server/executor/utils.d.ts +21 -0
- package/dist/server/runtime/http-server/executor/utils.js +62 -0
- package/dist/server/runtime/http-server/executor/utils.js.map +1 -0
- package/dist/server/runtime/http-server/executor-metadata.js +83 -2
- package/dist/server/runtime/http-server/executor-metadata.js.map +1 -1
- package/dist/server/runtime/http-server/executor-response.js +17 -9
- package/dist/server/runtime/http-server/executor-response.js.map +1 -1
- package/dist/server/runtime/http-server/http-server-bootstrap.d.ts +31 -0
- package/dist/server/runtime/http-server/http-server-bootstrap.js +367 -0
- package/dist/server/runtime/http-server/http-server-bootstrap.js.map +1 -0
- package/dist/server/runtime/http-server/http-server-clock-daemon.d.ts +5 -0
- package/dist/server/runtime/http-server/http-server-clock-daemon.js +242 -0
- package/dist/server/runtime/http-server/http-server-clock-daemon.js.map +1 -0
- package/dist/server/runtime/http-server/http-server-legacy-pipeline.d.ts +2 -0
- package/dist/server/runtime/http-server/http-server-legacy-pipeline.js +65 -0
- package/dist/server/runtime/http-server/http-server-legacy-pipeline.js.map +1 -0
- package/dist/server/runtime/http-server/http-server-lifecycle.d.ts +27 -0
- package/dist/server/runtime/http-server/http-server-lifecycle.js +285 -0
- package/dist/server/runtime/http-server/http-server-lifecycle.js.map +1 -0
- package/dist/server/runtime/http-server/http-server-runtime-providers.d.ts +10 -0
- package/dist/server/runtime/http-server/http-server-runtime-providers.js +415 -0
- package/dist/server/runtime/http-server/http-server-runtime-providers.js.map +1 -0
- package/dist/server/runtime/http-server/http-server-runtime-setup.d.ts +2 -0
- package/dist/server/runtime/http-server/http-server-runtime-setup.js +93 -0
- package/dist/server/runtime/http-server/http-server-runtime-setup.js.map +1 -0
- package/dist/server/runtime/http-server/index.d.ts +2 -46
- package/dist/server/runtime/http-server/index.js +96 -2615
- package/dist/server/runtime/http-server/index.js.map +1 -1
- package/dist/server/runtime/http-server/request-executor.d.ts +8 -21
- package/dist/server/runtime/http-server/request-executor.js +94 -956
- package/dist/server/runtime/http-server/request-executor.js.map +1 -1
- package/dist/server/runtime/http-server/routes.js +2 -2
- package/dist/server/runtime/http-server/routes.js.map +1 -1
- package/dist/server/runtime/http-server/servertool-admin-state.d.ts +42 -0
- package/dist/server/runtime/http-server/servertool-admin-state.js +210 -0
- package/dist/server/runtime/http-server/servertool-admin-state.js.map +1 -0
- package/dist/server/runtime/http-server/stats-manager-internals.d.ts +96 -0
- package/dist/server/runtime/http-server/stats-manager-internals.js +311 -0
- package/dist/server/runtime/http-server/stats-manager-internals.js.map +1 -0
- package/dist/server/runtime/http-server/stats-manager-table.d.ts +6 -0
- package/dist/server/runtime/http-server/stats-manager-table.js +135 -0
- package/dist/server/runtime/http-server/stats-manager-table.js.map +1 -0
- package/dist/server/runtime/http-server/stats-manager.d.ts +0 -23
- package/dist/server/runtime/http-server/stats-manager.js +95 -483
- package/dist/server/runtime/http-server/stats-manager.js.map +1 -1
- package/dist/server/utils/client-connection-state.js +61 -0
- package/dist/server/utils/client-connection-state.js.map +1 -1
- package/dist/server/utils/request-id-manager.d.ts +6 -0
- package/dist/server/utils/request-id-manager.js +105 -15
- package/dist/server/utils/request-id-manager.js.map +1 -1
- package/dist/server/utils/stage-logger.js +14 -4
- package/dist/server/utils/stage-logger.js.map +1 -1
- package/dist/server-lifecycle/index.d.ts +6 -0
- package/dist/server-lifecycle/index.js +7 -0
- package/dist/server-lifecycle/index.js.map +1 -0
- package/dist/server-lifecycle/port-utils.d.ts +18 -0
- package/dist/server-lifecycle/port-utils.js +204 -0
- package/dist/server-lifecycle/port-utils.js.map +1 -0
- package/dist/sharedmodule/process-snapshot.d.ts +26 -0
- package/dist/sharedmodule/process-snapshot.js +141 -0
- package/dist/sharedmodule/process-snapshot.js.map +1 -0
- package/dist/token-daemon/index.js +10 -3
- package/dist/token-daemon/index.js.map +1 -1
- package/dist/token-daemon/token-daemon.js +9 -11
- package/dist/token-daemon/token-daemon.js.map +1 -1
- package/dist/token-daemon/token-utils.d.ts +1 -1
- package/dist/token-daemon/token-utils.js +19 -3
- package/dist/token-daemon/token-utils.js.map +1 -1
- package/dist/tools/semantic-replay-snapshot-loader.d.ts +4 -0
- package/dist/tools/semantic-replay-snapshot-loader.js +396 -0
- package/dist/tools/semantic-replay-snapshot-loader.js.map +1 -0
- package/dist/tools/semantic-replay.js +2 -393
- package/dist/tools/semantic-replay.js.map +1 -1
- package/dist/utils/daemon-stop-intent.d.ts +17 -0
- package/dist/utils/daemon-stop-intent.js +104 -0
- package/dist/utils/daemon-stop-intent.js.map +1 -0
- package/dist/utils/key-429-tracker.js +6 -5
- package/dist/utils/key-429-tracker.js.map +1 -1
- package/dist/utils/managed-server-pids.js +44 -6
- package/dist/utils/managed-server-pids.js.map +1 -1
- package/dist/utils/pipeline-health-manager.js +7 -6
- package/dist/utils/pipeline-health-manager.js.map +1 -1
- package/dist/utils/process-lifecycle-logger.js +45 -1
- package/dist/utils/process-lifecycle-logger.js.map +1 -1
- package/dist/utils/runtime-exit-forensics.d.ts +2 -2
- package/dist/utils/runtime-exit-forensics.js +10 -5
- package/dist/utils/runtime-exit-forensics.js.map +1 -1
- package/dist/utils/snapshot-writer.js +3 -3
- package/dist/utils/snapshot-writer.js.map +1 -1
- package/docs/QUOTA_MANAGER_V3.md +3 -0
- package/docs/VIRTUAL_ROUTER_PRIORITY_AND_HEALTH.md +114 -0
- package/docs/daemon-admin-ui.html +268 -11
- package/docs/file-line-limit-gate.md +30 -0
- package/docs/refactoring/host-164.3-responsibility-migration.md +62 -0
- package/docs/release-iflow-400-gate.md +58 -0
- package/docs/replay-evidence-iflow-400.txt +33 -0
- package/docs/stop-message-auto.md +4 -3
- package/package.json +4 -3
- package/scripts/auth-iflow-manual.mjs +13 -23
- package/scripts/camoufox/launch-auth.mjs +158 -10
- package/scripts/ci/check-file-line-limit.mjs +149 -0
- package/scripts/copy-compat-assets.mjs +26 -0
- package/scripts/tests/ci-jest.mjs +4 -0
- package/scripts/verify-codex-error-samples.mjs +27 -6
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import os from 'os';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import fs from 'fs/promises';
|
|
5
|
-
import { createProviderOAuthStrategy } from '../dist/providers/core/config/provider-oauth-configs.js';
|
|
6
5
|
|
|
7
6
|
async function resolveIflowTokenPath() {
|
|
8
7
|
const envFile = process.env.IFLOW_TOKEN_FILE;
|
|
@@ -41,28 +40,19 @@ async function run() {
|
|
|
41
40
|
await fs.mkdir(path.dirname(tokenPath), { recursive: true });
|
|
42
41
|
try { await fs.access(tokenPath); } catch { await fs.writeFile(tokenPath, '{}', 'utf-8'); }
|
|
43
42
|
|
|
44
|
-
//
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
// Route through the same OAuth lifecycle as runtime to avoid stale per-script endpoint drift.
|
|
44
|
+
const { ensureValidOAuthToken } = await import('../dist/providers/auth/oauth-lifecycle.js');
|
|
45
|
+
await ensureValidOAuthToken(
|
|
46
|
+
'iflow',
|
|
47
|
+
{
|
|
48
|
+
type: 'iflow-oauth',
|
|
49
|
+
tokenFile: tokenPath
|
|
51
50
|
},
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
console.log('Please open this URL in your browser:');
|
|
58
|
-
console.log(deviceCodeData.verification_uri);
|
|
59
|
-
console.log('User code:', deviceCodeData.user_code);
|
|
60
|
-
console.log('Press Enter when you have authorized...');
|
|
61
|
-
|
|
62
|
-
await new Promise(resolve => process.stdin.once('data', resolve));
|
|
63
|
-
|
|
64
|
-
const token = await strategy.pollForToken(deviceCodeData);
|
|
65
|
-
await strategy.saveToken(token);
|
|
51
|
+
{
|
|
52
|
+
forceReauthorize: true,
|
|
53
|
+
openBrowser: true
|
|
54
|
+
}
|
|
55
|
+
);
|
|
66
56
|
|
|
67
57
|
// clean up duplicate token files for the same sequence
|
|
68
58
|
for (const dup of duplicates) {
|
|
@@ -75,7 +65,7 @@ async function run() {
|
|
|
75
65
|
}
|
|
76
66
|
}
|
|
77
67
|
|
|
78
|
-
console.log(`[iflow-manual] Token saved to: ${tokenPath}`);
|
|
68
|
+
console.log(`[iflow-manual] Token refreshed and saved to: ${tokenPath}`);
|
|
79
69
|
}
|
|
80
70
|
|
|
81
71
|
run().catch(err => { console.error('[iflow-manual] Error:', err); process.exit(1); });
|
|
@@ -104,6 +104,14 @@ function buildFirefoxUserPrefs() {
|
|
|
104
104
|
'javascript.use_us_english_locale': true,
|
|
105
105
|
'intl.charset.fallback.override': 'UTF-8',
|
|
106
106
|
'gfx.downloadable_fonts.enabled': true,
|
|
107
|
+
'browser.startup.page': 0,
|
|
108
|
+
'browser.sessionstore.resume_from_crash': false,
|
|
109
|
+
'browser.sessionstore.resume_session_once': false,
|
|
110
|
+
'browser.sessionstore.max_resumed_crashes': 0,
|
|
111
|
+
'layers.acceleration.disabled': true,
|
|
112
|
+
'gfx.webrender.all': false,
|
|
113
|
+
'gfx.webrender.software': true,
|
|
114
|
+
'media.hardware-video-decoding.enabled': false,
|
|
107
115
|
'font.default.x-western': 'sans-serif',
|
|
108
116
|
'font.name.sans-serif.x-western': 'Arial',
|
|
109
117
|
'font.name.serif.x-western': 'Times New Roman',
|
|
@@ -270,6 +278,92 @@ function cleanupExistingCamoufox(profileDir) {
|
|
|
270
278
|
// ignore lock cleanup failure
|
|
271
279
|
}
|
|
272
280
|
}
|
|
281
|
+
const volatileStatePaths = [
|
|
282
|
+
'sessionstore.jsonlz4',
|
|
283
|
+
'sessionstore-backups',
|
|
284
|
+
'recovery.jsonlz4',
|
|
285
|
+
'recovery.baklz4',
|
|
286
|
+
'previous.jsonlz4',
|
|
287
|
+
'sessionCheckpoints.json',
|
|
288
|
+
'startupCache'
|
|
289
|
+
];
|
|
290
|
+
for (const rel of volatileStatePaths) {
|
|
291
|
+
const target = path.join(profileDir, rel);
|
|
292
|
+
try {
|
|
293
|
+
if (fs.existsSync(target)) {
|
|
294
|
+
fs.rmSync(target, { recursive: true, force: true });
|
|
295
|
+
}
|
|
296
|
+
} catch {
|
|
297
|
+
// ignore volatile state cleanup failure
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
function hasRunningCamoufoxForProfile(profileDir) {
|
|
303
|
+
if (!profileDir) {
|
|
304
|
+
return false;
|
|
305
|
+
}
|
|
306
|
+
try {
|
|
307
|
+
const running = listRunningCamoufoxProcesses();
|
|
308
|
+
return running.some((proc) => String(proc.command || '').includes(profileDir));
|
|
309
|
+
} catch {
|
|
310
|
+
return false;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
function hasAnyRunningCamoufox() {
|
|
315
|
+
try {
|
|
316
|
+
return listRunningCamoufoxProcesses().length > 0;
|
|
317
|
+
} catch {
|
|
318
|
+
return false;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
function listRunningCamoufoxProcesses() {
|
|
323
|
+
const probe = spawnSync('pgrep', ['-fal', 'camoufox'], {
|
|
324
|
+
encoding: 'utf8',
|
|
325
|
+
stdio: ['ignore', 'pipe', 'ignore']
|
|
326
|
+
});
|
|
327
|
+
if (!probe || probe.status !== 0) {
|
|
328
|
+
return [];
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
const selfPid = process.pid;
|
|
332
|
+
const lines = String(probe.stdout || '')
|
|
333
|
+
.split(/\r?\n/)
|
|
334
|
+
.map((line) => String(line || '').trim())
|
|
335
|
+
.filter(Boolean);
|
|
336
|
+
|
|
337
|
+
const result = [];
|
|
338
|
+
for (const line of lines) {
|
|
339
|
+
const spaceIdx = line.indexOf(' ');
|
|
340
|
+
if (spaceIdx <= 0) {
|
|
341
|
+
continue;
|
|
342
|
+
}
|
|
343
|
+
const pid = Number(line.slice(0, spaceIdx));
|
|
344
|
+
const command = line.slice(spaceIdx + 1).trim();
|
|
345
|
+
if (!Number.isFinite(pid) || pid <= 0 || pid === selfPid) {
|
|
346
|
+
continue;
|
|
347
|
+
}
|
|
348
|
+
const cmd = command.toLowerCase();
|
|
349
|
+
if (!cmd) {
|
|
350
|
+
continue;
|
|
351
|
+
}
|
|
352
|
+
if (cmd.includes('launch-auth.mjs')) {
|
|
353
|
+
continue;
|
|
354
|
+
}
|
|
355
|
+
if (cmd.includes('pgrep -fal camoufox')) {
|
|
356
|
+
continue;
|
|
357
|
+
}
|
|
358
|
+
const looksLikeCamoufox =
|
|
359
|
+
cmd.includes('camoufox.app/contents/macos/camoufox') ||
|
|
360
|
+
/(^|\/)camoufox(\s|$)/.test(cmd);
|
|
361
|
+
if (!looksLikeCamoufox) {
|
|
362
|
+
continue;
|
|
363
|
+
}
|
|
364
|
+
result.push({ pid, command });
|
|
365
|
+
}
|
|
366
|
+
return result;
|
|
273
367
|
}
|
|
274
368
|
|
|
275
369
|
async function main() {
|
|
@@ -413,6 +507,16 @@ async function launchManualCamoufox({ camoufoxBinary, profileDir, url }) {
|
|
|
413
507
|
console.log(`[camoufox-launch-auth] binary=${camoufoxBinary}`);
|
|
414
508
|
console.log(`[camoufox-launch-auth] profileDir=${profileDir}`);
|
|
415
509
|
console.log(`[camoufox-launch-auth] url=${url}`);
|
|
510
|
+
if (hasRunningCamoufoxForProfile(profileDir)) {
|
|
511
|
+
console.log(
|
|
512
|
+
'[camoufox-launch-auth] Same OAuth profile is already running; cleaning stale session state and relaunching isolated instance.'
|
|
513
|
+
);
|
|
514
|
+
cleanupExistingCamoufox(profileDir);
|
|
515
|
+
} else if (hasAnyRunningCamoufox()) {
|
|
516
|
+
console.log(
|
|
517
|
+
'[camoufox-launch-auth] Detected other Camoufox instances with different profiles; launching isolated OAuth instance with -no-remote.'
|
|
518
|
+
);
|
|
519
|
+
}
|
|
416
520
|
let browserExitCode = 0;
|
|
417
521
|
let browser = null;
|
|
418
522
|
const shutdownBrowser = (signal = 'SIGTERM') => {
|
|
@@ -430,7 +534,7 @@ async function launchManualCamoufox({ camoufoxBinary, profileDir, url }) {
|
|
|
430
534
|
});
|
|
431
535
|
|
|
432
536
|
try {
|
|
433
|
-
browser = spawn(camoufoxBinary, ['-profile', profileDir, url], {
|
|
537
|
+
browser = spawn(camoufoxBinary, ['-no-remote', '-profile', profileDir, url], {
|
|
434
538
|
detached: false,
|
|
435
539
|
stdio: 'ignore',
|
|
436
540
|
env: buildCamoufoxLaunchEnv()
|
|
@@ -453,8 +557,18 @@ async function launchManualCamoufox({ camoufoxBinary, profileDir, url }) {
|
|
|
453
557
|
|
|
454
558
|
async function launchCamoufoxDetached({ camoufoxBinary, profileDir, url }) {
|
|
455
559
|
console.log('[camoufox-launch-auth] Launching Camoufox (detached) ...');
|
|
560
|
+
if (hasRunningCamoufoxForProfile(profileDir)) {
|
|
561
|
+
console.log(
|
|
562
|
+
'[camoufox-launch-auth] Same OAuth profile is already running; cleaning stale session state and relaunching isolated instance.'
|
|
563
|
+
);
|
|
564
|
+
cleanupExistingCamoufox(profileDir);
|
|
565
|
+
} else if (hasAnyRunningCamoufox()) {
|
|
566
|
+
console.log(
|
|
567
|
+
'[camoufox-launch-auth] Detected other Camoufox instances with different profiles; launching isolated OAuth instance with -no-remote.'
|
|
568
|
+
);
|
|
569
|
+
}
|
|
456
570
|
try {
|
|
457
|
-
const child = spawn(camoufoxBinary, ['-profile', profileDir, url], {
|
|
571
|
+
const child = spawn(camoufoxBinary, ['-no-remote', '-profile', profileDir, url], {
|
|
458
572
|
detached: true,
|
|
459
573
|
stdio: 'ignore',
|
|
460
574
|
env: buildCamoufoxLaunchEnv()
|
|
@@ -474,9 +588,14 @@ function isSelectorOrTimeoutError(error) {
|
|
|
474
588
|
return (
|
|
475
589
|
/timeout/i.test(message) ||
|
|
476
590
|
/waiting for selector/i.test(message) ||
|
|
591
|
+
/selector[^.\n]*not detected/i.test(message) ||
|
|
592
|
+
/page\/account selector not detected/i.test(message) ||
|
|
593
|
+
/not detected/i.test(message) ||
|
|
477
594
|
/strict mode violation/i.test(message) ||
|
|
595
|
+
/target page, context or browser has been closed/i.test(message) ||
|
|
478
596
|
message.includes('未能定位') ||
|
|
479
|
-
message.includes('无法定位')
|
|
597
|
+
message.includes('无法定位') ||
|
|
598
|
+
message.includes('未检测到')
|
|
480
599
|
);
|
|
481
600
|
}
|
|
482
601
|
|
|
@@ -636,6 +755,7 @@ async function runIflowAutoFlow({ url, profileDir, profileId, camoufoxBinary, de
|
|
|
636
755
|
}
|
|
637
756
|
|
|
638
757
|
const headless = !devMode;
|
|
758
|
+
const timeoutMs = Number(process.env.ROUTECODEX_CAMOUFOX_IFLOW_TIMEOUT_MS || 300_000);
|
|
639
759
|
console.log(`[camoufox-launch-auth] Launching Camoufox in ${headless ? 'headless' : 'headed'} mode...`);
|
|
640
760
|
cleanupExistingCamoufox(profileDir);
|
|
641
761
|
const context = await firefox.launchPersistentContext(profileDir, {
|
|
@@ -668,7 +788,7 @@ async function runIflowAutoFlow({ url, profileDir, profileId, camoufoxBinary, de
|
|
|
668
788
|
await button.click();
|
|
669
789
|
console.log('[camoufox-launch-auth] Continue button clicked, waiting for iFlow window...');
|
|
670
790
|
const popup = await popupPromise;
|
|
671
|
-
|
|
791
|
+
let iflowPage = popup ?? page;
|
|
672
792
|
const selectors = [
|
|
673
793
|
'span.accountName--ZKlffRBc',
|
|
674
794
|
'span[class^="accountName--"]',
|
|
@@ -678,16 +798,44 @@ async function runIflowAutoFlow({ url, profileDir, profileId, camoufoxBinary, de
|
|
|
678
798
|
];
|
|
679
799
|
const selectorQuery = selectors.join(', ');
|
|
680
800
|
console.log('[camoufox-launch-auth] Waiting for iFlow OAuth URL or account DOM to load...');
|
|
801
|
+
const waitForCallbackPromise = waitForCallback(context, iflowPage, 60000)
|
|
802
|
+
.then((callbackPage) => ({ kind: 'callback', callbackPage }))
|
|
803
|
+
.catch((error) => {
|
|
804
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
805
|
+
console.warn('[camoufox-launch-auth] waitForCallback did not settle:', msg);
|
|
806
|
+
return null;
|
|
807
|
+
});
|
|
681
808
|
const waitForUrlPromise = iflowPage
|
|
682
809
|
.waitForURL((current) => typeof current === 'string' && current.includes('iflow.cn'), { timeout: 60000 })
|
|
683
|
-
.then(() => 'url')
|
|
810
|
+
.then(() => ({ kind: 'url' }))
|
|
811
|
+
.catch((error) => {
|
|
812
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
813
|
+
console.warn('[camoufox-launch-auth] waitForURL did not settle:', msg);
|
|
814
|
+
return null;
|
|
815
|
+
});
|
|
684
816
|
const waitForDomPromise = iflowPage
|
|
685
817
|
.waitForSelector(selectorQuery, { timeout: 60000 })
|
|
686
|
-
.then(() => 'dom')
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
818
|
+
.then(() => ({ kind: 'dom' }))
|
|
819
|
+
.catch((error) => {
|
|
820
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
821
|
+
console.warn('[camoufox-launch-auth] waitForSelector did not settle:', msg);
|
|
822
|
+
return null;
|
|
823
|
+
});
|
|
824
|
+
const raceResult = await Promise.race([waitForUrlPromise, waitForDomPromise, waitForCallbackPromise]);
|
|
825
|
+
if (!raceResult) {
|
|
826
|
+
const fallback = await waitForAnyElementInPages(context, selectors, 60000);
|
|
827
|
+
if (fallback?.page) {
|
|
828
|
+
iflowPage = fallback.page;
|
|
829
|
+
console.log('[camoufox-launch-auth] Fallback page with account DOM detected, continuing...');
|
|
830
|
+
} else {
|
|
831
|
+
throw new Error('iFlow OAuth page/account selector not detected');
|
|
832
|
+
}
|
|
833
|
+
} else if (raceResult.kind === 'callback') {
|
|
834
|
+
callbackObserved = true;
|
|
835
|
+
await raceResult.callbackPage.waitForLoadState('load', { timeout: timeoutMs }).catch(() => {});
|
|
836
|
+
console.log('[camoufox-launch-auth] OAuth callback detected before account selection, automation complete.');
|
|
837
|
+
return;
|
|
838
|
+
} else if (raceResult.kind === 'url') {
|
|
691
839
|
console.log(`[camoufox-launch-auth] iFlow URL detected: ${await iflowPage.url()}`);
|
|
692
840
|
await iflowPage.waitForSelector(selectorQuery, { timeout: 60000 });
|
|
693
841
|
} else {
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { execSync } from 'node:child_process';
|
|
6
|
+
|
|
7
|
+
const repoRoot = process.cwd();
|
|
8
|
+
const policyPath = path.join(repoRoot, 'config', 'file-line-limit-policy.json');
|
|
9
|
+
|
|
10
|
+
function run(cmd) {
|
|
11
|
+
return execSync(cmd, { cwd: repoRoot, stdio: ['ignore', 'pipe', 'pipe'], encoding: 'utf8' }).trim();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function tryRun(cmd) {
|
|
15
|
+
try {
|
|
16
|
+
return run(cmd);
|
|
17
|
+
} catch {
|
|
18
|
+
return '';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function loadPolicy() {
|
|
23
|
+
const raw = fs.readFileSync(policyPath, 'utf8');
|
|
24
|
+
const parsed = JSON.parse(raw);
|
|
25
|
+
return {
|
|
26
|
+
limit: Number(parsed.limit) > 0 ? Number(parsed.limit) : 500,
|
|
27
|
+
extensions: Array.isArray(parsed.extensions) ? parsed.extensions.map((v) => String(v).toLowerCase()) : [],
|
|
28
|
+
excludeDirs: Array.isArray(parsed.excludeDirs) ? parsed.excludeDirs.map((v) => String(v)) : [],
|
|
29
|
+
allowList: Array.isArray(parsed.allowList) ? parsed.allowList.map((v) => String(v)) : []
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function resolveRange() {
|
|
34
|
+
const argvBase = process.argv.find((arg) => arg.startsWith('--base='));
|
|
35
|
+
if (argvBase) {
|
|
36
|
+
const value = argvBase.slice('--base='.length).trim();
|
|
37
|
+
if (value) {
|
|
38
|
+
return `${value}...HEAD`;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const envBase = String(process.env.ROUTECODEX_LINE_LIMIT_BASE || '').trim();
|
|
42
|
+
if (envBase) {
|
|
43
|
+
return `${envBase}...HEAD`;
|
|
44
|
+
}
|
|
45
|
+
const inCi = String(process.env.CI || '').toLowerCase() === 'true';
|
|
46
|
+
const hasLocalChanges = Boolean(tryRun('git status --porcelain'));
|
|
47
|
+
if (!inCi && hasLocalChanges) {
|
|
48
|
+
return '';
|
|
49
|
+
}
|
|
50
|
+
const isPr = String(process.env.GITHUB_EVENT_NAME || '') === 'pull_request';
|
|
51
|
+
const baseRef = String(process.env.GITHUB_BASE_REF || '').trim();
|
|
52
|
+
if (isPr && baseRef) {
|
|
53
|
+
return `origin/${baseRef}...HEAD`;
|
|
54
|
+
}
|
|
55
|
+
const hasHeadParent = tryRun('git rev-parse --verify --quiet HEAD~1');
|
|
56
|
+
if (hasHeadParent) {
|
|
57
|
+
return 'HEAD~1...HEAD';
|
|
58
|
+
}
|
|
59
|
+
return '';
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function parseNameStatus(output) {
|
|
63
|
+
if (!output) return [];
|
|
64
|
+
return output
|
|
65
|
+
.split('\n')
|
|
66
|
+
.map((line) => line.trim())
|
|
67
|
+
.filter(Boolean)
|
|
68
|
+
.map((line) => {
|
|
69
|
+
const parts = line.split('\t');
|
|
70
|
+
if (parts.length < 2) return null;
|
|
71
|
+
const status = parts[0];
|
|
72
|
+
if (status.startsWith('R')) {
|
|
73
|
+
return { status: 'R', path: parts[2] || parts[1] };
|
|
74
|
+
}
|
|
75
|
+
return { status: status[0], path: parts[1] };
|
|
76
|
+
})
|
|
77
|
+
.filter((v) => v && typeof v.path === 'string');
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function isExcluded(filePath, policy) {
|
|
81
|
+
const normalized = filePath.replace(/\\/g, '/');
|
|
82
|
+
if (policy.allowList.includes(normalized)) {
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
return policy.excludeDirs.some((prefix) => normalized.startsWith(prefix));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function isCodeFile(filePath, policy) {
|
|
89
|
+
const ext = path.extname(filePath).toLowerCase();
|
|
90
|
+
return policy.extensions.includes(ext);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function countLines(filePath) {
|
|
94
|
+
const content = fs.readFileSync(path.join(repoRoot, filePath), 'utf8');
|
|
95
|
+
if (!content.length) return 0;
|
|
96
|
+
return content.split(/\r?\n/).length;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function getChangedFiles(range) {
|
|
100
|
+
const diffCmd = range
|
|
101
|
+
? `git diff --name-status --diff-filter=ACMR ${range}`
|
|
102
|
+
: 'git diff --name-status --diff-filter=ACMR HEAD';
|
|
103
|
+
return parseNameStatus(tryRun(diffCmd));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function main() {
|
|
107
|
+
const policy = loadPolicy();
|
|
108
|
+
const range = resolveRange();
|
|
109
|
+
const changed = getChangedFiles(range);
|
|
110
|
+
if (!changed.length) {
|
|
111
|
+
console.log('[file-line-limit] no changed files; skip');
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const violations = [];
|
|
116
|
+
for (const entry of changed) {
|
|
117
|
+
const filePath = entry.path;
|
|
118
|
+
if (!filePath || !fs.existsSync(path.join(repoRoot, filePath))) {
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
if (!isCodeFile(filePath, policy) || isExcluded(filePath, policy)) {
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
const lines = countLines(filePath);
|
|
125
|
+
if (lines < policy.limit) {
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
const violationType = entry.status === 'A' ? 'new-file-over-limit' : 'modified-file-over-limit';
|
|
129
|
+
violations.push({ type: violationType, path: filePath, lines });
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (!violations.length) {
|
|
133
|
+
console.log(
|
|
134
|
+
`[file-line-limit] pass (range=${range || 'HEAD'} limit=${policy.limit}, checked=${changed.length})`
|
|
135
|
+
);
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
console.error(`[file-line-limit] fail (limit=${policy.limit}, range=${range || 'HEAD'})`);
|
|
140
|
+
for (const violation of violations) {
|
|
141
|
+
console.error(`- ${violation.type}: ${violation.path} (${violation.lines} lines)`);
|
|
142
|
+
}
|
|
143
|
+
console.error(
|
|
144
|
+
'Fix: split by feature/function and extract reusable helpers; if temporary exemption is required, add path to config/file-line-limit-policy.json allowList with a tracked follow-up issue.'
|
|
145
|
+
);
|
|
146
|
+
process.exit(1);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
main();
|
|
@@ -14,6 +14,17 @@ async function ensureDir(p) {
|
|
|
14
14
|
await fs.mkdir(p, { recursive: true }).catch(() => {});
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
async function assertFileExists(filePath, message) {
|
|
18
|
+
try {
|
|
19
|
+
const stats = await fs.stat(filePath);
|
|
20
|
+
if (!stats.isFile()) {
|
|
21
|
+
throw new Error(message);
|
|
22
|
+
}
|
|
23
|
+
} catch {
|
|
24
|
+
throw new Error(message);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
17
28
|
async function main() {
|
|
18
29
|
const PROMPT_SRC = path.resolve(process.cwd(), 'src/config/system-prompts');
|
|
19
30
|
const PROMPT_DIST = path.resolve(process.cwd(), 'dist/config/system-prompts');
|
|
@@ -21,6 +32,7 @@ async function main() {
|
|
|
21
32
|
const CAMOUFOX_DIST = path.resolve(process.cwd(), 'dist/scripts/camoufox');
|
|
22
33
|
const DEEPSEEK_SRC = path.resolve(process.cwd(), 'scripts/deepseek');
|
|
23
34
|
const DEEPSEEK_DIST = path.resolve(process.cwd(), 'dist/scripts/deepseek');
|
|
35
|
+
const REQUIRED_DEEPSEEK_ASSETS = ['pow-solver.mjs', 'sha3_wasm_bg.7b9ca65ddd.wasm'];
|
|
24
36
|
const promptCopied = [];
|
|
25
37
|
const camoufoxCopied = [];
|
|
26
38
|
const deepseekCopied = [];
|
|
@@ -69,6 +81,20 @@ async function main() {
|
|
|
69
81
|
} catch (deepseekErr) {
|
|
70
82
|
if (deepseekErr && deepseekErr.code !== 'ENOENT') throw deepseekErr;
|
|
71
83
|
}
|
|
84
|
+
|
|
85
|
+
for (const rel of REQUIRED_DEEPSEEK_ASSETS) {
|
|
86
|
+
const sourcePath = path.join(DEEPSEEK_SRC, rel);
|
|
87
|
+
const distPath = path.join(DEEPSEEK_DIST, rel);
|
|
88
|
+
await assertFileExists(
|
|
89
|
+
sourcePath,
|
|
90
|
+
`[copy-compat-assets] missing required deepseek source asset: ${sourcePath}`
|
|
91
|
+
);
|
|
92
|
+
await assertFileExists(
|
|
93
|
+
distPath,
|
|
94
|
+
`[copy-compat-assets] missing required deepseek dist asset after copy: ${distPath}`
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
72
98
|
console.log(`[copy-compat-assets] prompts copied: ${promptCopied.length}`);
|
|
73
99
|
console.log(`[copy-compat-assets] camoufox assets copied: ${camoufoxCopied.length}`);
|
|
74
100
|
console.log(`[copy-compat-assets] deepseek assets copied: ${deepseekCopied.length}`);
|
|
@@ -11,9 +11,11 @@ const routingInstructionTests = [
|
|
|
11
11
|
'tests/commands/oauth-command.qwen-auto.spec.ts',
|
|
12
12
|
'tests/server/runtime/request-executor.single-attempt.spec.ts',
|
|
13
13
|
'tests/server/runtime/executor-provider.retryable.spec.ts',
|
|
14
|
+
'tests/server/runtime/http-server/executor/usage-aggregator.spec.ts',
|
|
14
15
|
'tests/providers/auth/tokenfile-auth.iflow.spec.ts',
|
|
15
16
|
'tests/providers/core/runtime/gemini-http-provider.unit.test.ts',
|
|
16
17
|
'tests/providers/core/runtime/gemini-cli-http-provider.unit.test.ts',
|
|
18
|
+
'tests/providers/core/runtime/deepseek-http-provider.unit.test.ts',
|
|
17
19
|
'tests/providers/core/runtime/base-provider.spec.ts',
|
|
18
20
|
'tests/providers/core/runtime/http-transport-provider.headers.test.ts',
|
|
19
21
|
'tests/providers/core/runtime/protocol-http-providers.unit.test.ts',
|
|
@@ -64,8 +66,10 @@ const routingInstructionTests = [
|
|
|
64
66
|
'tests/servertool/hub-pipeline-session-headers.spec.ts',
|
|
65
67
|
'tests/servertool/stopmessage-anthropic-stop-sequence.spec.ts',
|
|
66
68
|
'tests/servertool/servertool-progress-logging.spec.ts',
|
|
69
|
+
'tests/sharedmodule/virtual-router-hit-log.spec.ts',
|
|
67
70
|
'tests/unified-hub/hub-v1-single-path-imports.spec.ts',
|
|
68
71
|
'tests/unified-hub/policy-errorsample-write.spec.ts',
|
|
72
|
+
'tests/unified-hub/runtime-error-errorsample-write.spec.ts',
|
|
69
73
|
'tests/unified-hub/policy-observe-shadow.spec.ts',
|
|
70
74
|
'tests/unified-hub/shadow-runtime-compare.errorsamples.spec.ts'
|
|
71
75
|
];
|
|
@@ -41,14 +41,35 @@ async function fileExists(p) {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
async function collectSampleFiles(rootDir) {
|
|
44
|
-
const entries = await fs.readdir(rootDir, { withFileTypes: true });
|
|
45
44
|
const files = [];
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
const queue = [rootDir];
|
|
46
|
+
|
|
47
|
+
while (queue.length > 0) {
|
|
48
|
+
const currentDir = queue.shift();
|
|
49
|
+
if (!currentDir) {
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
let entries = [];
|
|
54
|
+
try {
|
|
55
|
+
entries = await fs.readdir(currentDir, { withFileTypes: true });
|
|
56
|
+
} catch {
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
for (const entry of entries) {
|
|
61
|
+
const fullPath = path.join(currentDir, entry.name);
|
|
62
|
+
if (entry.isDirectory()) {
|
|
63
|
+
queue.push(fullPath);
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
if (!entry.isFile()) continue;
|
|
67
|
+
if (!entry.name.toLowerCase().endsWith('.json')) continue;
|
|
68
|
+
files.push(fullPath);
|
|
69
|
+
}
|
|
50
70
|
}
|
|
51
|
-
|
|
71
|
+
|
|
72
|
+
return files.sort();
|
|
52
73
|
}
|
|
53
74
|
|
|
54
75
|
async function checkFile(filePath) {
|