@psnext/slingcli 3.0.20260811-3 → 3.0.20260820-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/node_modules/@aws-sdk/core/dist-types/submodules/client/util-endpoints/lib/aws/partitions.d.ts +54 -54
  2. package/node_modules/@aws-sdk/core/dist-types/submodules/client/util-user-agent-browser/defaultUserAgent.d.ts +1 -1
  3. package/node_modules/@aws-sdk/core/dist-types/submodules/client/util-user-agent-browser/defaultUserAgent.native.d.ts +1 -1
  4. package/node_modules/@aws-sdk/core/dist-types/submodules/client/util-user-agent-node/defaultUserAgent.d.ts +1 -1
  5. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/partitions.d.ts +54 -54
  6. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.d.ts +1 -4
  7. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.native.d.ts +1 -4
  8. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/defaultUserAgent.d.ts +1 -4
  9. package/node_modules/@aws-sdk/core/package.json +4 -4
  10. package/node_modules/@aws-sdk/credential-provider-env/package.json +4 -4
  11. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-cjs/index.js +9 -2
  12. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +9 -2
  13. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +1 -1
  14. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-handler.d.ts +1 -1
  15. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/package.json +5 -13
  16. package/node_modules/@aws-sdk/credential-provider-http/package.json +4 -4
  17. package/node_modules/@aws-sdk/credential-provider-ini/package.json +11 -11
  18. package/node_modules/@aws-sdk/credential-provider-login/package.json +5 -5
  19. package/node_modules/@aws-sdk/credential-provider-node/package.json +9 -9
  20. package/node_modules/@aws-sdk/credential-provider-process/package.json +4 -4
  21. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +5 -5
  22. package/node_modules/@aws-sdk/credential-provider-sso/package.json +6 -6
  23. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +5 -5
  24. package/node_modules/@aws-sdk/eventstream-handler-node/package.json +3 -3
  25. package/node_modules/@aws-sdk/middleware-eventstream/package.json +3 -3
  26. package/node_modules/@aws-sdk/middleware-websocket/package.json +4 -4
  27. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  28. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
  29. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  30. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  31. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  32. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.browser.d.ts +42 -42
  33. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.d.ts +42 -42
  34. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.native.d.ts +41 -41
  35. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.shared.d.ts +2 -2
  36. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.browser.d.ts +43 -43
  37. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.d.ts +43 -43
  38. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.native.d.ts +42 -42
  39. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.shared.d.ts +2 -2
  40. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.browser.d.ts +42 -42
  41. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.d.ts +42 -42
  42. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.native.d.ts +41 -41
  43. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.shared.d.ts +2 -2
  44. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.browser.d.ts +42 -42
  45. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.d.ts +42 -42
  46. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.native.d.ts +41 -41
  47. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.shared.d.ts +2 -2
  48. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.browser.d.ts +44 -44
  49. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.d.ts +35 -35
  50. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.native.d.ts +43 -43
  51. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.shared.d.ts +2 -2
  52. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.browser.d.ts +64 -66
  53. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.d.ts +65 -65
  54. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.native.d.ts +68 -70
  55. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.shared.d.ts +3 -3
  56. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.browser.d.ts +67 -69
  57. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.d.ts +66 -66
  58. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.native.d.ts +71 -73
  59. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.shared.d.ts +3 -3
  60. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.browser.d.ts +64 -66
  61. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.d.ts +65 -65
  62. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.native.d.ts +68 -70
  63. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.shared.d.ts +3 -3
  64. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.browser.d.ts +64 -66
  65. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.d.ts +65 -65
  66. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.native.d.ts +68 -70
  67. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.shared.d.ts +3 -3
  68. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.browser.d.ts +68 -70
  69. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.d.ts +68 -68
  70. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.native.d.ts +72 -74
  71. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.shared.d.ts +3 -3
  72. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-cjs/index.js +9 -2
  73. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +9 -2
  74. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +1 -1
  75. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-handler.d.ts +1 -1
  76. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/package.json +5 -13
  77. package/node_modules/@aws-sdk/nested-clients/package.json +5 -5
  78. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +3 -3
  79. package/node_modules/@aws-sdk/types/package.json +2 -2
  80. package/node_modules/@aws-sdk/util-locate-window/package.json +27 -27
  81. package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
  82. package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js +4 -1
  83. package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
  84. package/node_modules/@hono/node-server/dist/index.cjs +151 -9
  85. package/node_modules/@hono/node-server/dist/index.mjs +151 -9
  86. package/node_modules/@hono/node-server/package.json +1 -1
  87. package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +1 -2
  88. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +23 -23
  89. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +23 -23
  90. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +17 -13
  91. package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +0 -10
  92. package/node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js +1 -2
  93. package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +4 -4
  94. package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/HeaderMarshaller.js +19 -19
  95. package/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +3 -4
  96. package/node_modules/@smithy/core/dist-es/submodules/protocols/middleware-content-length/contentLengthMiddleware.js +6 -4
  97. package/node_modules/@smithy/core/dist-es/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.js +8 -5
  98. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/ListSchema.js +0 -2
  99. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/MapSchema.js +0 -2
  100. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/OperationSchema.js +0 -2
  101. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/SimpleSchema.js +0 -2
  102. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/StructureSchema.js +0 -2
  103. package/node_modules/@smithy/core/dist-types/submodules/client/smithy-client/extensions/defaultExtensionConfiguration.d.ts +1 -7
  104. package/node_modules/@smithy/core/dist-types/submodules/config/config-resolver/regionConfig/checkRegion.d.ts +2 -1
  105. package/node_modules/@smithy/core/dist-types/submodules/endpoints/util-endpoints/utils/evaluateCondition.d.ts +1 -1
  106. package/node_modules/@smithy/core/dist-types/submodules/endpoints/util-endpoints/utils/evaluateConditions.d.ts +1 -1
  107. package/node_modules/@smithy/core/dist-types/submodules/endpoints/util-endpoints/utils/evaluateExpression.d.ts +2 -2
  108. package/node_modules/@smithy/core/dist-types/submodules/endpoints/util-endpoints/utils/evaluateRules.d.ts +2 -2
  109. package/node_modules/@smithy/core/dist-types/submodules/endpoints/util-endpoints/utils/getEndpointProperties.d.ts +2 -2
  110. package/node_modules/@smithy/core/dist-types/submodules/endpoints/util-endpoints/utils/getReferenceValue.d.ts +2 -2
  111. package/node_modules/@smithy/core/dist-types/submodules/event-streams/EventStreamSerde.d.ts +14 -2
  112. package/node_modules/@smithy/core/dist-types/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.d.ts +7 -2
  113. package/node_modules/@smithy/core/dist-types/submodules/retry/util-retry/retries-2026-config.d.ts +2 -2
  114. package/node_modules/@smithy/core/dist-types/submodules/schema/TypeRegistry.d.ts +1 -1
  115. package/node_modules/@smithy/core/dist-types/submodules/serde/parse-utils.d.ts +5 -5
  116. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/client/smithy-client/extensions/defaultExtensionConfiguration.d.ts +1 -7
  117. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/config/config-resolver/regionConfig/checkRegion.d.ts +2 -1
  118. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/util-endpoints/utils/evaluateCondition.d.ts +1 -1
  119. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/util-endpoints/utils/evaluateConditions.d.ts +1 -1
  120. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/util-endpoints/utils/evaluateExpression.d.ts +2 -2
  121. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/util-endpoints/utils/evaluateRules.d.ts +2 -2
  122. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/util-endpoints/utils/getEndpointProperties.d.ts +2 -2
  123. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/util-endpoints/utils/getReferenceValue.d.ts +2 -2
  124. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/event-streams/EventStreamSerde.d.ts +14 -2
  125. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.d.ts +7 -2
  126. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/retry/util-retry/retries-2026-config.d.ts +2 -2
  127. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/TypeRegistry.d.ts +1 -1
  128. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/parse-utils.d.ts +5 -5
  129. package/node_modules/@smithy/core/package.json +3 -11
  130. package/node_modules/@smithy/credential-provider-imds/package.json +4 -12
  131. package/node_modules/@smithy/fetch-http-handler/package.json +5 -13
  132. package/node_modules/@smithy/signature-v4/dist-cjs/index.js +9 -9
  133. package/node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js +9 -9
  134. package/node_modules/@smithy/signature-v4/package.json +4 -12
  135. package/node_modules/@smithy/types/dist-types/schema/sentinels.d.ts +14 -14
  136. package/node_modules/@smithy/types/package.json +29 -39
  137. package/node_modules/body-parser/node_modules/content-type/README.md +2 -0
  138. package/node_modules/body-parser/node_modules/content-type/dist/index.d.ts +20 -0
  139. package/node_modules/body-parser/node_modules/content-type/dist/index.js +20 -14
  140. package/node_modules/body-parser/node_modules/content-type/dist/index.js.map +1 -1
  141. package/node_modules/body-parser/node_modules/content-type/package.json +1 -1
  142. package/node_modules/gaxios/build/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  143. package/node_modules/gaxios/build/esm/tsconfig.tsbuildinfo +1 -1
  144. package/node_modules/gaxios/package.json +3 -3
  145. package/node_modules/hono/dist/cjs/client/client.js +3 -3
  146. package/node_modules/hono/dist/cjs/client/utils.js +1 -1
  147. package/node_modules/hono/dist/cjs/context.js +4 -0
  148. package/node_modules/hono/dist/cjs/jsx/intrinsic-element/components.js +1 -1
  149. package/node_modules/hono/dist/cjs/middleware/cors/index.js +16 -13
  150. package/node_modules/hono/dist/cjs/middleware/csrf/index.js +1 -1
  151. package/node_modules/hono/dist/cjs/middleware/etag/digest.js +47 -1
  152. package/node_modules/hono/dist/cjs/middleware/etag/index.js +2 -2
  153. package/node_modules/hono/dist/cjs/middleware/pretty-json/index.js +3 -1
  154. package/node_modules/hono/dist/cjs/middleware/secure-headers/secure-headers.js +6 -3
  155. package/node_modules/hono/dist/cjs/router/linear-router/router.js +7 -2
  156. package/node_modules/hono/dist/cjs/router/pattern-router/router.js +3 -9
  157. package/node_modules/hono/dist/cjs/router/trie-router/node.js +43 -67
  158. package/node_modules/hono/dist/cjs/router/trie-router/router.js +3 -11
  159. package/node_modules/hono/dist/cjs/utils/ipaddr.js +5 -3
  160. package/node_modules/hono/dist/cjs/utils/url.js +2 -2
  161. package/node_modules/hono/dist/client/client.js +3 -3
  162. package/node_modules/hono/dist/client/utils.js +1 -1
  163. package/node_modules/hono/dist/context.js +4 -0
  164. package/node_modules/hono/dist/jsx/intrinsic-element/components.js +1 -1
  165. package/node_modules/hono/dist/middleware/cors/index.js +16 -13
  166. package/node_modules/hono/dist/middleware/csrf/index.js +1 -1
  167. package/node_modules/hono/dist/middleware/etag/digest.js +47 -1
  168. package/node_modules/hono/dist/middleware/etag/index.js +2 -2
  169. package/node_modules/hono/dist/middleware/pretty-json/index.js +3 -1
  170. package/node_modules/hono/dist/middleware/secure-headers/secure-headers.js +6 -3
  171. package/node_modules/hono/dist/router/linear-router/router.js +7 -2
  172. package/node_modules/hono/dist/router/pattern-router/router.js +3 -9
  173. package/node_modules/hono/dist/router/trie-router/node.js +43 -67
  174. package/node_modules/hono/dist/router/trie-router/router.js +3 -11
  175. package/node_modules/hono/dist/types/context.d.ts +4 -0
  176. package/node_modules/hono/dist/types/middleware/secure-headers/permissions-policy.d.ts +3 -3
  177. package/node_modules/hono/dist/types/router/trie-router/node.d.ts +1 -2
  178. package/node_modules/hono/dist/types/router/trie-router/router.d.ts +0 -1
  179. package/node_modules/hono/dist/utils/ipaddr.js +5 -3
  180. package/node_modules/hono/dist/utils/url.js +2 -2
  181. package/node_modules/hono/package.json +1 -1
  182. package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +4 -3
  183. package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +4 -3
  184. package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +4 -3
  185. package/node_modules/jose/dist/types/jwt/encrypt.d.ts +4 -3
  186. package/node_modules/jose/dist/types/types.d.ts +4 -2
  187. package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +7 -3
  188. package/node_modules/jose/dist/webapi/jwks/remote.js +1 -1
  189. package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +6 -2
  190. package/node_modules/jose/package.json +1 -1
  191. package/node_modules/type-is/node_modules/content-type/README.md +2 -0
  192. package/node_modules/type-is/node_modules/content-type/dist/index.d.ts +20 -0
  193. package/node_modules/type-is/node_modules/content-type/dist/index.js +20 -14
  194. package/node_modules/type-is/node_modules/content-type/dist/index.js.map +1 -1
  195. package/node_modules/type-is/node_modules/content-type/package.json +1 -1
  196. package/package.json +2 -2
  197. package/slingshot/index.js +295 -279
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/xml-builder",
3
- "version": "3.972.37",
3
+ "version": "3.972.39",
4
4
  "description": "XML utilities for the AWS SDK",
