agentfootprint 7.24.0 → 7.25.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.
Files changed (71) hide show
  1. package/dist/adapters/hosting/agentcore.js +112 -1
  2. package/dist/adapters/hosting/agentcore.js.map +1 -1
  3. package/dist/esm/adapters/hosting/agentcore.d.ts +50 -1
  4. package/dist/esm/adapters/hosting/agentcore.js +110 -0
  5. package/dist/esm/adapters/hosting/agentcore.js.map +1 -1
  6. package/dist/esm/hosting/errors.d.ts +44 -2
  7. package/dist/esm/hosting/errors.js +63 -0
  8. package/dist/esm/hosting/errors.js.map +1 -1
  9. package/dist/esm/hosting/headers.d.ts +16 -0
  10. package/dist/esm/hosting/headers.js +24 -0
  11. package/dist/esm/hosting/headers.js.map +1 -0
  12. package/dist/esm/hosting/httpHost.d.ts +70 -4
  13. package/dist/esm/hosting/httpHost.js +211 -47
  14. package/dist/esm/hosting/httpHost.js.map +1 -1
  15. package/dist/esm/hosting/index.d.ts +23 -8
  16. package/dist/esm/hosting/index.js +21 -6
  17. package/dist/esm/hosting/index.js.map +1 -1
  18. package/dist/esm/hosting/nodeHost.d.ts +23 -0
  19. package/dist/esm/hosting/nodeHost.js +21 -1
  20. package/dist/esm/hosting/nodeHost.js.map +1 -1
  21. package/dist/esm/hosting/types.d.ts +212 -6
  22. package/dist/esm/hosting/types.js +7 -5
  23. package/dist/esm/hosting/types.js.map +1 -1
  24. package/dist/esm/hosting/webSocketConversation.d.ts +101 -0
  25. package/dist/esm/hosting/webSocketConversation.js +341 -0
  26. package/dist/esm/hosting/webSocketConversation.js.map +1 -0
  27. package/dist/esm/hosting/webSocketFrames.d.ts +164 -0
  28. package/dist/esm/hosting/webSocketFrames.js +284 -0
  29. package/dist/esm/hosting/webSocketFrames.js.map +1 -0
  30. package/dist/esm/hosting-providers.d.ts +7 -2
  31. package/dist/esm/hosting-providers.js +7 -2
  32. package/dist/esm/hosting-providers.js.map +1 -1
  33. package/dist/hosting/errors.js +66 -1
  34. package/dist/hosting/errors.js.map +1 -1
  35. package/dist/hosting/headers.js +28 -0
  36. package/dist/hosting/headers.js.map +1 -0
  37. package/dist/hosting/httpHost.js +211 -47
  38. package/dist/hosting/httpHost.js.map +1 -1
  39. package/dist/hosting/index.js +23 -6
  40. package/dist/hosting/index.js.map +1 -1
  41. package/dist/hosting/nodeHost.js +20 -0
  42. package/dist/hosting/nodeHost.js.map +1 -1
  43. package/dist/hosting/types.js +7 -5
  44. package/dist/hosting/types.js.map +1 -1
  45. package/dist/hosting/webSocketConversation.js +345 -0
  46. package/dist/hosting/webSocketConversation.js.map +1 -0
  47. package/dist/hosting/webSocketFrames.js +297 -0
  48. package/dist/hosting/webSocketFrames.js.map +1 -0
  49. package/dist/hosting-providers.js +8 -2
  50. package/dist/hosting-providers.js.map +1 -1
  51. package/dist/types/adapters/hosting/agentcore.d.ts +50 -1
  52. package/dist/types/adapters/hosting/agentcore.d.ts.map +1 -1
  53. package/dist/types/hosting/errors.d.ts +44 -2
  54. package/dist/types/hosting/errors.d.ts.map +1 -1
  55. package/dist/types/hosting/headers.d.ts +17 -0
  56. package/dist/types/hosting/headers.d.ts.map +1 -0
  57. package/dist/types/hosting/httpHost.d.ts +70 -4
  58. package/dist/types/hosting/httpHost.d.ts.map +1 -1
  59. package/dist/types/hosting/index.d.ts +23 -8
  60. package/dist/types/hosting/index.d.ts.map +1 -1
  61. package/dist/types/hosting/nodeHost.d.ts +23 -0
  62. package/dist/types/hosting/nodeHost.d.ts.map +1 -1
  63. package/dist/types/hosting/types.d.ts +212 -6
  64. package/dist/types/hosting/types.d.ts.map +1 -1
  65. package/dist/types/hosting/webSocketConversation.d.ts +102 -0
  66. package/dist/types/hosting/webSocketConversation.d.ts.map +1 -0
  67. package/dist/types/hosting/webSocketFrames.d.ts +165 -0
  68. package/dist/types/hosting/webSocketFrames.d.ts.map +1 -0
  69. package/dist/types/hosting-providers.d.ts +7 -2
  70. package/dist/types/hosting-providers.d.ts.map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AI,GAAG,yBAAyB,CAAC;QACtC,IAAI,SAAS,KAAK,SAAS;YAAE,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QACxD,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC;IAC/B,CAAC;IAED;;;;;;;OAOG;IACH,WAAW,CAAC,SAAiB;QAC3B,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS;YAAE,OAAO,IAAI,CAAC;QAC9C,MAAM,KAAK,GAAG,IAAI,uBAAuB,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,SAAS,CAAC,CAAC;QAC5F,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC;QACnB,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,iBAAiB,CAC/B,IAAkC,EAClC,UAA0B;IAE1B,IAAI,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC;QAAE,OAAO;IACnD,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IACjF,MAAM,IAAI,KAAK,CACb,kBAAkB,IAAI,CAAC,IAAI,4BAA4B,UAAU,KAAK;QACpE,eAAe,GAAG,wBAAwB;QAC1C,+BAA+B,UAAU,uCAAuC;QAChF,oFAAoF,CACvF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * hosting/headers — one lower-casing of one header bag, shared by every door.
