@orkestrel/server 0.0.12 → 0.0.14
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.
|
@@ -1476,10 +1476,11 @@ export declare function serializeEvent(message: SSEMessage): string;
|
|
|
1476
1476
|
* - **Lifecycle (AGENTS §10).** `start(signal?)` builds the underlying `node:http`
|
|
1477
1477
|
* server, binds the configured {@link ServerOptions.host} / {@link
|
|
1478
1478
|
* ServerOptions.port} (omitted/`0` port ⇒ EPHEMERAL, resolved from the
|
|
1479
|
-
* bound address),
|
|
1480
|
-
* `timeouts.start` deadline while the
|
|
1481
|
-
* `idle → starting → listening`. A
|
|
1482
|
-
* partial server and resets to `idle` for
|
|
1479
|
+
* bound address), exposes that {@link AddressInfo} through `address`, observes
|
|
1480
|
+
* caller cancellation plus the configured `timeouts.start` deadline while the
|
|
1481
|
+
* bind is pending, and transitions `idle → starting → listening`. A
|
|
1482
|
+
* cancelled or expired bind closes its partial server and resets to `idle` for
|
|
1483
|
+
* another start. `stop()` transitions
|
|
1483
1484
|
* to `stopping`: refuses new connections, fires a fresh-per-run stop signal
|
|
1484
1485
|
* so in-flight handlers observe cancellation, drains in-flight requests AND
|
|
1485
1486
|
* claimed upgraded sockets up to the `drain` deadline (event-driven, no
|
|
@@ -1522,6 +1523,7 @@ export declare class Server<TState> implements ServerInterface<TState> {
|
|
|
1522
1523
|
constructor(options: ServerOptions<TState>);
|
|
1523
1524
|
get status(): ServerStatus;
|
|
1524
1525
|
get port(): number | undefined;
|
|
1526
|
+
get address(): AddressInfo | undefined;
|
|
1525
1527
|
get dispatcher(): DispatcherInterface<TState>;
|
|
1526
1528
|
get emitter(): EmitterInterface<ServerEventMap>;
|
|
1527
1529
|
use(middleware: MiddlewareHandler<TState>): void;
|
|
@@ -1594,9 +1596,10 @@ export declare type ServerEventMap = {
|
|
|
1594
1596
|
* `use` adds middleware and `upgrade` registers a protocol-upgrade claimant,
|
|
1595
1597
|
* both configurable before or after `start()`. `start(signal?)` binds the
|
|
1596
1598
|
* configured `host`/`port` (an omitted/`0` port ⇒ an EPHEMERAL port, resolved
|
|
1597
|
-
* from the bound address),
|
|
1598
|
-
*
|
|
1599
|
-
*
|
|
1599
|
+
* from the bound address), exposes that {@link AddressInfo} through `address`,
|
|
1600
|
+
* observes caller cancellation plus `timeouts.start` while binding, and resolves
|
|
1601
|
+
* the actually-bound port. A cancelled or expired bind closes its partial server
|
|
1602
|
+
* and resets to `idle`. `stop()` refuses new
|
|
1600
1603
|
* connections, fires the stop signal so in-flight handlers can observe it,
|
|
1601
1604
|
* drains in-flight requests and claimed upgraded sockets up to the configured
|
|
1602
1605
|
* deadline, then closes — forcing whatever is left. `destroy()` is the final
|
|
@@ -1611,6 +1614,8 @@ export declare interface ServerInterface<TState> {
|
|
|
1611
1614
|
readonly id: string;
|
|
1612
1615
|
readonly status: ServerStatus;
|
|
1613
1616
|
readonly port: number | undefined;
|
|
1617
|
+
/** The bound listener address, or `undefined` while no listener is active. */
|
|
1618
|
+
readonly address: AddressInfo | undefined;
|
|
1614
1619
|
readonly dispatcher: DispatcherInterface<TState>;
|
|
1615
1620
|
readonly emitter: EmitterInterface<ServerEventMap>;
|
|
1616
1621
|
use(middleware: MiddlewareHandler<TState>): void;
|
|
@@ -1476,10 +1476,11 @@ export declare function serializeEvent(message: SSEMessage): string;
|
|
|
1476
1476
|
* - **Lifecycle (AGENTS §10).** `start(signal?)` builds the underlying `node:http`
|
|
1477
1477
|
* server, binds the configured {@link ServerOptions.host} / {@link
|
|
1478
1478
|
* ServerOptions.port} (omitted/`0` port ⇒ EPHEMERAL, resolved from the
|
|
1479
|
-
* bound address),
|
|
1480
|
-
* `timeouts.start` deadline while the
|
|
1481
|
-
* `idle → starting → listening`. A
|
|
1482
|
-
* partial server and resets to `idle` for
|
|
1479
|
+
* bound address), exposes that {@link AddressInfo} through `address`, observes
|
|
1480
|
+
* caller cancellation plus the configured `timeouts.start` deadline while the
|
|
1481
|
+
* bind is pending, and transitions `idle → starting → listening`. A
|
|
1482
|
+
* cancelled or expired bind closes its partial server and resets to `idle` for
|
|
1483
|
+
* another start. `stop()` transitions
|
|
1483
1484
|
* to `stopping`: refuses new connections, fires a fresh-per-run stop signal
|
|
1484
1485
|
* so in-flight handlers observe cancellation, drains in-flight requests AND
|
|
1485
1486
|
* claimed upgraded sockets up to the `drain` deadline (event-driven, no
|
|
@@ -1522,6 +1523,7 @@ export declare class Server<TState> implements ServerInterface<TState> {
|
|
|
1522
1523
|
constructor(options: ServerOptions<TState>);
|
|
1523
1524
|
get status(): ServerStatus;
|
|
1524
1525
|
get port(): number | undefined;
|
|
1526
|
+
get address(): AddressInfo | undefined;
|
|
1525
1527
|
get dispatcher(): DispatcherInterface<TState>;
|
|
1526
1528
|
get emitter(): EmitterInterface<ServerEventMap>;
|
|
1527
1529
|
use(middleware: MiddlewareHandler<TState>): void;
|
|
@@ -1594,9 +1596,10 @@ export declare type ServerEventMap = {
|
|
|
1594
1596
|
* `use` adds middleware and `upgrade` registers a protocol-upgrade claimant,
|
|
1595
1597
|
* both configurable before or after `start()`. `start(signal?)` binds the
|
|
1596
1598
|
* configured `host`/`port` (an omitted/`0` port ⇒ an EPHEMERAL port, resolved
|
|
1597
|
-
* from the bound address),
|
|
1598
|
-
*
|
|
1599
|
-
*
|
|
1599
|
+
* from the bound address), exposes that {@link AddressInfo} through `address`,
|
|
1600
|
+
* observes caller cancellation plus `timeouts.start` while binding, and resolves
|
|
1601
|
+
* the actually-bound port. A cancelled or expired bind closes its partial server
|
|
1602
|
+
* and resets to `idle`. `stop()` refuses new
|
|
1600
1603
|
* connections, fires the stop signal so in-flight handlers can observe it,
|
|
1601
1604
|
* drains in-flight requests and claimed upgraded sockets up to the configured
|
|
1602
1605
|
* deadline, then closes — forcing whatever is left. `destroy()` is the final
|
|
@@ -1611,6 +1614,8 @@ export declare interface ServerInterface<TState> {
|
|
|
1611
1614
|
readonly id: string;
|
|
1612
1615
|
readonly status: ServerStatus;
|
|
1613
1616
|
readonly port: number | undefined;
|
|
1617
|
+
/** The bound listener address, or `undefined` while no listener is active. */
|
|
1618
|
+
readonly address: AddressInfo | undefined;
|
|
1614
1619
|
readonly dispatcher: DispatcherInterface<TState>;
|
|
1615
1620
|
readonly emitter: EmitterInterface<ServerEventMap>;
|
|
1616
1621
|
use(middleware: MiddlewareHandler<TState>): void;
|
package/dist/src/server/index.js
CHANGED
|
@@ -1781,10 +1781,11 @@ var Negotiator = class {
|
|
|
1781
1781
|
* - **Lifecycle (AGENTS §10).** `start(signal?)` builds the underlying `node:http`
|
|
1782
1782
|
* server, binds the configured {@link ServerOptions.host} / {@link
|
|
1783
1783
|
* ServerOptions.port} (omitted/`0` port ⇒ EPHEMERAL, resolved from the
|
|
1784
|
-
* bound address),
|
|
1785
|
-
* `timeouts.start` deadline while the
|
|
1786
|
-
* `idle → starting → listening`. A
|
|
1787
|
-
* partial server and resets to `idle` for
|
|
1784
|
+
* bound address), exposes that {@link AddressInfo} through `address`, observes
|
|
1785
|
+
* caller cancellation plus the configured `timeouts.start` deadline while the
|
|
1786
|
+
* bind is pending, and transitions `idle → starting → listening`. A
|
|
1787
|
+
* cancelled or expired bind closes its partial server and resets to `idle` for
|
|
1788
|
+
* another start. `stop()` transitions
|
|
1788
1789
|
* to `stopping`: refuses new connections, fires a fresh-per-run stop signal
|
|
1789
1790
|
* so in-flight handlers observe cancellation, drains in-flight requests AND
|
|
1790
1791
|
* claimed upgraded sockets up to the `drain` deadline (event-driven, no
|
|
@@ -1880,6 +1881,10 @@ var Server = class {
|
|
|
1880
1881
|
get port() {
|
|
1881
1882
|
return this.#port;
|
|
1882
1883
|
}
|
|
1884
|
+
get address() {
|
|
1885
|
+
const address = this.#http?.address();
|
|
1886
|
+
return isAddressInfo(address) ? address : void 0;
|
|
1887
|
+
}
|
|
1883
1888
|
get dispatcher() {
|
|
1884
1889
|
return this.#dispatcher;
|
|
1885
1890
|
}
|