5
5
  "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages-internal/xml-builder",
6
6
  "license": "Apache-2.0",
@@ -55,7 +55,7 @@
55
55
  "concurrently": "7.0.0",
56
56
  "downlevel-dts": "0.10.1",
57
57
  "premove": "4.0.0",
58
- "typescript": "~5.8.3"
58
+ "typescript": "~7.0.2"
59
59
  },
60
60
  "engines": {
61
61
  "node": ">=20.0.0"
@@ -87,7 +87,10 @@ Sling documentation (read only when the user asks about sling itself, its SDK, e
87
87
  - When reading sling docs or examples, resolve docs/... under Additional docs and examples/... under Examples, not the current working directory
88
88
  - When asked about: extensions (docs/extensions.md, examples/extensions/), themes (docs/themes.md), skills (docs/skills.md), prompt templates (docs/prompt-templates.md), TUI components (docs/tui.md), keybindings (docs/keybindings.md), SDK integrations (docs/sdk.md), custom providers (docs/custom-provider.md), adding models (docs/models.md), sling packages (docs/packages.md), environment variables (docs/environment-variables.md)
89
89
  - When working on sling topics, read the docs and examples, and follow .md cross-references before implementing
90
- - Always read sling .md files completely and follow links to related docs (e.g., tui.md for TUI API details)`;
90
+ - Always read sling .md files completely and follow links to related docs (e.g., tui.md for TUI API details)
91
+
92
+ IMPORTANT: sling is an alias of pi, whenever you have command line examples of pi show them as sling,
93
+ for example \`pi -ne\` should be shown as \`sling -ne\``;
91
94
  if (appendSection) {
92
95
  prompt += appendSection;
93
96
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@earendil-works/pi-telemetry",
3
- "version": "0.84.1",
3
+ "version": "0.84.2",
4
4
  "description": "Vendor-neutral telemetry contracts and typed schema utilities for pi",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -13,6 +13,157 @@ var RequestError = class extends Error {
13
13
  }
14
14
  };
15
15
 
16
+ //#endregion
17
+ //#region src/headers.ts
18
+ const nonJoinedHeaders = new Set([
19
+ "age",
20
+ "authorization",
21
+ "content-length",
22
+ "content-type",
23
+ "etag",
24
+ "expires",
25
+ "from",
26
+ "host",
27
+ "if-modified-since",
28
+ "if-unmodified-since",
29
+ "last-modified",
30
+ "location",
31
+ "max-forwards",
32
+ "proxy-authorization",
33
+ "referer",
34
+ "retry-after",
35
+ "server",
36
+ "user-agent"
37
+ ]);
38
+ const validHeaderName = /^[!#$%&'*+\-.^_`|~\dA-Za-z]+$/;
39
+ const isHttpWhitespace = (code) => code === 9 || code === 10 || code === 13 || code === 32;
40
+ const normalizeHeaderValue = (value) => {
41
+ if (!isHttpWhitespace(value.charCodeAt(0)) && !isHttpWhitespace(value.charCodeAt(value.length - 1))) return value;
42
+ let start = 0;
43
+ let end = value.length;
44
+ while (start < end && isHttpWhitespace(value.charCodeAt(start))) start++;
45
+ while (end > start && isHttpWhitespace(value.charCodeAt(end - 1))) end--;
46
+ return value.slice(start, end);
47
+ };
48
+ const forbiddenHeaderValue = /[\0\r\n]/;
49
+ const GlobalHeaders = globalThis.Headers;
50
+ const materializeHeaders = (rawHeaders, HeadersCtor = GlobalHeaders) => {
51
+ const headers = new HeadersCtor();
52
+ for (let i = 0; i < rawHeaders.length; i += 2) {
53
+ const name = rawHeaders[i];
54
+ if (!name.startsWith(":")) headers.append(name, rawHeaders[i + 1]);
55
+ }
56
+ return headers;
57
+ };
58
+ var RequestHeaders = class {
59
+ #incoming;
60
+ #rawHeaders;
61
+ #headers;
62
+ #invalidValue;
63
+ constructor(incoming) {
64
+ this.#incoming = incoming;
65
+ if (incoming instanceof node_http2.Http2ServerRequest) this.#rawHeaders = incoming.rawHeaders.slice();
66
+ }
67
+ get #lazyRawHeaders() {
68
+ return this.#rawHeaders ??= this.#incoming.rawHeaders.slice();
69
+ }
70
+ get #native() {
71
+ if (!this.#headers) {
72
+ this.#headers = materializeHeaders(this.#lazyRawHeaders);
73
+ this.#rawHeaders = void 0;
74
+ }
75
+ return this.#headers;
76
+ }
77
+ #normalizedName(name) {
78
+ if (typeof name !== "string") return;
79
+ if (!validHeaderName.test(name)) throw new TypeError(`Invalid header name: ${name}`);
80
+ return name.toLowerCase();
81
+ }
82
+ #lookupHttp1(lowerName) {
83
+ const headers = this.#incoming instanceof node_http2.Http2ServerRequest ? void 0 : this.#incoming.headers;
84
+ if (!headers || nonJoinedHeaders.has(lowerName) || lowerName === "set-cookie" || lowerName === "__proto__") return;
85
+ if (!Object.hasOwn(headers, lowerName)) return null;
86
+ const rawValue = headers[lowerName];
87
+ if (typeof rawValue === "string") {
88
+ const value = normalizeHeaderValue(rawValue);
89
+ return forbiddenHeaderValue.test(value) ? void 0 : value;
90
+ }
91
+ }
92
+ #lookup(rawHeaders, lowerName) {
93
+ const separator = lowerName === "cookie" ? "; " : ", ";
94
+ let value = null;
95
+ for (let i = 0; i < rawHeaders.length; i += 2) {
96
+ const rawName = rawHeaders[i];
97
+ if (rawName.length === lowerName.length && rawName.toLowerCase() === lowerName) {
98
+ const rawValue = normalizeHeaderValue(rawHeaders[i + 1]);
99
+ if (forbiddenHeaderValue.test(rawValue)) {
100
+ this.#invalidValue = true;
101
+ return;
102
+ }
103
+ value = value === null ? rawValue : value + separator + rawValue;
104
+ }
105
+ }
106
+ return value;
107
+ }
108
+ append(name, value) {
109
+ this.#native.append(name, value);
110
+ }
111
+ delete(name) {
112
+ this.#native.delete(name);
113
+ }
114
+ get(name) {
115
+ const lowerName = this.#normalizedName(name);
116
+ if (lowerName && !this.#headers && !this.#invalidValue) {
117
+ const http1Value = this.#lookupHttp1(lowerName);
118
+ if (http1Value !== void 0) return http1Value;
119
+ const value = this.#lookup(this.#lazyRawHeaders, lowerName);
120
+ if (value !== void 0) return value;
121
+ }
122
+ return this.#native.get(name);
123
+ }
124
+ has(name) {
125
+ const lowerName = this.#normalizedName(name);
126
+ if (lowerName && !this.#headers && !this.#invalidValue) {
127
+ const http1Value = this.#lookupHttp1(lowerName);
128
+ if (http1Value !== void 0) return http1Value !== null;
129
+ const value = this.#lookup(this.#lazyRawHeaders, lowerName);
130
+ if (value !== void 0) return value !== null;
131
+ }
132
+ return this.#native.has(name);
133
+ }
134
+ set(name, value) {
135
+ this.#native.set(name, value);
136
+ }
137
+ getSetCookie() {
138
+ return this.#native.getSetCookie();
139
+ }
140
+ keys() {
141
+ return this.#native.keys();
142
+ }
143
+ values() {
144
+ return this.#native.values();
145
+ }
146
+ entries() {
147
+ return this.#native.entries();
148
+ }
149
+ forEach(callback, thisArg) {
150
+ this.#native.forEach((value, key) => {
151
+ callback.call(thisArg, value, key, this);
152
+ });
153
+ }
154
+ [Symbol.iterator]() {
155
+ return this.entries();
156
+ }
157
+ };
158
+ Object.defineProperty(RequestHeaders.prototype, Symbol.for("nodejs.util.inspect.custom"), { value: function(depth, options, inspectFn) {
159
+ return `Headers (lightweight) ${inspectFn(Object.fromEntries(this), {
160
+ ...options,
161
+ depth: depth == null ? null : depth - 1
162
+ })}`;
163
+ } });
164
+ Object.setPrototypeOf(RequestHeaders.prototype, GlobalHeaders.prototype);
165
+ const newHeadersFromIncoming = (incoming) => globalThis.Headers === GlobalHeaders ? new RequestHeaders(incoming) : materializeHeaders(incoming.rawHeaders, globalThis.Headers);
166
+
16
167
  //#endregion
