@stratusagent/gateway 0.10.0 → 0.11.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/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
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, type ScheduleRecord } from '@stratusagent/agents';
3
3
  import { type SchedulerLimits } from './schedules.ts';
4
+ export { claimHome, homeLockPath, HomeClaimedError, type HomeClaim, } from './lock.ts';
4
5
  export { SqliteScheduleStore, createSchedulerRuntime, isScheduleSessionId, SCHEDULE_SESSION_ID_PREFIX, type ScheduleStoreLike, type SchedulerLimits, type SchedulerRuntime, type SchedulerRuntimeOptions, } from './schedules.ts';
5
6
  import { type OptionalModuleHost } from '@stratusagent/plugins';
6
7
  import { type PluginsConfig, type RuntimeSelection, type StateEnvironment } from '@stratusagent/state';
@@ -102,6 +103,21 @@ export interface GatewayChannelAdapter {
102
103
  name: string;
103
104
  start(gateway: Gateway): Promise<void>;
104
105
  stop(): Promise<void>;
106
+ /**
107
+ * Whether the gateway may serve without this channel.
108
+ *
109
+ * A channel whose `start()` rejects is logged and skipped, which is right
110
+ * for a Slack app whose tokens went stale: the rest of the fleet stays
111
+ * up. A required channel fails `start()` instead — after stopping the
112
+ * channels that did come up, and before the scheduler starts or any
113
+ * sweep re-asks an approval, so a daemon refused this way has done no
114
+ * work. The control API is the case: a second `stratus serve` on the
115
+ * same home lost the port to the first, logged it, and went on serving
116
+ * with no channel at all — and the next scheduled firing ran in it,
117
+ * where nobody could approve or hear anything. A host that omits this
118
+ * gets the skip.
119
+ */
120
+ required?: boolean;
105
121
  /**
106
122
  * The addressable outbound seam, mirroring
107
123
  * `@stratusagent/channels`' `ChannelAdapter.resolveOutbound` structurally
@@ -129,6 +145,8 @@ export interface SessionRouting {
129
145
  agentId: string;
130
146
  /** The metadata the dispatching surface attached to the session. */
131
147
  metadata: JsonObject;
148
+ /** The latest turn's text (`latestTurnReply`), when it produced any — see `@stratusagent/channels`. */
149
+ reply?: string;
132
150
  }
133
151
  /**
134
152
  * What the gateway hands a policy that needs a human somewhere else: one
@@ -164,6 +182,17 @@ export interface GatewayApprovalRequest {
164
182
  input: JsonObject;
165
183
  };
166
184
  risk: ToolRisk;
185
+ /**
186
+ * The site this call would act on, for a tool judged by one
187
+ * (`Tool.originFor`). Passed straight through to whatever renders the
188
+ * request, because the call's arguments do not say where a click lands.
189
+ */
190
+ origin?: string;
191
+ /**
192
+ * True when answering `always` runs this call once and remembers
193
+ * nothing, so a renderer can stop offering one. Passed straight through.
194
+ */
195
+ oneShot?: boolean;
167
196
  /**
168
197
  * When this call first parked, if a restart is re-asking it. The wait is
169
198
  * measured from here, so a request keeps the window it started with
@@ -195,6 +224,10 @@ export interface PendingApproval {
195
224
  input: JsonObject;
196
225
  };
197
226
  risk: ToolRisk;
227
+ /** The site it would act on, for a tool judged by one. */
228
+ origin?: string;
229
+ /** True when `always` on this call remembers nothing — see the event. */
230
+ oneShot?: boolean;
198
231
  /** When this call parked, ISO-8601. */
199
232
  parkedAt: string;
200
233
  /**
@@ -246,6 +279,50 @@ export interface GatewaySkill {
246
279
  /** Where the SKILL.md lives. */
247
280
  path?: string;
248
281
  }
