refactor(agents): trim session helper facades

This commit is contained in:
Vincent Koc
2026-06-17 15:06:19 +08:00
parent 664948e7bf
commit bfd11ee29f
3 changed files with 4 additions and 10 deletions
-2
View File
@@ -11,10 +11,8 @@ import { resolveInternalSessionKey, resolveMainSessionAlias } from "./sessions-r
export {
createAgentToAgentPolicy,
createSessionVisibilityChecker,
createSessionVisibilityGuard,
createSessionVisibilityRowChecker,
listSpawnedSessionKeys,
resolveEffectiveSessionToolsVisibility,
} from "../../plugin-sdk/session-visibility.js";
+2 -2
View File
@@ -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;
+2 -6
View File
@@ -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