17
168
  //#region src/url.ts
18
169
  const reValidRequestUrl = /^\/[!#$&-;=?-\[\]_a-z~]*$/;
@@ -50,15 +201,6 @@ var Request$1 = class extends GlobalRequest {
50
201
  super(input, options);
51
202
  }
52
203
  };
53
- const newHeadersFromIncoming = (incoming) => {
54
- const headerRecord = [];
55
- const rawHeaders = incoming.rawHeaders;
56
- for (let i = 0, len = rawHeaders.length; i < len; i += 2) {
57
- const key = rawHeaders[i];
58
- if (key.charCodeAt(0) !== 58) headerRecord.push([key, rawHeaders[i + 1]]);
59
- }
60
- return new Headers(headerRecord);
61
- };
62
204
  const wrapBodyStream = Symbol("wrapBodyStream");
63
205
  const byteExactEncodings = new Set([
64
206
  "latin1",
@@ -12,6 +12,157 @@ var RequestError = class extends Error {
12
12
  }
13
13
  };
14
14
 
15
+ //#endregion
16
+ //#region src/headers.ts
17
+ const nonJoinedHeaders = new Set([
18
+ "age",
19
+ "authorization",
20
+ "content-length",
21
+ "content-type",
22
+ "etag",
23
+ "expires",
24
+ "from",
25
+ "host",
26
+ "if-modified-since",
27
+ "if-unmodified-since",
28
+ "last-modified",
29
+ "location",
30
+ "max-forwards",
31
+ "proxy-authorization",
32
+ "referer",
33
+ "retry-after",
34
+ "server",
35
+ "user-agent"
36
+ ]);
37
+ const validHeaderName = /^[!#$%&'*+\-.^_`|~\dA-Za-z]+$/;
38
+ const isHttpWhitespace = (code) => code === 9 || code === 10 || code === 13 || code === 32;
39
+ const normalizeHeaderValue = (value) => {
40
+ if (!isHttpWhitespace(value.charCodeAt(0)) && !isHttpWhitespace(value.charCodeAt(value.length - 1))) return value;
41
+ let start = 0;
42
+ let end = value.length;
43
+ while (start < end && isHttpWhitespace(value.charCodeAt(start))) start++;
44
+ while (end > start && isHttpWhitespace(value.charCodeAt(end - 1))) end--;
45
+ return value.slice(start, end);
46
+ };
47
+ const forbiddenHeaderValue = /[\0\r\n]/;
48
+ const GlobalHeaders = globalThis.Headers;
49
+ const materializeHeaders = (rawHeaders, HeadersCtor = GlobalHeaders) => {
50
+ const headers = new HeadersCtor();
51
+ for (let i = 0; i < rawHeaders.length; i += 2) {
52
+ const name = rawHeaders[i];
53
+ if (!name.startsWith(":")) headers.append(name, rawHeaders[i + 1]);
54
+ }
55
+ return headers;
56
+ };
57
+ var RequestHeaders = class {
58
+ #incoming;
59
+ #rawHeaders;
60
+ #headers;
61
+ #invalidValue;
62
+ constructor(incoming) {
63
+ this.#incoming = incoming;
64
+ if (incoming instanceof Http2ServerRequest) this.#rawHeaders = incoming.rawHeaders.slice();
65
+ }
66
+ get #lazyRawHeaders() {
67
+ return this.#rawHeaders ??= this.#incoming.rawHeaders.slice();
68
+ }
69
+ get #native() {
70
+ if (!this.#headers) {
71
+ this.#headers = materializeHeaders(this.#lazyRawHeaders);
72
+ this.#rawHeaders = void 0;
73
+ }
74
+ return this.#headers;
75
+ }
76
+ #normalizedName(name) {
77
+ if (typeof name !== "string") return;
78
+ if (!validHeaderName.test(name)) throw new TypeError(`Invalid header name: ${name}`);
79
+ return name.toLowerCase();
80
+ }
81
+ #lookupHttp1(lowerName) {
82
+ const headers = this.#incoming instanceof Http2ServerRequest ? void 0 : this.#incoming.headers;
83
+ if (!headers || nonJoinedHeaders.has(lowerName) || lowerName === "set-cookie" || lowerName === "__proto__") return;
84
+ if (!Object.hasOwn(headers, lowerName)) return null;
85
+ const rawValue = headers[lowerName];
86
+ if (typeof rawValue === "string") {
87
+ const value = normalizeHeaderValue(rawValue);
88
+ return forbiddenHeaderValue.test(value) ? void 0 : value;
89
+ }
90
+ }
91
+ #lookup(rawHeaders, lowerName) {
92
+ const separator = lowerName === "cookie" ? "; " : ", ";
93
+ let value = null;
94
+ for (let i = 0; i < rawHeaders.length; i += 2) {
95
+ const rawName = rawHeaders[i];
96
+ if (rawName.length === lowerName.length && rawName.toLowerCase() === lowerName) {
97
+ const rawValue = normalizeHeaderValue(rawHeaders[i + 1]);
98
+ if (forbiddenHeaderValue.test(rawValue)) {
99
+ this.#invalidValue = true;
100
+ return;
101
+ }
102
+ value = value === null ? rawValue : value + separator + rawValue;
103
+ }
104
+ }
105
+ return value;
106
+ }
107
+ append(name, value) {
108
+ this.#native.append(name, value);
109
+ }
110
+ delete(name) {
111
+ this.#native.delete(name);
112
+ }
113
+ get(name) {
114
+ const lowerName = this.#normalizedName(name);
115
+ if (lowerName && !this.#headers && !this.#invalidValue) {
116
+ const http1Value = this.#lookupHttp1(lowerName);
117
+ if (http1Value !== void 0) return http1Value;
118
+ const value = this.#lookup(this.#lazyRawHeaders, lowerName);
119
+ if (value !== void 0) return value;
120
+ }
121
+ return this.#native.get(name);
122
+ }
123
+ has(name) {
124
+ const lowerName = this.#normalizedName(name);
125
+ if (lowerName && !this.#headers && !this.#invalidValue) {
126
+ const http1Value = this.#lookupHttp1(lowerName);
127
+ if (http1Value !== void 0) return http1Value !== null;
128
+ const value = this.#lookup(this.#lazyRawHeaders, lowerName);
129
+ if (value !== void 0) return value !== null;
130
+ }
131
+ return this.#native.has(name);
132
+ }
133
+ set(name, value) {
134
+ this.#native.set(name, value);
135
+ }
136
+ getSetCookie() {
137
+ return this.#native.getSetCookie();
138
+ }
139
+ keys() {
140
+ return this.#native.keys();
141
+ }
142
+ values() {
143
+ return this.#native.values();
144
+ }
145
+ entries() {
146
+ return this.#native.entries();
147
+ }
148
+ forEach(callback, thisArg) {
149
+ this.#native.forEach((value, key) => {
150
+ callback.call(thisArg, value, key, this);
151
+ });
152
+ }
153
+ [Symbol.iterator]() {
154
+ return this.entries();
155
+ }
156
+ };
157
+ Object.defineProperty(RequestHeaders.prototype, Symbol.for("nodejs.util.inspect.custom"), { value: function(depth, options, inspectFn) {
158
+ return `Headers (lightweight) ${inspectFn(Object.fromEntries(this), {
159
+ ...options,
160
+ depth: depth == null ? null : depth - 1
161
+ })}`;
162
+ } });
163
+ Object.setPrototypeOf(RequestHeaders.prototype, GlobalHeaders.prototype);
164
+ const newHeadersFromIncoming = (incoming) => globalThis.Headers === GlobalHeaders ? new RequestHeaders(incoming) : materializeHeaders(incoming.rawHeaders, globalThis.Headers);
165
+
15
166
  //#endregion
