mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-23 19:08:22 -06:00
refactor(agents): trim session helper facades
This commit is contained in:
@@ -11,10 +11,8 @@ import { resolveInternalSessionKey, resolveMainSessionAlias } from "./sessions-r
|
||||
|
||||
export {
|
||||
createAgentToAgentPolicy,
|
||||
createSessionVisibilityChecker,
|
||||
createSessionVisibilityGuard,
|
||||
createSessionVisibilityRowChecker,
|
||||
listSpawnedSessionKeys,
|
||||
resolveEffectiveSessionToolsVisibility,
|
||||
} from "../../plugin-sdk/session-visibility.js";
|
||||
|
||||
|
||||
@@ -30,10 +30,10 @@ import { getRuntimeConfig } from "../../config/config.js";
|
||||
import type { OpenClawConfig } from "../../config/types.openclaw.js";
|
||||
|
||||
/** Coarse session category used by session list/status tools. */
|
||||
export type SessionKind = "main" | "group" | "cron" | "hook" | "node" | "other";
|
||||
type SessionKind = "main" | "group" | "cron" | "hook" | "node" | "other";
|
||||
|
||||
/** Delivery target metadata attached to session rows. */
|
||||
export type SessionListDeliveryContext = {
|
||||
type SessionListDeliveryContext = {
|
||||
channel?: string;
|
||||
to?: string;
|
||||
accountId?: string;
|
||||
|
||||
@@ -88,8 +88,6 @@ export function resolveCurrentSessionClientAlias(params: {
|
||||
return requesterKey;
|
||||
}
|
||||
|
||||
export { listSpawnedSessionKeys };
|
||||
|
||||
export async function isRequesterSpawnedSessionVisible(params: {
|
||||
requesterSessionKey: string;
|
||||
targetSessionKey: string;
|
||||
@@ -190,7 +188,7 @@ export function shouldResolveSessionIdInput(value: string): boolean {
|
||||
return looksLikeSessionId(value) || !looksLikeSessionKey(value);
|
||||
}
|
||||
|
||||
export type SessionReferenceResolution =
|
||||
type SessionReferenceResolution =
|
||||
| {
|
||||
ok: true;
|
||||
key: string;
|
||||
@@ -199,7 +197,7 @@ export type SessionReferenceResolution =
|
||||
}
|
||||
| { ok: false; status: "error" | "forbidden"; error: string };
|
||||
|
||||
export type VisibleSessionReferenceResolution =
|
||||
type VisibleSessionReferenceResolution =
|
||||
| {
|
||||
ok: true;
|
||||
key: string;
|
||||
@@ -508,8 +506,6 @@ export async function resolveVisibleSessionReference(params: {
|
||||
return { ok: true, key: resolvedKey, displayKey };
|
||||
}
|
||||
|
||||
export const normalizeOptionalKey: (value?: string) => string | undefined = normalizeOptionalString;
|
||||
|
||||
export const testing = {
|
||||
setDepsForTest(overrides?: Partial<{ callGateway: GatewayCaller }>) {
|
||||
sessionsResolutionDeps = overrides
|
||||
|
||||
Reference in New Issue
Block a user