282
+ /** What a turn cut short by an announced restart records as its failure. */
283
+ export declare const RESTARTING_TURN_ERROR = "Run aborted: stratusd is restarting";
284
+ /**
285
+ * How long an announced restart lets in-flight turns finish before aborting
286
+ * them. Matches the systemd unit's `TimeoutStopSec`, so the two windows an
287
+ * operator can hit agree.
288
+ */
289
+ export declare const DEFAULT_RESTART_DRAIN_TIMEOUT_MS = 30000;
290
+ export interface RestartRequest {
291
+ /** Why, for the log — "plugin stratus-plugin-github enabled". */
292
+ reason?: string;
293
+ /** Overrides the gateway's drain window for this restart. */
294
+ drainTimeoutMs?: number;
295
+ }
296
+ /** What `restart()` announced: the terms the drain is running under. */
297
+ export interface RestartStatus {
298
+ reason?: string;
299
+ drainTimeoutMs: number;
300
+ /** Turns that were running when the restart was announced. */
301
+ inflight: number;
302
+ }
303
+ /** What the host is handed once the daemon has stopped for a restart. */
304
+ export interface RestartOutcome {
305
+ reason?: string;
306
+ /**
307
+ * Whether everything let go — every turn finished inside the window or
308
+ * after being aborted at it, every channel stopped, and every plugin
309
+ * released what it held. False means a turn ignored its abort for a
310
+ * whole second window, or a channel's stop or a plugin's dispose never
311
+ * settled or rejected, and the gateway shut down around it; a host
312
+ * should exit the process rather than start a new daemon beside a turn
313
+ * still writing, a channel still connected, or a plugin still holding a
314
+ * browser or a socket.
315
+ */
316
+ drained: boolean;
317
+ }
318
+ /**
319
+ * `restart()` on a gateway whose host gave it no way back. Exported so the
320
+ * control API can answer it as "not supported here" rather than as a
321
+ * failure of the daemon.
322
+ */
323
+ export declare class RestartUnsupportedError extends Error {
324
+ constructor();
325
+ }
249
326
  /** A plugin this daemon was asked to load, and what came of it. */
250
327
  export interface GatewayPluginStatus {
251
328
  package: string;
@@ -309,6 +386,16 @@ export interface GatewayOptions {
309
386
  * to the CLI.
310
387
  */
311
388
  pluginHost?: OptionalModuleHost;
389
+ /**
390
+ * How this daemon comes back after `restart()`: called once the gateway
391
+ * has stopped, by the host that owns the process — `stratus serve`
392
+ * starts a fresh daemon and supervises it. The gateway can drain and
393
+ * stop; only its host can start a process. A host that omits this gives
394
+ * up `restart()`, which then throws `RestartUnsupportedError`.
395
+ */
396
+ onRestart?: (outcome: RestartOutcome) => void | Promise<void>;
397
+ /** The drain window a `restart()` uses when the request names none. Default 30s. */
398
+ restartDrainTimeoutMs?: number;
312
399
  log?: (line: string) => void;
313
400
  warn?: (line: string) => void;
314
401
  }
@@ -353,6 +440,38 @@ export interface Gateway {
353
440
  * created by another surface, or one whose soul was deleted.
354
441
  */
355
442
  reloadRoster(): Promise<AgentDefinition[]>;
443
+ /**
444
+ * Re-read `~/.stratus/skills/` and serve what is there now, without a
445
+ * restart — the shape `reloadRoster()` established: idempotent,
446
+ * serialized against itself and the roster reload, and a failure that
447
+ * leaves the previous set serving. Plugin-contributed skills are rebuilt
448
+ * from the plugins already loaded (never re-imported), in the same order
449
+ * they loaded, so operator precedence and contested aliases come out as
450
+ * a restart would produce them.
451
+ *
452
+ * A skill that would not load — a malformed `SKILL.md`, a directory whose
453
+ * name is not an id — rejects with the file named and changes nothing:
454
+ * half a catalog is worse than a stale one.
455
+ *
456
+ * Loaded is not enabled: a reloaded skill still reaches only the agents
457
+ * whose souls list it.
458
+ */
459
+ reloadSkills(): Promise<GatewaySkill[]>;
460
+ /**
461
+ * Announce a restart: refuse new turns now, let running ones finish
462
+ * inside the drain window, abort what is still running at the end of
463
+ * it, stop, and hand the process back to the host through `onRestart`.
464
+ * Returns at once with the terms; the drain runs behind it. Idempotent —
465
+ * a second call while one is underway reports the same announcement.
466
+ *
467
+ * What comes back is what a stop-and-start brings back: durable sessions,
468
+ * schedules, and channels; a call parked on a human is denied as
469
+ * cancelled, exactly as a stop denies it. The refusal comes first, which
470
+ * makes the drain's known gap smaller — a turn finishing after the
471
+ * snapshot can still start work the snapshot never saw — but does not
472
+ * close it.
473
+ */
474
+ restart(request?: RestartRequest): RestartStatus;
356
475
  /**
357
476
  * The turn currently running on a session, if the caller that started it
358
477
  * named one. Single-flight per session is what makes this exact: at most
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAIL,QAAQ,EAQR,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,cAAc,EAEnB,KAAK,UAAU,EACf,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,YAAY,EAEjB,KAAK,QAAQ,EACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAgBL,KAAK,UAAU,EAEf,KAAK,cAAc,EACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAKL,KAAK,eAAe,EACrB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