16
167
  //#region src/url.ts
17
168
  const reValidRequestUrl = /^\/[!#$&-;=?-\[\]_a-z~]*$/;
@@ -49,15 +200,6 @@ var Request$1 = class extends GlobalRequest {
49
200
  super(input, options);
50
201
  }
51
202
  };
52
- const newHeadersFromIncoming = (incoming) => {
53
- const headerRecord = [];
54
- const rawHeaders = incoming.rawHeaders;
55
- for (let i = 0, len = rawHeaders.length; i < len; i += 2) {
56
- const key = rawHeaders[i];
57
- if (key.charCodeAt(0) !== 58) headerRecord.push([key, rawHeaders[i + 1]]);
58
- }
59
- return new Headers(headerRecord);
60
- };
61
203
  const wrapBodyStream = Symbol("wrapBodyStream");
62
204
  const byteExactEncodings = new Set([
63
205
  "latin1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hono/node-server",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "Node.js Adapter for Hono",
5
5
  "main": "dist/index.mjs",
6
6
  "type": "module",
@@ -2187,10 +2187,9 @@ class SmithyRpcV2CborProtocol extends RpcProtocol {
2187
2187
  this.serializer.write(15, {});
2188
2188
  request.body = this.serializer.flush();
2189
2189
  }
2190
- try {
2190
+ if (request.body instanceof Uint8Array) {
2191
2191
  request.headers["content-length"] = String(request.body.byteLength);
2192
2192
  }
2193
- catch (ignored) { }
2194
2193
  }
2195
2194
  const { service, operation } = getSmithyContext(context);
2196
2195
  const path = `/service/${service}/operation/${operation}`;
@@ -70,27 +70,27 @@ class HeaderMarshaller {
70
70
  formatHeaderValue(header) {
71
71
  switch (header.type) {
72
72
  case "boolean":
73
- return Uint8Array.from([header.value ? HEADER_VALUE_TYPE.boolTrue : HEADER_VALUE_TYPE.boolFalse]);
73
+ return Uint8Array.from([header.value ? 0 : 1]);
74
74
  case "byte":
75
- return Uint8Array.from([HEADER_VALUE_TYPE.byte, header.value]);
75
+ return Uint8Array.from([2, header.value]);
76
76
  case "short":
77
77
  const shortView = new DataView(new ArrayBuffer(3));
78
- shortView.setUint8(0, HEADER_VALUE_TYPE.short);
78
+ shortView.setUint8(0, 3);
79
79
  shortView.setInt16(1, header.value, false);
80
80
  return new Uint8Array(shortView.buffer);
81
81
  case "integer":
82
82
  const intView = new DataView(new ArrayBuffer(5));
83
- intView.setUint8(0, HEADER_VALUE_TYPE.integer);
83
+ intView.setUint8(0, 4);
84
84
  intView.setInt32(1, header.value, false);
85
85
  return new Uint8Array(intView.buffer);
86
86
  case "long":
87
87
  const longBytes = new Uint8Array(9);
88
- longBytes[0] = HEADER_VALUE_TYPE.long;
88
+ longBytes[0] = 5;
89
89
  longBytes.set(header.value.bytes, 1);
90
90
  return longBytes;
91
91
  case "binary":
92
92
  const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength));
93
- binView.setUint8(0, HEADER_VALUE_TYPE.byteArray);
93
+ binView.setUint8(0, 6);
94
94
  binView.setUint16(1, header.value.byteLength, false);
95
95
  const binBytes = new Uint8Array(binView.buffer);
96
96
  binBytes.set(header.value, 3);
@@ -98,14 +98,14 @@ class HeaderMarshaller {
98
98
  case "string":
99
99
  const utf8Bytes = this.fromUtf8(header.value);
100
100
  const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength));
101
- strView.setUint8(0, HEADER_VALUE_TYPE.string);
101
+ strView.setUint8(0, 7);
102
102
  strView.setUint16(1, utf8Bytes.byteLength, false);
103
103
  const strBytes = new Uint8Array(strView.buffer);
104
104
  strBytes.set(utf8Bytes, 3);
105
105
  return strBytes;
106
106
  case "timestamp":
107
107
  const tsBytes = new Uint8Array(9);
108
- tsBytes[0] = HEADER_VALUE_TYPE.timestamp;
108
+ tsBytes[0] = 8;
109
109
  tsBytes.set(Int64.fromNumber(header.value.valueOf()).bytes, 1);
110
110
  return tsBytes;
111
111
  case "uuid":
@@ -113,7 +113,7 @@ class HeaderMarshaller {
113
113
  throw new Error(`Invalid UUID received: ${header.value}`);
114
114
  }
115
115
  const uuidBytes = new Uint8Array(17);
116
- uuidBytes[0] = HEADER_VALUE_TYPE.uuid;
116
+ uuidBytes[0] = 9;
117
117
  uuidBytes.set(fromHex(header.value.replace(/-/g, "")), 1);
118
118
  return uuidBytes;
119
119
  }
@@ -126,46 +126,46 @@ class HeaderMarshaller {
126
126
  const name = this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, nameLength));
