mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-23 09:28:37 +00:00
chore: wtf.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { MsgContext } from "../../auto-reply/templating.js";
|
||||
import type { GroupKeyResolution } from "./types.js";
|
||||
import { listDeliverableMessageChannels } from "../../utils/message-channel.js";
|
||||
import type { GroupKeyResolution } from "./types.js";
|
||||
|
||||
const getGroupSurfaces = () => new Set<string>([...listDeliverableMessageChannels(), "webchat"]);
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import type { SessionScope } from "./types.js";
|
||||
import {
|
||||
buildAgentMainSessionKey,
|
||||
DEFAULT_AGENT_ID,
|
||||
@@ -7,6 +6,7 @@ import {
|
||||
resolveAgentIdFromSessionKey,
|
||||
} from "../../routing/session-key.js";
|
||||
import { loadConfig } from "../config.js";
|
||||
import type { SessionScope } from "./types.js";
|
||||
|
||||
export function resolveMainSessionKey(cfg?: {
|
||||
session?: { scope?: SessionScope; mainKey?: string };
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import type { MsgContext } from "../../auto-reply/templating.js";
|
||||
import type { GroupKeyResolution, SessionEntry, SessionOrigin } from "./types.js";
|
||||
import { normalizeChatType } from "../../channels/chat-type.js";
|
||||
import { resolveConversationLabel } from "../../channels/conversation-label.js";
|
||||
import { getChannelDock } from "../../channels/dock.js";
|
||||
import { normalizeChannelId } from "../../channels/plugins/index.js";
|
||||
import { normalizeMessageChannel } from "../../utils/message-channel.js";
|
||||
import { buildGroupDisplayName, resolveGroupSessionKey } from "./group.js";
|
||||
import type { GroupKeyResolution, SessionEntry, SessionOrigin } from "./types.js";
|
||||
|
||||
const mergeOrigin = (
|
||||
existing: SessionOrigin | undefined,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { SessionConfig, SessionResetConfig } from "../types.base.js";
|
||||
import { normalizeMessageChannel } from "../../utils/message-channel.js";
|
||||
import type { SessionConfig, SessionResetConfig } from "../types.base.js";
|
||||
import { DEFAULT_IDLE_MINUTES } from "./types.js";
|
||||
|
||||
export type SessionResetMode = "daily" | "idle";
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import type { MsgContext } from "../../auto-reply/templating.js";
|
||||
import type { SessionScope } from "./types.js";
|
||||
import {
|
||||
buildAgentMainSessionKey,
|
||||
DEFAULT_AGENT_ID,
|
||||
@@ -7,6 +6,7 @@ import {
|
||||
} from "../../routing/session-key.js";
|
||||
import { normalizeE164 } from "../../utils.js";
|
||||
import { resolveGroupSessionKey } from "./group.js";
|
||||
import type { SessionScope } from "./types.js";
|
||||
|
||||
// Decide which session bucket to use (per-sender vs global).
|
||||
export function deriveSessionKey(scope: SessionScope, ctx: MsgContext) {
|
||||
|
||||
@@ -3,13 +3,12 @@ import fsPromises from "node:fs/promises";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import type { SessionConfig } from "../types.base.js";
|
||||
import type { SessionEntry } from "./types.js";
|
||||
import {
|
||||
clearSessionStoreCacheForTest,
|
||||
loadSessionStore,
|
||||
updateSessionStore,
|
||||
} from "../sessions.js";
|
||||
import type { SessionConfig } from "../types.base.js";
|
||||
import {
|
||||
resolveSessionFilePath,
|
||||
resolveSessionTranscriptPathInDir,
|
||||
@@ -17,6 +16,7 @@ import {
|
||||
} from "./paths.js";
|
||||
import { resolveSessionResetPolicy } from "./reset.js";
|
||||
import { appendAssistantMessageToSessionTranscript } from "./transcript.js";
|
||||
import type { SessionEntry } from "./types.js";
|
||||
|
||||
describe("session path safety", () => {
|
||||
it("rejects unsafe session IDs", () => {
|
||||
|
||||
@@ -3,8 +3,8 @@ import fs from "node:fs/promises";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import type { SessionEntry } from "./types.js";
|
||||
import { clearSessionStoreCacheForTest, loadSessionStore, saveSessionStore } from "./store.js";
|
||||
import type { SessionEntry } from "./types.js";
|
||||
|
||||
// Keep integration tests deterministic: never read a real openclaw.json.
|
||||
vi.mock("../config.js", () => ({
|
||||
|
||||
@@ -3,8 +3,8 @@ import fs from "node:fs/promises";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import type { SessionEntry } from "./types.js";
|
||||
import { capEntryCount, pruneStaleEntries, rotateSessionFile } from "./store.js";
|
||||
import type { SessionEntry } from "./types.js";
|
||||
|
||||
const DAY_MS = 24 * 60 * 60 * 1000;
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import crypto from "node:crypto";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import type { MsgContext } from "../../auto-reply/templating.js";
|
||||
import type { SessionMaintenanceConfig, SessionMaintenanceMode } from "../types.base.js";
|
||||
import { acquireSessionWriteLock } from "../../agents/session-write-lock.js";
|
||||
import type { MsgContext } from "../../auto-reply/templating.js";
|
||||
import { parseByteSize } from "../../cli/parse-bytes.js";
|
||||
import { parseDurationMs } from "../../cli/parse-duration.js";
|
||||
import {
|
||||
@@ -20,6 +19,7 @@ import {
|
||||
} from "../../utils/delivery-context.js";
|
||||
import { getFileMtimeMs, isCacheEnabled, resolveCacheTtlMs } from "../cache-utils.js";
|
||||
import { loadConfig } from "../config.js";
|
||||
import type { SessionMaintenanceConfig, SessionMaintenanceMode } from "../types.base.js";
|
||||
import { deriveSessionMetaPatch } from "./metadata.js";
|
||||
import { mergeSessionEntry, type SessionEntry } from "./types.js";
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { CURRENT_SESSION_VERSION, SessionManager } from "@mariozechner/pi-coding-agent";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import type { SessionEntry } from "./types.js";
|
||||
import { CURRENT_SESSION_VERSION, SessionManager } from "@mariozechner/pi-coding-agent";
|
||||
import { emitSessionTranscriptUpdate } from "../../sessions/transcript-events.js";
|
||||
import { resolveDefaultSessionStorePath, resolveSessionFilePath } from "./paths.js";
|
||||
import { loadSessionStore, updateSessionStore } from "./store.js";
|
||||
import type { SessionEntry } from "./types.js";
|
||||
|
||||
function stripQuery(value: string): string {
|
||||
const noHash = value.split("#")[0] ?? value;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Skill } from "@mariozechner/pi-coding-agent";
|
||||
import crypto from "node:crypto";
|
||||
import type { Skill } from "@mariozechner/pi-coding-agent";
|
||||
import type { ChatType } from "../../channels/chat-type.js";
|
||||
import type { ChannelId } from "../../channels/plugins/types.js";
|
||||
import type { DeliveryContext } from "../../utils/delivery-context.js";
|
||||
|
||||
Reference in New Issue
Block a user