@cosmonic-labs/openapi2mcp 0.10.0 → 0.10.2

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 (95) hide show
  1. package/dist/interfaces/wasi-cli-environment.d.ts +1 -1
  2. package/dist/interfaces/wasi-cli-exit.d.ts +1 -1
  3. package/dist/interfaces/wasi-cli-stderr.d.ts +1 -1
  4. package/dist/interfaces/wasi-cli-stdin.d.ts +1 -1
  5. package/dist/interfaces/wasi-cli-stdout.d.ts +1 -1
  6. package/dist/interfaces/wasi-cli-terminal-input.d.ts +1 -1
  7. package/dist/interfaces/wasi-cli-terminal-output.d.ts +1 -1
  8. package/dist/interfaces/wasi-cli-terminal-stderr.d.ts +1 -1
  9. package/dist/interfaces/wasi-cli-terminal-stdin.d.ts +1 -1
  10. package/dist/interfaces/wasi-cli-terminal-stdout.d.ts +1 -1
  11. package/dist/interfaces/wasi-clocks-monotonic-clock.d.ts +4 -0
  12. package/dist/interfaces/wasi-clocks-wall-clock.d.ts +1 -1
  13. package/dist/interfaces/wasi-filesystem-preopens.d.ts +1 -1
  14. package/dist/interfaces/wasi-filesystem-types.d.ts +1 -1
  15. package/dist/interfaces/wasi-io-error.d.ts +1 -1
  16. package/dist/interfaces/wasi-io-poll.d.ts +2 -1
  17. package/dist/interfaces/wasi-io-streams.d.ts +2 -2
  18. package/dist/interfaces/wasi-random-insecure-seed.d.ts +1 -1
  19. package/dist/openapi2mcp.core.wasm +0 -0
  20. package/dist/openapi2mcp.d.ts +18 -17
  21. package/dist/openapi2mcp.js +655 -359
  22. package/node_modules/@bytecodealliance/preview2-shim/LICENSE +220 -0
  23. package/node_modules/@bytecodealliance/preview2-shim/README.md +113 -0
  24. package/node_modules/@bytecodealliance/preview2-shim/lib/browser/cli.js +135 -0
  25. package/node_modules/@bytecodealliance/preview2-shim/lib/browser/clocks.js +39 -0
  26. package/node_modules/@bytecodealliance/preview2-shim/lib/browser/config.js +9 -0
  27. package/node_modules/@bytecodealliance/preview2-shim/lib/browser/environment.js +29 -0
  28. package/node_modules/@bytecodealliance/preview2-shim/lib/browser/filesystem.js +485 -0
  29. package/node_modules/@bytecodealliance/preview2-shim/lib/browser/http.js +707 -0
  30. package/node_modules/@bytecodealliance/preview2-shim/lib/browser/index.js +9 -0
  31. package/node_modules/@bytecodealliance/preview2-shim/lib/browser/io.js +262 -0
  32. package/node_modules/@bytecodealliance/preview2-shim/lib/browser/random.js +56 -0
  33. package/node_modules/@bytecodealliance/preview2-shim/lib/browser/sockets.js +88 -0
  34. package/node_modules/@bytecodealliance/preview2-shim/lib/common/instantiation.js +253 -0
  35. package/node_modules/@bytecodealliance/preview2-shim/lib/io/calls.js +128 -0
  36. package/node_modules/@bytecodealliance/preview2-shim/lib/io/worker-http.js +206 -0
  37. package/node_modules/@bytecodealliance/preview2-shim/lib/io/worker-io.js +468 -0
  38. package/node_modules/@bytecodealliance/preview2-shim/lib/io/worker-socket-tcp.js +331 -0
  39. package/node_modules/@bytecodealliance/preview2-shim/lib/io/worker-socket-udp.js +587 -0
  40. package/node_modules/@bytecodealliance/preview2-shim/lib/io/worker-sockets.js +364 -0
  41. package/node_modules/@bytecodealliance/preview2-shim/lib/io/worker-thread.js +1051 -0
  42. package/node_modules/@bytecodealliance/preview2-shim/lib/nodejs/cli.js +109 -0
  43. package/node_modules/@bytecodealliance/preview2-shim/lib/nodejs/clocks.js +67 -0
  44. package/node_modules/@bytecodealliance/preview2-shim/lib/nodejs/filesystem.js +829 -0
  45. package/node_modules/@bytecodealliance/preview2-shim/lib/nodejs/http.js +764 -0
  46. package/node_modules/@bytecodealliance/preview2-shim/lib/nodejs/index.js +9 -0
  47. package/node_modules/@bytecodealliance/preview2-shim/lib/nodejs/io.js +1 -0
  48. package/node_modules/@bytecodealliance/preview2-shim/lib/nodejs/random.js +49 -0
  49. package/node_modules/@bytecodealliance/preview2-shim/lib/nodejs/sockets.js +565 -0
  50. package/node_modules/@bytecodealliance/preview2-shim/lib/synckit/index.js +127 -0
  51. package/node_modules/@bytecodealliance/preview2-shim/package.json +65 -0
  52. package/node_modules/@bytecodealliance/preview2-shim/types/cli.d.ts +11 -0
  53. package/node_modules/@bytecodealliance/preview2-shim/types/clocks.d.ts +2 -0
  54. package/node_modules/@bytecodealliance/preview2-shim/types/filesystem.d.ts +29 -0
  55. package/node_modules/@bytecodealliance/preview2-shim/types/http.d.ts +3 -0
  56. package/node_modules/@bytecodealliance/preview2-shim/types/index.d.ts +6 -0
  57. package/node_modules/@bytecodealliance/preview2-shim/types/instantiation.d.ts +199 -0
  58. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-cli-environment.d.ts +21 -0
  59. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-cli-exit.d.ts +6 -0
  60. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-cli-run.d.ts +5 -0
  61. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-cli-stderr.d.ts +3 -0
  62. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-cli-stdin.d.ts +3 -0
  63. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-cli-stdout.d.ts +3 -0
  64. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-cli-terminal-input.d.ts +8 -0
  65. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-cli-terminal-output.d.ts +8 -0
  66. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-cli-terminal-stderr.d.ts +7 -0
  67. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-cli-terminal-stdin.d.ts +7 -0
  68. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-cli-terminal-stdout.d.ts +7 -0
  69. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-clocks-monotonic-clock.d.ts +34 -0
  70. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-clocks-wall-clock.d.ts +30 -0
  71. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-filesystem-preopens.d.ts +6 -0
  72. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-filesystem-types.d.ts +669 -0
  73. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-http-incoming-handler.d.ts +16 -0
  74. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-http-outgoing-handler.d.ts +18 -0
  75. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-http-types.d.ts +748 -0
  76. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-io-error.d.ts +18 -0
  77. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-io-poll.d.ts +44 -0
  78. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-io-streams.d.ts +243 -0
  79. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-random-insecure-seed.d.ts +21 -0
  80. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-random-insecure.d.ts +19 -0
  81. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-random-random.d.ts +23 -0
  82. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-sockets-instance-network.d.ts +6 -0
  83. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-sockets-ip-name-lookup.d.ts +58 -0
  84. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-sockets-network.d.ts +164 -0
  85. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-sockets-tcp-create-socket.d.ts +28 -0
  86. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-sockets-tcp.d.ts +359 -0
  87. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-sockets-udp-create-socket.d.ts +28 -0
  88. package/node_modules/@bytecodealliance/preview2-shim/types/interfaces/wasi-sockets-udp.d.ts +301 -0
  89. package/node_modules/@bytecodealliance/preview2-shim/types/io.d.ts +3 -0
  90. package/node_modules/@bytecodealliance/preview2-shim/types/random.d.ts +3 -0
  91. package/node_modules/@bytecodealliance/preview2-shim/types/sockets.d.ts +7 -0
  92. package/node_modules/@bytecodealliance/preview2-shim/types/wasi-cli-command.d.ts +29 -0
  93. package/node_modules/@bytecodealliance/preview2-shim/types/wasi-http-proxy.d.ts +13 -0
  94. package/package.json +9 -6
  95. package/patches/@bytecodealliance+preview2-shim+0.18.0.patch +13 -0
