@stratusagent/gateway 0.3.0 → 0.6.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.
package/README.md CHANGED
@@ -7,6 +7,7 @@ One gateway owns:
7
7
  - **Durable sessions** — `SqliteSessionStore` on `node:sqlite` (Node 22.13+, no native deps). The whole session round-trips as one JSON body, provider replay state included, so a conversation resumed after a daemon restart replays exactly. Session ids are caller-chosen and stable (channels derive them from conversations), which is what makes any inbound message resumable.
8
8
  - **A per-provider runner pool** — each agent's soul pins its own provider/model; config re-resolves on every dispatch and runners are pooled by resolved configuration, so two agents never share a billing path or credentials by accident.
9
9
  - **Dispatcher-backed delegation** — `agent.delegate` routes the target through the same per-provider dispatch as a direct message; a delegated specialist runs on *their* provider, never the delegator's.
10
+ - **Approval recovery** — a turn parked on a human is a durable checkpoint, not a lost turn. The runner records the parked call and the calls queued behind it *before* asking, and clears it before the tool runs, so the record covers exactly the window in which nothing has happened. On start the gateway sweeps for `pending_approval` sessions and finishes them: the parked call is re-asked (or refused, if its window ran out while the process was down), and the queue behind it drains, so every `tool_use` still ends with a `tool_result`. Earlier calls are never replayed — their results were already durable, and a re-asked request keeps the remainder of its original window rather than starting a new one. Calls made through a provider that drives its own inner loop are deliberately excluded: recovery re-enters the *kernel* loop and cannot rebuild that provider's, so those fail cleanly instead (see [04](../../docs/roadmap/04-agent-sdk-bridge.md)).
10
11
  - **An activity watchdog** — progress-based, not wall-clock: any event from the session resets it, and an idle turn is aborted cleanly (the abort cancels the underlying provider request and kills tool subprocesses).
11
12
  - **Single-flight per session** — a second message to a busy session queues behind the in-flight turn; different sessions run concurrently.
12
13
  - **Live-refresh** — souls are re-read on each dispatch, so an edited persona or allowlist reaches existing conversations on their next turn. Sessions pin an agent *id* and never cross identities.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { EventBus, type AgentDefinition, type ApprovalPolicy, type JsonObject, type Session, type SessionStore } from '@stratusagent/core';
1
+ import { EventBus, type AgentDefinition, type ApprovalAnswer, type ApprovalPolicy, type JsonObject, type Session, type SessionStatus, type SessionStore, type ToolRisk } from '@stratusagent/core';
2
2
  import { type ParsedSoul } from '@stratusagent/agents';
3
- import { type RuntimeSelection, type StateEnvironment } from '@stratusagent/state';
3
+ import { type OptionalModuleHost } from '@stratusagent/plugins';
4
+ import { type PluginsConfig, type RuntimeSelection, type StateEnvironment } from '@stratusagent/state';
4
5
  /**
5
6
  * Durable session storage on node:sqlite (unflagged on Node 22.13+). The
6
7
  * whole session — messages, status, and metadata, including provider replay
@@ -24,44 +25,188 @@ export declare class SqliteSessionStore implements SessionStore {
24
25
  create(input: Omit<Session, 'createdAt' | 'updatedAt'>): Promise<Session>;
25
26
  get(id: string): Promise<Session | undefined>;
26
27
  save(session: Session): Promise<void>;
27
- /** Newest-first session listing for one agent (or all agents). */
28
- list(agentId?: string): Array<Pick<Session, 'id' | 'status' | 'createdAt' | 'updatedAt'> & {
28
+ /**
29
+ * Session ids in a state, oldest first — the index a restarting daemon
30
+ * sweeps for turns parked on a human. The `status` column carries it, so
31
+ * no conversation body is deserialized to answer the question.
32
+ */
33
+ listIdsByStatus(status: SessionStatus): Promise<string[]>;
34
+ /**
35
+ * When each agent last did anything, and how many of its sessions are live
36
+ * right now.
37
+ *
38
+ * One aggregate over the indexed columns — no conversation body is
39
+ * deserialized, for the same reason `listIdsByStatus` returns ids: a
40
+ * roster view asks this on every load, and it must not cost a JSON parse
41
+ * per session to answer.
42
+ *
43
+ * Both halves are needed and neither is sufficient. `lastActiveAt` alone
44
+ * reads a turn parked on a human as idle, because the save that recorded
45
+ * the park is the last thing that touched the row — and a turn waiting
46
+ * twenty minutes on an approval is exactly when someone wants to see the
47
+ * agent lit. `activeSessions` alone loses an agent that finished a moment
48
+ * ago. The caller decides what window counts as "recent"; a daemon that
49
+ * baked one in would need upgrading to change it.
50
+ */
51
+ /**
52
+ * How many sessions are in each state.
53
+ *
54
+ * A grouped count, not a listing that gets counted. The table grows for the
55
+ * life of an install and a health endpoint is polled, so materialising one
56
+ * object per historical session to produce five numbers gets steadily
57
+ * slower at exactly the thing meant to report that the daemon is fine.
58
+ */
59
+ countByStatus(): Record<string, number>;
60
+ lastActivityByAgent(): Record<string, {
61
+ lastActiveAt: string;
62
+ activeSessions: number;
63
+ }>;
64
+ /**
65
+ * Newest-first session listing for one agent (or all agents).
66
+ *
67
+ * `limit` is not decoration: this table grows for the life of an install,
68
+ * and a surface that renders "recent conversations" would otherwise pull
69
+ * every session anyone has ever had to show ten of them.
70
+ */
71
+ list(agentId?: string, limit?: number): Array<Pick<Session, 'id' | 'status' | 'createdAt' | 'updatedAt'> & {
29
72
  agentId: string;
30
73
  }>;
31
74
  close(): void;
32
75
  }
