agentfootprint
Version:
The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.
54 lines • 2.9 kB
JavaScript
;
/**
* hosting/types — the ports an agent needs to stand up and stay up.
*
* `AgentHost` is "something can call me". `ConversationHost` is "something can
* TALK to me" — a door that stays open, because `HostRequest → HostReply` is
* one exchange and some doors are not. `SessionLifecycle` is "the conversation
* outlives the request". All three are deliberately written in the vocabulary
* every transport and every store already has — an input, a reply, a frame, a
* session id, a stored blob — and in nothing else.
*
* **The rule these types are written under:** no runtime, product or protocol
* gets a field, a name or an assumption here. A port shaped around one
* provider's request envelope stops being a port and becomes that provider's
* SDK with extra steps, and every later adapter pays for it. If a decision only
* makes sense for one place you might deploy, it belongs in the adapter for
* that place, not in this file. `nodeHost` is the first adapter and it does not
* get special treatment either: its paths, its status codes and its JSON body
* shape all live in `nodeHost.ts`, and nothing in this file knows they exist.
*
* Pattern: Ports & adapters (hexagonal). Role: the port side, exclusively.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.TURN_ARTIFACTS_TIMEOUT_MS = exports.DEFAULT_MAX_ACTIVE_SESSIONS = exports.DEFAULT_ARTIFACT_OPS_PER_SESSION = exports.DEFAULT_SWEEP_LIMIT = void 0;
/**
* How many sessions one {@link SessionSweep.forgetOlderThan} forgets when the
* caller names no limit.
*
* Big enough that an ordinary nightly sweep finishes in one call, small enough
* that the first sweep of a neglected store is a series of short transactions
* rather than one long one.
*/
exports.DEFAULT_SWEEP_LIMIT = 1000;
/**
* How many artifact operations one session may have in flight by default —
* enough for a screen redrawing a handful of panes, too few for one session
* to crowd the event loop every session shares. See
* {@link StandingAgentBaseOptions.artifactOpsPerSession}.
*/
exports.DEFAULT_ARTIFACT_OPS_PER_SESSION = 8;
/** How many sessions a `agentFactory` pool holds before it evicts the least
* recently used one. See {@link StandingAgentPoolOptions.maxActiveSessions}. */
exports.DEFAULT_MAX_ACTIVE_SESSIONS = 100;
/**
* How long a turn's artifact hand-over may hold its reply by default — the
* hook plus the operations it started. Five seconds: the order of
* `TOOL_TEARDOWN_TIMEOUT_MS`, and for the same reason — both sit on the
* shutdown path (`close()` drains in-flight requests), where an unbounded wait
* turns a container stop into a wait for SIGKILL — while leaving a store room
* for a few ordinary writes. See
* {@link StandingAgentBaseOptions.turnArtifactsTimeoutMs}.
*/
exports.TURN_ARTIFACTS_TIMEOUT_MS = 5_000;
//# sourceMappingURL=types.js.map