refactor(agents): trim session helper facades · openclaw/openclaw@bfd11ee
vincentkoc
·
2026-06-17
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -11,10 +11,8 @@ import { resolveInternalSessionKey, resolveMainSessionAlias } from "./sessions-r
|
11 | 11 | |
12 | 12 | export { |
13 | 13 | createAgentToAgentPolicy, |
14 | | -createSessionVisibilityChecker, |
15 | 14 | createSessionVisibilityGuard, |
16 | 15 | createSessionVisibilityRowChecker, |
17 | | -listSpawnedSessionKeys, |
18 | 16 | resolveEffectiveSessionToolsVisibility, |
19 | 17 | } from "../../plugin-sdk/session-visibility.js"; |
20 | 18 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -30,10 +30,10 @@ import { getRuntimeConfig } from "../../config/config.js";
|
30 | 30 | import type { OpenClawConfig } from "../../config/types.openclaw.js"; |
31 | 31 | |
32 | 32 | /** Coarse session category used by session list/status tools. */ |
33 | | -export type SessionKind = "main" | "group" | "cron" | "hook" | "node" | "other"; |
| 33 | +type SessionKind = "main" | "group" | "cron" | "hook" | "node" | "other"; |
34 | 34 | |
35 | 35 | /** Delivery target metadata attached to session rows. */ |
36 | | -export type SessionListDeliveryContext = { |
| 36 | +type SessionListDeliveryContext = { |
37 | 37 | channel?: string; |
38 | 38 | to?: string; |
39 | 39 | accountId?: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -88,8 +88,6 @@ export function resolveCurrentSessionClientAlias(params: {
|
88 | 88 | return requesterKey; |
89 | 89 | } |
90 | 90 | |
91 | | -export { listSpawnedSessionKeys }; |
92 | | - |
93 | 91 | export async function isRequesterSpawnedSessionVisible(params: { |
94 | 92 | requesterSessionKey: string; |
95 | 93 | targetSessionKey: string; |
@@ -190,7 +188,7 @@ export function shouldResolveSessionIdInput(value: string): boolean {
|
190 | 188 | return looksLikeSessionId(value) || !looksLikeSessionKey(value); |
191 | 189 | } |
192 | 190 | |
193 | | -export type SessionReferenceResolution = |
| 191 | +type SessionReferenceResolution = |
194 | 192 | | { |
195 | 193 | ok: true; |
196 | 194 | key: string; |
@@ -199,7 +197,7 @@ export type SessionReferenceResolution =
|
199 | 197 | } |
200 | 198 | | { ok: false; status: "error" | "forbidden"; error: string }; |
201 | 199 | |
202 | | -export type VisibleSessionReferenceResolution = |
| 200 | +type VisibleSessionReferenceResolution = |
203 | 201 | | { |
204 | 202 | ok: true; |
205 | 203 | key: string; |
@@ -508,8 +506,6 @@ export async function resolveVisibleSessionReference(params: {
|
508 | 506 | return { ok: true, key: resolvedKey, displayKey }; |
509 | 507 | } |
510 | 508 | |
511 | | -export const normalizeOptionalKey: (value?: string) => string | undefined = normalizeOptionalString; |
512 | | - |
513 | 509 | export const testing = { |
514 | 510 | setDepsForTest(overrides?: Partial<{ callGateway: GatewayCaller }>) { |
515 | 511 | sessionsResolutionDeps = overrides |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。