127
127
  position += nameLength;
128
128
  switch (headers.getUint8(position++)) {
129
- case HEADER_VALUE_TYPE.boolTrue:
129
+ case 0:
130
130
  out[name] = {
131
131
  type: BOOLEAN_TAG,
132
132
  value: true,
133
133
  };
134
134
  break;
135
- case HEADER_VALUE_TYPE.boolFalse:
135
+ case 1:
136
136
  out[name] = {
137
137
  type: BOOLEAN_TAG,
138
138
  value: false,
139
139
  };
140
140
  break;
141
- case HEADER_VALUE_TYPE.byte:
141
+ case 2:
142
142
  out[name] = {
143
143
  type: BYTE_TAG,
144
144
  value: headers.getInt8(position++),
145
145
  };
146
146
  break;
147
- case HEADER_VALUE_TYPE.short:
147
+ case 3:
148
148
  out[name] = {
149
149
  type: SHORT_TAG,
150
150
  value: headers.getInt16(position, false),
151
151
  };
152
152
  position += 2;
153
153
  break;
154
- case HEADER_VALUE_TYPE.integer:
154
+ case 4:
155
155
  out[name] = {
156
156
  type: INT_TAG,
157
157
  value: headers.getInt32(position, false),
158
158
  };
159
159
  position += 4;
160
160
  break;
161
- case HEADER_VALUE_TYPE.long:
161
+ case 5:
162
162
  out[name] = {
163
163
  type: LONG_TAG,
164
164
  value: new Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)),