@@ -0,0 +1,301 @@
1
+ /** @module Interface wasi:sockets/udp@0.2.3 **/
2
+ export type Pollable = import('./wasi-io-poll.js').Pollable;
3
+ export type Network = import('./wasi-sockets-network.js').Network;
4
+ export type ErrorCode = import('./wasi-sockets-network.js').ErrorCode;
5
+ export type IpSocketAddress = import('./wasi-sockets-network.js').IpSocketAddress;
6
+ export type IpAddressFamily = import('./wasi-sockets-network.js').IpAddressFamily;
7
+ /**
8
+ * A received datagram.
9
+ */
10
+ export interface IncomingDatagram {
11
+ /**
12
+ * The payload.
13
+ *
14
+ * Theoretical max size: ~64 KiB. In practice, typically less than 1500 bytes.
15
+ */
16
+ data: Uint8Array,
17
+ /**
18
+ * The source address.
19
+ *
20
+ * This field is guaranteed to match the remote address the stream was initialized with, if any.
21
+ *
22
+ * Equivalent to the `src_addr` out parameter of `recvfrom`.
23
+ */
24
+ remoteAddress: IpSocketAddress,
25
+ }
26
+ /**
27
+ * A datagram to be sent out.
28
+ */
29
+ export interface OutgoingDatagram {
30
+ /**
31
+ * The payload.
32
+ */
33
+ data: Uint8Array,
34
+ /**
35
+ * The destination address.
36
+ *
37
+ * The requirements on this field depend on how the stream was initialized:
38
+ * - with a remote address: this field must be None or match the stream's remote address exactly.
39
+ * - without a remote address: this field is required.
40
+ *
41
+ * If this value is None, the send operation is equivalent to `send` in POSIX. Otherwise it is equivalent to `sendto`.
42
+ */
43
+ remoteAddress?: IpSocketAddress,
44
+ }
45
+
46
+ export class IncomingDatagramStream {
47
+ /**
48
+ * This type does not have a public constructor.
49
+ */
50
+ private constructor();
51
+ /**
52
+ * Receive messages on the socket.
53
+ *
54
+ * This function attempts to receive up to `max-results` datagrams on the socket without blocking.
55
+ * The returned list may contain fewer elements than requested, but never more.
56
+ *
57
+ * This function returns successfully with an empty list when either:
58
+ * - `max-results` is 0, or:
59
+ * - `max-results` is greater than 0, but no results are immediately available.
60
+ * This function never returns `error(would-block)`.
61
+ *
62
+ * # Typical errors
63
+ * - `remote-unreachable`: The remote address is not reachable. (ECONNRESET, ENETRESET on Windows, EHOSTUNREACH, EHOSTDOWN, ENETUNREACH, ENETDOWN, ENONET)
64
+ * - `connection-refused`: The connection was refused. (ECONNREFUSED)
65
+ *
66
+ * # References
67
+ * - <https://pubs.opengroup.org/onlinepubs/9699919799/functions/recvfrom.html>
68
+ * - <https://pubs.opengroup.org/onlinepubs/9699919799/functions/recvmsg.html>
69
+ * - <https://man7.org/linux/man-pages/man2/recv.2.html>
70
+ * - <https://man7.org/linux/man-pages/man2/recvmmsg.2.html>
71
+ * - <https://learn.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-recv>
72
+ * - <https://learn.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-recvfrom>
73
+ * - <https://learn.microsoft.com/en-us/previous-versions/windows/desktop/legacy/ms741687(v=vs.85)>
74
+ * - <https://man.freebsd.org/cgi/man.cgi?query=recv&sektion=2>
75
+ */
76
+ receive(maxResults: bigint): Array<IncomingDatagram>;
77
+ /**
78
+ * Create a `pollable` which will resolve once the stream is ready to receive again.
79
+ *
80
+ * Note: this function is here for WASI 0.2 only.
81
+ * It's planned to be removed when `future` is natively supported in Preview3.
82
+ */
83
+ subscribe(): Pollable;
84
+ }
85
+
86
+ export class OutgoingDatagramStream {
87
+ /**
88
+ * This type does not have a public constructor.
89
+ */
90
+ private constructor();
91
+ /**
92
+ * Check readiness for sending. This function never blocks.
93
+ *
94
+ * Returns the number of datagrams permitted for the next call to `send`,
95
+ * or an error. Calling `send` with more datagrams than this function has
96
+ * permitted will trap.
97
+ *
98
+ * When this function returns ok(0), the `subscribe` pollable will
99
+ * become ready when this function will report at least ok(1), or an
100
+ * error.
101
+ *
102
+ * Never returns `would-block`.
103
+ */
104
+ checkSend(): bigint;
105
+ /**
106
+ * Send messages on the socket.
107
+ *
108
+ * This function attempts to send all provided `datagrams` on the socket without blocking and
109
+ * returns how many messages were actually sent (or queued for sending). This function never
110
+ * returns `error(would-block)`. If none of the datagrams were able to be sent, `ok(0)` is returned.
111
+ *
112
+ * This function semantically behaves the same as iterating the `datagrams` list and sequentially
113
+ * sending each individual datagram until either the end of the list has been reached or the first error occurred.
114
+ * If at least one datagram has been sent successfully, this function never returns an error.
115
+ *
116
+ * If the input list is empty, the function returns `ok(0)`.
117
+ *
118
+ * Each call to `send` must be permitted by a preceding `check-send`. Implementations must trap if
119
+ * either `check-send` was not called or `datagrams` contains more items than `check-send` permitted.
120
+ *
121
+ * # Typical errors
122
+ * - `invalid-argument`: The `remote-address` has the wrong address family. (EAFNOSUPPORT)
123
+ * - `invalid-argument`: The IP address in `remote-address` is set to INADDR_ANY (`0.0.0.0` / `::`). (EDESTADDRREQ, EADDRNOTAVAIL)
124
+ * - `invalid-argument`: The port in `remote-address` is set to 0. (EDESTADDRREQ, EADDRNOTAVAIL)
125
+ * - `invalid-argument`: The socket is in "connected" mode and `remote-address` is `some` value that does not match the address passed to `stream`. (EISCONN)
126
+ * - `invalid-argument`: The socket is not "connected" and no value for `remote-address` was provided. (EDESTADDRREQ)
127
+ * - `remote-unreachable`: The remote address is not reachable. (ECONNRESET, ENETRESET on Windows, EHOSTUNREACH, EHOSTDOWN, ENETUNREACH, ENETDOWN, ENONET)
128
+ * - `connection-refused`: The connection was refused. (ECONNREFUSED)
129
+ * - `datagram-too-large`: The datagram is too large. (EMSGSIZE)
130
+ *
131
+ * # References
132
+ * - <https://pubs.opengroup.org/onlinepubs/9699919799/functions/sendto.html>
133
+ * - <https://pubs.opengroup.org/onlinepubs/9699919799/functions/sendmsg.html>
134
+ * - <https://man7.org/linux/man-pages/man2/send.2.html>
135
+ * - <https://man7.org/linux/man-pages/man2/sendmmsg.2.html>
136
+ * - <https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-send>
137
+ * - <https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-sendto>
138
+ * - <https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsasendmsg>
139
+ * - <https://man.freebsd.org/cgi/man.cgi?query=send&sektion=2>
140
+ */
141
+ send(datagrams: Array<OutgoingDatagram>): bigint;
142
+ /**
143
+ * Create a `pollable` which will resolve once the stream is ready to send again.
144
+ *
145
+ * Note: this function is here for WASI 0.2 only.
146
+ * It's planned to be removed when `future` is natively supported in Preview3.
147
+ */
148
+ subscribe(): Pollable;
149
+ }
150
+
151
+ export class UdpSocket {
152
+ /**
153
+ * This type does not have a public constructor.
154
+ */
155
+ private constructor();
156
+ /**
157
+ * Bind the socket to a specific network on the provided IP address and port.
158
+ *
159
+ * If the IP address is zero (`0.0.0.0` in IPv4, `::` in IPv6), it is left to the implementation to decide which
160
+ * network interface(s) to bind to.
161
+ * If the port is zero, the socket will be bound to a random free port.
162
+ *
163
+ * # Typical errors
164
+ * - `invalid-argument`: The `local-address` has the wrong address family. (EAFNOSUPPORT, EFAULT on Windows)
165
+ * - `invalid-state`: The socket is already bound. (EINVAL)
166
+ * - `address-in-use`: No ephemeral ports available. (EADDRINUSE, ENOBUFS on Windows)
167
+ * - `address-in-use`: Address is already in use. (EADDRINUSE)
168
+ * - `address-not-bindable`: `local-address` is not an address that the `network` can bind to. (EADDRNOTAVAIL)
169
+ * - `not-in-progress`: A `bind` operation is not in progress.
170
+ * - `would-block`: Can't finish the operation, it is still in progress. (EWOULDBLOCK, EAGAIN)
171
+ *
172
+ * # Implementors note
173
+ * Unlike in POSIX, in WASI the bind operation is async. This enables
174
+ * interactive WASI hosts to inject permission prompts. Runtimes that
175
+ * don't want to make use of this ability can simply call the native
176
+ * `bind` as part of either `start-bind` or `finish-bind`.
177
+ *
178
+ * # References
179
+ * - <https://pubs.opengroup.org/onlinepubs/9699919799/functions/bind.html>
180
+ * - <https://man7.org/linux/man-pages/man2/bind.2.html>
181
+ * - <https://learn.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-bind>
182
+ * - <https://man.freebsd.org/cgi/man.cgi?query=bind&sektion=2&format=html>
183
+ */
184
+ startBind(network: Network, localAddress: IpSocketAddress): void;
185
+ finishBind(): void;
186
+ /**
187
+ * Set up inbound & outbound communication channels, optionally to a specific peer.
188
+ *
189
+ * This function only changes the local socket configuration and does not generate any network traffic.
190
+ * On success, the `remote-address` of the socket is updated. The `local-address` may be updated as well,
191
+ * based on the best network path to `remote-address`.
192
+ *
193
+ * When a `remote-address` is provided, the returned streams are limited to communicating with that specific peer:
194
+ * - `send` can only be used to send to this destination.
195
+ * - `receive` will only return datagrams sent from the provided `remote-address`.
196
+ *
197
+ * This method may be called multiple times on the same socket to change its association, but
198
+ * only the most recently returned pair of streams will be operational. Implementations may trap if
199
+ * the streams returned by a previous invocation haven't been dropped yet before calling `stream` again.
200
+ *
201
+ * The POSIX equivalent in pseudo-code is:
202
+ * ```text
203
+ * if (was previously connected) {
204
+ * connect(s, AF_UNSPEC)
205
+ * }
206
+ * if (remote_address is Some) {
207
+ * connect(s, remote_address)
208
+ * }
209
+ * ```
210
+ *
211
+ * Unlike in POSIX, the socket must already be explicitly bound.
212
+ *
213
+ * # Typical errors
214
+ * - `invalid-argument`: The `remote-address` has the wrong address family. (EAFNOSUPPORT)
215
+ * - `invalid-argument`: The IP address in `remote-address` is set to INADDR_ANY (`0.0.0.0` / `::`). (EDESTADDRREQ, EADDRNOTAVAIL)
216
+ * - `invalid-argument`: The port in `remote-address` is set to 0. (EDESTADDRREQ, EADDRNOTAVAIL)
217
+ * - `invalid-state`: The socket is not bound.
218
+ * - `address-in-use`: Tried to perform an implicit bind, but there were no ephemeral ports available. (EADDRINUSE, EADDRNOTAVAIL on Linux, EAGAIN on BSD)
219
+ * - `remote-unreachable`: The remote address is not reachable. (ECONNRESET, ENETRESET, EHOSTUNREACH, EHOSTDOWN, ENETUNREACH, ENETDOWN, ENONET)
220
+ * - `connection-refused`: The connection was refused. (ECONNREFUSED)
221
+ *
222
+ * # References
223
+ * - <https://pubs.opengroup.org/onlinepubs/9699919799/functions/connect.html>
224
+ * - <https://man7.org/linux/man-pages/man2/connect.2.html>
225
+ * - <https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-connect>
226
+ * - <https://man.freebsd.org/cgi/man.cgi?connect>
227
+ */
228
+ stream(remoteAddress: IpSocketAddress | undefined): [IncomingDatagramStream, OutgoingDatagramStream];
229
+ /**
230
+ * Get the current bound address.
231
+ *
232
+ * POSIX mentions:
233
+ * > If the socket has not been bound to a local name, the value
234
+ * > stored in the object pointed to by `address` is unspecified.
235
+ *
236
+ * WASI is stricter and requires `local-address` to return `invalid-state` when the socket hasn't been bound yet.
237
+ *
238
+ * # Typical errors
239
+ * - `invalid-state`: The socket is not bound to any local address.
240
+ *
241
+ * # References
242
+ * - <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsockname.html>
243
+ * - <https://man7.org/linux/man-pages/man2/getsockname.2.html>
244
+ * - <https://learn.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-getsockname>
245
+ * - <https://man.freebsd.org/cgi/man.cgi?getsockname>
246
+ */
247
+ localAddress(): IpSocketAddress;
248
+ /**
249
+ * Get the address the socket is currently streaming to.
250
+ *
251
+ * # Typical errors
252
+ * - `invalid-state`: The socket is not streaming to a specific remote address. (ENOTCONN)
253
+ *
254
+ * # References
255
+ * - <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpeername.html>
256
+ * - <https://man7.org/linux/man-pages/man2/getpeername.2.html>
257
+ * - <https://learn.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-getpeername>
258
+ * - <https://man.freebsd.org/cgi/man.cgi?query=getpeername&sektion=2&n=1>
259
+ */
260
+ remoteAddress(): IpSocketAddress;
261
+ /**
262
+ * Whether this is a IPv4 or IPv6 socket.
263
+ *
264
+ * Equivalent to the SO_DOMAIN socket option.
265
+ */
266
+ addressFamily(): IpAddressFamily;
267
+ /**
268
+ * Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options.
269
+ *
270
+ * If the provided value is 0, an `invalid-argument` error is returned.
271
+ *
272
+ * # Typical errors
273
+ * - `invalid-argument`: (set) The TTL value must be 1 or higher.
274
+ */
275
+ unicastHopLimit(): number;
276
+ setUnicastHopLimit(value: number): void;
277
+ /**
278
+ * The kernel buffer space reserved for sends/receives on this socket.
279
+ *
280
+ * If the provided value is 0, an `invalid-argument` error is returned.
281
+ * Any other value will never cause an error, but it might be silently clamped and/or rounded.
282
+ * I.e. after setting a value, reading the same setting back may return a different value.
283
+ *
284
+ * Equivalent to the SO_RCVBUF and SO_SNDBUF socket options.
285
+ *
286
+ * # Typical errors
287
+ * - `invalid-argument`: (set) The provided value was 0.
288
+ */
289
+ receiveBufferSize(): bigint;
290
+ setReceiveBufferSize(value: bigint): void;
291
+ sendBufferSize(): bigint;
292
+ setSendBufferSize(value: bigint): void;
293
+ /**
294
+ * Create a `pollable` which will resolve once the socket is ready for I/O.
295
+ *
296
+ * Note: this function is here for WASI 0.2 only.
297
+ * It's planned to be removed when `future` is natively supported in Preview3.
298
+ */
299
+ subscribe(): Pollable;
300
+ }
301
+
@@ -0,0 +1,3 @@
1
+ export type * as error from './interfaces/wasi-io-error.d.ts';
2
+ export type * as poll from './interfaces/wasi-io-poll.d.ts';
3
+ export type * as streams from './interfaces/wasi-io-streams.d.ts';
@@ -0,0 +1,3 @@
1
+ export type * as insecureSeed from './interfaces/wasi-random-insecure-seed.d.ts';
2
+ export type * as insecure from './interfaces/wasi-random-insecure.d.ts';
3
+ export type * as random from './interfaces/wasi-random-random.d.ts';
@@ -0,0 +1,7 @@
1
+ export type * as instanceNetwork from './interfaces/wasi-sockets-instance-network.d.ts';
2
+ export type * as ipNameLookup from './interfaces/wasi-sockets-ip-name-lookup.d.ts';
3
+ export type * as network from './interfaces/wasi-sockets-network.d.ts';
4
+ export type * as tcpCreateSocket from './interfaces/wasi-sockets-tcp-create-socket.d.ts';
5
+ export type * as tcp from './interfaces/wasi-sockets-tcp.d.ts';
6
+ export type * as udpCreateSocket from './interfaces/wasi-sockets-udp-create-socket.d.ts';
7
+ export type * as udp from './interfaces/wasi-sockets-udp.d.ts';
@@ -0,0 +1,29 @@
1
+ // world wasi:cli/command@0.2.3
2
+ export type * as WasiCliEnvironment023 from './interfaces/wasi-cli-environment.js'; // import wasi:cli/environment@0.2.3
3
+ export type * as WasiCliExit023 from './interfaces/wasi-cli-exit.js'; // import wasi:cli/exit@0.2.3
4
+ export type * as WasiCliStderr023 from './interfaces/wasi-cli-stderr.js'; // import wasi:cli/stderr@0.2.3
5
+ export type * as WasiCliStdin023 from './interfaces/wasi-cli-stdin.js'; // import wasi:cli/stdin@0.2.3
6
+ export type * as WasiCliStdout023 from './interfaces/wasi-cli-stdout.js'; // import wasi:cli/stdout@0.2.3
7
+ export type * as WasiCliTerminalInput023 from './interfaces/wasi-cli-terminal-input.js'; // import wasi:cli/terminal-input@0.2.3
8
+ export type * as WasiCliTerminalOutput023 from './interfaces/wasi-cli-terminal-output.js'; // import wasi:cli/terminal-output@0.2.3
9
+ export type * as WasiCliTerminalStderr023 from './interfaces/wasi-cli-terminal-stderr.js'; // import wasi:cli/terminal-stderr@0.2.3
10
+ export type * as WasiCliTerminalStdin023 from './interfaces/wasi-cli-terminal-stdin.js'; // import wasi:cli/terminal-stdin@0.2.3
11
+ export type * as WasiCliTerminalStdout023 from './interfaces/wasi-cli-terminal-stdout.js'; // import wasi:cli/terminal-stdout@0.2.3
12
+ export type * as WasiClocksMonotonicClock023 from './interfaces/wasi-clocks-monotonic-clock.js'; // import wasi:clocks/monotonic-clock@0.2.3
13
+ export type * as WasiClocksWallClock023 from './interfaces/wasi-clocks-wall-clock.js'; // import wasi:clocks/wall-clock@0.2.3
14
+ export type * as WasiFilesystemPreopens023 from './interfaces/wasi-filesystem-preopens.js'; // import wasi:filesystem/preopens@0.2.3
15
+ export type * as WasiFilesystemTypes023 from './interfaces/wasi-filesystem-types.js'; // import wasi:filesystem/types@0.2.3
16
+ export type * as WasiIoError023 from './interfaces/wasi-io-error.js'; // import wasi:io/error@0.2.3
17
+ export type * as WasiIoPoll023 from './interfaces/wasi-io-poll.js'; // import wasi:io/poll@0.2.3
18
+ export type * as WasiIoStreams023 from './interfaces/wasi-io-streams.js'; // import wasi:io/streams@0.2.3
19
+ export type * as WasiRandomInsecureSeed023 from './interfaces/wasi-random-insecure-seed.js'; // import wasi:random/insecure-seed@0.2.3
20
+ export type * as WasiRandomInsecure023 from './interfaces/wasi-random-insecure.js'; // import wasi:random/insecure@0.2.3
21
+ export type * as WasiRandomRandom023 from './interfaces/wasi-random-random.js'; // import wasi:random/random@0.2.3
22
+ export type * as WasiSocketsInstanceNetwork023 from './interfaces/wasi-sockets-instance-network.js'; // import wasi:sockets/instance-network@0.2.3
23
+ export type * as WasiSocketsIpNameLookup023 from './interfaces/wasi-sockets-ip-name-lookup.js'; // import wasi:sockets/ip-name-lookup@0.2.3
24
+ export type * as WasiSocketsNetwork023 from './interfaces/wasi-sockets-network.js'; // import wasi:sockets/network@0.2.3
25
+ export type * as WasiSocketsTcpCreateSocket023 from './interfaces/wasi-sockets-tcp-create-socket.js'; // import wasi:sockets/tcp-create-socket@0.2.3
26
+ export type * as WasiSocketsTcp023 from './interfaces/wasi-sockets-tcp.js'; // import wasi:sockets/tcp@0.2.3
27
+ export type * as WasiSocketsUdpCreateSocket023 from './interfaces/wasi-sockets-udp-create-socket.js'; // import wasi:sockets/udp-create-socket@0.2.3
28
+ export type * as WasiSocketsUdp023 from './interfaces/wasi-sockets-udp.js'; // import wasi:sockets/udp@0.2.3
29
+ export * as run from './interfaces/wasi-cli-run.js'; // export wasi:cli/run@0.2.3
@@ -0,0 +1,13 @@
1
+ // world wasi:http/proxy@0.2.3
2
+ export type * as WasiCliStderr023 from './interfaces/wasi-cli-stderr.js'; // import wasi:cli/stderr@0.2.3
3
+ export type * as WasiCliStdin023 from './interfaces/wasi-cli-stdin.js'; // import wasi:cli/stdin@0.2.3
4
+ export type * as WasiCliStdout023 from './interfaces/wasi-cli-stdout.js'; // import wasi:cli/stdout@0.2.3
5
+ export type * as WasiClocksMonotonicClock023 from './interfaces/wasi-clocks-monotonic-clock.js'; // import wasi:clocks/monotonic-clock@0.2.3
6
+ export type * as WasiClocksWallClock023 from './interfaces/wasi-clocks-wall-clock.js'; // import wasi:clocks/wall-clock@0.2.3
7
+ export type * as WasiHttpOutgoingHandler023 from './interfaces/wasi-http-outgoing-handler.js'; // import wasi:http/outgoing-handler@0.2.3
8
+ export type * as WasiHttpTypes023 from './interfaces/wasi-http-types.js'; // import wasi:http/types@0.2.3
9
+ export type * as WasiIoError023 from './interfaces/wasi-io-error.js'; // import wasi:io/error@0.2.3
10
+ export type * as WasiIoPoll023 from './interfaces/wasi-io-poll.js'; // import wasi:io/poll@0.2.3
11
+ export type * as WasiIoStreams023 from './interfaces/wasi-io-streams.js'; // import wasi:io/streams@0.2.3
12
+ export type * as WasiRandomRandom023 from './interfaces/wasi-random-random.js'; // import wasi:random/random@0.2.3
13
+ export * as incomingHandler from './interfaces/wasi-http-incoming-handler.js'; // export wasi:http/incoming-handler@0.2.3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmonic-labs/openapi2mcp",
3
- "version": "0.10.0",
3
+ "version": "0.10.2",
4
4
  "description": "Generate MCP servers from OpenAPI specs. Works with https://github.com/cosmonic-labs/mcp-server-template-ts",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -10,14 +10,15 @@
