@stratusagent/gateway 0.14.7 → 0.14.9
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/agent-source.d.ts +10 -0
- package/dist/agent-source.d.ts.map +1 -0
- package/dist/agent-source.js +7 -0
- package/dist/agent-source.js.map +1 -0
- package/dist/approvals.d.ts +38 -0
- package/dist/approvals.d.ts.map +1 -0
- package/dist/approvals.js +330 -0
- package/dist/approvals.js.map +1 -0
- package/dist/credential-requests.d.ts +24 -0
- package/dist/credential-requests.d.ts.map +1 -0
- package/dist/credential-requests.js +452 -0
- package/dist/credential-requests.js.map +1 -0
- package/dist/dispatch.d.ts +34 -0
- package/dist/dispatch.d.ts.map +1 -0
- package/dist/dispatch.js +461 -0
- package/dist/dispatch.js.map +1 -0
- package/dist/index.d.ts +4 -1290
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +202 -2546
- package/dist/index.js.map +1 -1
- package/dist/lifecycle.d.ts +130 -0
- package/dist/lifecycle.d.ts.map +1 -0
- package/dist/lifecycle.js +147 -0
- package/dist/lifecycle.js.map +1 -0
- package/dist/merge-batch.d.ts +60 -0
- package/dist/merge-batch.d.ts.map +1 -0
- package/dist/merge-batch.js +59 -0
- package/dist/merge-batch.js.map +1 -0
- package/dist/recovery.d.ts +49 -0
- package/dist/recovery.d.ts.map +1 -0
- package/dist/recovery.js +487 -0
- package/dist/recovery.js.map +1 -0
- package/dist/session-keys.d.ts +101 -0
- package/dist/session-keys.d.ts.map +1 -0
- package/dist/session-keys.js +148 -0
- package/dist/session-keys.js.map +1 -0
- package/dist/steering.d.ts +24 -0
- package/dist/steering.d.ts.map +1 -0
- package/dist/steering.js +108 -0
- package/dist/steering.js.map +1 -0
- package/dist/sub-agents.d.ts +20 -0
- package/dist/sub-agents.d.ts.map +1 -0
- package/dist/sub-agents.js +263 -0
- package/dist/sub-agents.js.map +1 -0
- package/dist/turn-dispatch.d.ts +34 -0
- package/dist/turn-dispatch.d.ts.map +1 -0
- package/dist/turn-dispatch.js +179 -0
- package/dist/turn-dispatch.js.map +1 -0
- package/dist/types.d.ts +1103 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +7 -7
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type AgentDefinition, type AgentRunner, type AgentRuntimeContext, type Executor, type JsonObject, type Session, type SteeredMessage } from '@stratusagent/core';
|
|
2
|
+
import type { AgentSource } from './agent-source.ts';
|
|
3
|
+
import type { ShardedSessionStore } from './sessions.ts';
|
|
4
|
+
import type { DispatchInput, GatewayOptions } from './types.ts';
|
|
5
|
+
import { type RuntimeConfig, type StateEnvironment } from '@stratusagent/state';
|
|
6
|
+
/** What the turn dispatch closes over in `createGateway`. */
|
|
7
|
+
export interface TurnDispatchDeps {
|
|
8
|
+
options: GatewayOptions;
|
|
9
|
+
env: StateEnvironment;
|
|
10
|
+
store: ShardedSessionStore;
|
|
11
|
+
getSelectedExecutor: () => Executor | undefined;
|
|
12
|
+
defaultAgentId: () => Promise<string>;
|
|
13
|
+
refreshAgent: (agentId: string) => Promise<AgentSource>;
|
|
14
|
+
runtimeContextFor: (source: AgentSource, config: RuntimeConfig, onFallback: boolean, metadata: JsonObject | undefined, subAgent?: boolean) => AgentRuntimeContext;
|
|
15
|
+
runnerFor: (config: RuntimeConfig, agentId: string, subAgent?: boolean) => AgentRunner;
|
|
16
|
+
withWatchdog: <T>(sessionId: string, external: AbortSignal | undefined, idleEnabled: boolean, fallbackStreams: boolean, run: (signal: AbortSignal) => Promise<T>) => Promise<T>;
|
|
17
|
+
onTurnRuntime: <T>(sessionId: string, runtime: {
|
|
18
|
+
source: AgentSource;
|
|
19
|
+
config: RuntimeConfig;
|
|
20
|
+
}, work: () => Promise<T>) => Promise<T>;
|
|
21
|
+
runtimeForAgent: (source: AgentSource) => Promise<RuntimeConfig>;
|
|
22
|
+
watchdogStreamsFor: (session: Pick<Session, 'metadata'> | undefined, config: RuntimeConfig) => {
|
|
23
|
+
switchedToFallback: boolean;
|
|
24
|
+
effectiveStreams: boolean;
|
|
25
|
+
fallbackStreams: boolean;
|
|
26
|
+
};
|
|
27
|
+
reachesHarness: (config: RuntimeConfig, switchedToFallback: boolean) => boolean;
|
|
28
|
+
settleLeftForNextStart: (input: DispatchInput, turn: Promise<Session>) => Promise<Session>;
|
|
29
|
+
}
|
|
30
|
+
export declare const createTurnDispatch: ({ options, env, store, getSelectedExecutor, defaultAgentId, refreshAgent, runtimeContextFor, runnerFor, withWatchdog, onTurnRuntime, runtimeForAgent, watchdogStreamsFor, reachesHarness, settleLeftForNextStart, }: TurnDispatchDeps) => {
|
|
31
|
+
dispatchInternal: (input: DispatchInput, absorbedKeys?: readonly string[], subAgent?: AgentDefinition, steer?: (turnSignal: AbortSignal) => Promise<SteeredMessage | undefined>) => Promise<Session>;
|
|
32
|
+
};
|
|
33
|
+
export type TurnDispatch = ReturnType<typeof createTurnDispatch>;
|
|
34
|
+
//# sourceMappingURL=turn-dispatch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"turn-dispatch.d.ts","sourceRoot":"","sources":["../src/turn-dispatch.ts"],"names":[],"mappings":"AAWA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,mBAAmB,EAExB,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,OAAO,EACZ,KAAK,cAAc,EACpB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAQhE,OAAO,EAAyB,KAAK,aAAa,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvG,6DAA6D;AAC7D,MAAM,WAAW,gBAAgB;I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a,KAClB;QAAE,kBAAkB,EAAE,OAAO,CAAC;QAAC,gBAAgB,EAAE,OAAO,CAAC;QAAC,eAAe,EAAE,OAAO,CAAA;KAAE,CAAC;IAC1F,cAAc,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,kBAAkB,EAAE,OAAO,KAAK,OAAO,CAAC;IAChF,sBAAsB,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAC5F;AAED,eAAO,MAAM,kBAAkB,GAAI,qNAehC,gBAAgB;8BAOR,aAAa,iBACN,SAAS,MAAM,EAAE,aACpB,eAAe,UAQlB,CAAC,UAAU,EAAE,WAAW,KAAK,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,KACvE,OAAO,CAAC,OAAO,CAAC;CAoKpB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* One turn on a session, below the queueing `dispatch` does: resolve the
|
|
3
|
+
* agent and its runtime, run it under the watchdog, and save what it left.
|
|
4
|
+
* `dispatchInternal` is what `dispatch`, scheduled firings, tool-call
|
|
5
|
+
* bindings and sub-agents call. Moved out of `createGateway` in index.ts as
|
|
6
|
+
* is: the statement is unchanged, inside a factory that takes what it closed
|
|
7
|
+
* over there, and `createGateway` calls it where it was. The one edit:
|
|
8
|
+
* `selectedExecutor` is a `let` set when plugins start, so it is read through
|
|
9
|
+
* `getSelectedExecutor()`.
|
|
10
|
+
*/
|
|
11
|
+
import { abortErrorFor, CONVERSATION_METADATA_KEY, } from '@stratusagent/core';
|
|
12
|
+
import { isDelegatedSession, withoutDelegation } from '@stratusagent/agents';
|
|
13
|
+
import { crossIdentityError, EXECUTOR_METADATA_KEY, isSubAgentSession, ROLLED_OVER_TO_METADATA_KEY, SUB_AGENT_METADATA_KEY, } from "./session-keys.js";
|
|
14
|
+
import { assertStateCompatible } from '@stratusagent/state';
|
|
15
|
+
export const createTurnDispatch = ({ options, env, store, getSelectedExecutor, defaultAgentId, refreshAgent, runtimeContextFor, runnerFor, withWatchdog, onTurnRuntime, runtimeForAgent, watchdogStreamsFor, reachesHarness, settleLeftForNextStart, }) => {
|
|
16
|
+
/**
|
|
17
|
+
* `subAgent` is the narrowed definition `subAgents.run` built: the turn
|
|
18
|
+
* runs as that, on the parent's resolved provider, with no memory and no
|
|
19
|
+
* soul. Only that path passes it.
|
|
20
|
+
*/
|
|
21
|
+
const dispatchInternal = async (input, absorbedKeys = [], subAgent,
|
|
22
|
+
/**
|
|
23
|
+
* See `RunInput.steer`; passed by `dispatch` for an opted-in caller.
|
|
24
|
+
* Handed the turn's own signal — the one the runner was given, which
|
|
25
|
+
* the watchdog, `abortTurns` and a restart's window abort as well as
|
|
26
|
+
* the callers — so it takes nothing into a turn that is already
|
|
27
|
+
* stopping (card 959).
|
|
28
|
+
*/
|
|
29
|
+
steer) => {
|
|
30
|
+
// Re-read on every turn, not once at start: a newer build that stamps
|
|
31
|
+
// the home while this daemon is serving has formats this build does not
|
|
32
|
+
// understand, and a daemon that kept writing into them would be the
|
|
33
|
+
// downgrade the stamp exists to refuse — from the inside. Inside the
|
|
34
|
+
// session chain, so a turn already accepted is counted by the drain
|
|
35
|
+
// before anything else runs. One small file read per turn.
|
|
36
|
+
assertStateCompatible(env);
|
|
37
|
+
// A dispatch whose signal fired while it queued behind another turn
|
|
38
|
+
// must not touch durable state: without this check, the runner would
|
|
39
|
+
// load the session, append the cancelled user message, and save it as
|
|
40
|
+
// failed — polluting future model history with input never processed.
|
|
41
|
+
if (input.signal?.aborted) {
|
|
42
|
+
throw abortErrorFor(input.signal);
|
|
43
|
+
}
|
|
44
|
+
// A session pins its agent: when the caller names none, an existing
|
|
45
|
+
// conversation keeps the agent it was created with even if the
|
|
46
|
+
// configured default soul has changed since — only a brand-new session
|
|
47
|
+
// takes the current default. (Loaded here, before the watchdog, also
|
|
48
|
+
// because whether this turn streams depends on durable session state.)
|
|
49
|
+
const existing = await store.get(input.sessionId);
|
|
50
|
+
const agentId = input.agentId ?? existing?.agent.id ?? await defaultAgentId();
|
|
51
|
+
const source = await refreshAgent(agentId);
|
|
52
|
+
const agent = subAgent ?? source.definition;
|
|
53
|
+
if (subAgent !== undefined && existing) {
|
|
54
|
+
throw new Error(`Session ${input.sessionId} already exists; a sub-agent's session is new every time.`);
|
|
55
|
+
}
|
|
56
|
+
// An archived transcript is the record of a conversation that has moved
|
|
57
|
+
// on. Continuing it would revive a session the operator deliberately
|
|
58
|
+
// left behind, under an id nothing routes to any more.
|
|
59
|
+
const continuedAs = existing?.metadata?.[ROLLED_OVER_TO_METADATA_KEY];
|
|
60
|
+
if (typeof continuedAs === 'string') {
|
|
61
|
+
throw new Error(`Session ${input.sessionId} was rolled over; it is an archived transcript and the conversation continues as ${continuedAs}.`);
|
|
62
|
+
}
|
|
63
|
+
const config = await runtimeForAgent(source);
|
|
64
|
+
const runner = runnerFor(config, source.definition.id, subAgent !== undefined);
|
|
65
|
+
// Which executor the turn's tool calls run through — the built-in
|
|
66
|
+
// under the name `stratus run` has always recorded, a contributed one
|
|
67
|
+
// under its registered name — so a transcript says where a command
|
|
68
|
+
// ran, not only which model asked for it.
|
|
69
|
+
const executorRecord = getSelectedExecutor() && options.executor !== undefined ? options.executor : 'local-command';
|
|
70
|
+
const metadata = {
|
|
71
|
+
provider: config.provider,
|
|
72
|
+
// A contributed provider may leave the model to its own default, in
|
|
73
|
+
// which case there is none to record.
|
|
74
|
+
...(config.provider !== 'demo' && config.model !== undefined ? { model: config.model } : {}),
|
|
75
|
+
...input.metadata,
|
|
76
|
+
// After the caller's metadata, and reserved besides: a dispatch that
|
|
77
|
+
// could write it could make a transcript claim a sandbox ran what
|
|
78
|
+
// the host ran.
|
|
79
|
+
[EXECUTOR_METADATA_KEY]: executorRecord,
|
|
80
|
+
};
|
|
81
|
+
if (existing && existing.agent.id !== agent.id) {
|
|
82
|
+
throw crossIdentityError(input.sessionId, existing.agent.id, agent.id);
|
|
83
|
+
}
|
|
84
|
+
// A sub-agent's session is new, but may start on its parent's fallback.
|
|
85
|
+
const { switchedToFallback, effectiveStreams, fallbackStreams } = watchdogStreamsFor(existing ?? (subAgent !== undefined ? { metadata } : undefined), config);
|
|
86
|
+
// Recorded with a keyed message so a restart judges the turn by what it
|
|
87
|
+
// could have run on, not by whatever the config resolves to by then.
|
|
88
|
+
// The fallback counts: a turn can switch to it mid-run. Once a session
|
|
89
|
+
// has switched for good, the primary is never called again, and only
|
|
90
|
+
// the fallback counts.
|
|
91
|
+
const hostedLoop = input.idempotencyKey !== undefined && reachesHarness(config, switchedToFallback);
|
|
92
|
+
return settleLeftForNextStart(input, onTurnRuntime(input.sessionId, { source, config }, () => withWatchdog(input.sessionId, input.signal, effectiveStreams, fallbackStreams, async (signal) => {
|
|
93
|
+
// The preflight above (agent refresh, config resolution, session
|
|
94
|
+
// load) awaited filesystem work; the entry check has long passed.
|
|
95
|
+
// Recheck before the runner touches durable state, or a dispatch
|
|
96
|
+
// cancelled mid-preflight would still persist its user message.
|
|
97
|
+
if (signal.aborted) {
|
|
98
|
+
throw abortErrorFor(signal);
|
|
99
|
+
}
|
|
100
|
+
if (existing) {
|
|
101
|
+
// Refresh the stored definition before resuming, so the turn runs
|
|
102
|
+
// with the current instructions, tools, and credentials.
|
|
103
|
+
existing.agent = agent;
|
|
104
|
+
// A sub-session reached here is being continued from outside — a
|
|
105
|
+
// delegation never resumes its own child; its ids are minted once.
|
|
106
|
+
// The delegating turn is over, so the markers come off: what is
|
|
107
|
+
// now an ordinary conversation must not be closed as an orphan if
|
|
108
|
+
// a later turn of it parks and the daemon dies.
|
|
109
|
+
if (isDelegatedSession(existing) && existing.metadata) {
|
|
110
|
+
existing.metadata = withoutDelegation(existing.metadata);
|
|
111
|
+
}
|
|
112
|
+
// The same for a sub-agent's session, continued as the agent itself:
|
|
113
|
+
// the marker that denies its approvals unasked comes off with the
|
|
114
|
+
// delegation markers it carries.
|
|
115
|
+
if (isSubAgentSession(existing) && existing.metadata) {
|
|
116
|
+
const { [SUB_AGENT_METADATA_KEY]: _subAgent, ...rest } = withoutDelegation(existing.metadata);
|
|
117
|
+
existing.metadata = rest;
|
|
118
|
+
}
|
|
119
|
+
// The executor record follows the daemon, not the session's first
|
|
120
|
+
// turn: a restart that selected another executor runs this turn's
|
|
121
|
+
// commands there, and a session from before the record existed
|
|
122
|
+
// gets one now rather than never.
|
|
123
|
+
if (existing.metadata?.[EXECUTOR_METADATA_KEY] !== executorRecord) {
|
|
124
|
+
existing.metadata = { ...existing.metadata, [EXECUTOR_METADATA_KEY]: executorRecord };
|
|
125
|
+
}
|
|
126
|
+
// The room rides on the turn, but two readers have only the
|
|
127
|
+
// session's: a turn parked on approval and recovered after a
|
|
128
|
+
// restart, and a turn that brings no room of its own (a schedule
|
|
129
|
+
// firing into the thread). Both get the latest room this way, not
|
|
130
|
+
// the first turn's, which a channel made public since would make
|
|
131
|
+
// read as more private than it is. A turn from a channel that
|
|
132
|
+
// could not tell the room (its lookup failed) clears it instead:
|
|
133
|
+
// no room is the generic line, and an old one is a claim.
|
|
134
|
+
if (typeof input.metadata?.channel === 'string') {
|
|
135
|
+
const room = input.metadata[CONVERSATION_METADATA_KEY];
|
|
136
|
+
const { [CONVERSATION_METADATA_KEY]: _stale, ...rest } = existing.metadata ?? {};
|
|
137
|
+
existing.metadata = room !== undefined ? { ...rest, [CONVERSATION_METADATA_KEY]: room } : rest;
|
|
138
|
+
}
|
|
139
|
+
await store.save(existing);
|
|
140
|
+
// The turn's metadata rides along for the sender's trust: without
|
|
141
|
+
// it a resumed turn has no way to say who sent it, and a stranger
|
|
142
|
+
// mentioning the agent in a thread the operator opened would
|
|
143
|
+
// inherit the operator's label.
|
|
144
|
+
return runner.resume({
|
|
145
|
+
sessionId: input.sessionId,
|
|
146
|
+
userMessage: input.userMessage,
|
|
147
|
+
...(input.images !== undefined ? { images: input.images } : {}),
|
|
148
|
+
...(input.addressed !== undefined ? { addressed: input.addressed } : {}),
|
|
149
|
+
...(input.replyOptional === true ? { replyOptional: true } : {}),
|
|
150
|
+
...(input.idempotencyKey !== undefined ? { idempotencyKey: input.idempotencyKey } : {}),
|
|
151
|
+
...(absorbedKeys.length > 0 ? { absorbedKeys: [...absorbedKeys] } : {}),
|
|
152
|
+
...(hostedLoop ? { hostedLoop } : {}),
|
|
153
|
+
...(input.metadata ? { metadata: input.metadata } : {}),
|
|
154
|
+
runtime: runtimeContextFor(source, config, switchedToFallback, input.metadata),
|
|
155
|
+
...(steer !== undefined ? { steer: () => steer(signal) } : {}),
|
|
156
|
+
signal,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
return runner.run({
|
|
160
|
+
sessionId: input.sessionId,
|
|
161
|
+
agent,
|
|
162
|
+
userMessage: input.userMessage,
|
|
163
|
+
...(input.images !== undefined ? { images: input.images } : {}),
|
|
164
|
+
...(input.addressed !== undefined ? { addressed: input.addressed } : {}),
|
|
165
|
+
...(input.replyOptional === true ? { replyOptional: true } : {}),
|
|
166
|
+
...(input.idempotencyKey !== undefined ? { idempotencyKey: input.idempotencyKey } : {}),
|
|
167
|
+
...(absorbedKeys.length > 0 ? { absorbedKeys: [...absorbedKeys] } : {}),
|
|
168
|
+
...(hostedLoop ? { hostedLoop } : {}),
|
|
169
|
+
...(input.earlier !== undefined && input.earlier.length > 0 ? { earlier: input.earlier } : {}),
|
|
170
|
+
metadata,
|
|
171
|
+
runtime: runtimeContextFor(source, config, switchedToFallback, input.metadata, subAgent !== undefined),
|
|
172
|
+
...(steer !== undefined ? { steer: () => steer(signal) } : {}),
|
|
173
|
+
signal,
|
|
174
|
+
});
|
|
175
|
+
})));
|
|
176
|
+
};
|
|
177
|
+
return { dispatchInternal };
|
|
178
|
+
};
|
|
179
|
+
//# sourceMappingURL=turn-dispatch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tur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