3
+ *
4
+ * A six-line helper gets its own file for the reason every other shared piece
5
+ * in this folder does: two copies of it is how the request door and the
6
+ * conversation door end up disagreeing about whether a header the caller sent
7
+ * as `X-Session-Id` is present, and that disagreement would surface as one door
8
+ * seeing a session the other cannot.
9
+ */
10
+ /// <reference types="node" />
11
+ import type { IncomingMessage } from 'node:http';
12
+ /**
13
+ * Header names lower-cased, repeated values joined — the shape every wire reads
14
+ * from, so no wire ever has to guess at casing.
15
+ */
16
+ export declare function lowerCasedHeaders(headers: IncomingMessage['headers']): Record<string, string>;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * hosting/headers — one lower-casing of one header bag, shared by every door.
3
+ *
4
+ * A six-line helper gets its own file for the reason every other shared piece
5
+ * in this folder does: two copies of it is how the request door and the
6
+ * conversation door end up disagreeing about whether a header the caller sent
7
+ * as `X-Session-Id` is present, and that disagreement would surface as one door
8
+ * seeing a session the other cannot.
9
+ */
10
+ /**
11
+ * Header names lower-cased, repeated values joined — the shape every wire reads
12
+ * from, so no wire ever has to guess at casing.
13
+ */
14
+ export function lowerCasedHeaders(headers) {
15
+ const out = {};
16
+ for (const [name, value] of Object.entries(headers)) {
17
+ if (typeof value === 'string')
18
+ out[name.toLowerCase()] = value;
19
+ else if (Array.isArray(value))
20
+ out[name.toLowerCase()] = value.join(', ');
21
+ }
22
+ return out;
23
+ }
24
+ //# sourceMappingURL=headers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"headers.js","sourceRoot":"","sources":["../../../src/hosting/headers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAmC;IACnE,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QACpD,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,GAAG,KAAK,CAAC;aAC1D,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;YAAE,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5E,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -34,12 +34,28 @@
34
34
  * detaches and drains without closing a socket it never opened. That is the
35
35
  * whole difference; every other law on this page is the same either way.
36
36
  *
37
+ * ── The third door: a conversation ───────────────────────────────────────────
38
+ * `serveConversations(handler)` sits beside `serve(handler)` and takes upgrades
39
+ * on `conversationPath`, because `HostRequest → HostReply` is one exchange and
40
+ * some doors are not. Give a host a `conversationPath` and it declares
41
+ * `'conversation'`; leave it out and `serveConversations` refuses by name.
42
+ *
43
+ * **Both doors share ONE socket.** That is not an optimisation, it is the
44
+ * premise: the runtimes that need a conversation are the ones that hand a
45
+ * container exactly one port, so a host whose two doors each bound their own
46
+ * would fail with `EADDRINUSE` on the deployment it exists for. On a private
47
+ * socket the server is created by whichever door opens first and closed by
48
+ * whichever closes last; on a caller-owned one each door attaches and detaches
49
+ * its own listener and neither touches the socket.
50
+ *
37
51
  * Pattern: Template method via configuration (Strategy on the wire format).
