gsd-pi 2.20.0 → 2.22.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/README.md +12 -0
- package/dist/cli.js +21 -18
- package/dist/help-text.d.ts +2 -0
- package/dist/help-text.js +47 -0
- package/dist/loader.js +2 -16
- package/dist/mcp-server.d.ts +18 -0
- package/dist/mcp-server.js +53 -0
- package/dist/onboarding.d.ts +0 -6
- package/dist/onboarding.js +0 -28
- package/dist/resources/agents/javascript-pro.md +280 -0
- package/dist/resources/agents/typescript-pro.md +255 -0
- package/dist/resources/extensions/bg-shell/index.ts +14 -2
- package/dist/resources/extensions/bg-shell/utilities.ts +14 -0
- package/dist/resources/extensions/browser-tools/{core.js → core.ts} +329 -190
- package/dist/resources/extensions/gsd/auto-dashboard.ts +2 -1
- package/dist/resources/extensions/gsd/auto-prompts.ts +42 -1
- package/dist/resources/extensions/gsd/auto-worktree.ts +35 -2
- package/dist/resources/extensions/gsd/auto.ts +116 -10
- package/dist/resources/extensions/gsd/claude-import.ts +656 -0
- package/dist/resources/extensions/gsd/collision-diagnostics.ts +332 -0
- package/dist/resources/extensions/gsd/commands.ts +60 -7
- package/dist/resources/extensions/gsd/diff-context.ts +220 -0
- package/dist/resources/extensions/gsd/docs/claude-marketplace-import.md +214 -0
- package/dist/resources/extensions/gsd/docs/preferences-reference.md +2 -1
- package/dist/resources/extensions/gsd/doctor.ts +12 -4
- package/dist/resources/extensions/gsd/file-watcher.ts +97 -0
- package/dist/resources/extensions/gsd/files.ts +1 -1
- package/dist/resources/extensions/gsd/forensics.ts +596 -0
- package/dist/resources/extensions/gsd/git-service.ts +2 -1
- package/dist/resources/extensions/gsd/github-client.ts +235 -0
- package/dist/resources/extensions/gsd/gitignore.ts +1 -0
- package/dist/resources/extensions/gsd/marketplace-discovery.ts +507 -0
- package/dist/resources/extensions/gsd/mcp-server.ts +87 -0
- package/dist/resources/extensions/gsd/namespaced-registry.ts +467 -0
- package/dist/resources/extensions/gsd/namespaced-resolver.ts +307 -0
- package/dist/resources/extensions/gsd/plugin-importer.ts +410 -0
- package/dist/resources/extensions/gsd/preferences.ts +14 -3
- package/dist/resources/extensions/gsd/prompts/execute-task.md +1 -1
- package/dist/resources/extensions/gsd/prompts/forensics.md +71 -0
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/research-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/system.md +12 -3
- package/dist/resources/extensions/gsd/roadmap-slices.ts +1 -1
- package/dist/resources/extensions/gsd/session-forensics.ts +5 -5
- package/dist/resources/extensions/gsd/tests/claude-import-tui.test.ts +351 -0
- package/dist/resources/extensions/gsd/tests/collision-diagnostics.test.ts +705 -0
- package/dist/resources/extensions/gsd/tests/context-compression.test.ts +13 -0
- package/dist/resources/extensions/gsd/tests/diff-context.test.ts +136 -0
- package/dist/resources/extensions/gsd/tests/doctor-git.test.ts +118 -0
- package/dist/resources/extensions/gsd/tests/marketplace-discovery.test.ts +202 -0
- package/dist/resources/extensions/gsd/tests/marketplace-test-fixtures.ts +91 -0
- package/dist/resources/extensions/gsd/tests/namespaced-registry.test.ts +1027 -0
- package/dist/resources/extensions/gsd/tests/namespaced-resolver.test.ts +671 -0
- package/dist/resources/extensions/gsd/tests/none-mode-gates.test.ts +105 -0
- package/dist/resources/extensions/gsd/tests/plugin-importer-live.test.ts +481 -0
- package/dist/resources/extensions/gsd/tests/plugin-importer.test.ts +1383 -0
- package/dist/resources/extensions/gsd/tests/preferences-git.test.ts +21 -2
- package/dist/resources/extensions/gsd/tests/preferences-schema-validation.test.ts +8 -1
- package/dist/resources/extensions/gsd/tests/visualizer-data.test.ts +11 -0
- package/dist/resources/extensions/gsd/tests/worktree-bugfix.test.ts +120 -0
- package/dist/resources/extensions/gsd/token-counter.ts +45 -0
- package/dist/resources/extensions/gsd/visualizer-data.ts +2 -2
- package/dist/resources/extensions/gsd/worktree-manager.ts +29 -1
- package/dist/resources/extensions/gsd/worktree.ts +3 -0
- package/dist/resources/extensions/mcporter/index.ts +90 -7
- package/dist/resources/extensions/search-the-web/native-search.ts +2 -0
- package/dist/resources/extensions/search-the-web/tool-fetch-page.ts +9 -1
- package/dist/resources/extensions/search-the-web/url-utils.ts +35 -1
- package/dist/resources/extensions/shared/terminal.ts +1 -1
- package/dist/resources/extensions/universal-config/discovery.ts +4 -0
- package/dist/resources/extensions/universal-config/format.ts +35 -4
- package/dist/resources/extensions/universal-config/index.ts +5 -3
- package/dist/resources/extensions/universal-config/scanners.ts +65 -2
- package/dist/resources/extensions/universal-config/tests/discovery.test.ts +9 -1
- package/dist/resources/extensions/universal-config/tests/format.test.ts +22 -6
- package/dist/resources/extensions/universal-config/tests/scanners.test.ts +18 -0
- package/dist/resources/extensions/universal-config/types.ts +20 -1
- package/dist/resources/skills/lint/SKILL.md +141 -0
- package/dist/resources/skills/review/SKILL.md +214 -0
- package/dist/resources/skills/test/SKILL.md +201 -0
- package/dist/tool-bootstrap.js +2 -1
- package/dist/wizard.js +2 -0
- package/package.json +12 -7
- package/packages/pi-ai/dist/providers/azure-openai-responses.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/azure-openai-responses.js +12 -1
- package/packages/pi-ai/dist/providers/azure-openai-responses.js.map +1 -1
- package/packages/pi-ai/dist/providers/openai-responses.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/openai-responses.js +12 -1
- package/packages/pi-ai/dist/providers/openai-responses.js.map +1 -1
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/LICENSE +201 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/README.md +9 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-cjs/index.js +762 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/build-abort-error.js +19 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/constants.js +1 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js +9 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/index.js +3 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +230 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +87 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js +32 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +169 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/readable.mock.js +21 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/server.mock.js +88 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js +36 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/set-request-timeout.js +21 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js +22 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js +23 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js +8 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js +41 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/stream-collector/readable.mock.js +21 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/timing.js +4 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js +63 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/build-abort-error.d.ts +10 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/constants.d.ts +5 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/get-transformed-headers.d.ts +4 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/index.d.ts +3 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +46 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-manager.d.ts +24 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-pool.d.ts +12 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +63 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/readable.mock.d.ts +13 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/server.mock.d.ts +12 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/set-connection-timeout.d.ts +2 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/set-request-timeout.d.ts +6 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/set-socket-keep-alive.d.ts +6 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/set-socket-timeout.d.ts +2 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/stream-collector/collector.d.ts +5 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/stream-collector/index.d.ts +6 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/stream-collector/readable.mock.d.ts +13 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/timing.d.ts +8 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/build-abort-error.d.ts +10 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/constants.d.ts +5 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/get-transformed-headers.d.ts +4 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/index.d.ts +3 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http-handler.d.ts +46 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-manager.d.ts +24 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-pool.d.ts +12 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-handler.d.ts +63 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/readable.mock.d.ts +13 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/server.mock.d.ts +12 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-connection-timeout.d.ts +2 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-request-timeout.d.ts +6 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-keep-alive.d.ts +6 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts +2 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/collector.d.ts +5 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/index.d.ts +6 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/readable.mock.d.ts +13 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/timing.d.ts +8 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/write-request-body.d.ts +12 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/write-request-body.d.ts +12 -0
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/package.json +68 -0
- package/packages/pi-ai/package.json +3 -0
- package/packages/pi-ai/pnpm-lock.yaml +2022 -0
- package/packages/pi-ai/src/providers/azure-openai-responses.ts +12 -1
- package/packages/pi-ai/src/providers/openai-responses.ts +12 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.d.ts +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.js +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.js +12 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.test.js +113 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/project-trust.d.ts +4 -0
- package/packages/pi-coding-agent/dist/core/extensions/project-trust.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/project-trust.js +42 -0
- package/packages/pi-coding-agent/dist/core/extensions/project-trust.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/resolve-config-value.d.ts +1 -0
- package/packages/pi-coding-agent/dist/core/resolve-config-value.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/resolve-config-value.js +18 -0
- package/packages/pi-coding-agent/dist/core/resolve-config-value.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/resolve-config-value.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/resolve-config-value.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/resolve-config-value.test.js +114 -0
- package/packages/pi-coding-agent/dist/core/resolve-config-value.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +8 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.d.ts +2 -0
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.js +23 -9
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.js.map +1 -1
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.test.js +67 -0
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.test.js.map +1 -0
- package/packages/pi-coding-agent/package.json +1 -1
- package/packages/pi-coding-agent/pnpm-lock.yaml +454 -0
- package/packages/pi-coding-agent/scripts/copy-assets.cjs +24 -0
- package/packages/pi-coding-agent/src/core/extensions/index.ts +3 -0
- package/packages/pi-coding-agent/src/core/extensions/loader.test.ts +141 -0
- package/packages/pi-coding-agent/src/core/extensions/loader.ts +14 -1
- package/packages/pi-coding-agent/src/core/extensions/project-trust.ts +51 -0
- package/packages/pi-coding-agent/src/core/resolve-config-value.test.ts +132 -0
- package/packages/pi-coding-agent/src/core/resolve-config-value.ts +20 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/login-dialog.ts +7 -2
- package/packages/pi-coding-agent/src/resources/extensions/memory/storage.test.ts +98 -0
- package/packages/pi-coding-agent/src/resources/extensions/memory/storage.ts +24 -9
- package/packages/pi-tui/dist/tui.d.ts.map +1 -1
- package/packages/pi-tui/dist/tui.js +2 -2
- package/packages/pi-tui/dist/tui.js.map +1 -1
- package/packages/pi-tui/package.json +3 -1
- package/packages/pi-tui/src/tui.ts +2 -2
- package/src/resources/agents/javascript-pro.md +280 -0
- package/src/resources/agents/typescript-pro.md +255 -0
- package/src/resources/extensions/bg-shell/index.ts +14 -2
- package/src/resources/extensions/bg-shell/utilities.ts +14 -0
- package/src/resources/extensions/browser-tools/{core.js → core.ts} +329 -190
- package/src/resources/extensions/gsd/auto-dashboard.ts +2 -1
- package/src/resources/extensions/gsd/auto-prompts.ts +42 -1
- package/src/resources/extensions/gsd/auto-worktree.ts +35 -2
- package/src/resources/extensions/gsd/auto.ts +116 -10
- package/src/resources/extensions/gsd/claude-import.ts +656 -0
- package/src/resources/extensions/gsd/collision-diagnostics.ts +332 -0
- package/src/resources/extensions/gsd/commands.ts +60 -7
- package/src/resources/extensions/gsd/diff-context.ts +220 -0
- package/src/resources/extensions/gsd/docs/claude-marketplace-import.md +214 -0
- package/src/resources/extensions/gsd/docs/preferences-reference.md +2 -1
- package/src/resources/extensions/gsd/doctor.ts +12 -4
- package/src/resources/extensions/gsd/file-watcher.ts +97 -0
- package/src/resources/extensions/gsd/files.ts +1 -1
- package/src/resources/extensions/gsd/forensics.ts +596 -0
- package/src/resources/extensions/gsd/git-service.ts +2 -1
- package/src/resources/extensions/gsd/github-client.ts +235 -0
- package/src/resources/extensions/gsd/gitignore.ts +1 -0
- package/src/resources/extensions/gsd/marketplace-discovery.ts +507 -0
- package/src/resources/extensions/gsd/mcp-server.ts +87 -0
- package/src/resources/extensions/gsd/namespaced-registry.ts +467 -0
- package/src/resources/extensions/gsd/namespaced-resolver.ts +307 -0
- package/src/resources/extensions/gsd/plugin-importer.ts +410 -0
- package/src/resources/extensions/gsd/preferences.ts +14 -3
- package/src/resources/extensions/gsd/prompts/execute-task.md +1 -1
- package/src/resources/extensions/gsd/prompts/forensics.md +71 -0
- package/src/resources/extensions/gsd/prompts/plan-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/research-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/system.md +12 -3
- package/src/resources/extensions/gsd/roadmap-slices.ts +1 -1
- package/src/resources/extensions/gsd/session-forensics.ts +5 -5
- package/src/resources/extensions/gsd/tests/claude-import-tui.test.ts +351 -0
- package/src/resources/extensions/gsd/tests/collision-diagnostics.test.ts +705 -0
- package/src/resources/extensions/gsd/tests/context-compression.test.ts +13 -0
- package/src/resources/extensions/gsd/tests/diff-context.test.ts +136 -0
- package/src/resources/extensions/gsd/tests/doctor-git.test.ts +118 -0
- package/src/resources/extensions/gsd/tests/marketplace-discovery.test.ts +202 -0
- package/src/resources/extensions/gsd/tests/marketplace-test-fixtures.ts +91 -0
- package/src/resources/extensions/gsd/tests/namespaced-registry.test.ts +1027 -0
- package/src/resources/extensions/gsd/tests/namespaced-resolver.test.ts +671 -0
- package/src/resources/extensions/gsd/tests/none-mode-gates.test.ts +105 -0
- package/src/resources/extensions/gsd/tests/plugin-importer-live.test.ts +481 -0
- package/src/resources/extensions/gsd/tests/plugin-importer.test.ts +1383 -0
- package/src/resources/extensions/gsd/tests/preferences-git.test.ts +21 -2
- package/src/resources/extensions/gsd/tests/preferences-schema-validation.test.ts +8 -1
- package/src/resources/extensions/gsd/tests/visualizer-data.test.ts +11 -0
- package/src/resources/extensions/gsd/tests/worktree-bugfix.test.ts +120 -0
- package/src/resources/extensions/gsd/token-counter.ts +45 -0
- package/src/resources/extensions/gsd/visualizer-data.ts +2 -2
- package/src/resources/extensions/gsd/worktree-manager.ts +29 -1
- package/src/resources/extensions/gsd/worktree.ts +3 -0
- package/src/resources/extensions/mcporter/index.ts +90 -7
- package/src/resources/extensions/search-the-web/native-search.ts +2 -0
- package/src/resources/extensions/search-the-web/tool-fetch-page.ts +9 -1
- package/src/resources/extensions/search-the-web/url-utils.ts +35 -1
- package/src/resources/extensions/shared/terminal.ts +1 -1
- package/src/resources/extensions/universal-config/discovery.ts +4 -0
- package/src/resources/extensions/universal-config/format.ts +35 -4
- package/src/resources/extensions/universal-config/index.ts +5 -3
- package/src/resources/extensions/universal-config/scanners.ts +65 -2
- package/src/resources/extensions/universal-config/tests/discovery.test.ts +9 -1
- package/src/resources/extensions/universal-config/tests/format.test.ts +22 -6
- package/src/resources/extensions/universal-config/tests/scanners.test.ts +18 -0
- package/src/resources/extensions/universal-config/types.ts +20 -1
- package/src/resources/skills/lint/SKILL.md +141 -0
- package/src/resources/skills/review/SKILL.md +214 -0
- package/src/resources/skills/test/SKILL.md +201 -0
- package/dist/resources/extensions/browser-tools/core.d.ts +0 -205
- package/src/resources/extensions/browser-tools/core.d.ts +0 -205
package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { timing } from "./timing";
|
|
2
|
+
const DEFER_EVENT_LISTENER_TIME = 1000;
|
|
3
|
+
export const setConnectionTimeout = (request, reject, timeoutInMs = 0) => {
|
|
4
|
+
if (!timeoutInMs) {
|
|
5
|
+
return -1;
|
|
6
|
+
}
|
|
7
|
+
const registerTimeout = (offset) => {
|
|
8
|
+
const timeoutId = timing.setTimeout(() => {
|
|
9
|
+
request.destroy();
|
|
10
|
+
reject(Object.assign(new Error(`@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${timeoutInMs} ms.`), {
|
|
11
|
+
name: "TimeoutError",
|
|
12
|
+
}));
|
|
13
|
+
}, timeoutInMs - offset);
|
|
14
|
+
const doWithSocket = (socket) => {
|
|
15
|
+
if (socket?.connecting) {
|
|
16
|
+
socket.on("connect", () => {
|
|
17
|
+
timing.clearTimeout(timeoutId);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
timing.clearTimeout(timeoutId);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
if (request.socket) {
|
|
25
|
+
doWithSocket(request.socket);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
request.on("socket", doWithSocket);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
if (timeoutInMs < 2000) {
|
|
32
|
+
registerTimeout(0);
|
|
33
|
+
return 0;
|
|
34
|
+
}
|
|
35
|
+
return timing.setTimeout(registerTimeout.bind(null, DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME);
|
|
36
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { timing } from "./timing";
|
|
2
|
+
export const setRequestTimeout = (req, reject, timeoutInMs = 0, throwOnRequestTimeout, logger) => {
|
|
3
|
+
if (timeoutInMs) {
|
|
4
|
+
return timing.setTimeout(() => {
|
|
5
|
+
let msg = `@smithy/node-http-handler - [${throwOnRequestTimeout ? "ERROR" : "WARN"}] a request has exceeded the configured ${timeoutInMs} ms requestTimeout.`;
|
|
6
|
+
if (throwOnRequestTimeout) {
|
|
7
|
+
const error = Object.assign(new Error(msg), {
|
|
8
|
+
name: "TimeoutError",
|
|
9
|
+
code: "ETIMEDOUT",
|
|
10
|
+
});
|
|
11
|
+
req.destroy(error);
|
|
12
|
+
reject(error);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
msg += ` Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.`;
|
|
16
|
+
logger?.warn?.(msg);
|
|
17
|
+
}
|
|
18
|
+
}, timeoutInMs);
|
|
19
|
+
}
|
|
20
|
+
return -1;
|
|
21
|
+
};
|
package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { timing } from "./timing";
|
|
2
|
+
const DEFER_EVENT_LISTENER_TIME = 3000;
|
|
3
|
+
export const setSocketKeepAlive = (request, { keepAlive, keepAliveMsecs }, deferTimeMs = DEFER_EVENT_LISTENER_TIME) => {
|
|
4
|
+
if (keepAlive !== true) {
|
|
5
|
+
return -1;
|
|
6
|
+
}
|
|
7
|
+
const registerListener = () => {
|
|
8
|
+
if (request.socket) {
|
|
9
|
+
request.socket.setKeepAlive(keepAlive, keepAliveMsecs || 0);
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
request.on("socket", (socket) => {
|
|
13
|
+
socket.setKeepAlive(keepAlive, keepAliveMsecs || 0);
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
if (deferTimeMs === 0) {
|
|
18
|
+
registerListener();
|
|
19
|
+
return 0;
|
|
20
|
+
}
|
|
21
|
+
return timing.setTimeout(registerListener, deferTimeMs);
|
|
22
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { timing } from "./timing";
|
|
2
|
+
const DEFER_EVENT_LISTENER_TIME = 3000;
|
|
3
|
+
export const setSocketTimeout = (request, reject, timeoutInMs = 0) => {
|
|
4
|
+
const registerTimeout = (offset) => {
|
|
5
|
+
const timeout = timeoutInMs - offset;
|
|
6
|
+
const onTimeout = () => {
|
|
7
|
+
request.destroy();
|
|
8
|
+
reject(Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${timeoutInMs} ms of inactivity (configured by client requestHandler).`), { name: "TimeoutError" }));
|
|
9
|
+
};
|
|
10
|
+
if (request.socket) {
|
|
11
|
+
request.socket.setTimeout(timeout, onTimeout);
|
|
12
|
+
request.on("close", () => request.socket?.removeListener("timeout", onTimeout));
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
request.setTimeout(timeout, onTimeout);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
if (0 < timeoutInMs && timeoutInMs < 6000) {
|
|
19
|
+
registerTimeout(0);
|
|
20
|
+
return 0;
|
|
21
|
+
}
|
|
22
|
+
return timing.setTimeout(registerTimeout.bind(null, timeoutInMs === 0 ? 0 : DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME);
|
|
23
|
+
};
|
package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Collector } from "./collector";
|
|
2
|
+
export const streamCollector = (stream) => {
|
|
3
|
+
if (isReadableStreamInstance(stream)) {
|
|
4
|
+
return collectReadableStream(stream);
|
|
5
|
+
}
|
|
6
|
+
return new Promise((resolve, reject) => {
|
|
7
|
+
const collector = new Collector();
|
|
8
|
+
stream.pipe(collector);
|
|
9
|
+
stream.on("error", (err) => {
|
|
10
|
+
collector.end();
|
|
11
|
+
reject(err);
|
|
12
|
+
});
|
|
13
|
+
collector.on("error", reject);
|
|
14
|
+
collector.on("finish", function () {
|
|
15
|
+
const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes));
|
|
16
|
+
resolve(bytes);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
const isReadableStreamInstance = (stream) => typeof ReadableStream === "function" && stream instanceof ReadableStream;
|
|
21
|
+
async function collectReadableStream(stream) {
|
|
22
|
+
const chunks = [];
|
|
23
|
+
const reader = stream.getReader();
|
|
24
|
+
let isDone = false;
|
|
25
|
+
let length = 0;
|
|
26
|
+
while (!isDone) {
|
|
27
|
+
const { done, value } = await reader.read();
|
|
28
|
+
if (value) {
|
|
29
|
+
chunks.push(value);
|
|
30
|
+
length += value.length;
|
|
31
|
+
}
|
|
32
|
+
isDone = done;
|
|
33
|
+
}
|
|
34
|
+
const collected = new Uint8Array(length);
|
|
35
|
+
let offset = 0;
|
|
36
|
+
for (const chunk of chunks) {
|
|
37
|
+
collected.set(chunk, offset);
|
|
38
|
+
offset += chunk.length;
|
|
39
|
+
}
|
|
40
|
+
return collected;
|
|
41
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Readable } from "node:stream";
|
|
2
|
+
export class ReadFromBuffers extends Readable {
|
|
3
|
+
buffersToRead;
|
|
4
|
+
numBuffersRead = 0;
|
|
5
|
+
errorAfter;
|
|
6
|
+
constructor(options) {
|
|
7
|
+
super(options);
|
|
8
|
+
this.buffersToRead = options.buffers;
|
|
9
|
+
this.errorAfter = typeof options.errorAfter === "number" ? options.errorAfter : -1;
|
|
10
|
+
}
|
|
11
|
+
_read(size) {
|
|
12
|
+
if (this.errorAfter !== -1 && this.errorAfter === this.numBuffersRead) {
|
|
13
|
+
this.emit("error", new Error("Mock Error"));
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (this.numBuffersRead >= this.buffersToRead.length) {
|
|
17
|
+
return this.push(null);
|
|
18
|
+
}
|
|
19
|
+
return this.push(this.buffersToRead[this.numBuffersRead++]);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Readable } from "node:stream";
|
|
2
|
+
import { timing } from "./timing";
|
|
3
|
+
const MIN_WAIT_TIME = 6_000;
|
|
4
|
+
export async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME, externalAgent = false) {
|
|
5
|
+
const headers = request.headers ?? {};
|
|
6
|
+
const expect = headers.Expect || headers.expect;
|
|
7
|
+
let timeoutId = -1;
|
|
8
|
+
let sendBody = true;
|
|
9
|
+
if (!externalAgent && expect === "100-continue") {
|
|
10
|
+
sendBody = await Promise.race([
|
|
11
|
+
new Promise((resolve) => {
|
|
12
|
+
timeoutId = Number(timing.setTimeout(() => resolve(true), Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs)));
|
|
13
|
+
}),
|
|
14
|
+
new Promise((resolve) => {
|
|
15
|
+
httpRequest.on("continue", () => {
|
|
16
|
+
timing.clearTimeout(timeoutId);
|
|
17
|
+
resolve(true);
|
|
18
|
+
});
|
|
19
|
+
httpRequest.on("response", () => {
|
|
20
|
+
timing.clearTimeout(timeoutId);
|
|
21
|
+
resolve(false);
|
|
22
|
+
});
|
|
23
|
+
httpRequest.on("error", () => {
|
|
24
|
+
timing.clearTimeout(timeoutId);
|
|
25
|
+
resolve(false);
|
|
26
|
+
});
|
|
27
|
+
}),
|
|
28
|
+
]);
|
|
29
|
+
}
|
|
30
|
+
if (sendBody) {
|
|
31
|
+
writeBody(httpRequest, request.body);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function writeBody(httpRequest, body) {
|
|
35
|
+
if (body instanceof Readable) {
|
|
36
|
+
body.pipe(httpRequest);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (body) {
|
|
40
|
+
const isBuffer = Buffer.isBuffer(body);
|
|
41
|
+
const isString = typeof body === "string";
|
|
42
|
+
if (isBuffer || isString) {
|
|
43
|
+
if (isBuffer && body.byteLength === 0) {
|
|
44
|
+
httpRequest.end();
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
httpRequest.end(body);
|
|
48
|
+
}
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const uint8 = body;
|
|
52
|
+
if (typeof uint8 === "object" &&
|
|
53
|
+
uint8.buffer &&
|
|
54
|
+
typeof uint8.byteOffset === "number" &&
|
|
55
|
+
typeof uint8.byteLength === "number") {
|
|
56
|
+
httpRequest.end(Buffer.from(uint8.buffer, uint8.byteOffset, uint8.byteLength));
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
httpRequest.end(Buffer.from(body));
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
httpRequest.end();
|
|
63
|
+
}
|
package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/build-abort-error.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds an abort error, using the AbortSignal's reason if available.
|
|
3
|
+
*
|
|
4
|
+
* @param abortSignal - Optional AbortSignal that may contain a reason.
|
|
5
|
+
* @returns A new Error with name "AbortError". If the signal has a reason that's
|
|
6
|
+
* already an Error, the reason is set as `cause`. Otherwise creates a
|
|
7
|
+
* new Error with the reason as the message, or "Request aborted" if no
|
|
8
|
+
* reason.
|
|
9
|
+
*/
|
|
10
|
+
export declare function buildAbortError(abortSignal?: unknown): Error;
|
package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { HttpHandler, HttpRequest } from "@smithy/protocol-http";
|
|
2
|
+
import { HttpResponse } from "@smithy/protocol-http";
|
|
3
|
+
import type { HttpHandlerOptions, Logger, NodeHttpHandlerOptions, Provider } from "@smithy/types";
|
|
4
|
+
import type { Agent as hAgentType } from "node:http";
|
|
5
|
+
import { Agent as hsAgent } from "node:https";
|
|
6
|
+
export { NodeHttpHandlerOptions };
|
|
7
|
+
/**
|
|
8
|
+
* @public
|
|
9
|
+
* A default of 0 means no timeout.
|
|
10
|
+
*/
|
|
11
|
+
export declare const DEFAULT_REQUEST_TIMEOUT = 0;
|
|
12
|
+
/**
|
|
13
|
+
* @public
|
|
14
|
+
* A request handler that uses the Node.js http and https modules.
|
|
15
|
+
*/
|
|
16
|
+
export declare class NodeHttpHandler implements HttpHandler<NodeHttpHandlerOptions> {
|
|
17
|
+
private config?;
|
|
18
|
+
private configProvider;
|
|
19
|
+
private socketWarningTimestamp;
|
|
20
|
+
private externalAgent;
|
|
21
|
+
readonly metadata: {
|
|
22
|
+
handlerProtocol: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* @returns the input if it is an HttpHandler of any class,
|
|
26
|
+
* or instantiates a new instance of this handler.
|
|
27
|
+
*/
|
|
28
|
+
static create(instanceOrOptions?: HttpHandler<any> | NodeHttpHandlerOptions | Provider<NodeHttpHandlerOptions | void>): NodeHttpHandler | HttpHandler<any>;
|
|
29
|
+
/**
|
|
30
|
+
* @internal
|
|
31
|
+
*
|
|
32
|
+
* @param agent - http(s) agent in use by the NodeHttpHandler instance.
|
|
33
|
+
* @param socketWarningTimestamp - last socket usage check timestamp.
|
|
34
|
+
* @param logger - channel for the warning.
|
|
35
|
+
* @returns timestamp of last emitted warning.
|
|
36
|
+
*/
|
|
37
|
+
static checkSocketUsage(agent: hAgentType | hsAgent, socketWarningTimestamp: number, logger?: Logger): number;
|
|
38
|
+
constructor(options?: NodeHttpHandlerOptions | Provider<NodeHttpHandlerOptions | void>);
|
|
39
|
+
destroy(): void;
|
|
40
|
+
handle(request: HttpRequest, { abortSignal, requestTimeout }?: HttpHandlerOptions): Promise<{
|
|
41
|
+
response: HttpResponse;
|
|
42
|
+
}>;
|
|
43
|
+
updateHttpClientConfig(key: keyof NodeHttpHandlerOptions, value: NodeHttpHandlerOptions[typeof key]): void;
|
|
44
|
+
httpHandlerConfigs(): NodeHttpHandlerOptions;
|
|
45
|
+
private resolveDefaultConfig;
|
|
46
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { RequestContext } from "@smithy/types";
|
|
2
|
+
import type { ConnectConfiguration } from "@smithy/types";
|
|
3
|
+
import type { ConnectionManager, ConnectionManagerConfiguration } from "@smithy/types";
|
|
4
|
+
import type { ClientHttp2Session } from "node:http2";
|
|
5
|
+
/**
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export declare class NodeHttp2ConnectionManager implements ConnectionManager<ClientHttp2Session> {
|
|
9
|
+
constructor(config: ConnectionManagerConfiguration);
|
|
10
|
+
private config;
|
|
11
|
+
private readonly sessionCache;
|
|
12
|
+
lease(requestContext: RequestContext, connectionConfiguration: ConnectConfiguration): ClientHttp2Session;
|
|
13
|
+
/**
|
|
14
|
+
* Delete a session from the connection pool.
|
|
15
|
+
* @param authority The authority of the session to delete.
|
|
16
|
+
* @param session The session to delete.
|
|
17
|
+
*/
|
|
18
|
+
deleteSession(authority: string, session: ClientHttp2Session): void;
|
|
19
|
+
release(requestContext: RequestContext, session: ClientHttp2Session): void;
|
|
20
|
+
destroy(): void;
|
|
21
|
+
setMaxConcurrentStreams(maxConcurrentStreams: number): void;
|
|
22
|
+
setDisableConcurrentStreams(disableConcurrentStreams: boolean): void;
|
|
23
|
+
private getUrlString;
|
|
24
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ConnectionPool } from "@smithy/types";
|
|
2
|
+
import type { ClientHttp2Session } from "node:http2";
|
|
3
|
+
export declare class NodeHttp2ConnectionPool implements ConnectionPool<ClientHttp2Session> {
|
|
4
|
+
private sessions;
|
|
5
|
+
constructor(sessions?: ClientHttp2Session[]);
|
|
6
|
+
poll(): ClientHttp2Session | void;
|
|
7
|
+
offerLast(session: ClientHttp2Session): void;
|
|
8
|
+
contains(session: ClientHttp2Session): boolean;
|
|
9
|
+
remove(session: ClientHttp2Session): void;
|
|
10
|
+
[Symbol.iterator](): ArrayIterator<ClientHttp2Session>;
|
|
11
|
+
destroy(connection: ClientHttp2Session): void;
|
|
12
|
+
}
|
package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { HttpHandler, HttpRequest } from "@smithy/protocol-http";
|
|
2
|
+
import { HttpResponse } from "@smithy/protocol-http";
|
|
3
|
+
import type { HttpHandlerOptions, Provider } from "@smithy/types";
|
|
4
|
+
/**
|
|
5
|
+
* Represents the http2 options that can be passed to a node http2 client.
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export interface NodeHttp2HandlerOptions {
|
|
9
|
+
/**
|
|
10
|
+
* The maximum time in milliseconds that a stream may remain idle before it
|
|
11
|
+
* is closed.
|
|
12
|
+
*/
|
|
13
|
+
requestTimeout?: number;
|
|
14
|
+
/**
|
|
15
|
+
* The maximum time in milliseconds that a session or socket may remain idle
|
|
16
|
+
* before it is closed.
|
|
17
|
+
* https://nodejs.org/docs/latest-v12.x/api/http2.html#http2_http2session_and_sockets
|
|
18
|
+
*/
|
|
19
|
+
sessionTimeout?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Disables processing concurrent streams on a ClientHttp2Session instance. When set
|
|
22
|
+
* to true, a new session instance is created for each request to a URL.
|
|
23
|
+
* **Default:** false.
|
|
24
|
+
* https://nodejs.org/api/http2.html#http2_class_clienthttp2session
|
|
25
|
+
*/
|
|
26
|
+
disableConcurrentStreams?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Maximum number of concurrent Http2Stream instances per ClientHttp2Session. Each session
|
|
29
|
+
* may have up to 2^31-1 Http2Stream instances over its lifetime.
|
|
30
|
+
* This value must be greater than or equal to 0.
|
|
31
|
+
* https://nodejs.org/api/http2.html#class-http2stream
|
|
32
|
+
*/
|
|
33
|
+
maxConcurrentStreams?: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A request handler using the node:http2 package.
|
|
37
|
+
* @public
|
|
38
|
+
*/
|
|
39
|
+
export declare class NodeHttp2Handler implements HttpHandler<NodeHttp2HandlerOptions> {
|
|
40
|
+
private config?;
|
|
41
|
+
private configProvider;
|
|
42
|
+
readonly metadata: {
|
|
43
|
+
handlerProtocol: string;
|
|
44
|
+
};
|
|
45
|
+
private readonly connectionManager;
|
|
46
|
+
/**
|
|
47
|
+
* @returns the input if it is an HttpHandler of any class,
|
|
48
|
+
* or instantiates a new instance of this handler.
|
|
49
|
+
*/
|
|
50
|
+
static create(instanceOrOptions?: HttpHandler<any> | NodeHttp2HandlerOptions | Provider<NodeHttp2HandlerOptions | void>): HttpHandler<any> | NodeHttp2Handler;
|
|
51
|
+
constructor(options?: NodeHttp2HandlerOptions | Provider<NodeHttp2HandlerOptions | void>);
|
|
52
|
+
destroy(): void;
|
|
53
|
+
handle(request: HttpRequest, { abortSignal, requestTimeout }?: HttpHandlerOptions): Promise<{
|
|
54
|
+
response: HttpResponse;
|
|
55
|
+
}>;
|
|
56
|
+
updateHttpClientConfig(key: keyof NodeHttp2HandlerOptions, value: NodeHttp2HandlerOptions[typeof key]): void;
|
|
57
|
+
httpHandlerConfigs(): NodeHttp2HandlerOptions;
|
|
58
|
+
/**
|
|
59
|
+
* Destroys a session.
|
|
60
|
+
* @param session - the session to destroy.
|
|
61
|
+
*/
|
|
62
|
+
private destroySession;
|
|
63
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReadableOptions } from "node:stream";
|
|
2
|
+
import { Readable } from "node:stream";
|
|
3
|
+
export interface ReadFromBuffersOptions extends ReadableOptions {
|
|
4
|
+
buffers: Buffer[];
|
|
5
|
+
errorAfter?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare class ReadFromBuffers extends Readable {
|
|
8
|
+
private buffersToRead;
|
|
9
|
+
private numBuffersRead;
|
|
10
|
+
private errorAfter;
|
|
11
|
+
constructor(options: ReadFromBuffersOptions);
|
|
12
|
+
_read(): boolean | undefined;
|
|
13
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { HttpResponse } from "@smithy/types";
|
|
2
|
+
import type { IncomingMessage, Server as HttpServer, ServerResponse } from "node:http";
|
|
3
|
+
import type { Http2Server } from "node:http2";
|
|
4
|
+
import type { Server as HttpsServer } from "node:https";
|
|
5
|
+
export declare const createResponseFunction: (httpResp: HttpResponse) => (request: IncomingMessage, response: ServerResponse) => void;
|
|
6
|
+
export declare const createResponseFunctionWithDelay: (httpResp: HttpResponse, delay: number) => (request: IncomingMessage, response: ServerResponse) => void;
|
|
7
|
+
export declare const createContinueResponseFunction: (httpResp: HttpResponse) => (request: IncomingMessage, response: ServerResponse) => void;
|
|
8
|
+
export declare const createMockHttpsServer: () => HttpsServer;
|
|
9
|
+
export declare const createMockHttpServer: () => HttpServer;
|
|
10
|
+
export declare const createMockHttp2Server: () => Http2Server;
|
|
11
|
+
export declare const createMirrorResponseFunction: (httpResp: HttpResponse) => (request: IncomingMessage, response: ServerResponse) => void;
|
|
12
|
+
export declare const getResponseBody: (response: HttpResponse) => Promise<string>;
|
package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/set-request-timeout.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Logger } from "@smithy/types";
|
|
2
|
+
import type { ClientRequest } from "node:http";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare const setRequestTimeout: (req: ClientRequest, reject: (err: Error) => void, timeoutInMs?: number, throwOnRequestTimeout?: boolean, logger?: Logger) => number;
|
package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/set-socket-keep-alive.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ClientRequest } from "node:http";
|
|
2
|
+
export interface SocketKeepAliveOptions {
|
|
3
|
+
keepAlive: boolean;
|
|
4
|
+
keepAliveMsecs?: number;
|
|
5
|
+
}
|
|
6
|
+
export declare const setSocketKeepAlive: (request: ClientRequest, { keepAlive, keepAliveMsecs }: SocketKeepAliveOptions, deferTimeMs?: number) => NodeJS.Timeout | number;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReadableOptions } from "node:stream";
|
|
2
|
+
import { Readable } from "node:stream";
|
|
3
|
+
export interface ReadFromBuffersOptions extends ReadableOptions {
|
|
4
|
+
buffers: Buffer[];
|
|
5
|
+
errorAfter?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare class ReadFromBuffers extends Readable {
|
|
8
|
+
private buffersToRead;
|
|
9
|
+
private numBuffersRead;
|
|
10
|
+
private errorAfter;
|
|
11
|
+
constructor(options: ReadFromBuffersOptions);
|
|
12
|
+
_read(size: number): boolean | undefined;
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds an abort error, using the AbortSignal's reason if available.
|
|
3
|
+
*
|
|
4
|
+
* @param abortSignal - Optional AbortSignal that may contain a reason.
|
|
5
|
+
* @returns A new Error with name "AbortError". If the signal has a reason that's
|
|
6
|
+
* already an Error, the reason is set as `cause`. Otherwise creates a
|
|
7
|
+
* new Error with the reason as the message, or "Request aborted" if no
|
|
8
|
+
* reason.
|
|
9
|
+
*/
|
|
10
|
+
export declare function buildAbortError(abortSignal?: unknown): Error;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { HttpHandler, HttpRequest } from "@smithy/protocol-http";
|
|
2
|
+
import { HttpResponse } from "@smithy/protocol-http";
|
|
3
|
+
import { HttpHandlerOptions, Logger, NodeHttpHandlerOptions, Provider } from "@smithy/types";
|
|
4
|
+
import { Agent as hAgentType } from "node:http";
|
|
5
|
+
import { Agent as hsAgent } from "node:https";
|
|
6
|
+
export { NodeHttpHandlerOptions };
|
|
7
|
+
/**
|
|
8
|
+
* @public
|
|
9
|
+
* A default of 0 means no timeout.
|
|
10
|
+
*/
|
|
11
|
+
export declare const DEFAULT_REQUEST_TIMEOUT = 0;
|
|
12
|
+
/**
|
|
13
|
+
* @public
|
|
14
|
+
* A request handler that uses the Node.js http and https modules.
|
|
15
|
+
*/
|
|
16
|
+
export declare class NodeHttpHandler implements HttpHandler<NodeHttpHandlerOptions> {
|
|
17
|
+
private config?;
|
|
18
|
+
private configProvider;
|
|
19
|
+
private socketWarningTimestamp;
|
|
20
|
+
private externalAgent;
|
|
21
|
+
readonly metadata: {
|
|
22
|
+
handlerProtocol: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* @returns the input if it is an HttpHandler of any class,
|
|
26
|
+
* or instantiates a new instance of this handler.
|
|
27
|
+
*/
|
|
28
|
+
static create(instanceOrOptions?: HttpHandler<any> | NodeHttpHandlerOptions | Provider<NodeHttpHandlerOptions | void>): NodeHttpHandler | HttpHandler<any>;
|
|
29
|
+
/**
|
|
30
|
+
* @internal
|
|
31
|
+
*
|
|
32
|
+
* @param agent - http(s) agent in use by the NodeHttpHandler instance.
|
|
33
|
+
* @param socketWarningTimestamp - last socket usage check timestamp.
|
|
34
|
+
* @param logger - channel for the warning.
|
|
35
|
+
* @returns timestamp of last emitted warning.
|
|
36
|
+
*/
|
|
37
|
+
static checkSocketUsage(agent: hAgentType | hsAgent, socketWarningTimestamp: number, logger?: Logger): number;
|
|
38
|
+
constructor(options?: NodeHttpHandlerOptions | Provider<NodeHttpHandlerOptions | void>);
|
|
39
|
+
destroy(): void;
|
|
40
|
+
handle(request: HttpRequest, { abortSignal, requestTimeout }?: HttpHandlerOptions): Promise<{
|
|
41
|
+
response: HttpResponse;
|
|
42
|
+
}>;
|
|
43
|
+
updateHttpClientConfig(key: keyof NodeHttpHandlerOptions, value: NodeHttpHandlerOptions[typeof key]): void;
|
|
44
|
+
httpHandlerConfigs(): NodeHttpHandlerOptions;
|
|
45
|
+
private resolveDefaultConfig;
|
|
46
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { RequestContext } from "@smithy/types";
|
|
2
|
+
import { ConnectConfiguration } from "@smithy/types";
|
|
3
|
+
import { ConnectionManager, ConnectionManagerConfiguration } from "@smithy/types";
|
|
4
|
+
import { ClientHttp2Session } from "node:http2";
|
|
5
|
+
/**
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export declare class NodeHttp2ConnectionManager implements ConnectionManager<ClientHttp2Session> {
|
|
9
|
+
constructor(config: ConnectionManagerConfiguration);
|
|
10
|
+
private config;
|
|
11
|
+
private readonly sessionCache;
|
|
12
|
+
lease(requestContext: RequestContext, connectionConfiguration: ConnectConfiguration): ClientHttp2Session;
|
|
13
|
+
/**
|
|
14
|
+
* Delete a session from the connection pool.
|
|
15
|
+
* @param authority The authority of the session to delete.
|
|
16
|
+
* @param session The session to delete.
|
|
17
|
+
*/
|
|
18
|
+
deleteSession(authority: string, session: ClientHttp2Session): void;
|
|
19
|
+
release(requestContext: RequestContext, session: ClientHttp2Session): void;
|
|
20
|
+
destroy(): void;
|
|
21
|
+
setMaxConcurrentStreams(maxConcurrentStreams: number): void;
|
|
22
|
+
setDisableConcurrentStreams(disableConcurrentStreams: boolean): void;
|
|
23
|
+
private getUrlString;
|
|
24
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ConnectionPool } from "@smithy/types";
|
|
2
|
+
import { ClientHttp2Session } from "node:http2";
|
|
3
|
+
export declare class NodeHttp2ConnectionPool implements ConnectionPool<ClientHttp2Session> {
|
|
4
|
+
private sessions;
|
|
5
|
+
constructor(sessions?: ClientHttp2Session[]);
|
|
6
|
+
poll(): ClientHttp2Session | void;
|
|
7
|
+
offerLast(session: ClientHttp2Session): void;
|
|
8
|
+
contains(session: ClientHttp2Session): boolean;
|
|
9
|
+
remove(session: ClientHttp2Session): void;
|
|
10
|
+
[Symbol.iterator](): ArrayIterator<ClientHttp2Session>;
|
|
11
|
+
destroy(connection: ClientHttp2Session): void;
|
|
12
|
+
}
|