mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-26 12:26:38 -06:00
24 lines
812 B
TypeScript
24 lines
812 B
TypeScript
// Session-envelope context resolver for inbound channel turns.
|
|
import { resolveEnvelopeFormatOptions } from "../auto-reply/envelope.js";
|
|
import { readSessionUpdatedAt, resolveStorePath } from "../config/sessions.js";
|
|
import type { OpenClawConfig } from "../config/types.openclaw.js";
|
|
|
|
/** Resolves envelope options and previous timestamp for one inbound channel session. */
|
|
export function resolveInboundSessionEnvelopeContext(params: {
|
|
cfg: OpenClawConfig;
|
|
agentId: string;
|
|
sessionKey: string;
|
|
}) {
|
|
const storePath = resolveStorePath(params.cfg.session?.store, {
|
|
agentId: params.agentId,
|
|
});
|
|
return {
|
|
storePath,
|
|
envelopeOptions: resolveEnvelopeFormatOptions(params.cfg),
|
|
previousTimestamp: readSessionUpdatedAt({
|
|
storePath,
|
|
sessionKey: params.sessionKey,
|
|
}),
|
|
};
|
|
}
|