38
52
  * Everything HTTP lives here and in the wires; `types.ts` knows none of it.
39
53
  */
40
54
  /// <reference types="node" />
41
55
  import type { Server } from 'node:http';
42
- import type { AgentHost, HostCapability, HostHandle, HostHandler, PendingAsk } from './types.js';
56
+ import type { AgentHost, ConversationHandler, ConversationHost, ConversationLimits, HostCapability, HostHandle, HostHandler, PendingAsk } from './types.js';
57
+ import { type ConversationHandshake, type HandshakeFacts } from './webSocketConversation.js';
58
+ export type { ConversationHandshake, HandshakeFacts };
43
59
  /** Everything a {@link HttpWire} may read when pulling a request apart. */
44
60
  export interface HttpRequestFacts {
45
61
  /** The parsed JSON body, or `{}` for an empty one. */
@@ -93,6 +109,17 @@ export interface HttpWire {
93
109
  * either way.
94
110
  */
95
111
  awaiting?(pending: PendingAsk): unknown;
112
+ /**
113
+ * Pull the port's vocabulary out of one conversation handshake — the session
114
+ * this conversation claims, any header mapping this dialect performs, and the
115
+ * subprotocol to echo.
116
+ *
117
+ * Optional, and absent means "raw headers, no session": there is no body in a
118
+ * handshake, so a dialect that wants a session id has to name where it looks,
119
+ * and guessing on its behalf would invent an affinity rule the deployment
120
+ * never agreed to.
121
+ */
122
+ readConversation?(facts: HandshakeFacts): ConversationHandshake;
96
123
  }
97
124
  /** Options for {@link httpHost}. */
98
125
  export interface HttpHostOptions {
@@ -161,6 +188,31 @@ export interface HttpHostOptions {
161
188
  * await handle.close();
162
189
  */
163
190
  readonly server?: Server;
191
+ /**
192
+ * Path that takes a conversation upgrade.
193
+ *
194
+ * **No default, for exactly the reason `invokePath` has none** — a default
195
+ * here is inherited by every adapter built on this file, and one that
196
+ * silently matched somebody's runtime contract is that runtime leaking into a
197
+ * library that promises not to know about one.
198
+ *
199
+ * ABSENT is meaningful: the host does not declare `'conversation'` and
200
+ * {@link HttpHost.serveConversations} refuses by name. Present, and the host
201
+ * can carry conversations whether or not anybody serves them.
202
+ */
203
+ readonly conversationPath?: string;
204
+ /**
205
+ * What the conversation door caps. Whatever is left out is filled with this
206
+ * file's defaults and then DECLARED, so `conversationLimits` on the host is
207
+ * always what is actually enforced rather than what was passed in.
208
+ *
209
+ * An unset `maxFrameBytes` would mean an unbounded buffer somebody else
210
+ * fills, which is a way to kill this process; an unset `maxPendingBytes` the
211
+ * same, one layer up. `idleMs` has no default because this door does not idle
212
+ * anything out — it reports the ceiling of whatever sits in front of it, and
213
+ * inventing one would be reporting a fact nobody established.
214
+ */
215
+ readonly conversationLimits?: ConversationLimits;
164
216
  }
165
217
  /** A {@link HostHandle} that also says where it landed. */
166
218
  export interface HttpHostHandle extends HostHandle {
@@ -174,9 +226,18 @@ export interface HttpHostHandle extends HostHandle {
174
226
  /** The port it actually bound — the real one, when you asked for `0`. */
175
227
  readonly port: number;
176
228
  }
177
- /** {@link AgentHost} narrowed to an HTTP handle. */
178
- export interface HttpHost extends AgentHost {
229
+ /**
230
+ * {@link AgentHost} and {@link ConversationHost} narrowed to an HTTP handle.
231
+ *
232
+ * One object with two doors, because they share one socket. Whether the
233
+ * conversation door is USABLE is `capabilities`' answer, not this type's: a
234
+ * host built without a `conversationPath` still has the method and refuses by
235
+ * name, which is a better error than a method that is missing at runtime on
236
+ * some adapters and present on others.
237
+ */
238
+ export interface HttpHost extends AgentHost, ConversationHost {
179
239
  serve(handler: HostHandler): Promise<HttpHostHandle>;
240
+ serveConversations(handler: ConversationHandler): Promise<HttpHostHandle>;
180
241
  }
181
242
  /**
182
243
  * An HTTP host for one handler, speaking the dialect you hand it.
@@ -192,5 +253,10 @@ export declare function httpHost(options: HttpHostOptions): HttpHost;
192
253
  * Exported because every wire that maps a header needs it and re-deriving it
193
254
  * per adapter is how one of them ends up matching only the exact casing the
194
255
  * author happened to test with.
256
+ *
257
+ * Takes anything carrying lower-cased headers, so a request wire and a
258
+ * handshake wire read a header the same way rather than each growing their own.
195
259
  */
196
- export declare function headerValue(facts: HttpRequestFacts, name: string, ...fallbacks: string[]): string | undefined;
260
+ export declare function headerValue(facts: {
261
+ readonly headers: Readonly<Record<string, string>>;
262
+ }, name: string, ...fallbacks: string[]): string | undefined;
@@ -34,11 +34,27 @@
34
34
  * detaches and drains without closing a socket it never opened. That is the
35
35
  * whole difference; every other law on this page is the same either way.
36
36
  *
37
+ * ── The third door: a conversation ───────────────────────────────────────────
38
+ * `serveConversations(handler)` sits beside `serve(handler)` and takes upgrades
39
+ * on `conversationPath`, because `HostRequest → HostReply` is one exchange and
40
+ * some doors are not. Give a host a `conversationPath` and it declares
41
+ * `'conversation'`; leave it out and `serveConversations` refuses by name.
42
+ *
43
+ * **Both doors share ONE socket.** That is not an optimisation, it is the
44
+ * premise: the runtimes that need a conversation are the ones that hand a
45
+ * container exactly one port, so a host whose two doors each bound their own
46
+ * would fail with `EADDRINUSE` on the deployment it exists for. On a private
47
+ * socket the server is created by whichever door opens first and closed by
48
+ * whichever closes last; on a caller-owned one each door attaches and detaches
49
+ * its own listener and neither touches the socket.
50
+ *
37
51
  * Pattern: Template method via configuration (Strategy on the wire format).
38
52
  * Everything HTTP lives here and in the wires; `types.ts` knows none of it.
39
53
  */
40
54
  import { encodeSSE } from '../stream.js';
41
55
  import { HostClosedError } from './errors.js';
56
+ import { lowerCasedHeaders } from './headers.js';
57
+ import { conversationDoor, } from './webSocketConversation.js';
42
58
  /**
43
59
  * Status codes mapped by refusal code. Anything else is a 500.
44
60
  *
@@ -64,6 +80,20 @@ const STATUS_BY_CODE = {
64
80
  */
65
81
  const AWAITING_STATUS = 202;
66
82
  const DEFAULT_CAPABILITIES = ['streaming'];
83
+ /**
84
+ * What a conversation door caps when the deployment did not say.
85
+ *
86
+ * Both are memory this process pays for while somebody else fills it, so
87
+ * "unlimited" is not one of the options — and since what is enforced must be
88
+ * what is declared, the resolved numbers are what the host reports.
89
+ * One mebibyte is chosen as a number large enough that no ordinary protocol
90
+ * frame meets it and small enough that a hostile one cannot spend the heap;
91
+ * a deployment with a real ceiling passes its own.
92
+ */
93
+ const DEFAULT_CONVERSATION_LIMITS = {
94
+ maxFrameBytes: 1_048_576,
95
+ maxPendingBytes: 1_048_576,
96
+ };
67
97
  /**
68
98
  * An HTTP host for one handler, speaking the dialect you hand it.
69
99
  *
@@ -72,7 +102,7 @@ const DEFAULT_CAPABILITIES = ['streaming'];
72
102
  * httpHost({ name: 'myRuntime', wire: myWire, invokePath: '/v1/run', healthPath: '/up' });
73
103
  */
74
104
  export function httpHost(options) {
75
- const { name, wire, invokePath, healthPath } = options;
105
+ const { name, wire, invokePath, healthPath, conversationPath } = options;
76
106
  const ownServer = options.server;
77
107
  // Refused at construction, not ignored at serve time: a `port` next to a
78
108
  // server this host does not bind is a caller who believes something untrue
@@ -86,10 +116,171 @@ export function httpHost(options) {
86
116
  }
87
117
  const port = options.port ?? 8080;
88
118
  const hostname = options.hostname ?? '0.0.0.0';
89
- const capabilities = options.capabilities ?? DEFAULT_CAPABILITIES;
119
+ // A door that exists is a capability that can be honoured; one built without
120
+ // a path is not, and says so rather than being discovered at runtime.
121
+ const capabilities = options.capabilities ??
122
+ (conversationPath !== undefined
123
+ ? [...DEFAULT_CAPABILITIES, 'conversation']
124
+ : DEFAULT_CAPABILITIES);
125
+ // Resolved once, declared as resolved: `host.conversationLimits` is what is
126
+ // actually enforced, never what was passed in and quietly topped up.
127
+ const conversationLimits = {
128
+ ...DEFAULT_CONVERSATION_LIMITS,
129
+ ...options.conversationLimits,
130
+ };
131
+ // ── The socket both doors stand on ─────────────────────────────────
132
+ //
133
+ // Refcounted, because the deployment this exists for hands a container ONE
134
+ // port: two doors that each bound their own would be `EADDRINUSE` on exactly
135
+ // the machine that needed both. First door in creates and listens; last door
136
+ // out drains and closes. On a caller-owned server there is nothing to count —
137
+ // the socket was never ours to open or to close.
138
+ let socket;
139
+ let holders = 0;
140
+ async function acquireSocket() {
141
+ if (ownServer) {
142
+ if (!ownServer.listening) {
143
+ throw new Error(`[hosting] httpHost('${name}') was handed a server that is not listening yet. ` +
144
+ `This handle promises the url and port it is answering on, and a server with ` +
145
+ `no address has neither. Call server.listen(...) first, then serve() — ` +
146
+ `attaching after listen() is safe and is the intended order.`);
147
+ }
148
+ return ownServer;
149
+ }
150
+ holders += 1;
151
+ socket ??= (async () => {
152
+ const { createServer } = await import('node:http');
153
+ const created = createServer();
154
+ await new Promise((resolve, reject) => {
155
+ created.once('error', reject);
156
+ created.listen(port, hostname, resolve);
157
+ });
158
+ return created;
159
+ })();
160
+ try {
161
+ return await socket;
162
+ }
163
+ catch (err) {
164
+ // A socket that never came up is not one anybody is holding.
165
+ holders -= 1;
166
+ socket = undefined;
167
+ throw err;
168
+ }
169
+ }
170
+ async function releaseSocket() {
171
+ if (ownServer)
172
+ return;
173
+ holders -= 1;
174
+ if (holders > 0)
175
+ return;
176
+ const held = socket;
177
+ socket = undefined;
178
+ if (!held)
179
+ return;
180
+ const server = await held.catch(() => undefined);
181
+ if (!server)
182
+ return;
183
+ server.closeIdleConnections();
184
+ await new Promise((resolve) => server.close(() => resolve()));
185
+ }
186
+ /** Where this host is answering — the caller's address, or the one we bound. */
187
+ function addressOf(server) {
188
+ const address = server.address();
189
+ const tcp = typeof address === 'object' && address !== null ? address : undefined;
190
+ if (ownServer && !tcp) {
191
+ throw new Error(`[hosting] httpHost('${name}') was handed a server bound to ${JSON.stringify(address)}` +
192
+ ` — a pipe or socket path, which has no port. This handle promises a url and a ` +
193
+ `port, and inventing one would be worse than refusing. Serve on a TCP server, or ` +
194
+ `drive the handler yourself.`);
195
+ }
196
+ const boundPort = tcp ? tcp.port : port;
197
+ // With our own socket the requested hostname IS the answer; with the
198
+ // caller's we ask the socket, because we never chose it.
199
+ const boundHost = ownServer ? tcp?.address ?? '127.0.0.1' : hostname;
200
+ const displayHost = boundHost === '0.0.0.0' || boundHost === '::' ? '127.0.0.1' : boundHost;
201
+ return { url: `http://${displayHost}:${boundPort}`, port: boundPort };
202
+ }
203
+ let conversationsServing = false;
90
204
  return {
91
205
  name,
92
206
  capabilities,
207
+ conversationLimits,
208
+ async serveConversations(handler) {
209
+ if (conversationPath === undefined) {
210
+ throw new Error(`[hosting] the '${name}' host was built without a 'conversationPath', so it has no ` +
211
+ `door to take conversations on and does not declare 'conversation' in its ` +
212
+ `capabilities. Build it with a conversationPath, or feature-detect with ` +
213
+ `host.capabilities.includes('conversation') and use serve() instead.`);
214
+ }
215
+ if (conversationsServing) {
216
+ throw new Error(`[hosting] the '${name}' host is already serving conversations on ` +
217
+ `'${conversationPath}'. One door, one handler — two would make which handler ` +
218
+ `receives a conversation depend on registration order. Close the first handle ` +
219
+ `before serving again.`);
220
+ }
221
+ conversationsServing = true;
222
+ let accepting = true;
223
+ let closing;
224
+ const door = conversationDoor({
225
+ hostName: name,
226
+ path: conversationPath,
227
+ limits: conversationLimits,
228
+ ...(wire.readConversation && { readConversation: wire.readConversation.bind(wire) }),
229
+ handler,
230
+ accepting: () => accepting,
231
+ });
232
+ const onUpgrade = (request, socketOfConversation) => {
233
+ if (door.handleUpgrade(request, socketOfConversation))
234
+ return;
235
+ // Not our path. On the caller's server that is theirs to answer or to
236
+ // ignore, exactly as an unmatched request path is; on ours nobody else
237
+ // can, so leaving the socket hanging would be the one dishonest option.
238
+ if (ownServer)
239
+ return;
240
+ socketOfConversation.end('HTTP/1.1 400 Bad Request\r\nconnection: close\r\n\r\n' +
241
+ `[hosting] the '${name}' host takes conversations on ${conversationPath}.`);
242
+ };
243
+ let server;
244
+ try {
245
+ server = await acquireSocket();
246
+ }
247
+ catch (err) {
248
+ conversationsServing = false;
249
+ throw err;
250
+ }
251
+ server.on('upgrade', onUpgrade);
252
+ let where;
253
+ try {
254
+ where = addressOf(server);
255
+ }
256
+ catch (err) {
257
+ server.off('upgrade', onUpgrade);
258
+ conversationsServing = false;
259
+ await releaseSocket();
260
+ throw err;
261
+ }
262
+ return {
263
+ url: where.url,
264
+ port: where.port,
265
+ close() {
266
+ closing ??= (async () => {
267
+ accepting = false;
268
+ if (ownServer)
269
+ server.off('upgrade', onUpgrade);
270
+ // End the live conversations BEFORE letting go of the socket. An
271
+ // upgraded socket keeps `server.close()` waiting forever — measured,
272
+ // not assumed — so a door that walked away from its conversations
273
+ // would hang every shutdown that shares this socket.
274
+ await door.closeAll(`the '${name}' host is shutting down`);
275
+ if (!ownServer)
276
+ server.off('upgrade', onUpgrade);
277
+ conversationsServing = false;
278
+ await releaseSocket();
279
+ })();
280
+ return closing;
281
+ },
282
+ };
283
+ },
93
284
  async serve(handler) {
94
285
  const startedAt = Date.now();
95
286
  const inFlight = new Set();
@@ -123,42 +314,20 @@ export function httpHost(options) {
123
314
  inFlight.add(served);
124
315
  void served.finally(() => inFlight.delete(served));
125
316
  };
126
- let server;
127
- if (ownServer) {
128
- server = ownServer;
129
- if (!server.listening) {
130
- throw new Error(`[hosting] httpHost('${name}') was handed a server that is not listening yet. ` +
131
- `This handle promises the url and port it is answering on, and a server with ` +
132
- `no address has neither. Call server.listen(...) first, then serve() — ` +
133
- `attaching after listen() is safe and is the intended order.`);
134
- }
135
- server.on('request', onRequest);
136
- }
137
- else {
138
- const { createServer } = await import('node:http');
139
- server = createServer(onRequest);
140
- await new Promise((resolve, reject) => {
141
- server.once('error', reject);
142
- server.listen(port, hostname, resolve);
143
- });
317
+ const server = await acquireSocket();
318
+ server.on('request', onRequest);
319
+ let where;
320
+ try {
321
+ where = addressOf(server);
144
322
  }
145
- const address = server.address();
146
- const tcp = typeof address === 'object' && address !== null ? address : undefined;
147
- if (ownServer && !tcp) {
323
+ catch (err) {
148
324
  server.off('request', onRequest);
149
- throw new Error(`[hosting] httpHost('${name}') was handed a server bound to ${JSON.stringify(address)}` +
150
- ` — a pipe or socket path, which has no port. This handle promises a url and a ` +
151
- `port, and inventing one would be worse than refusing. Serve on a TCP server, or ` +
152
- `drive the handler yourself.`);
325
+ await releaseSocket();
326
+ throw err;
153
327
  }
154
- const boundPort = tcp ? tcp.port : port;
155
- // With our own socket the requested hostname IS the answer; with the
156
- // caller's we ask the socket, because we never chose it.
157
- const boundHost = ownServer ? tcp?.address ?? '127.0.0.1' : hostname;
158
- const displayHost = boundHost === '0.0.0.0' || boundHost === '::' ? '127.0.0.1' : boundHost;
159
328
  return {
160
- url: `http://${displayHost}:${boundPort}`,
161
- port: boundPort,
329
+ url: where.url,
330
+ port: where.port,
162
331
  close() {
163
332
  // Idempotent: the first call owns the shutdown, later ones await it.
164
333
  closing ??= (async () => {
@@ -177,8 +346,10 @@ export function httpHost(options) {
177
346
  // caller is still waiting on, and dropping it would be the exact
178
347
  // thing close() promises not to do.
179
348
  await Promise.allSettled([...inFlight]);
180
- server.closeIdleConnections();
181
- await new Promise((resolve) => server.close(() => resolve()));
349
+ server.off('request', onRequest);
350
+ // The socket goes only when the LAST door lets go of it. A
351
+ // conversation still open on this port is not this door's to end.
352
+ await releaseSocket();
182
353
  })();
183
354
  return closing;
184
355
  },
@@ -198,7 +369,7 @@ async function serveOne(req, res, handler, wire) {
198
369
  sendJson(res, 400, wire.failure(`invalid JSON body: ${asError(err).message}`));
199
370
  return;
200
371
  }
201
- const headers = lowerCased(req.headers);
372
+ const headers = lowerCasedHeaders(req.headers);
202
373
  const query = new URLSearchParams((req.url ?? '').split('?')[1] ?? '');
203
374
  const { input, sessionId, decision } = wire.readRequest({ body, headers, query });
204
375
  if (wantsStream) {
@@ -317,16 +488,6 @@ function sendJson(res, status, body) {
317
488
  res.writeHead(status, { 'content-type': 'application/json' });
318
489
  res.end(JSON.stringify(body));
319
490
  }
320
- function lowerCased(headers) {
321
- const out = {};
322
- for (const [name, value] of Object.entries(headers)) {
323
- if (typeof value === 'string')
324
- out[name.toLowerCase()] = value;
325
- else if (Array.isArray(value))
326
- out[name.toLowerCase()] = value.join(', ');
327
- }
328
- return out;
329
- }
330
491
  function asError(err) {
331
492
  return err instanceof Error ? err : new Error(String(err));
332
493
  }
@@ -336,6 +497,9 @@ function asError(err) {
336
497
  * Exported because every wire that maps a header needs it and re-deriving it
337
498
  * per adapter is how one of them ends up matching only the exact casing the
338
499
  * author happened to test with.
500
+ *
501
+ * Takes anything carrying lower-cased headers, so a request wire and a
502
+ * handshake wire read a header the same way rather than each growing their own.
339
503
  */
340
504
  export function headerValue(facts, name, ...fallbacks) {
341
505
  for (const candidate of [name, ...fallbacks]) {
@@ -1 +1 @@
1
- {"version":3,"file":"httpHost.js","sourceRoot":"","sources":["../../../src/hosting/httpHost.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAIH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAyJ9C;;;;;;;;GAQG;AACH,MAAM,cAAc,GAAqC;IACvD,eAAe,EAAE,GAAG;IACpB,kBAAkB,EAAE,GAAG;IACvB,qBAAqB,EAAE,GAAG;IAC1B,qBAAqB,EAAE,GAAG;IAC1B,kBAAkB,EAAE,GAAG;CACxB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,eAAe,GAAG,GAAG,CAAC;AAE5B,MAAM,oBAAoB,GAA8B,CAAC,WAAW,CAAC,CAAC;AAEtE;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC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AC,CAAC;gBACxC,OAAO,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAE,MAAkC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YAC3F,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,MAAM,CAAC,GAAG,CAAC,CAAC;YACd,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,QAAQ,CAAC,GAAmB,EAAE,MAAc,EAAE,IAAa;IAClE,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAC9D,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;AAChC,CAAC;AAED,SAAS,OAAO,CAAC,GAAY;IAC3B,OAAO,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7D,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CACzB,KAA6D,EAC7D,IAAY,EACZ,GAAG,SAAmB;IAEtB,KAAK,MAAM,SAAS,IAAI,CAAC,IAAI,EAAE,GAAG,SAAS,CAAC,EAAE,CAAC;QAC7C,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC;QACrD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;YAAE,OAAO,KAAK,CAAC;IAClE,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -1,13 +1,17 @@
1
1
  /**
2
- * agentfootprint/hosting — the two ports between an agent and the place it runs.
2
+ * agentfootprint/hosting — the ports between an agent and the place it runs.
3
3
  *
4
4
  * An agent that answers one call in a script and an agent that has been up for
5
- * a month differ in two things, and only two: something has to carry requests
6
- * to it, and the conversation has to outlive the request. This subpath is those
7
- * two things as **ports**, plus local adapters that prove the ports work, plus
8
- * the composer that wires them together.
5
+ * a month differ in a few things: something has to carry requests to it,
6
+ * something sometimes has to hold a channel OPEN to it, and the conversation
7
+ * has to outlive the request. This subpath is those things as **ports**, plus
8
+ * local adapters that prove the ports work, plus the composer that wires the
9
+ * request half together.
9
10
  *
10
11
  * `AgentHost` — something can call me.
12
+ * `ConversationHost` — something can talk to me, both ways, until one of us
13
+ * ends it. `HostRequest → HostReply` is one exchange;
14
+ * some doors are not.
11
15
  * `SessionLifecycle` — the conversation outlives the request.
12
16
  * `standingAgent` — hydrate → resume-or-fresh → persist → reply.
13
17
  *
@@ -34,6 +38,17 @@
34
38
  * re-decides. Pass `server` and it attaches to a `node:http` server YOU
35
39
  * own instead of binding one — for the container that gets a single port
36
40
  * and must serve a WebSocket upgrade (or anything else) beside the agent.
41
+ * • `host.serveConversations(handler)` — the conversation door, on every
42
+ * adapter built on `httpHost` that was given a `conversationPath`.
43
+ * `nodeHost` serves it on `/conversation` with a real WebSocket
44
+ * implementation and **no dependency to install**, sharing the socket with
45
+ * `/invoke`. Frames are STRINGS at the port; what they mean is your
46
+ * protocol's business, not this port's.
47
+ * • `ConversationLimits` — the ceilings a door DECLARES
48
+ * (`maxFrameBytes`, `idleMs`, `maxPendingBytes`) so the layer above can
49
+ * chunk or heartbeat on its own protocol. The port does neither, on
50
+ * purpose: hiding a cap inside auto-chunking decides a protocol question
51
+ * for every consumer at once.
37
52
  * • `memorySessions()` — conversations in a Map, for tests and local dev.
38
53
  * • `standingAgent({ agent, sessions, host, durability? })` — the composer.
39
54
  * • `toEnvelope` / `readEnvelope` — pack a conversation, and refuse by name to
@@ -61,9 +76,9 @@
61
76
  export { nodeHost, jsonWire } from './nodeHost.js';
62
77
  export type { NodeHost, NodeHostHandle, NodeHostOptions } from './nodeHost.js';
63
78
  export { httpHost, headerValue } from './httpHost.js';
64
- export type { HttpHost, HttpHostHandle, HttpHostOptions, HttpRequestFacts, HttpWire, } from './httpHost.js';
79
+ export type { ConversationHandshake, HandshakeFacts, HttpHost, HttpHostHandle, HttpHostOptions, HttpRequestFacts, HttpWire, } from './httpHost.js';
65
80
  export { memorySessions } from './memorySessions.js';
66
81
  export { toEnvelope, toPausedEnvelope, readEnvelope, readPausedRun, checkEnvelope, } from './envelope.js';
67
82
  export { standingAgent } from './standingAgent.js';
68
- export { requireCapability, HostClosedError, ConcurrentRunError, PauseNotCarriedError, AwaitingDecisionError, NoPendingAskError, UnreadableEnvelopeError, } from './errors.js';
69
- export type { AgentHost, CheckpointEnvelope, ConcurrentInvokePolicy, ConversationEnvelope, DurabilityMode, HostCapability, HostHandle, HostHandler, HostReply, HostRequest, PausedRun, PausedRunEnvelope, PendingAsk, SessionLifecycle, StandingAgentOptions, WakeReason, } from './types.js';
83
+ export { requireCapability, HostClosedError, ConcurrentRunError, PauseNotCarriedError, AwaitingDecisionError, NoPendingAskError, UnreadableEnvelopeError, ConversationClosedError, FrameTooLargeError, } from './errors.js';
84
+ export type { AgentHost, CheckpointEnvelope, ConcurrentInvokePolicy, ConversationClose, ConversationEnvelope, ConversationHandler, ConversationHost, ConversationLimits, DurabilityMode, HostCapability, HostConversation, HostHandle, HostHandler, HostReply, HostRequest, PausedRun, PausedRunEnvelope, PendingAsk, SessionLifecycle, StandingAgentOptions, Unsubscribe, WakeReason, } from './types.js';