165
165
  };
166
166
  position += 8;
167
167
  break;
168
- case HEADER_VALUE_TYPE.byteArray:
168
+ case 6:
169
169
  const binaryLength = headers.getUint16(position, false);
170
170
  position += 2;
171
171
  out[name] = {
@@ -174,7 +174,7 @@ class HeaderMarshaller {
174
174
  };
175
175
  position += binaryLength;
176
176
  break;
177
- case HEADER_VALUE_TYPE.string:
177
+ case 7:
178
178
  const stringLength = headers.getUint16(position, false);
179
179
  position += 2;
180
180
  out[name] = {
@@ -183,14 +183,14 @@ class HeaderMarshaller {
183
183
  };
184
184
  position += stringLength;
185
185
  break;
186
- case HEADER_VALUE_TYPE.timestamp:
186
+ case 8:
187
187
  out[name] = {
188
188
  type: TIMESTAMP_TAG,
189
189
  value: new Date(new Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)).valueOf()),
190
190
  };
191
191
  position += 8;
192
192
  break;
193
- case HEADER_VALUE_TYPE.uuid:
193
+ case 9:
194
194
  const uuidBytes = new Uint8Array(headers.buffer, headers.byteOffset + position, 16);
195
195
  position += 16;
196
196
  out[name] = {
@@ -601,7 +601,7 @@ class EventStreamSerde {
601
601
  this.defaultContentType = defaultContentType;
602
602
  this.compositeErrorRegistry = compositeErrorRegistry;
603
603
  }
604
- async serializeEventStream({ eventStream, requestSchema, initialRequest, }) {
604
+ async serializeEventStream({ eventStream, requestSchema, initialRequest, initialMessageType, }) {
605
605
  const marshaller = this.marshaller;
606
606
  const eventStreamMember = requestSchema.getEventStreamMember();
607
607
  const unionSchema = requestSchema.getMemberSchema(eventStreamMember);
@@ -612,7 +612,7 @@ class EventStreamSerde {
612
612
  async *[Symbol.asyncIterator]() {
613
613
  if (initialRequest) {
614
614
  const headers = {
615
- ":event-type": { type: "string", value: "initial-request" },
615
+ ":event-type": { type: "string", value: initialMessageType ?? "initial-request" },
616
616
  ":message-type": { type: "string", value: "event" },
617
617
  ":content-type": { type: "string", value: defaultContentType },
618
618
  };
@@ -656,7 +656,7 @@ class EventStreamSerde {
656
656
  };
657
657
  });
658
658
  }
659
- async deserializeEventStream({ response, responseSchema, initialResponseContainer, }) {
659
+ async deserializeEventStream({ response, responseSchema, initialResponseContainer, initialMessageType, }) {
660
660
  const marshaller = this.marshaller;
661
661
  const eventStreamMember = responseSchema.getEventStreamMember();
662
662
  const unionSchema = responseSchema.getMemberSchema(eventStreamMember);
@@ -671,7 +671,7 @@ class EventStreamSerde {
671
671
  }
672
672
  }
673
673
  const body = event[unionMember].body;
674
- if (unionMember === "initial-response") {
674
+ if (unionMember === (initialMessageType ?? "initial-response")) {
675
675
  const dataObject = await this.deserializer.read(responseSchema, body);
676
676
  delete dataObject[eventStreamMember];
677
677
  return {