76
+ /**
77
+ * A soul's provider/model pins, and the daemon-wide defaults they demote.
78
+ *
79
+ * The implementation lives in `@stratusagent/state`, beside the resolver
80
+ * whose precedence it manipulates — it never had a gateway dependency. It is
81
+ * re-exported here because this is where callers were told to import it from,
82
+ * and because "what will a served agent actually resolve to" is a gateway
83
+ * question even when the rule answering it is not gateway code.
84
+ */
85
+ export { applySoulPins, type SoulPinContext } from '@stratusagent/state';
33
86
  /**
34
87
  * A channel adapter as the gateway sees it: started after the roster
35
88
  * loads, stopped before the store drains. Structurally identical to
36
89
  * @stratusagent/channels' ChannelAdapter — kept structural here so the
37
90
  * gateway does not depend on the channels package.
38
91
  */
39
- /** Where the daemon-wide provider default could have come from. */
40
- export interface SoulPinContext {
41
- /** A provider fixed by the caller (the gateway's own selection). */
42
- selectionProvider?: string;
43
- /** The provider named by the active config file. */
44
- configProvider?: string;
45
- /** Whether a config file was found at all. */
46
- configPresent: boolean;
92
+ export interface GatewayChannelAdapter {
93
+ name: string;
94
+ start(gateway: Gateway): Promise<void>;
95
+ stop(): Promise<void>;
47
96
  }
48
97
  /**
49
- * Apply a soul's provider/model pins to a selection, demoting the
50
- * daemon-wide defaults the pins outrank.
98
+ * Where a session came from, as the gateway reports it. Structural for the
99
+ * same reason as the adapter above — @stratusagent/channels declares the
100
+ * matching shape for adapters to consume, and neither package imports the
101
+ * other to agree on it.
102
+ */
103
+ export interface SessionRouting {
104
+ /** Whose app must do the talking. */
105
+ agentId: string;
106
+ /** The metadata the dispatching surface attached to the session. */
107
+ metadata: JsonObject;
108
+ }
109
+ /**
110
+ * What the gateway hands a policy that needs a human somewhere else: one
111
+ * function that publishes a request and settles on the answer. Handed to a
112
+ * factory rather than exposed on the built gateway because the policy has
113
+ * to exist before the first dispatch, and a gateway cannot be constructed
114
+ * with a policy that needs the gateway.
115
+ */
116
+ export interface ApprovalTransport {
117
+ request: ApprovalRequester;
118
+ }
119
+ /**
120
+ * A parked call, published for anyone who can reach a person. Mirrors
121
+ * `@stratusagent/permissions`' `ApprovalRequest` structurally rather than
122
+ * importing it: the gateway consumes any `ApprovalPolicy`, and depending on
123
+ * one implementation of the seam to describe the seam would invert that.
124
+ */
125
+ export interface GatewayApprovalRequest {
126
+ session: Session;
127
+ call: {
128
+ id: string;
129
+ toolName: string;
130
+ input: JsonObject;
131
+ };
132
+ risk: ToolRisk;
133
+ /**
134
+ * When this call first parked, if a restart is re-asking it. The wait is
135
+ * measured from here, so a request keeps the window it started with
136
+ * instead of winning a fresh one — otherwise a daemon that restarts a
137
+ * minute before the deadline grants another full timeout, and one that
138
+ * crash-loops keeps a request alive forever.
139
+ */
140
+ parkedAt?: string;
141
+ signal?: AbortSignal;
142
+ }
143
+ export type ApprovalRequester = (request: GatewayApprovalRequest) => Promise<ApprovalAnswer>;
144
+ /**
145
+ * A parked call as an observer sees it — everything `tool.approval-requested`
146
+ * announced, still outstanding.
51
147
  *
52
- * Exported because this is not only dispatch logic: anything that wants to
53
- * know what a served agent will actually resolve to — a startup billing
54
- * check, a diagnostic — has to normalize the same way, and a second copy
55
- * of these rules drifts from this one.
148
+ * Listable because an event stream only tells you what happened while you
149
+ * were listening. A surface that connects while a turn is already parked
150
+ * would otherwise show no pending request at all until the next one, and
151
+ * rebuilding the set from the bus means keeping a second copy of state the
152
+ * gateway already holds.
56
153
  */
57
- export declare const applySoulPins: (pins: ParsedSoul, selection: RuntimeSelection, env: StateEnvironment, context: SoulPinContext) => {
58
- selection: RuntimeSelection;
59
- env: StateEnvironment;
60
- };
61
- export interface GatewayChannelAdapter {
154
+ export interface PendingApproval {
155
+ requestId: string;
156
+ sessionId: string;
157
+ agentId: string;
158
+ call: {
159
+ id: string;
160
+ toolName: string;
161
+ input: JsonObject;
162
+ };
163
+ risk: ToolRisk;
164
+ /** When this call parked, ISO-8601. */
165
+ parkedAt: string;
166
+ /**
167
+ * When it denies itself, ISO-8601. Absent when it never will — the same
168
+ * distinction the announcing event draws.
169
+ */
170
+ expiresAt?: string;
171
+ /** The session's metadata: where the turn is happening. */
172
+ metadata?: JsonObject;
173
+ }
174
+ export interface ResolveApprovalInput {
175
+ requestId: string;
176
+ answer: ApprovalAnswer;
177
+ /**
178
+ * The person who decided, in whatever ids their channel uses. Recorded on
179
+ * the resolved event; who is *allowed* to decide is the channel's
180
+ * question, since the approver set is written in its ids.
181
+ */
182
+ actor?: string;
183
+ /**
184
+ * Why, when it was not a person. A channel that cannot deliver a request
185
+ * — nobody configured to ask, nowhere to ask — still has to settle it,
186
+ * and recording that as `decided` would file a denial nobody made
187
+ * alongside the ones somebody did. `timeout` and `cancelled` are not
188
+ * offered here: those are the gateway's own endings to declare.
189
+ */
190
+ reason?: 'decided' | 'undeliverable';
191
+ }
192
+ /** One registered tool, as an operator's surfaces need to see it. */
193
+ export interface GatewayTool {
62
194
  name: string;
63
- start(gateway: Gateway): Promise<void>;
64
- stop(): Promise<void>;
195
+ description?: string;
196
+ risk: ToolRisk;
197
+ /** The plugin package that contributed it; absent for kernel tools. */
198
+ package?: string;
199
+ /** Whether that package is trusted to declare a tool `safe`. */
200
+ trusted?: boolean;
201
+ }
202
+ /** A plugin this daemon was asked to load, and what came of it. */
203
+ export interface GatewayPluginStatus {
204
+ package: string;
205
+ name?: string;
206
+ trusted?: boolean;
207
+ tools?: GatewayTool[];
208
+ /** Present when the plugin did not load, and the only field that is. */
209
+ error?: string;
65
210
  }
66
211
  export interface GatewayOptions {
67
212
  env?: StateEnvironment;
@@ -69,7 +214,18 @@ export interface GatewayOptions {
69
214
  selection?: RuntimeSelection;
70
215
  /** Channel adapters to run (Slack, …). Started on start(), stopped on stop(). */
71
216
  channels?: GatewayChannelAdapter[];
72
- approvals?: ApprovalPolicy;
217
+ /**
218
+ * The policy, or a factory that builds one from the gateway's approval
219
+ * transport. Pass a factory whenever the policy parks turns on a human
220
+ * reached through a channel — `remote` mode — since that policy needs the
221
+ * transport the gateway is still constructing.
222
+ */
223
+ approvals?: ApprovalPolicy | ((transport: ApprovalTransport) => ApprovalPolicy);
224
+ /**
225
+ * How long a parked call waits before it denies itself. 0 waits forever,
226
+ * which is only ever right in a test. Default 15 minutes.
227
+ */
228
+ approvalTimeoutMs?: number;
73
229
  maxTurns?: number;
74
230
  /**
75
231
  * The activity watchdog: abort a turn when no event for its session has
@@ -79,6 +235,26 @@ export interface GatewayOptions {
79
235
  idleTimeoutMs?: number;
80
236
  /** Session database path. Default ~/.stratus/sessions.db. */
81
237
  sessionDbPath?: string;
238
+ /**
239
+ * Plugins to load, keyed by package name — the `plugins` block, which the
240
+ * caller has already read from a **trusted** config. The gateway does not
241
+ * go looking for one: a plugin runs in-process with the daemon, and which
242
+ * file may say so is a decision that belongs where the config precedence
243
+ * is already understood.
244
+ */
245
+ plugins?: PluginsConfig;
246
+ /**
247
+ * How plugin packages are resolved and imported.
248
+ *
249
+ * Worth passing, and `stratus serve` does. `import.meta.resolve` answers
250
+ * relative to the module that calls it, so the default here asks "is this
251
+ * plugin visible from the gateway package" when the question is "is it
252
+ * visible from the thing the operator installed". Those differ under any
253
+ * layout that is not flat — a pnpm install being the obvious one — and the
254
+ * failure is a plugin reported as not installed while sitting right next
255
+ * to the CLI.
256
+ */
257
+ pluginHost?: OptionalModuleHost;
82
258
  log?: (line: string) => void;
83
259
  warn?: (line: string) => void;
84
260
  }
@@ -94,6 +270,16 @@ export interface DispatchInput {
94
270
  userMessage: string;
95
271
  metadata?: JsonObject;
96
272
  signal?: AbortSignal;
273
+ /**
274
+ * Caller-chosen id for this turn, so events emitted while it runs can be
275
+ * attributed to it. A session processes several turns in sequence and
276
+ * `StratusEvent` carries no turn identifier, so a surface that queued a
277
+ * message has no other way to tell its own deltas from the next caller's.
278
+ *
279
+ * Optional because most callers do not need one: a channel renders
280
+ * whatever arrives for the conversation it is watching.
281
+ */
282
+ turnId?: string;
97
283
  }
98
284
  export interface Gateway {
99
285
  start(): Promise<void>;
@@ -106,7 +292,94 @@ export interface Gateway {
106
292
  readonly store: SqliteSessionStore;
107
293
  /** The current roster, default agent included. */
108
294
  agents(): AgentDefinition[];
295
+ /**
296
+ * Re-read the agents directory and the configured default soul, returning
297
+ * the roster that results. Souls are already re-read on every dispatch, so
298
+ * this is for files that appeared or disappeared since start — an agent
299
+ * created by another surface, or one whose soul was deleted.
300
+ */
301
+ reloadRoster(): Promise<AgentDefinition[]>;
302
+ /**
303
+ * The turn currently running on a session, if the caller that started it
304
+ * named one. Single-flight per session is what makes this exact: at most
305
+ * one turn is ever running on a session, so an event emitted for it
306
+ * belongs to this turn and no other.
307
+ */
308
+ activeTurnId(sessionId: string): string | undefined;
309
+ /** Every call parked on a human right now, oldest first. */
310
+ pendingApprovals(): PendingApproval[];
311
+ /**
312
+ * Every registered tool, with the risk it will actually be judged at and
313
+ * the package it came from.
314
+ *
315
+ * Provenance is the reason this is not `tools.describe()`: "which of
316
+ * these can this daemon run, and whose code is it" is the question the
317
+ * catalog endpoint and 07's tool screens are asking, and a descriptor
318
+ * list answers only half of it. Kernel tools have no package, which is
319
+ * itself the answer for them.
320
+ */
321
+ tools(): GatewayTool[];
322
+ /**
323
+ * The plugins this daemon loaded, and the ones it could not — a plugin an
324
+ * operator enabled that failed to load is exactly what they need to see,
325
+ * and an empty list would say the opposite.
326
+ */
327
+ plugins(): GatewayPluginStatus[];
328
+ /**
329
+ * The soul behind each agent in the current roster, built-in included
330
+ * (which has none).
331
+ *
332
+ * The roster the daemon is *serving*, which the agents directory stops
333
+ * describing the moment a soul is added, deleted, or broken since the last
334
+ * reload — and the gateway keeps dispatching from the soul it cached. A
335
+ * caller that has to answer "what would a turn as this agent run on" needs
336
+ * the pins that answer it, so this hands back the parsed soul rather than a
337
+ * path a second reader would have to re-read (and now read differently).
338
+ *
339
+ * Async because it re-reads each soul file, exactly as `refreshAgent` does
340
+ * before every dispatch: a pin edited on disk is live on the next turn, so
341
+ * a caller answering from the load-time snapshot would name the provider
342
+ * the daemon has already stopped billing. An unreadable file falls back to
343
+ * the cached soul, which is what that next dispatch falls back to as well.
344
+ *
345
+ * An agent is **absent** from this list when its file now declares a
346
+ * different id: `refreshAgent` refuses every dispatch for the old one until
347
+ * the roster reloads, so nothing is served under it and no runtime should
348
+ * be claimed for it. The roster it reports is therefore what can currently
349
+ * run, which is a narrower thing than `agents()`.
350
+ */
351
+ servedSouls(): Promise<Array<{
352
+ id: string;
353
+ soul?: ParsedSoul;
354
+ }>>;
355
+ /**
356
+ * Where a durable session came from — its agent, and the metadata the
357
+ * dispatching surface attached to it.
358
+ *
359
+ * A projection rather than an accessor: the session's messages are not
360
+ * a channel's business, and handing back the whole record to save a few
361
+ * lines would make them one.
362
+ */
363
+ sessionRouting(sessionId: string): Promise<SessionRouting | undefined>;
364
+ /**
365
+ * Settles a parked call. Returns false when the request is not pending —
366
+ * already decided, expired, or belonging to a turn that was cancelled —
367
+ * which is the normal outcome of a button clicked a minute too late, not
368
+ * an error. Callers surface it to whoever clicked; they must never treat
369
+ * it as "try again".
370
+ */
371
+ resolveApproval(input: ResolveApprovalInput): boolean;
109
372
  }
373
+ /**
374
+ * Recorded on a turn the previous process was still running when it died.
375
+ *
376
+ * Exported because "distinguishable" is the whole point: a surface, a
377
+ * test, or an operator reading `lastError` has to be able to tell a turn
378
+ * nobody finished apart from one a provider or a tool actually failed, and
379
+ * matching on prose that lives in one place beats each caller inventing
380
+ * its own guess at the wording.
381
+ */
382
+ export declare const ABANDONED_TURN_ERROR = "stratusd stopped while this turn was still running; it was not resumed. Send the message again.";
110
383
  /**
111
384
  * The always-on Stratus process. One gateway holds the roster, the durable
112
385
  * session store, the shared event bus, and a pool of runners keyed by
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAGL,QAAQ,EAGR,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,OAAO,EACZ,KAAK,YAAY,EAElB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGL,KAAK,UAAU,EAChB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAqBL,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACtB,MAAM,qBAAqB,CAAC;AAK7B;;;;;GAKG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,qBAAa,kBAAmB,YAAW,YAAY;IACrD,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAe;gBAEtB,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,yBAA8B;IAuD/D,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,WAAW,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IASzE,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;IAO7C,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAO3C,kEAAkE;IAClE,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,GAAG,QAAQ,GAAG,WAAW,GAAG,WAAW,CAAC,GAAG;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAmB/G,KA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