10
10
  "build:wasm": "cargo build --target wasm32-wasip2 --release",
11
11
  "build:jco": "jco transpile ./target/wasm32-wasip2/release/openapi2mcp.wasm -o dist",
12
12
  "build": "npm run build:wasm && npm run build:jco",
13
- "postinstall": "patch-package"
13
+ "prepare": "patch-package --error-on-fail"
14
14
  },
15
15
  "bin": {
16
16
  "openapi2mcp": "index.js"
17
17
  },
18
18
  "files": [
19
19
  "dist",
20
- "index.js"
20
+ "index.js",
21
+ "patches"
21
22
  ],
22
23
  "type": "module",
23
24
  "repository": {
@@ -35,7 +36,9 @@
35
36
  },
36
37
  "devDependencies": {
37
38
  "@bytecodealliance/jco": "^1.19.0",
38
- "patch-package": "^8.0.1",
39
- "postinstall-postinstall": "^2.1.0"
40
- }
39
+ "patch-package": "^8.0.1"
40
+ },
41
+ "bundleDependencies": [
42
+ "@bytecodealliance/preview2-shim"
43
+ ]
41
44
  }
@@ -0,0 +1,13 @@
1
+ diff --git a/node_modules/@bytecodealliance/preview2-shim/lib/nodejs/filesystem.js b/node_modules/@bytecodealliance/preview2-shim/lib/nodejs/filesystem.js
2
+ index 0000000..0000000 100644
3
+ --- a/node_modules/@bytecodealliance/preview2-shim/lib/nodejs/filesystem.js
4
+ +++ b/node_modules/@bytecodealliance/preview2-shim/lib/nodejs/filesystem.js
5
+ @@ -385,7 +385,7 @@
6
+ if (!pathFlags.symlinkFollow) {
7
+ fsOpenFlags |= constants.O_NOFOLLOW;
8
+ }
9
+ - if (descriptorFlags.requestedWriteSync || descriptorFlags.mutateDirectory) {
10
+ + if (descriptorFlags.requestedWriteSync) {
11
+ throw "unsupported";
12
+ }
13
+ // Currently throw to match Wasmtime