@entelligentsia/forgecli 0.7.10 → 0.9.0
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/CHANGELOG.md +127 -0
- package/dist/CHANGELOG-forge-plugin.md +70 -0
- package/dist/CHANGELOG-pi.md +63 -0
- package/dist/bin/argv.d.ts +2 -2
- package/dist/bin/argv.js +27 -0
- package/dist/bin/argv.js.map +1 -1
- package/dist/bin/config.d.ts +69 -0
- package/dist/bin/config.js +315 -0
- package/dist/bin/config.js.map +1 -0
- package/dist/bin/doctor.d.ts +1 -0
- package/dist/bin/doctor.js +12 -0
- package/dist/bin/doctor.js.map +1 -1
- package/dist/bin/env-defaults.d.ts +1 -0
- package/dist/bin/env-defaults.js +13 -0
- package/dist/bin/env-defaults.js.map +1 -0
- package/dist/bin/forge.js +16 -0
- package/dist/bin/forge.js.map +1 -1
- package/dist/bin/update-cli.d.ts +9 -0
- package/dist/bin/update-cli.js +120 -0
- package/dist/bin/update-cli.js.map +1 -0
- package/dist/extensions/forgecli/config-command.d.ts +8 -0
- package/dist/extensions/forgecli/config-command.js +66 -0
- package/dist/extensions/forgecli/config-command.js.map +1 -0
- package/dist/extensions/forgecli/config-layer.d.ts +38 -0
- package/dist/extensions/forgecli/config-layer.js +68 -0
- package/dist/extensions/forgecli/config-layer.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/component.d.ts +35 -0
- package/dist/extensions/forgecli/config-tui/component.js +236 -0
- package/dist/extensions/forgecli/config-tui/component.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/handler.d.ts +40 -0
- package/dist/extensions/forgecli/config-tui/handler.js +240 -0
- package/dist/extensions/forgecli/config-tui/handler.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/index.d.ts +5 -0
- package/dist/extensions/forgecli/config-tui/index.js +5 -0
- package/dist/extensions/forgecli/config-tui/index.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/keys.d.ts +26 -0
- package/dist/extensions/forgecli/config-tui/keys.js +33 -0
- package/dist/extensions/forgecli/config-tui/keys.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/plugin-config-reader.d.ts +23 -0
- package/dist/extensions/forgecli/config-tui/plugin-config-reader.js +58 -0
- package/dist/extensions/forgecli/config-tui/plugin-config-reader.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/screens/advanced-menu.d.ts +7 -0
- package/dist/extensions/forgecli/config-tui/screens/advanced-menu.js +83 -0
- package/dist/extensions/forgecli/config-tui/screens/advanced-menu.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/screens/confirm-quit.d.ts +11 -0
- package/dist/extensions/forgecli/config-tui/screens/confirm-quit.js +54 -0
- package/dist/extensions/forgecli/config-tui/screens/confirm-quit.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/screens/override-editor.d.ts +11 -0
- package/dist/extensions/forgecli/config-tui/screens/override-editor.js +233 -0
- package/dist/extensions/forgecli/config-tui/screens/override-editor.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/screens/overrides-list-phases.d.ts +7 -0
- package/dist/extensions/forgecli/config-tui/screens/overrides-list-phases.js +91 -0
- package/dist/extensions/forgecli/config-tui/screens/overrides-list-phases.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/screens/overrides-list.d.ts +7 -0
- package/dist/extensions/forgecli/config-tui/screens/overrides-list.js +71 -0
- package/dist/extensions/forgecli/config-tui/screens/overrides-list.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/screens/persona-editor.d.ts +10 -0
- package/dist/extensions/forgecli/config-tui/screens/persona-editor.js +182 -0
- package/dist/extensions/forgecli/config-tui/screens/persona-editor.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/screens/persona-picker.d.ts +7 -0
- package/dist/extensions/forgecli/config-tui/screens/persona-picker.js +76 -0
- package/dist/extensions/forgecli/config-tui/screens/persona-picker.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/screens/personas-list.d.ts +7 -0
- package/dist/extensions/forgecli/config-tui/screens/personas-list.js +98 -0
- package/dist/extensions/forgecli/config-tui/screens/personas-list.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/screens/shared.d.ts +29 -0
- package/dist/extensions/forgecli/config-tui/screens/shared.js +100 -0
- package/dist/extensions/forgecli/config-tui/screens/shared.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/screens/show-resolved.d.ts +23 -0
- package/dist/extensions/forgecli/config-tui/screens/show-resolved.js +128 -0
- package/dist/extensions/forgecli/config-tui/screens/show-resolved.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/screens/tier-menu.d.ts +7 -0
- package/dist/extensions/forgecli/config-tui/screens/tier-menu.js +135 -0
- package/dist/extensions/forgecli/config-tui/screens/tier-menu.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/screens/tier-picker.d.ts +9 -0
- package/dist/extensions/forgecli/config-tui/screens/tier-picker.js +122 -0
- package/dist/extensions/forgecli/config-tui/screens/tier-picker.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/screens/types.d.ts +24 -0
- package/dist/extensions/forgecli/config-tui/screens/types.js +5 -0
- package/dist/extensions/forgecli/config-tui/screens/types.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/screens.d.ts +24 -0
- package/dist/extensions/forgecli/config-tui/screens.js +78 -0
- package/dist/extensions/forgecli/config-tui/screens.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/state/buffer.d.ts +11 -0
- package/dist/extensions/forgecli/config-tui/state/buffer.js +91 -0
- package/dist/extensions/forgecli/config-tui/state/buffer.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/state/constants.d.ts +4 -0
- package/dist/extensions/forgecli/config-tui/state/constants.js +14 -0
- package/dist/extensions/forgecli/config-tui/state/constants.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/state/index.d.ts +6 -0
- package/dist/extensions/forgecli/config-tui/state/index.js +9 -0
- package/dist/extensions/forgecli/config-tui/state/index.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/state/init.d.ts +2 -0
- package/dist/extensions/forgecli/config-tui/state/init.js +30 -0
- package/dist/extensions/forgecli/config-tui/state/init.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/state/model.d.ts +192 -0
- package/dist/extensions/forgecli/config-tui/state/model.js +4 -0
- package/dist/extensions/forgecli/config-tui/state/model.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/state/reducer.d.ts +2 -0
- package/dist/extensions/forgecli/config-tui/state/reducer.js +212 -0
- package/dist/extensions/forgecli/config-tui/state/reducer.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/state/selectors.d.ts +91 -0
- package/dist/extensions/forgecli/config-tui/state/selectors.js +231 -0
- package/dist/extensions/forgecli/config-tui/state/selectors.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/state.d.ts +6 -0
- package/dist/extensions/forgecli/config-tui/state.js +11 -0
- package/dist/extensions/forgecli/config-tui/state.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/theme.d.ts +37 -0
- package/dist/extensions/forgecli/config-tui/theme.js +88 -0
- package/dist/extensions/forgecli/config-tui/theme.js.map +1 -0
- package/dist/extensions/forgecli/config-tui/tier-meta.d.ts +28 -0
- package/dist/extensions/forgecli/config-tui/tier-meta.js +69 -0
- package/dist/extensions/forgecli/config-tui/tier-meta.js.map +1 -0
- package/dist/extensions/forgecli/config-writer.d.ts +16 -0
- package/dist/extensions/forgecli/config-writer.js +63 -0
- package/dist/extensions/forgecli/config-writer.js.map +1 -0
- package/dist/extensions/forgecli/fix-bug.js +85 -1
- package/dist/extensions/forgecli/fix-bug.js.map +1 -1
- package/dist/extensions/forgecli/forge-cli-schema.json +54 -0
- package/dist/extensions/forgecli/forge-commands.js +3 -8
- package/dist/extensions/forgecli/forge-commands.js.map +1 -1
- package/dist/extensions/forgecli/forge-subagent.d.ts +13 -0
- package/dist/extensions/forgecli/forge-subagent.js +19 -0
- package/dist/extensions/forgecli/forge-subagent.js.map +1 -1
- package/dist/extensions/forgecli/index.js +19 -3
- package/dist/extensions/forgecli/index.js.map +1 -1
- package/dist/extensions/forgecli/input-router.d.ts +33 -0
- package/dist/extensions/forgecli/input-router.js +133 -0
- package/dist/extensions/forgecli/input-router.js.map +1 -0
- package/dist/extensions/forgecli/model-resolver.d.ts +32 -0
- package/dist/extensions/forgecli/model-resolver.js +65 -0
- package/dist/extensions/forgecli/model-resolver.js.map +1 -0
- package/dist/extensions/forgecli/model-validator.d.ts +29 -0
- package/dist/extensions/forgecli/model-validator.js +107 -0
- package/dist/extensions/forgecli/model-validator.js.map +1 -0
- package/dist/extensions/forgecli/run-sprint.js +59 -0
- package/dist/extensions/forgecli/run-sprint.js.map +1 -1
- package/dist/extensions/forgecli/run-task.js +93 -1
- package/dist/extensions/forgecli/run-task.js.map +1 -1
- package/dist/extensions/forgecli/thread-switcher.js +5 -2
- package/dist/extensions/forgecli/thread-switcher.js.map +1 -1
- package/dist/extensions/forgecli/update-check.js +1 -1
- package/dist/extensions/forgecli/update-check.js.map +1 -1
- package/dist/extensions/forgecli/whats-new-widget.d.ts +5 -5
- package/dist/extensions/forgecli/whats-new-widget.js +16 -13
- package/dist/extensions/forgecli/whats-new-widget.js.map +1 -1
- package/dist/extensions/forgecli/whats-new.js +6 -5
- package/dist/extensions/forgecli/whats-new.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +27 -98
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +62 -132
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js +25 -15
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +17 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js +8 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js +17 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.js +8 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/CHANGELOG.md +63 -0
- package/node_modules/@earendil-works/pi-coding-agent/README.md +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/config-selector.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/config-selector.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/config-selector.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli.js +6 -10
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/config.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/config.js +12 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/config.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +30 -15
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.d.ts +3 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js +23 -13
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.d.ts +4 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js +58 -38
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/slash-commands.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/slash-commands.js +0 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/slash-commands.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js +3 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/config-selector.d.ts +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/config-selector.js +7 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +6 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js +3 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/changelog.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/changelog.js +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/changelog.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/child-process.d.ts +7 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/child-process.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/child-process.js +60 -7
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/child-process.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/packages.md +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/docs/settings.md +1 -3
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/package.json +6 -6
- package/node_modules/@earendil-works/pi-tui/package.json +2 -2
- package/node_modules/@protobufjs/fetch/CHANGELOG.md +8 -0
- package/node_modules/@protobufjs/fetch/index.d.ts +7 -7
- package/node_modules/@protobufjs/fetch/index.js +4 -7
- package/node_modules/@protobufjs/fetch/package.json +7 -5
- package/node_modules/@protobufjs/fetch/tests/data/file.txt +1 -0
- package/node_modules/@protobufjs/fetch/tests/index.js +150 -8
- package/node_modules/@protobufjs/fetch/util/fs.js +11 -0
- package/node_modules/@protobufjs/inquire/CHANGELOG.md +8 -0
- package/node_modules/@protobufjs/inquire/index.d.ts +1 -0
- package/node_modules/@protobufjs/inquire/index.js +1 -0
- package/node_modules/@protobufjs/inquire/package.json +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.js +187 -153
- package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.js +14 -5
- package/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.js +207 -173
- package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/package.json +6 -3
- package/node_modules/protobufjs/src/util/fs.js +11 -0
- package/node_modules/protobufjs/src/util/minimal.js +10 -2
- package/node_modules/protobufjs/src/util.js +1 -1
- package/node_modules/undici/README.md +14 -5
- package/node_modules/undici/docs/docs/api/Client.md +4 -2
- package/node_modules/undici/docs/docs/api/Dispatcher.md +62 -27
- package/node_modules/undici/docs/docs/api/GlobalInstallation.md +7 -5
- package/node_modules/undici/docs/docs/api/H2CClient.md +1 -1
- package/node_modules/undici/docs/docs/api/RedirectHandler.md +14 -9
- package/node_modules/undici/docs/docs/api/RetryAgent.md +0 -1
- package/node_modules/undici/docs/docs/api/RetryHandler.md +12 -14
- package/node_modules/undici/docs/docs/api/SnapshotAgent.md +23 -0
- package/node_modules/undici/docs/docs/best-practices/migrating-from-v7-to-v8.md +231 -0
- package/node_modules/undici/index.js +4 -2
- package/node_modules/undici/lib/api/api-connect.js +13 -11
- package/node_modules/undici/lib/api/api-pipeline.js +26 -13
- package/node_modules/undici/lib/api/api-request.js +45 -21
- package/node_modules/undici/lib/api/api-stream.js +81 -20
- package/node_modules/undici/lib/api/api-upgrade.js +21 -11
- package/node_modules/undici/lib/api/readable.js +3 -2
- package/node_modules/undici/lib/cache/memory-cache-store.js +1 -1
- package/node_modules/undici/lib/cache/sqlite-cache-store.js +6 -4
- package/node_modules/undici/lib/core/connect.js +17 -1
- package/node_modules/undici/lib/core/constants.js +1 -24
- package/node_modules/undici/lib/core/errors.js +2 -2
- package/node_modules/undici/lib/core/request.js +115 -18
- package/node_modules/undici/lib/core/socks5-client.js +24 -9
- package/node_modules/undici/lib/core/socks5-utils.js +32 -23
- package/node_modules/undici/lib/core/symbols.js +1 -0
- package/node_modules/undici/lib/core/util.js +70 -43
- package/node_modules/undici/lib/dispatcher/agent.js +47 -33
- package/node_modules/undici/lib/dispatcher/balanced-pool.js +21 -26
- package/node_modules/undici/lib/dispatcher/client-h1.js +98 -39
- package/node_modules/undici/lib/dispatcher/client-h2.js +603 -272
- package/node_modules/undici/lib/dispatcher/client.js +12 -5
- package/node_modules/undici/lib/dispatcher/dispatcher-base.js +24 -5
- package/node_modules/undici/lib/dispatcher/dispatcher.js +0 -4
- package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +107 -0
- package/node_modules/undici/lib/dispatcher/h2c-client.js +5 -5
- package/node_modules/undici/lib/dispatcher/pool-base.js +28 -10
- package/node_modules/undici/lib/dispatcher/pool.js +31 -6
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +38 -13
- package/node_modules/undici/lib/dispatcher/round-robin-pool.js +31 -9
- package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +95 -80
- package/node_modules/undici/lib/global.js +13 -1
- package/node_modules/undici/lib/handler/cache-handler.js +16 -8
- package/node_modules/undici/lib/handler/decorator-handler.js +1 -2
- package/node_modules/undici/lib/handler/redirect-handler.js +5 -51
- package/node_modules/undici/lib/handler/retry-handler.js +15 -2
- package/node_modules/undici/lib/interceptor/cache.js +30 -17
- package/node_modules/undici/lib/interceptor/decompress.js +28 -2
- package/node_modules/undici/lib/interceptor/dns.js +1 -1
- package/node_modules/undici/lib/interceptor/redirect.js +3 -3
- package/node_modules/undici/lib/llhttp/llhttp-wasm.js +1 -1
- package/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +1 -1
- package/node_modules/undici/lib/mock/mock-agent.js +8 -8
- package/node_modules/undici/lib/mock/mock-call-history.js +15 -15
- package/node_modules/undici/lib/mock/mock-utils.js +37 -22
- package/node_modules/undici/lib/mock/snapshot-agent.js +16 -6
- package/node_modules/undici/lib/mock/snapshot-recorder.js +38 -3
- package/node_modules/undici/lib/util/cache.js +8 -7
- package/node_modules/undici/lib/util/runtime-features.js +3 -34
- package/node_modules/undici/lib/web/cache/cache.js +6 -8
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +245 -150
- package/node_modules/undici/lib/web/fetch/body.js +3 -9
- package/node_modules/undici/lib/web/fetch/formdata-parser.js +17 -6
- package/node_modules/undici/lib/web/fetch/formdata.js +21 -2
- package/node_modules/undici/lib/web/fetch/index.js +214 -221
- package/node_modules/undici/lib/web/webidl/index.js +7 -9
- package/node_modules/undici/lib/web/websocket/frame.js +1 -7
- package/node_modules/undici/lib/web/websocket/permessage-deflate.js +13 -31
- package/node_modules/undici/lib/web/websocket/receiver.js +62 -22
- package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +11 -17
- package/node_modules/undici/lib/web/websocket/websocket.js +6 -1
- package/node_modules/undici/package.json +9 -9
- package/node_modules/undici/types/agent.d.ts +0 -2
- package/node_modules/undici/types/client.d.ts +25 -19
- package/node_modules/undici/types/dispatcher.d.ts +7 -27
- package/node_modules/undici/types/dispatcher1-wrapper.d.ts +7 -0
- package/node_modules/undici/types/formdata.d.ts +0 -6
- package/node_modules/undici/types/h2c-client.d.ts +6 -6
- package/node_modules/undici/types/header.d.ts +5 -0
- package/node_modules/undici/types/index.d.ts +3 -1
- package/node_modules/undici/types/interceptors.d.ts +1 -1
- package/node_modules/undici/types/pool.d.ts +0 -2
- package/node_modules/undici/types/proxy-agent.d.ts +2 -2
- package/node_modules/undici/types/round-robin-pool.d.ts +0 -2
- package/node_modules/undici/types/snapshot-agent.d.ts +4 -0
- package/node_modules/undici/types/socks5-proxy-agent.d.ts +2 -2
- package/node_modules/undici/types/webidl.d.ts +0 -1
- package/package.json +16 -9
- package/dist/extensions/forgecli/review-command.d.ts +0 -2
- package/dist/extensions/forgecli/review-command.js +0 -184
- package/dist/extensions/forgecli/review-command.js.map +0 -1
- package/dist/forge-payload/.tools/banners.cjs +0 -435
- package/dist/forge-payload/.tools/build-context-pack.cjs +0 -290
- package/dist/forge-payload/.tools/build-init-context.cjs +0 -322
- package/dist/forge-payload/.tools/build-overlay.cjs +0 -326
- package/dist/forge-payload/.tools/build-persona-pack.cjs +0 -226
- package/dist/forge-payload/.tools/collate.cjs +0 -1041
- package/dist/forge-payload/.tools/generation-manifest.cjs +0 -311
- package/dist/forge-payload/.tools/lib/forge-root.cjs +0 -59
- package/dist/forge-payload/.tools/lib/paths.cjs +0 -29
- package/dist/forge-payload/.tools/lib/pricing.cjs +0 -165
- package/dist/forge-payload/.tools/lib/project-root.cjs +0 -32
- package/dist/forge-payload/.tools/lib/result.js +0 -40
- package/dist/forge-payload/.tools/lib/store-facade.cjs +0 -162
- package/dist/forge-payload/.tools/lib/store-nlp.cjs +0 -250
- package/dist/forge-payload/.tools/lib/store-query-exec.cjs +0 -272
- package/dist/forge-payload/.tools/lib/validate.js +0 -141
- package/dist/forge-payload/.tools/manage-config.cjs +0 -340
- package/dist/forge-payload/.tools/manage-versions.cjs +0 -365
- package/dist/forge-payload/.tools/package.json +0 -3
- package/dist/forge-payload/.tools/parse-gates.cjs +0 -151
- package/dist/forge-payload/.tools/parse-verdict.cjs +0 -67
- package/dist/forge-payload/.tools/preflight-gate.cjs +0 -350
- package/dist/forge-payload/.tools/prompts/sprint-plan-prompt.md +0 -70
- package/dist/forge-payload/.tools/schemas/task-list.schema.json +0 -53
- package/dist/forge-payload/.tools/seed-store.cjs +0 -237
- package/dist/forge-payload/.tools/store-cli.cjs +0 -1226
- package/dist/forge-payload/.tools/store-query.cjs +0 -319
- package/dist/forge-payload/.tools/store.cjs +0 -315
- package/dist/forge-payload/.tools/substitute-placeholders.cjs +0 -625
- package/dist/forge-payload/.tools/validate-store.cjs +0 -593
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package-lock.json +0 -24
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package-lock.json +0 -92
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package-lock.json +0 -31
- package/node_modules/undici/lib/handler/unwrap-handler.js +0 -100
- package/node_modules/undici/lib/handler/wrap-handler.js +0 -105
- package/node_modules/undici/lib/llhttp/.gitkeep +0 -0
- package/node_modules/undici/lib/util/promise.js +0 -28
- package/skills/refresh-kb-links/SKILL.md +0 -217
- package/skills/store-custodian/SKILL.md +0 -163
- package/skills/store-query-grammar/SKILL.md +0 -145
- package/skills/store-query-nlp/SKILL.md +0 -110
|
@@ -64,12 +64,7 @@ const { getGlobalDispatcher } = require('../../global')
|
|
|
64
64
|
const { webidl } = require('../webidl')
|
|
65
65
|
const { STATUS_CODES } = require('node:http')
|
|
66
66
|
const { bytesMatch } = require('../subresource-integrity/subresource-integrity')
|
|
67
|
-
const { createDeferredPromise } = require('../../util/promise')
|
|
68
67
|
const { isomorphicEncode } = require('../infra')
|
|
69
|
-
const { runtimeFeatures } = require('../../util/runtime-features')
|
|
70
|
-
|
|
71
|
-
// Node.js v23.8.0+ and v22.15.0+ supports Zstandard
|
|
72
|
-
const hasZstd = runtimeFeatures.has('zstd')
|
|
73
68
|
|
|
74
69
|
const GET_OR_HEAD = ['GET', 'HEAD']
|
|
75
70
|
|
|
@@ -80,6 +75,35 @@ const defaultUserAgent = typeof __UNDICI_IS_NODE__ !== 'undefined' || typeof esb
|
|
|
80
75
|
/** @type {import('buffer').resolveObjectURL} */
|
|
81
76
|
let resolveObjectURL
|
|
82
77
|
|
|
78
|
+
function appendHeadersListFromResponseHeaders (headersList, headers, rawHeaders) {
|
|
79
|
+
if (Array.isArray(rawHeaders)) {
|
|
80
|
+
for (let i = 0; i < rawHeaders.length; i += 2) {
|
|
81
|
+
const nameStr = bufferToLowerCasedHeaderName(rawHeaders[i])
|
|
82
|
+
const value = rawHeaders[i + 1]
|
|
83
|
+
|
|
84
|
+
if (Array.isArray(value) && !Buffer.isBuffer(value)) {
|
|
85
|
+
for (const val of value) {
|
|
86
|
+
headersList.append(nameStr, val.toString('latin1'), true)
|
|
87
|
+
}
|
|
88
|
+
} else {
|
|
89
|
+
headersList.append(nameStr, value.toString('latin1'), true)
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
for (const [name, value] of Object.entries(headers ?? {})) {
|
|
97
|
+
if (Array.isArray(value)) {
|
|
98
|
+
for (const entry of value) {
|
|
99
|
+
headersList.append(name, `${entry}`, true)
|
|
100
|
+
}
|
|
101
|
+
} else {
|
|
102
|
+
headersList.append(name, `${value}`, true)
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
83
107
|
class Fetch extends EE {
|
|
84
108
|
constructor (dispatcher) {
|
|
85
109
|
super()
|
|
@@ -136,7 +160,7 @@ function fetch (input, init = undefined) {
|
|
|
136
160
|
webidl.argumentLengthCheck(arguments, 1, 'globalThis.fetch')
|
|
137
161
|
|
|
138
162
|
// 1. Let p be a new promise.
|
|
139
|
-
let p =
|
|
163
|
+
let p = Promise.withResolvers()
|
|
140
164
|
|
|
141
165
|
// 2. Let requestObject be the result of invoking the initial value of
|
|
142
166
|
// Request as constructor with input and init as arguments. If this throws
|
|
@@ -1030,7 +1054,7 @@ function fetchFinale (fetchParams, response) {
|
|
|
1030
1054
|
let responseStatus = 0
|
|
1031
1055
|
|
|
1032
1056
|
// 7. If fetchParams’s request’s mode is not "navigate" or response’s has-cross-origin-redirects is false:
|
|
1033
|
-
if (fetchParams.request.mode !== '
|
|
1057
|
+
if (fetchParams.request.mode !== 'navigate' || !response.hasCrossOriginRedirects) {
|
|
1034
1058
|
// 1. Set responseStatus to response’s status.
|
|
1035
1059
|
responseStatus = response.status
|
|
1036
1060
|
|
|
@@ -1433,7 +1457,10 @@ async function httpNetworkOrCacheFetch (
|
|
|
1433
1457
|
// 8. If contentLengthHeaderValue is non-null, then append
|
|
1434
1458
|
// `Content-Length`/contentLengthHeaderValue to httpRequest’s header
|
|
1435
1459
|
// list.
|
|
1436
|
-
if (
|
|
1460
|
+
if (
|
|
1461
|
+
contentLengthHeaderValue != null &&
|
|
1462
|
+
!httpRequest.headersList.contains('content-length', true)
|
|
1463
|
+
) {
|
|
1437
1464
|
httpRequest.headersList.append('content-length', contentLengthHeaderValue, true)
|
|
1438
1465
|
}
|
|
1439
1466
|
|
|
@@ -2148,257 +2175,223 @@ async function httpNetworkFetch (
|
|
|
2148
2175
|
const path = url.pathname + url.search
|
|
2149
2176
|
const hasTrailingQuestionMark = url.search.length === 0 && url.href[url.href.length - url.hash.length - 1] === '?'
|
|
2150
2177
|
|
|
2151
|
-
return
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
// TODO (fix): Do we need connection here?
|
|
2167
|
-
const { connection } = fetchParams.controller
|
|
2168
|
-
|
|
2169
|
-
// Set timingInfo’s final connection timing info to the result of calling clamp and coarsen
|
|
2170
|
-
// connection timing info with connection’s timing info, timingInfo’s post-redirect start
|
|
2171
|
-
// time, and fetchParams’s cross-origin isolated capability.
|
|
2172
|
-
// TODO: implement connection timing
|
|
2173
|
-
timingInfo.finalConnectionTimingInfo = clampAndCoarsenConnectionTimingInfo(undefined, timingInfo.postRedirectStartTime, fetchParams.crossOriginIsolatedCapability)
|
|
2174
|
-
|
|
2175
|
-
if (connection.destroyed) {
|
|
2176
|
-
abort(new DOMException('The operation was aborted.', 'AbortError'))
|
|
2177
|
-
} else {
|
|
2178
|
-
fetchParams.controller.on('terminated', abort)
|
|
2179
|
-
this.abort = connection.abort = abort
|
|
2180
|
-
}
|
|
2181
|
-
|
|
2182
|
-
// Set timingInfo’s final network-request start time to the coarsened shared current time given
|
|
2183
|
-
// fetchParams’s cross-origin isolated capability.
|
|
2184
|
-
timingInfo.finalNetworkRequestStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)
|
|
2178
|
+
return dispatchWithProtocolPreference(body)
|
|
2179
|
+
|
|
2180
|
+
function dispatchWithProtocolPreference (body, allowH2) {
|
|
2181
|
+
return new Promise((resolve, reject) => agent.dispatch(
|
|
2182
|
+
{
|
|
2183
|
+
path: hasTrailingQuestionMark ? `${path}?` : path,
|
|
2184
|
+
origin: url.origin,
|
|
2185
|
+
method: request.method,
|
|
2186
|
+
body: agent.isMockActive ? request.body && (request.body.source || request.body.stream) : body,
|
|
2187
|
+
// Preserve the serialized fetch body for MockAgent net-connect fallthroughs.
|
|
2188
|
+
__mockAgentBodyForDispatch: body,
|
|
2189
|
+
headers: request.headersList.entries,
|
|
2190
|
+
maxRedirections: 0,
|
|
2191
|
+
upgrade: request.mode === 'websocket' ? 'websocket' : undefined,
|
|
2192
|
+
...(allowH2 === false ? { allowH2 } : null)
|
|
2185
2193
|
},
|
|
2194
|
+
{
|
|
2195
|
+
body: null,
|
|
2196
|
+
abort: null,
|
|
2186
2197
|
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
// user agent’s HTTP parser receives the first byte of the response (e.g., frame header
|
|
2191
|
-
// bytes for HTTP/2 or response status line for HTTP/1.x).
|
|
2192
|
-
timingInfo.finalNetworkResponseStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)
|
|
2193
|
-
},
|
|
2198
|
+
onRequestStart (controller) {
|
|
2199
|
+
// TODO (fix): Do we need connection here?
|
|
2200
|
+
const { connection } = fetchParams.controller
|
|
2194
2201
|
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2202
|
+
// Set timingInfo’s final connection timing info to the result of calling clamp and coarsen
|
|
2203
|
+
// connection timing info with connection’s timing info, timingInfo’s post-redirect start
|
|
2204
|
+
// time, and fetchParams’s cross-origin isolated capability.
|
|
2205
|
+
// TODO: implement connection timing
|
|
2206
|
+
timingInfo.finalConnectionTimingInfo = clampAndCoarsenConnectionTimingInfo(undefined, timingInfo.postRedirectStartTime, fetchParams.crossOriginIsolatedCapability)
|
|
2199
2207
|
|
|
2200
|
-
|
|
2208
|
+
const abort = (reason) => controller.abort(reason)
|
|
2201
2209
|
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
const value = rawHeaders[i + 1]
|
|
2205
|
-
if (Array.isArray(value) && !Buffer.isBuffer(rawHeaders[i + 1])) {
|
|
2206
|
-
for (const val of value) {
|
|
2207
|
-
headersList.append(nameStr, val.toString('latin1'), true)
|
|
2208
|
-
}
|
|
2210
|
+
if (connection.destroyed) {
|
|
2211
|
+
abort(new DOMException('The operation was aborted.', 'AbortError'))
|
|
2209
2212
|
} else {
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
}
|
|
2213
|
-
const location = headersList.get('location', true)
|
|
2214
|
-
|
|
2215
|
-
this.body = new Readable({ read: resume })
|
|
2216
|
-
|
|
2217
|
-
const willFollow = location && request.redirect === 'follow' &&
|
|
2218
|
-
redirectStatusSet.has(status)
|
|
2219
|
-
|
|
2220
|
-
const decoders = []
|
|
2221
|
-
|
|
2222
|
-
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
|
|
2223
|
-
if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {
|
|
2224
|
-
// https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
|
|
2225
|
-
const contentEncoding = headersList.get('content-encoding', true)
|
|
2226
|
-
// "All content-coding values are case-insensitive..."
|
|
2227
|
-
/** @type {string[]} */
|
|
2228
|
-
const codings = contentEncoding ? contentEncoding.toLowerCase().split(',') : []
|
|
2229
|
-
|
|
2230
|
-
// Limit the number of content-encodings to prevent resource exhaustion.
|
|
2231
|
-
// CVE fix similar to urllib3 (GHSA-gm62-xv2j-4w53) and curl (CVE-2022-32206).
|
|
2232
|
-
const maxContentEncodings = 5
|
|
2233
|
-
if (codings.length > maxContentEncodings) {
|
|
2234
|
-
reject(new Error(`too many content-encodings in response: ${codings.length}, maximum allowed is ${maxContentEncodings}`))
|
|
2235
|
-
return true
|
|
2213
|
+
fetchParams.controller.on('terminated', abort)
|
|
2214
|
+
this.abort = connection.abort = abort
|
|
2236
2215
|
}
|
|
2237
2216
|
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
}))
|
|
2255
|
-
} else if (coding === 'br') {
|
|
2256
|
-
decoders.push(zlib.createBrotliDecompress({
|
|
2257
|
-
flush: zlib.constants.BROTLI_OPERATION_FLUSH,
|
|
2258
|
-
finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH
|
|
2259
|
-
}))
|
|
2260
|
-
} else if (coding === 'zstd' && hasZstd) {
|
|
2261
|
-
decoders.push(zlib.createZstdDecompress({
|
|
2262
|
-
flush: zlib.constants.ZSTD_e_continue,
|
|
2263
|
-
finishFlush: zlib.constants.ZSTD_e_end
|
|
2264
|
-
}))
|
|
2265
|
-
} else {
|
|
2266
|
-
decoders.length = 0
|
|
2267
|
-
break
|
|
2268
|
-
}
|
|
2217
|
+
// Set timingInfo’s final network-request start time to the coarsened shared current time given
|
|
2218
|
+
// fetchParams’s cross-origin isolated capability.
|
|
2219
|
+
timingInfo.finalNetworkRequestStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)
|
|
2220
|
+
},
|
|
2221
|
+
|
|
2222
|
+
onResponseStarted () {
|
|
2223
|
+
// Set timingInfo’s final network-response start time to the coarsened shared current
|
|
2224
|
+
// time given fetchParams’s cross-origin isolated capability, immediately after the
|
|
2225
|
+
// user agent’s HTTP parser receives the first byte of the response (e.g., frame header
|
|
2226
|
+
// bytes for HTTP/2 or response status line for HTTP/1.x).
|
|
2227
|
+
timingInfo.finalNetworkResponseStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)
|
|
2228
|
+
},
|
|
2229
|
+
|
|
2230
|
+
onResponseStart (controller, status, headers, statusText) {
|
|
2231
|
+
if (status < 200) {
|
|
2232
|
+
return
|
|
2269
2233
|
}
|
|
2270
|
-
}
|
|
2271
2234
|
|
|
2272
|
-
|
|
2235
|
+
const rawHeaders = controller?.rawHeaders ?? []
|
|
2236
|
+
const headersList = new HeadersList()
|
|
2237
|
+
appendHeadersListFromResponseHeaders(headersList, headers, rawHeaders)
|
|
2238
|
+
const location = headersList.get('location', true)
|
|
2273
2239
|
|
|
2274
|
-
|
|
2275
|
-
status,
|
|
2276
|
-
statusText,
|
|
2277
|
-
headersList,
|
|
2278
|
-
body: decoders.length
|
|
2279
|
-
? pipeline(this.body, ...decoders, (err) => {
|
|
2280
|
-
if (err) {
|
|
2281
|
-
this.onError(err)
|
|
2282
|
-
}
|
|
2283
|
-
}).on('error', onError)
|
|
2284
|
-
: this.body.on('error', onError)
|
|
2285
|
-
})
|
|
2240
|
+
this.body = new Readable({ read: () => controller.resume() })
|
|
2286
2241
|
|
|
2287
|
-
|
|
2288
|
-
|
|
2242
|
+
const willFollow = location && request.redirect === 'follow' &&
|
|
2243
|
+
redirectStatusSet.has(status)
|
|
2289
2244
|
|
|
2290
|
-
|
|
2291
|
-
if (fetchParams.controller.dump) {
|
|
2292
|
-
return
|
|
2293
|
-
}
|
|
2245
|
+
const decoders = []
|
|
2294
2246
|
|
|
2295
|
-
|
|
2296
|
-
|
|
2247
|
+
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
|
|
2248
|
+
if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {
|
|
2249
|
+
// https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
|
|
2250
|
+
const contentEncoding = headersList.get('content-encoding', true)
|
|
2251
|
+
// "All content-coding values are case-insensitive..."
|
|
2252
|
+
/** @type {string[]} */
|
|
2253
|
+
const codings = contentEncoding ? contentEncoding.toLowerCase().split(',') : []
|
|
2297
2254
|
|
|
2298
|
-
|
|
2299
|
-
|
|
2255
|
+
// Limit the number of content-encodings to prevent resource exhaustion.
|
|
2256
|
+
// CVE fix similar to urllib3 (GHSA-gm62-xv2j-4w53) and curl (CVE-2022-32206).
|
|
2257
|
+
const maxContentEncodings = 5
|
|
2258
|
+
if (codings.length > maxContentEncodings) {
|
|
2259
|
+
reject(new Error(`too many content-encodings in response: ${codings.length}, maximum allowed is ${maxContentEncodings}`))
|
|
2260
|
+
return
|
|
2261
|
+
}
|
|
2300
2262
|
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2263
|
+
for (let i = codings.length - 1; i >= 0; --i) {
|
|
2264
|
+
const coding = codings[i].trim()
|
|
2265
|
+
// https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2
|
|
2266
|
+
if (coding === 'x-gzip' || coding === 'gzip') {
|
|
2267
|
+
decoders.push(zlib.createGunzip({
|
|
2268
|
+
// Be less strict when decoding compressed responses, since sometimes
|
|
2269
|
+
// servers send slightly invalid responses that are still accepted
|
|
2270
|
+
// by common browsers.
|
|
2271
|
+
// Always using Z_SYNC_FLUSH is what cURL does.
|
|
2272
|
+
flush: zlib.constants.Z_SYNC_FLUSH,
|
|
2273
|
+
finishFlush: zlib.constants.Z_SYNC_FLUSH
|
|
2274
|
+
}))
|
|
2275
|
+
} else if (coding === 'deflate') {
|
|
2276
|
+
decoders.push(createInflate({
|
|
2277
|
+
flush: zlib.constants.Z_SYNC_FLUSH,
|
|
2278
|
+
finishFlush: zlib.constants.Z_SYNC_FLUSH
|
|
2279
|
+
}))
|
|
2280
|
+
} else if (coding === 'br') {
|
|
2281
|
+
decoders.push(zlib.createBrotliDecompress({
|
|
2282
|
+
flush: zlib.constants.BROTLI_OPERATION_FLUSH,
|
|
2283
|
+
finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH
|
|
2284
|
+
}))
|
|
2285
|
+
} else if (coding === 'zstd') {
|
|
2286
|
+
decoders.push(zlib.createZstdDecompress({
|
|
2287
|
+
flush: zlib.constants.ZSTD_e_continue,
|
|
2288
|
+
finishFlush: zlib.constants.ZSTD_e_end
|
|
2289
|
+
}))
|
|
2290
|
+
} else {
|
|
2291
|
+
decoders.length = 0
|
|
2292
|
+
break
|
|
2293
|
+
}
|
|
2294
|
+
}
|
|
2295
|
+
}
|
|
2304
2296
|
|
|
2305
|
-
|
|
2306
|
-
|
|
2297
|
+
const onError = (err) => this.onResponseError(controller, err)
|
|
2298
|
+
|
|
2299
|
+
resolve({
|
|
2300
|
+
status,
|
|
2301
|
+
statusText,
|
|
2302
|
+
headersList,
|
|
2303
|
+
body: decoders.length
|
|
2304
|
+
? pipeline(this.body, ...decoders, (err) => {
|
|
2305
|
+
if (err) {
|
|
2306
|
+
this.onResponseError(controller, err)
|
|
2307
|
+
}
|
|
2308
|
+
}).on('error', onError)
|
|
2309
|
+
: this.body.on('error', onError)
|
|
2310
|
+
})
|
|
2311
|
+
},
|
|
2312
|
+
|
|
2313
|
+
onResponseData (controller, chunk) {
|
|
2314
|
+
if (fetchParams.controller.dump) {
|
|
2315
|
+
return
|
|
2316
|
+
}
|
|
2307
2317
|
|
|
2308
|
-
|
|
2318
|
+
// 1. If one or more bytes have been transmitted from response’s
|
|
2319
|
+
// message body, then:
|
|
2309
2320
|
|
|
2310
|
-
|
|
2311
|
-
|
|
2321
|
+
// 1. Let bytes be the transmitted bytes.
|
|
2322
|
+
const bytes = chunk
|
|
2312
2323
|
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
}
|
|
2317
|
-
|
|
2318
|
-
fetchParams.controller.ended = true
|
|
2324
|
+
// 2. Let codings be the result of extracting header list values
|
|
2325
|
+
// given `Content-Encoding` and response’s header list.
|
|
2326
|
+
// See pullAlgorithm.
|
|
2319
2327
|
|
|
2320
|
-
|
|
2321
|
-
|
|
2328
|
+
// 3. Increase timingInfo’s encoded body size by bytes’s length.
|
|
2329
|
+
timingInfo.encodedBodySize += bytes.byteLength
|
|
2322
2330
|
|
|
2323
|
-
|
|
2324
|
-
if (this.abort) {
|
|
2325
|
-
fetchParams.controller.off('terminated', this.abort)
|
|
2326
|
-
}
|
|
2331
|
+
// 4. See pullAlgorithm...
|
|
2327
2332
|
|
|
2328
|
-
|
|
2333
|
+
if (this.body.push(bytes) === false) {
|
|
2334
|
+
controller.pause()
|
|
2335
|
+
}
|
|
2336
|
+
},
|
|
2329
2337
|
|
|
2330
|
-
|
|
2338
|
+
onResponseEnd () {
|
|
2339
|
+
if (this.abort) {
|
|
2340
|
+
fetchParams.controller.off('terminated', this.abort)
|
|
2341
|
+
}
|
|
2331
2342
|
|
|
2332
|
-
|
|
2333
|
-
},
|
|
2343
|
+
fetchParams.controller.ended = true
|
|
2334
2344
|
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
// Absence of session means H1
|
|
2338
|
-
if ((socket.session != null && status !== 200) || (socket.session == null && status !== 101)) {
|
|
2339
|
-
return false
|
|
2340
|
-
}
|
|
2345
|
+
this.body?.push(null)
|
|
2346
|
+
},
|
|
2341
2347
|
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
if (value == null) {
|
|
2346
|
-
continue
|
|
2348
|
+
onResponseError (_controller, error) {
|
|
2349
|
+
if (this.abort) {
|
|
2350
|
+
fetchParams.controller.off('terminated', this.abort)
|
|
2347
2351
|
}
|
|
2348
2352
|
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2353
|
+
if (
|
|
2354
|
+
request.mode === 'websocket' &&
|
|
2355
|
+
allowH2 !== false &&
|
|
2356
|
+
error?.code === 'UND_ERR_INFO' &&
|
|
2357
|
+
error?.message === 'HTTP/2: Extended CONNECT protocol not supported by server'
|
|
2358
|
+
) {
|
|
2359
|
+
// The origin negotiated H2, but RFC 8441 websocket support is unavailable.
|
|
2360
|
+
// Retry the opening handshake on a fresh HTTP/1.1-only connection instead.
|
|
2361
|
+
resolve(dispatchWithProtocolPreference(body, false))
|
|
2362
|
+
return
|
|
2357
2363
|
}
|
|
2358
|
-
}
|
|
2359
|
-
|
|
2360
|
-
resolve({
|
|
2361
|
-
status,
|
|
2362
|
-
statusText: STATUS_CODES[status],
|
|
2363
|
-
headersList,
|
|
2364
|
-
socket
|
|
2365
|
-
})
|
|
2366
2364
|
|
|
2367
|
-
|
|
2368
|
-
},
|
|
2365
|
+
this.body?.destroy(error)
|
|
2369
2366
|
|
|
2370
|
-
|
|
2371
|
-
// We need to support 200 for websocket over h2 as per RFC-8441
|
|
2372
|
-
// Absence of session means H1
|
|
2373
|
-
if ((socket.session != null && status !== 200) || (socket.session == null && status !== 101)) {
|
|
2374
|
-
return false
|
|
2375
|
-
}
|
|
2367
|
+
fetchParams.controller.terminate(error)
|
|
2376
2368
|
|
|
2377
|
-
|
|
2369
|
+
reject(error)
|
|
2370
|
+
},
|
|
2378
2371
|
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
if (
|
|
2383
|
-
|
|
2384
|
-
headersList.append(nameStr, val.toString('latin1'), true)
|
|
2385
|
-
}
|
|
2386
|
-
} else {
|
|
2387
|
-
headersList.append(nameStr, value.toString('latin1'), true)
|
|
2372
|
+
onRequestUpgrade (controller, status, headers, socket) {
|
|
2373
|
+
// We need to support 200 for websocket over h2 as per RFC-8441
|
|
2374
|
+
// Absence of session means H1
|
|
2375
|
+
if ((socket.session != null && status !== 200) || (socket.session == null && status !== 101)) {
|
|
2376
|
+
return false
|
|
2388
2377
|
}
|
|
2389
|
-
}
|
|
2390
2378
|
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2379
|
+
const rawHeaders = controller?.rawHeaders ?? []
|
|
2380
|
+
const headersList = new HeadersList()
|
|
2381
|
+
appendHeadersListFromResponseHeaders(headersList, headers, rawHeaders)
|
|
2382
|
+
|
|
2383
|
+
resolve({
|
|
2384
|
+
status,
|
|
2385
|
+
statusText: STATUS_CODES[status],
|
|
2386
|
+
headersList,
|
|
2387
|
+
socket
|
|
2388
|
+
})
|
|
2397
2389
|
|
|
2398
|
-
|
|
2390
|
+
return true
|
|
2391
|
+
}
|
|
2399
2392
|
}
|
|
2400
|
-
|
|
2401
|
-
|
|
2393
|
+
))
|
|
2394
|
+
}
|
|
2402
2395
|
}
|
|
2403
2396
|
}
|
|
2404
2397
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const assert = require('node:assert')
|
|
4
4
|
const { types, inspect } = require('node:util')
|
|
5
|
-
const {
|
|
5
|
+
const { markAsUncloneable } = require('node:worker_threads')
|
|
6
6
|
|
|
7
7
|
const UNDEFINED = 1
|
|
8
8
|
const BOOLEAN = 2
|
|
@@ -158,9 +158,7 @@ webidl.util.TypeValueToString = function (o) {
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
webidl.util.markAsUncloneable =
|
|
162
|
-
? require('node:worker_threads').markAsUncloneable
|
|
163
|
-
: () => {}
|
|
161
|
+
webidl.util.markAsUncloneable = markAsUncloneable
|
|
164
162
|
|
|
165
163
|
// https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
|
|
166
164
|
webidl.util.ConvertToInt = function (V, bitLength, signedness, flags) {
|
|
@@ -190,10 +188,10 @@ webidl.util.ConvertToInt = function (V, bitLength, signedness, flags) {
|
|
|
190
188
|
} else {
|
|
191
189
|
// 3. Otherwise:
|
|
192
190
|
|
|
193
|
-
// 1. Let lowerBound be -2^bitLength − 1.
|
|
194
|
-
lowerBound = Math.pow(
|
|
191
|
+
// 1. Let lowerBound be -2^(bitLength − 1).
|
|
192
|
+
lowerBound = -Math.pow(2, bitLength - 1)
|
|
195
193
|
|
|
196
|
-
// 2. Let upperBound be 2^bitLength − 1 − 1.
|
|
194
|
+
// 2. Let upperBound be 2^(bitLength − 1) − 1.
|
|
197
195
|
upperBound = Math.pow(2, bitLength - 1) - 1
|
|
198
196
|
}
|
|
199
197
|
|
|
@@ -272,9 +270,9 @@ webidl.util.ConvertToInt = function (V, bitLength, signedness, flags) {
|
|
|
272
270
|
// 10. Set x to x modulo 2^bitLength.
|
|
273
271
|
x = x % Math.pow(2, bitLength)
|
|
274
272
|
|
|
275
|
-
// 11. If signedness is "signed" and x ≥ 2^bitLength − 1,
|
|
273
|
+
// 11. If signedness is "signed" and x ≥ 2^(bitLength − 1),
|
|
276
274
|
// then return x − 2^bitLength.
|
|
277
|
-
if (signedness === 'signed' && x >= Math.pow(2, bitLength
|
|
275
|
+
if (signedness === 'signed' && x >= Math.pow(2, bitLength - 1)) {
|
|
278
276
|
return x - Math.pow(2, bitLength)
|
|
279
277
|
}
|
|
280
278
|
|
|
@@ -10,13 +10,7 @@ let bufIdx = BUFFER_SIZE
|
|
|
10
10
|
|
|
11
11
|
const randomFillSync = runtimeFeatures.has('crypto')
|
|
12
12
|
? require('node:crypto').randomFillSync
|
|
13
|
-
|
|
14
|
-
: function randomFillSync (buffer, _offset, _size) {
|
|
15
|
-
for (let i = 0; i < buffer.length; ++i) {
|
|
16
|
-
buffer[i] = Math.random() * 255 | 0
|
|
17
|
-
}
|
|
18
|
-
return buffer
|
|
19
|
-
}
|
|
13
|
+
: null
|
|
20
14
|
|
|
21
15
|
function generateMask () {
|
|
22
16
|
if (bufIdx === BUFFER_SIZE) {
|